libmaa-1.3.2004075500017500000000000000000001200301156100122015ustar cheusovwheellibmaa-1.3.2/doc004075500017500000000000000000001200301155300127475ustar cheusovwheellibmaa-1.3.2/doc/Makefile.in010064400017500000000000000056500777723354200151300ustar cheusovwheel# Makefile.in -- Makefile for Khepera documentation # Created: Sun Jan 8 21:44:38 1995 by faith@cs.unc.edu # Revised: Wed May 21 00:56:52 1997 by faith@acm.org # Copyright 1995, 1996, 1997 Rickard E. Faith (faith@acm.org) # # 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 1, or (at your option) any # later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 675 Mass Ave, Cambridge, MA 02139, USA. # # $Id: Makefile.in,v 1.10 2004/01/08 10:56:34 cheusov Exp $ # .SUFFIXES: srcdir= @srcdir@ VPATH= @srcdir@ prefix= @prefix@ exec_prefix= @exec_prefix@ LATEX= @LATEX@ PERL= @PERL@ FIG2DEV= @FIG2DEV@ DVIPS= @DVIPS@ REFBIBTEX= @REFBIBTEX@ BIBTEX= @BIBTEX@ SHELL= /bin/sh LIBMAA_SOURCES= ../maa.h ../maa.c ../arg.c ../base26.c ../base64.c \ ../bit.c ../debug.c ../error.c ../flags.c ../hash.c ../list.c \ ../memory.c ../parse-concrete.c ../pr.c ../prime.c \ ../set.c ../sl.c ../source.c ../stack.c ../string.c ../text.c \ ../timer.c FIGS= SLIDEFIGS= TEMPORARIES=general.tex libmaa.dvi: libmaa.tex $(TEMPORARIES) $(FIGS) all: libmaa.dvi libmaa.bib: if $(REFBIBTEX) -j libmaa.tex $(TEMPORARIES) > $@.tmp; then \ touch $@; \ fi cmp -s $@ $@.tmp || mv $@.tmp $@ -rm -f $@.tmp general.tex: $(LIBMAA_SOURCES) $(PERL) extract.pl $(LIBMAA_SOURCES) > general.tex %.300dpi.ps: %.dvi if fgrep 'LANDSCAPE MODE' $*.log > /dev/null; then \ $(DVIPS) -D300 -t landscape -o $@ $*; \ else \ $(DVIPS) -D300 -o $@ $*; \ fi %.600dpi.ps: %.dvi if fgrep 'LANDSCAPE MODE' $*.log > /dev/null; then \ $(DVIPS) -D600 -t landscape -o $@ $*; \ else \ $(DVIPS) -D600 -o $@ $*; \ fi %.stamp: %.tex test -f $*.stamp || cp $*.aux $*.stamp || touch $*.stamp $(LATEX) $* cmp -s $*.stamp $*.aux || cp $*.aux $*.stamp %.dvi: %.bbl %.tex %.stamp if fgrep 'LaTeX Warning: Label' $*.log>/dev/null; then $(LATEX) $*; fi if fgrep 'LaTeX Warning: Label' $*.log>/dev/null; then $(LATEX) $*; fi if fgrep 'LaTeX Warning: Label' $*.log>/dev/null; then $(LATEX) $*; fi %.bbl: %.bib %.stamp test ! -s $*.bib || $(BIBTEX) $* .PRECIOUS: %.aux %.bib %.bbl %.blg .PHONY: clean distclean clean: -rm -f *.o *~ core a.out config.log $(EXES) $(FIGS) $(SLIDEFIGS) -rm -f *.log *.aux *.toc *.dvi *.lj $(TEMPORARIES) -rm -f *.bbl *.blg *.stamp distclean: clean -rm -f config.h config.cache Makefile # This is from the textutils-1.11 lib/Makefile.in subdir=doc Makefile: Makefile.in ../config.status cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status libmaa-1.3.2/doc/extract.pl010064400017500000000000000161530625307305400150560ustar cheusovwheel#!/usr/local/bin/perl # This file is -*- perl -*- source. # Created: Wed Jan 4 13:04:37 1995 by faith@cs.unc.edu # Revised: Mon Dec 9 15:22:26 1996 by faith@cs.unc.edu # Public domain 1995 Rickard E. Faith (faith@cs.unc.edu) # # Special thanks to Nick Simicich (njs@scifi.gate.net) and Nicolai # Langfeldt (janl@ifi.uio.no), who where very patient while answering all # my stupid Perl questions. Any errors and stylistic problems in this code # are my fault, not theirs. # $oldfh = select(STDOUT); $| = 1; select($oldfh); ##@section = ( "section", "subsection", "subsubsection", "paragraph" ); ##@Section = ( "Section", "Subsection", "Subsubsection", "Paragraph" ); @section = ( "subsection", "subsubsection", "paragraph" ); @Section = ( "Subsection", "Subsubsection", "Paragraph" ); $defaultCurrent = 0; $current = $defaultCurrent; $figextension = ".eepicemu"; sub bf { local($tmp) = $_[0]; $tmp =~ s/_/\\_/g; $tmp =~ s/#/\\#/g; return "\\textbf{${tmp}}"; } sub tt { local($tmp) = $_[0]; $tmp =~ s/_/\\_/g; $tmp =~ s/#/\\#/g; return "\\emph{${tmp}}"; } sub figure { local($tmp) = $_[0]; "Figure~$tmp"; } foreach $file (@ARGV) { printf STDERR "Reading ${file}\n"; open (FILE, $file) || printf STDERR "Can't open $file: $!\n"; @lines = (@lines,); } @origlines = @lines; $state = 0; $endflag = 0; foreach $line (@lines) { if (!$state && $line =~ s/^.*\\section\{(.*)\}/$1/) { $current = $defaultCurrent; &print_header($line); $state = 3; next; } if ((!$state || $state == 3) && $line =~ s/^.*\\subsection\{(.*)\}/$1/) { $current = $defaultCurrent + 1; printf STDERR " * "; &print_header($line); $state = 3; next; } ++$current if ($line =~ s/\\bump\s//); --$current if ($line =~ s/\\unbump\s//); $state = 1 if ($line =~ s/\\doc\s//); $state = 3 if ($line =~ s/\\intro\s//); $state = 0 if ($line =~ s/\\endintro\s//); if ($state == 3) { local($result) = ($line =~ s/\*\///); $line =~ s/^\s*\*\s*//; push(@doc,$line); if ($result) { &print_doc(@doc); @doc = (); &dump_secondary("\n"); $state = 0; } } if ($state == 1) { $state = 2 if ($line =~ s/\*\///); push(@doc,$line); } elsif ($state == 2) { if ($endflag == 0 && $line !~ /^\s*{\s*$/) { $endflag = 1 if ($line =~ /^.*{\s*$/); $line =~ s/{//; push(@decl,$line); } else { &print_decl(@decl); @decl = (); &print_doc(@doc); @doc = (); &dump_secondary("\n"); $state = 0; $endflag = 0; } } } &dump_secondary("\n"); sub print_header { $_[0] =~ s/^\s*//; $_[0] =~ s/\s*$//; $_[0] =~ s/\s*\*\///; printf STDERR "Processing \"${_[0]}\"\n"; print "\n\\typeout{*** " . $Section[$current] . ": ${_[0]}}\n"; print "\\" . $section[$current] . "{${_[0]}}\n\n"; } sub print_decl { local($line); local($tmp); local($state) = 0; local(@input) = @_; foreach $line (@input) { if (!$state && $line =~ /\(/) { $tmp = $line; $tmp =~ s/^[^(]*[\s\*](\w+)\s*\(.*$/$1/; chop $tmp; printf STDERR " ${tmp}\n"; $tmp = &tt($tmp); print "\n\\typeout{*** " . $Section[$current+1] . ": ${tmp}}\n"; print "\\" . $section[$current+1] . "{${tmp}}\n\n"; print "\\begin{lgrind}\n"; &lgrindopen; $state = 1; } if ($state) { print LGOUT $line; } } close(LGOUT); print while (); close(LGIN); wait; print "\\end{lgrind}\n\\vspace{2ex}\n\n\\noindent "; } sub lgrindopen { # This code is based on code from njs@scifi.gate.net (Nick Simicich) local($pid) = 0; close(LGIN); # close(LGOUT); pipe(LGIN, LGINCH) || die "Can't pipe LGIN: $!"; pipe(LGOUTCH, LGOUT) || die "Can't pipe LGOUT: $!"; # Unbuffer the output pipes. $oldfh = select(LGINCH); $| = 1; select($oldfh); $oldfh = select(LGOUT); $| = 1; select($oldfh); if($pid = fork) { # parent close(LGINCH); close(LGOUTCH); return; } # Now in child close(LGOUT); open(STDIN, "<&LGOUTCH") || die "Can't dup STDIN: &!"; close(LGOUTCH); close(LGIN); open(STDOUT, ">&LGINCH") || die "can't open STDOUT: &!"; close(LGINCH); exec('lgrind','-i','-d','lgrindefs','-'); die "exec must have failed, or I wouldn't be here: $!"; } sub get_section { return $section[${_[0]}]; } sub print_doc { local($line); # print "\n\\subsubsection{Description}\n\n"; foreach $line (@_) { &dump_secondary($line); $line =~ s/\|([^|]*)\|/&tt($1)/ge; $line =~ s/\"([^"]*)\"/&bf($1)/ge; # " $line =~ s/\\val{([^{]*)}/&print_values($1)/ge; $line =~ s/\\fig{([^{]*)}{([^{]*)}/&do_figure($1,$2)/ge; $line =~ s/\\grind{([^{]*)}/&do_grind($1)/ge; $line =~ s/\\grindref{([^{]*)}/&figure("\\ref{$1}")/ge; # $line =~ s/\<([^>]*)\>/\\&get_section("$current+2"){$1}/ge; $line =~ s/^\s*\/\*\s*//; $line =~ s/^\s*//; $line =~ s/\s*$/\n/; print $line; } } sub print_values { local($target) = $_[0]; local($line); local($state) = 0; local($result) = ""; local($orig); foreach $orig (@lines) { $line = $orig; if ($state == 0) { if ($line =~ /^\w+\s+${target}\s*\[\]\s*=\s*/) { $state = 1; $line =~ s/^.*{//; } } if ($state) { if ($line =~ s/}.*$/\n/) { $state = 2; $line =~ s/,\s*0\s*$/\n/; } $line =~ s/^\s*//; $line =~ s/\s*$/ /; $result .= $line; } if ($state == 2) { $result =~ s/\s*$//; return $result; } } } sub dump_secondary { local($line) = $_[0]; if ($line =~ /^\s*\n$/ && $#secondary) { print @secondary; @secondary = (); } } sub do_grind { local($target) = $_[0]; local($tt_target) = $target; local($_target) = $target; local($line); local($state) = 0; $tt_target = &tt($tt_target); $_target =~ s/_//g; push(@secondary,"\n\\begin{figure}[hbtp]\n\\begin{center}\n\\leavevmode"); push(@secondary,"\n\\begin{lgrind}\n"); &lgrindopen; foreach $line (@origlines) { next if !length($line); next if (!$state && $line =~ /^extern\s/); $state = 1 if (!$state && $line =~ /^[^(]*[\s\*]${target}\s*\(/); $state = 2 if (!$state && $line =~ /^\s*typedef\s.*\s${target}/); print LGOUT $line if ($state); last if ($state == 1 && $line =~ /^\s*}\s*\n$/); last if ($state == 2 && $line =~ /^\s*}.*;\s*$/); } close(LGOUT); push(@secondary,$_) while (); close(LGIN); wait; push(@secondary,"\\end{lgrind}\n"); push(@secondary,"\n\\caption{${tt_target}}\n\\label{fig:${_target}}\n"); push(@secondary,"\\end{center}\n\\end{figure}\n\n"); return &figure("\\ref{fig:$_target}"); } sub do_figure { local($target) = $_[0]; local($caption) = $_[1]; local($_target) = $target; local($line); local($state) = 0; $_target =~ s/_//g; $_target =~ s/\..*$//; push(@secondary,"\n\\begin{figure}[hbtp]\n\\begin{center}\n\\leavevmode"); push(@secondary,"\\input{$target$figextension}\n"); push(@secondary,"\n\\caption{$caption}\n\\label{fig:${_target}}\n"); push(@secondary,"\\end{center}\n\\end{figure}\n\n"); return &figure("\\ref{fig:$_target}"); } libmaa-1.3.2/doc/lgrindefs010064400017500000000000000307310610665700200147430ustar cheusovwheel# Database of program templates for lgrind # $Id: lgrindefs,v 1.1 1996/02/09 14:45:22 faith Exp $ a68:\ :oc:\ :cb=\|:ce=$:ab=/*:ae=*/:\ :sb=':se=':lb=":le=":\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :kw=ascii block byte end equ globl text data word even long\ #else #endif #if #ifdef #ifndef #include #undef #define: asm:\ :oc:\ :cb=#:ce=$:ab=/*:ae=*/:\ :sb=':se=':lb=":le=":\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :kw=ascii block byte end equ globl text data word even long\ #else #endif #if #ifdef #ifndef #include #undef #define else endif\ if ifdef ifndef include undef define: asm68:\ :pb=(^\d?.proc\d\p\d:\ :oc:\ :cb=;:ce=$:\ :sb=':se=':lb=":le=":\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :kw=ascii block byte end equ include long proc word: C|c:\ :pb=^\d?*?\d?\p\d?\(\a?\)(\d|{):bb={:be=}:\ :cb=/*:ce=*/:sb=":se=\e":lb=':\ :le=\e':tl:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :kw=asm auto break case char const continue default do double else\ enum extern float for fortran goto if int long register return short\ sizeof static struct switch typedef union unsigned void while #define\ #else #endif #if #ifdef #ifndef #include #undef # define else endif\ if ifdef ifndef include undef\ #pragma #elif pragma elif\ #module #dictionary module dictionary\ variant_struct variant_union\ noshare readonly globaldef globalref globalvalue main_program: #Last couple of lines are partial ANSI, plus VAX-C specific C++|c++|CC:\ :pb=^\d?*?\d?\p\d?\(\a?\)(\d|{):bb={:be=}:\ :cb=/*:ce=*/:ab=//:ae=$:sb=":se=\e":lb=':\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :le=\e':tl:\ :kw=asm auto break case char continue default do double else enum\ extern float for fortran goto if int long register return short\ sizeof static struct switch typedef union unsigned while void #define\ #else #endif #if #ifdef #ifndef #include #undef # define endif\ ifdef ifndef include undef defined\ class const delete friend inline new operator overload private\ protected public virtual: CSH|csh:\ :bb={:be=}:cb=#:ce=$:sb=":se=\e":lb=':\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :le=\e':tl:\ :kw=alias alloc break breaksw case cd chdir continue default\ echo else end endif endsw exec exit foreach \ glob goto history if logout nice nohup onintr repeat set\ setenv shift source switch then time \ while umask unalias unset wait while @ env \ argv child home ignoreeof noclobber noglob \ nomatch path prompt shell status verbose : fortran|FORTRAN|f77|fc|f:\ :pb=(function|subroutine|program)\d\p\d?\(\a?\):\ :bb=(function|subroutine|program)\d\p\d?\(\a?\):be=^\dend:\ :cb=^c:\ :ce=$:\ :sb=':\ :se=':\ :oc:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :kw=call common complex continue dimension do double else elseif\ end endif equivalence format function\ goto if include integer \ parameter precision real return stop subroutine: Icon|icon|I:\ :pb=^\d?procedure\d\p\d?\(\a?\):\ :bb=(^\d?procedure\d\p\d?\(\a?\))|{:be=}|(^\d?end\d?$):\ :cb=#:ce=$:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :sb=":se=\e":lb=':le=\e':tl:\ :kw=break by case create default do dynamic else end every external\ fail global if initial local next not of procedure record\ repeat return static suspend then to until using while\ &ascii &clock &cset &date &dateline &errout &fail &host &input\ &lcase &level &main &null &output &pos &random &source &subject\ &time &trace &ucase &version: ISP|isp|i:\ :cb=!:ce=!|$:oc:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :kw=and begin decode define end eql eqv geq gtr if leave leq lss mod\ neq next not or otherwise repeat restart resume sr0 sr1 srd\ srr sl0 sl1 sld slr tst xor: ldl|LDL:\ :pb=^\p\::bb=\::be=;:cb=/*:ce=*/:sb=":se=\e":\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :kw=constant functions grammar reswords tokens add1 addste\ car cdr check colno cond cons copy defun divide empty enter\ eq equal findattr firstchild ge getattr getfield gt hash label\ lambda lastchild le leftsibling lookone lookup lt minus name ne\ newnode nextcom nil null parent plus precnl prevcom prog progn\ quote reglob return rightsibling self set setattr setfield setq\ stjoin sub1 t times tnull tokno ttype: #Linda is just like C, with a couple of extra keywords. Note: The non- #blocking operations are included, as are the pre-defined VAX Linda-C macros. linda|l:\ :pb=^\d?*?\d?\p\d?\(\a?\)(\d|{):bb={:be=}:\ :cb=/*:ce=*/:sb=":se=\e":lb=':\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :le=\e':tl:\ :kw=asm auto break case char continue default do double else enum\ extern float for fortran goto if int long register return short\ sizeof static struct switch typedef union unsigned void while #define\ #else #endif #if #ifdef #ifndef #include #undef # define else endif\ if ifdef ifndef include undef\ #pragma #elif pragma elif #line\ #module #dictionary module dictionary\ variant_struct variant_union\ noshare readonly globaldef globalref globalvalue main_program\ in inp rd rdp out eval newtype varying nchar\ $ARR $ARRAY $ARRAY_TYPE $MAKE_ARRAY\ $STR $STRING $STRING_TYPE $SET_DIM $MAKE_STRING\ #ttcontext ttcontext: # Use MFT (part of the MetaFontWare package) instead. mf|metafont:\ :bb={:be=}:cb=%:ce=$:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :kw=def if else fi for step until endfor\ input let end: # # This entry makes use of new capabilities added to support the description # of lisp-like languages (id, pl, and px). The set of keywords given is a # matter of taste. It would be reasonable to add all the wired functions to # the list. MLisp|ml|Emacs Mock Lisp:\ :cb=;:ce=$:lb=':le=\e':sb=":se=\e":bb=\(:be=\):\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :id=_-$#@./,%&?!^*+~`|;<>'\::\ :kw=defun if progn while:pl:px=\d\(defun:pb=^\d\(\p($|(\d\a$)): model|mod|m:\ :pb=^\d(space\d\p\drep)|(\p\dis|inline|public\dbeginproc):\ :bb=\dbeginproc|space|case\d:be=\dendproc|end\d|;:\ :cb=\$:ce=\$|$:sb=":se=":lb=':le=\a|$:\ :kw=abs and array beginproc boolean by case cdnl char copied dispose\ div do dynamic else elsif end endproc entry external FALSE false\ fi file for formal fortran global if iff ift\ in integer include inline is lbnd\ max min mod new NIL nil noresult not notin od of or procedure public\ read readln readonly record recursive rem rep repeat res\ result return set\ space string subscript such then TRUE true type ubnd union until\ varies while width: modula2|mod2|m2:\ :pb=(^\d?(procedure|function|module)\d\p\d|\(|;|\:):\ :bb=\d(begin|case|for|if|loop|record|repeat|while|with)\d:\ :be=\dend|;:\ :cb={:ce=}:\ :ab=\(*:ae=*\):\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :sb=":se=":\ :oc:\ :kw=and array begin by case const\ definition div do else elsif end exit export\ for from if implementation import in\ loop mod module not of or pointer procedure qualified\ record repeat return set then to type\ until var while with: pascal|pasc|p:\ :pb=(^\d?procedure|function|program\d\p\d|\(|;|\:)|(=\d?record\d):\ :bb=\dcase|begin\d:be=\dend|forward\d|;:\ :oc:\ :cb={:ce=}:ab=\(*:ae=*\):\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :sb=':se=':lb=":le=":\ :kw=and array assert begin boolean case char const div do downto else\ end file for forward function goto if in integer label mod nil not\ of or packed procedure program record repeat set then to type\ until var while with oct hex external: #Perl definition; snarfed from the net PERL|perl|pl:\ :pb=^\d?sub\d\p(\d|{):\ :bb={:be=}:cb=\d#:ce=$:sb=":se=\e":lb=':le=\e':\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :tl:\ :kw=if until while elsif else unless for foreach continue sub\ accept atan2 bind chdir chmod chop chown chroot close\ closedir connect cos crypt dbmclose dbmopen defined delete die\ do dump each eof eval exec exit exp fcntl fileno flock fork\ getc getlogin getpeername getpgrp getppid getpriority getpwnam\ getgrnam gethostbyname getnetbyname getprotobyname getpwuid getgrgid\ getservbyname gethostbyaddr getnetbyaddr getprotobynumber\ getservbyport getpwent getgrent gethostent getnetent getprotoent\ getservent setpwent setgrent sethostent setnetent setprotoent\ setservent endpwent endgrent endhostent endnetent endprotoent\ endservent getsockname getsockopt gmtime goto grep hex ioctl\ index int join keys kill last length link listen local localtime\ log lstat m mkdir next oct open opendir ord pack pop print printf\ push q qq rand read readdir readlink recv redo rename reset return\ reverse rewinddir rindex rmdir s seek seekdir select setpgrp send\ setpriority setsockopt shift shutdown sin sleep socket socketpair\ sort split sprintf sqrt srand stat study substr syscall system\ symlink tell telldir time times tr y umask undef unlink unpack\ unshift utime values vec wait wantarray warn write: prolog|PROLOG:\ :bb=\:-:be=.:cb=%:ce=$:ab=/*:ae=*/:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :sb=":se=\e":lb=':le=\e':oc:\ :kw=op mod abort ancestors arg ascii ask assert asserta assertz\ atom atomic char clause close concat consult ed ef em eof fail\ file findall write functor getc integer is length listing load name\ nl nonvar not numbervars op or pp prin print private prompt putc\ ratom read read_from_this_file rename repeat retract retractall\ save see seeing seen sh skip statistics subgoal_of system tab\ tell telling time told trace true unload untrace var write: ps|postscript:\ :oc:\ :cb=%:ce=$:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :sb=\(:se=\e\):\ :kw=forall array null dict begin end def store string \ exec if ifelse repeat for loop exit stop stopped quit \ start save restore gsave grestore grestoreall definefont \ newpath initgraphics erasepage showpage copypage initclip \ clip eoclip fill eofill stroke image imagemask: r|R|ratfor:\ :pb=^\d?program|subroutine|function|(integer|real|complex|character\dfunction)\d\p\d|\(:\ :bb={:be=}:cb=#:ce=$:sb=":se=":lb=':le=':oc:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :kw= break call case character common complex data default define\ dimension do else end equivalence external false for function go\ goto if implicit include integer logical next pause program read\ real repeat return rewind stop string subroutine switch true until\ while write: # # It's not obvious what constitutes a "procedure definition" in Russell. # This entry doesn't even try... russell|Russell:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :cb=\(*:ce=*\):kw=cand cor do od if fi else enum record prod union\ extend export hide with constants let use in ni val var func type\ field characters readonly:sb=":se=":lb=':le=': SH|sh:\ :bb={:be=}:cb=#:ce=$:sb=":se=\e":lb=':\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :le=\e':tl:\ :kw=break case cd continue do done \ elif else esac eval exec exit export \ fi for if in then while until \ read readonly set shift test trap umask wait: SOURCE|source|src:\ :kw=: TEX|tex:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :bb={:be=}:cb=%:ce=$:kw=\\def: vmsasm:\ :pb=^\d?.entry\d\p(\d|,|$|;):\ :oc:\ :cb=;:ce=$:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :sb=(.ident|.asci(x|c|d|i|z))\d:se=$:\ :kw=.address .align .ascix .ascic .ascid .ascii .asciz \ .blkx .byte .cross .debug .default .d_floating .double \ .disable .enable .end .endc .endm .endr .entry .error \ .even .external .f_floating .float .g_floating .ident .if \ .if_x .iff .irp .irpc .library .link .list .long .macro \ .mask .mcall .mdelete .mexit .narg .nchr .nlist .nocross \ .noshow .ntype .octa .odd .opdef .packed .page .print \ .psect .quad .refn .repeat .restore_psect .save_psect \ .show .signed_byte .signed_word .subtitle .title .transfer \ .warn .weak .word: yacc|Yacc|y:\ :zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|%:\ :cb=/*:ce=*/:sb=":se=\e":lb=':le=\e':tl:\ :kw=%{ %} %% %union %token %type\ #else #endif #if #ifdef #ifndef #include #undef #define else endif\ if ifdef ifndef include undef: proteus:\ :am::bb={:be=}:cb=--:ce=$:id=_:\ :cb=--:ce=$:\ :kw= boolean bool div do else false for forall function if in \ integer int lambda let om real return string then true type var \ while #define #else #endif #if #ifdef #ifndef #include #undef # \ define else endif if ifdef ifndef include undef #pragma #elif \ pragma elif:\ pb=function\d\p:sb=":se=\e":\ zb=@:ze=@:tb=%%:te=%%:mb=%\$:me=\$%:vb=%\|:ve=\|% libmaa-1.3.2/doc/libmaa.600dpi.ps010064400017500000000000007101770634050065200156440ustar cheusovwheel%!PS-Adobe-2.0 %%Creator: dvipsk 5.55a Copyright 1986, 1994 Radical Eye Software %%Title: libmaa.dvi %%Pages: 39 %%PageOrder: Ascend %%BoundingBox: 0 0 612 792 %%EndComments %DVIPSCommandLine: dvips -D600 -o libmaa.600dpi.ps libmaa %DVIPSParameters: dpi=600, compressed, comments removed %DVIPSSource: TeX output 1997.05.21:0050 %%BeginProcSet: texc.pro /TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N /X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} forall round exch round exch]setmatrix}N /@landscape{/isls true N}B /@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ /nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ /sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ 128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N /rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 sub]/id ch-image N /rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N /cp 0 N{rc 0 ne{rc 1 sub /rc X rw}{G}ifelse}imagemask restore}B /G{{id gp get /gp gp 1 add N dup 18 mod S 18 idiv pl S get exec}loop}B /adv{cp add /cp X}B /chg{rw cp id gp 4 index getinterval putinterval dup gp add /gp X adv}B /nd{/cp 0 N rw exit}B /lsh{rw cp 2 copy get dup 0 eq{pop 1}{ dup 255 eq{pop 254}{dup dup add 255 and S 1 and or}ifelse}ifelse put 1 adv}B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 eq{pop 127}{dup 2 idiv S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 index string putinterval adv}B /set{rw cp fillstr 0 4 index getinterval putinterval adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv 1 chg} {adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{ adv rsh nd}{1 add adv}{/rc X nd}{1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]dup{bind pop}forall N /D{/cc X dup type /stringtype ne{] }if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin 0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore showpage userdict /eop-hook known{eop-hook}if}N /@start{userdict /start-hook known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X /IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V {}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail {dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ 4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p a}B /bos{/SS save N}B /eos{SS restore}B end %%EndProcSet TeXDict begin 40258431 52099146 1000 600 600 (libmaa.dvi) @start /Fa 2 52 600 300 dfs[<123EEA4180EA80C012C01200A2EA0180EA03001204 EA08401230EA7F8012FF>10 13 126 140 28 50 D[<123E1241EA61801201EA0300121E EA0180EA00C0A212C0A2EA4180EA3E00>10 13 126 140 28 I E /Fb 2 113 600 300 dfs[18 2 125 135 52 0 D[<154015C0EC0180A2EC 0300A21406A25C5CA25CA25CA200305B12D838180180120C49C7FC120613066C5AA2EA01 98A2EA00F0A21360A2>26 30 127 129 54 112 D E /Fc 2 111 600 300 dfs[<130113031306A3130CA31318A31330A31360A213C0A3EA0180A3EA0300 A31206A25AA35AA35AA35AA35AA2>16 41 126 158 42 61 D[20 18 126 145 50 110 D E /Fd 3 51 df48 D<5A1207123F12C71207B3A5EAFFF80D1C7C9B15>II E /Fe 25 122 600 300 dfs[13 11 124 152 44 34 D[19 25 127 152 44 I[17 3 126 141 44 45 D[19 25 127 152 44 76 D[<387E07F038FF0FF8387F07F0381D81C0A313C1121C13E1A213611371A313311339 A21319131D130DA3EA7F07EAFF87EA7F03>21 25 128 152 44 78 D[17 25 126 152 44 83 D[<387F07F038FF8FF8387F07F0381C01C0B0380E0380A23807070013 FF6C5AEA00F8>21 25 128 152 44 85 D[<12C07EA21270A27EA27EA27EA27EA26C7EA2 6C7EA26C7EA21370A27FA27FA27FA27FA2EB0380A21301>17 32 126 156 44 92 D[19 18 126 145 44 97 D[<12FCA3121CA4137CEA 1DFEEA1FFFEB0780381E03C0EA1C01EB00E0A6EB01C0EA1E03381F0780EBFF00EA1DFEEA 0C78>19 25 127 152 44 I[<133FA31307A4EA03C7EA0FF748B4FCEA3C1F487EEA7007 12E0A6EA700F12786C5A381FFFE0EA0FF7EA07C7>19 25 127 152 44 100 D[17 18 126 145 44 I[<3803E3C03807F7E0EA0F FF381C1CC038380E00A56C5AEA0FF8485AEA1BE00038C7FC1218EA1FFC13FF4813803870 03C038E000E0A4387001C0EA7C07383FFF80380FFE00EA03F8>19 28 127 145 44 103 D[<1203EA0780A2EA0300C7FCA4EAFF80A31203ACEAFFFC13FE13 FC>15 26 124 153 44 105 D[<127E12FE127E120EA4EB7FE0A3EB0F00131E5B5B5B12 0F7F13BC131EEA0E0E7F1480387F87F0EAFFCFEA7F87>20 25 128 152 44 107 D[17 25 126 152 44 I[<38F9C38038FFEFC0EBFFE0EA3C78A2EA3870AA38FE7CF8A3>21 18 128 145 44 I[19 18 127 145 44 I[17 18 126 145 44 I[<387F0FC038FF3FE0EA7F 7F3807F040EBC0005BA290C7FCA8EA7FFC12FF127F>19 18 127 145 44 114 D[15 18 125 145 44 I[<12035AA4EA7FFFB5FCA20007C7FCA75BEB0380A3EB8700EA03FE6C5A6C5A>17 23 127 150 44 I[19 18 127 145 44 I[<387F1FC038FF9FE0387F1FC0381C0700A2EA0E0EA36C5AA4EA03B8 A3EA01F0A26C5A>19 18 127 145 44 I[<387F1FC038FF9FE0387F1FC0381C0700120E 130EA212075BA2EA039CA21398EA01B8A2EA00F0A35BA3485A1279127BEA7F8090C7FC12 3C>19 27 127 145 44 121 D E /Ff 8 117 600 300 dfs[<127C1218A45AA4EA6780 EA68C0EA7040EA606012C0A4EA80C0A2EA8180EAC1001246123C>11 23 124 150 32 98 D[<133E130CA41318A4EA03B0EA0C701218EA303013601260A3EAC0 C013C812401241EA62D0EA1C70>15 23 124 150 36 100 D[11 14 124 141 32 I[14 20 126 141 32 103 D[<1203120712061200A61218122C 124CA2128C1218A3123012321262126412241238>8 23 125 150 22 105 D[13 14 125 141 30 114 D[11 14 125 141 30 I[<1206A25AA4EAFF80EA1800A35AA45A 1261A2126212641238>9 20 125 147 24 I E /Fg 6 115 480 300 dfs[<39FFF00FF0390F0003C0150014025C5C5C1460148049C7FC13021307497E13 17EB23C0EB43E01381EB00F08014788080141F80EC078015C015E039FFF01FF8>29 28 125 155 56 75 D[<13201370A313B8A3EA011CA2EA031EEA020EA2487EEA07FFEA04 0738080380A2001813C01301123838FC07F8>21 21 127 148 40 97 D[19 21 127 148 37 101 D[<38FF8FF8381C01C0A9EA1FFFEA1C 01A938FF8FF8>21 21 127 148 40 104 D[18 21 127 148 37 112 D[22 21 127 148 40 114 D E /Fh 1 50 600 300 dfs[<1218127812981218AC12FF>8 16 125 143 30 49 D E /Fi 5 55 600 300 dfs[<120C121C12EC120CAFEAFFC0>10 19 125 146 34 49 D[<121FEA60C01360EAF07013301260EA0070A2136013C012011380 EA02005AEA08101210EA2020EA7FE012FF>12 19 126 146 34 I[ 14 19 127 146 34 I[12 19 126 146 34 53 D[12 19 126 146 34 I E /Fj 10 115 600 300 dfs[<39FFF00FF0390F0003C0150014025C5C5C1460148049C7FC1302130749 7E1317EB23C0EB43E01381EB00F08014788080141F80EC078015C015E039FFF01FF8>29 28 125 155 70 75 D[<13201370A313B8A3EA011CA2EA031EEA020EA2487EEA07FFEA04 0738080380A2001813C01301123838FC07F8>21 21 127 148 50 97 D[19 21 127 148 48 I[19 21 127 148 46 101 D[<38FF8FF8381C01C0A9EA1FFFEA1C01A938FF8FF8>21 21 127 148 50 104 D[9 21 127 148 26 I[17 21 127 148 42 108 D[<00FEEB0FE0001E140000171317A338138027A23811C047A33810E087A2 EB7107A3133AA2131CA2123839FE083FE0>27 21 127 148 62 I[18 21 127 148 46 112 D[22 21 127 148 50 114 D E /Fk 3 104 600 300 dfs[<1203A4EAC30CEAE31CEA7338EA1FE0EA0780A2EA1FE0EA7338EA E31CEAC30CEA0300A4>14 18 125 146 42 3 D[<133C13E0EA01C013801203AD13005A 121C12F0121C12077E1380AD120113C0EA00E0133C>14 41 125 158 42 102 D[<12F0121C12077E1380AD120113C0EA00E0133C13E0EA01C013801203AD 13005A121C12F0>14 41 125 158 42 I E /Fl 19 86 600 300 dfs[<12E0B3A212401200A512E0A3>3 29 123 156 26 33 D[10 42 125 158 32 40 D[<12E012707E7EA27EA27EA3EA0380A4EA01C0AEEA0380A4EA0700 A3120EA25AA25A5A5A>10 42 126 158 32 I[<1306ADB612E0A2D80006C7FCAD>27 28 126 151 64 43 D[<12E0A312601240A312C0>3 8 124 130 24 I[<12E0A3>3 3 124 130 24 46 D[16 29 126 155 42 48 D[16 28 126 155 42 50 D[16 29 126 155 42 I[<133C137C135C13DCA2EA019C1203A2EA071CA2120EA2121CA2 12381278127012F0B512C0A238001C00A7>18 27 127 154 42 I[17 28 127 154 42 I[<13F8EA03FCEA0704EA0E005A5AA25AA2EA71F0EAE7F8EA EFFCEAFC3CEAF81EEAF00E130712E0A51270A2130E1230EA381CEA1C38EA0FF0EA03E0> 16 29 126 155 42 I[16 27 126 154 42 I[16 29 126 155 42 I[16 29 126 155 42 I[<12E0A31200AC12E0A312601240 A312C0>3 23 124 145 24 59 D[<007FB512C0B612E0C9FCA8B612E06C14C0>27 12 126 143 64 61 D[<12F0B3A9B5FCA2>16 29 125 156 44 76 D[<00F01370B3A5007813E0A2383C01C0381E0380EA0F073807FE00EA01F8>20 30 124 156 58 85 D E /Fm 28 122 600 300 dfs[<9138FE07C0903901C71C709039 078F3CF0EC1F39010F137991380E78E002001300011E5BA40003B61280A23A003C01E000 A549485AA549485AA5484848C7FCA33871C70E38F9CF8E38FB8F9C00F3131838E70E3038 3C03C0>36 37 129 156 62 11 D[28 37 129 156 56 I[30 37 129 156 58 I[20 18 124 145 50 97 D[17 29 124 156 44 I[<13FCEA0383EA0F07381E0F80383E1F00EA3C0FEA7C0490C7FC5AA5EAF002EA7007EA 780EEA3838EA0FE0>17 18 124 145 44 I[21 29 124 156 50 I[<13FCEA0382EA0F03381E0180383E0300123CEA 7C06137CEAFFC000F8C7FCA41302EA7807EA380EEA1C38EA0FE0>17 18 124 145 44 I[22 37 129 156 34 I[20 26 126 145 44 I[21 29 125 156 50 I[<13E0EA01F0A213E0EA00C01300A7120FEA1380EA23C01263EA4780 12C71207EA0F00A3121E1320EA3C60A21340EA38C0EA1980EA0F00>12 30 125 157 30 I[<1303EB0780130FA2EB070090C7FCA71378EA018EEA030E1206131E 120C1200A25BA45BA45BA4EA71E012F95B485A48C7FC127C>17 38 129 157 30 I[20 29 126 156 44 I[10 29 125 156 24 I[<391E07E0FC393318718E3963A07A0FEBC07C00C7 137813801207A2390F00F01EA3ED3C20261E01E01360A2ED784016C03A3C03C039803A18 01801E00>35 18 125 145 78 I[<381E0FC0383318E03863A0F013C0EAC780A21207A2 380F01E0A3EB03C2001E13C6A2EB0784148C383C0398381801E0>23 18 125 145 54 I[<13FE3803C380380701C0001E13E0A2123C007C13F0A238F803E0A3 14C0130700F0138038780F00131E6C5AEA0FE0>20 18 124 145 50 I[<380783E0380CCC303818F838EBF03CEA31E0143E1201A23803C07CA31478380780 F814F0EB81E014C0380FC380EB3E0090C7FCA2121EA4B47EA2>23 26 127 145 50 I[18 26 124 145 44 I[18 18 125 145 42 I[16 18 125 145 40 I[12 26 125 153 32 I[<000F1360381180F0EA21C012 633843C1E012C3EA0781A2380F03C0A314C4380E078C121E120EEB0F9838071B903803E1 E0>22 18 125 145 52 I[<380F0380381187C0EA21C712631243EAC3C1EA0780A2380F 0180A3EB0300120E130213065B6C5AEA03E0>18 18 125 145 44 I[<000FEB60E0391180F1F0EA21C012633843C1E100C3EBE070D807811330A2390F03C0 60A31540000EEB80C01580EB0781000F140038070DC23801F07C>28 18 125 145 64 I[<3807C3803818EC60383078E0EA607913F312C03800F1C0EBF00048 5AA300311320387BC06012FB14C000F713803844C300EA387E>19 18 125 145 46 I[<000F1360381180F0EA31C012633843C1E012C3EA0781A2380F03C0 A4380E0780121E120E130F38071F00EA03EFEA000F130EEA3C1EEA7C1C5BEA7870EA30E0 EA1F80>20 26 125 145 46 I E /Fn 49 122 600 300 dfs[<13181330136013C01201 EA0380EA0700A2120E121E121C123CA35AA412F85AAB7E1278A47EA3121C121E120E7EA2 EA0380EA01C01200136013301318>13 49 123 164 44 40 D[<12C012607E7E121C7E7E A2EA038013C0120113E0A3EA00F0A413F81378AB13F813F0A4EA01E0A313C012031380EA 0700A2120E5A12185A5A5A>13 49 125 164 44 I[14 4 127 140 38 45 D[<1238127C12FEA3127C1238>7 7 124 134 32 I[<13FE3807FFC0380F83E0381F01F0383E00F8A248137CA312FC147EAD007C137CA3 6C13F8A2381F01F0380F83E03807FFC03800FE00>23 32 126 159 56 48 D[<13181378EA01F812FFA21201B3A7387FFFE0A2>19 32 124 159 56 I[21 32 125 159 56 I[<13FE3807FFC0380F07E0381E 03F0123FEB81F8A3EA1F0314F0120014E0EB07C0EB1F803801FE007F380007C0EB01F014 F8EB00FCA2003C13FE127EB4FCA314FCEA7E01007813F8381E07F0380FFFC03801FE00> 23 32 126 159 56 I[<14E013011303A21307130F131FA21337137713E7EA01C71387EA 03071207120E120C12181238127012E0B6FCA2380007E0A790B5FCA2>24 32 126 159 56 I[<00301320383E01E0383FFFC0148014005B13F8EA33C00030C7FCA4 EA31FCEA37FF383E0FC0383807E0EA3003000013F0A214F8A21238127C12FEA200FC13F0 A2387007E0003013C0383C1F80380FFF00EA03F8>21 32 125 159 56 I[23 32 126 159 56 I[<12601278387FFFFEA214 FC14F8A214F038E0006014C038C00180EB0300A2EA00065B131C131813381378A25BA312 01A31203A76C5A>23 34 125 161 56 I[<13FE3803FFC0380703E0380E00F05A147812 3C123E123F1380EBE0F0381FF9E0EBFFC06C13806C13C06C13E04813F0381E7FF8383C1F FCEA7807EB01FEEAF000143E141EA36C131C007813387E001F13F0380FFFC000011300> 23 32 126 159 56 I[23 32 126 159 56 I[<1470A214F8A3497EA2497EA3EB067FA2010C7F143FA2496C7EA201307F140F 01707FEB6007A201C07F90B5FC4880EB8001A2D803007F14004880000680A23AFFE007FF F8A2>37 34 126 161 84 65 D[34 34 126 161 80 I[ 33 34 125 161 80 I[37 34 126 161 86 I[32 34 126 161 74 I[30 34 126 161 70 I[38 34 125 161 88 I[39 34 126 161 88 I[29 34 126 161 68 76 D[48 34 126 161 106 I[39 34 126 161 88 I[32 34 126 161 76 80 D[39 34 126 161 84 82 D[<3801FE023807FF86381F01FE383C007E007C131E0078 130EA200F81306A27E1400B4FC13E06CB4FC14C06C13F06C13F86C13FC000313FEEA003F 1303EB007F143FA200C0131FA36C131EA26C133C12FCB413F838C7FFE000801380>24 34 125 161 62 I[<007FB61280A2397E03F80F00781407007014030060140100E015C0 A200C01400A400001500B3A248B512F0A2>34 34 126 161 78 I[24 22 126 149 54 97 D[ 26 35 126 162 62 I[21 22 126 149 50 I[26 35 126 162 62 I[<13FE3807FF80380F87C0381E01E0003E13F0EA7C0014F812FCA2B5 FCA200FCC7FCA3127CA2127E003E13186C1330380FC0703803FFC0C61300>21 22 126 149 52 I[<3801FE0F3907FFBF80380F87C7381F03E7391E01E000003E7FA500 1E5BEA1F03380F87C0EBFF80D809FEC7FC0018C8FCA2121C381FFFE06C13F86C13FE001F 7F383C003F48EB0F80481307A40078EB0F006C131E001F137C6CB45A000113C0>25 33 127 149 56 103 D[26 35 126 162 62 I[<121C123E127FA3123E121CC7FCA7B4FCA2121F B2EAFFE0A2>11 36 126 163 32 I[26 35 126 162 60 107 D[11 35 126 162 32 I[<3AFF07F007F090391FFC1FFC3A1F303E303E01401340496C487EA201001300 AE3BFFE0FFE0FFE0A2>43 22 126 149 96 I[<38FF07E0EB1FF8381F307CEB403CEB80 3EA21300AE39FFE1FFC0A2>26 22 126 149 62 I[<13FE3807FFC0380F83E0381E00F0 003E13F848137CA300FC137EA7007C137CA26C13F8381F01F0380F83E03807FFC03800FE 00>23 22 126 149 56 I[<38FF0FE0EB3FF8381FE07CEB803E497E1580A2EC0FC0A8EC 1F80A29038803F00EBC03EEBE0FCEB3FF8EB0FC090C8FCA8EAFFE0A2>26 32 126 149 62 I[ 19 22 126 149 46 114 D[17 22 126 149 44 I[<487EA41203A21207A2120F123FB5FCA2EA0F80ABEB8180A5EB 8300EA07C3EA03FEEA00F8>17 32 127 159 44 I[<38FF01FEA2381F003EAF147E14FE 380F81BE3907FF3FC0EA01FC>26 22 126 149 62 I[<39FFE07FC0A2390F801C006C6C 5A6C6C5AEBF0606C6C5A3800F980137F6DC7FC7F80497E1337EB63E0EBC1F03801C0F848 487E3807007E000E133E39FF80FFE0A2>27 22 127 149 60 120 D[<39FFE01FE0A2391F800700000F1306EBC00E0007130C13E000035BA26C6C5AA26C6C 5AA2EB7CC0A2137F6D5AA26DC7FCA2130EA2130CA25B1278EAFC3813305BEA69C0EA7F80 001FC8FC>27 32 127 149 60 I E /Fo 10 115 540 300 dfs[<39FFF00FF0390F0003 C0150014025C5C5C1460148049C7FC13021307497E1317EB23C0EB43E01381EB00F08014 788080141F80EC078015C015E039FFF01FF8>29 28 125 155 63 75 D[<13201370A313B8A3EA011CA2EA031EEA020EA2487EEA07FFEA040738080380A200 1813C01301123838FC07F8>21 21 127 148 45 97 D[19 21 127 148 43 I[19 21 127 148 41 101 D[<38FF8FF8381C01C0 A9EA1FFFEA1C01A938FF8FF8>21 21 127 148 45 104 D[9 21 127 148 23 I[17 21 127 148 38 108 D[<00FEEB0FE0001E140000171317A338138027A23811C047A338 10E087A2EB7107A3133AA2131CA2123839FE083FE0>27 21 127 148 56 I[18 21 127 148 41 112 D[22 21 127 148 45 114 D E /Fp 27 122 600 300 dfs[<126012F0A212701210A31220A21240A2>4 11 125 131 22 44 D[10 2 128 136 26 I[<126012F0A21260>4 4 125 131 22 I[<130CA3131EA2132F1327A2EB4380A3EB81C0A200017F1300A248B47E 38020070A2487FA3487FA2003C131EB4EBFFC0>26 26 127 153 58 65 D[16 26 126 153 42 83 D[<007FB5FC38701C0700401301A200C0148000801300A300001400 B13803FFE0>25 26 127 153 56 I[17 16 127 143 38 97 D[<12FC121CA913FCEA1D07381E0380381C01C0130014E0A6EB01C01480381E0300EA19 06EA10F8>19 26 128 153 42 I[14 16 127 143 34 I[<133F1307A9EA03E7EA0C17EA180F487E1270 12E0A6126012706C5AEA1C373807C7E0>19 26 127 153 42 I[14 16 127 143 34 I[13 26 128 153 24 I[17 24 127 143 38 I[<12FC121CA9137CEA1D87381E0380A2121CAB38FF9FF0>20 26 128 153 42 I[<1218123CA212181200A612FC121CAE12FF>8 26 128 153 20 I[<12FC121CB3A6EAFF80>9 26 128 153 20 108 D[<38FC7C1F391D8E6380391E0781C0A2001C1301AB39FF9FE7F8>29 16 127 143 64 I[20 16 128 143 42 I[16 16 127 143 38 I[19 23 128 143 42 I[14 16 128 143 30 114 D[12 16 127 143 30 I[<1208A41218A21238EAFFC0 EA3800A81320A41218EA1C40EA0780>11 23 127 150 30 I[<38FC1F80EA1C03AB1307 120CEA0E0B3803F3F0>20 16 128 143 42 I[<38FF0F80383C0700EA1C061304A26C5A A26C5AA3EA03A0A2EA01C0A36C5A>17 16 127 143 40 I[<39FE7F1F8039381C070000 3C1306381C0C04130E380E16081317A238072310149013A33803C1A014E0380180C0A3> 25 16 127 143 56 I[<38FF0F80383C0700EA1C061304A26C5AA26C5AA3EA03A0A2EA01 C0A36C5AA248C7FCA212E112E212E41278>17 23 127 143 40 121 D E /Fq 7 117 600 300 dfs[<1303497EA2497EA3EB1BE0A2EB3BF01331A2EB60F8A2 EBE0FCEBC07CA248487EEBFFFE487FEB001F4814800006130FA248EB07C039FF803FFCA2 >30 26 127 153 66 65 D[19 17 127 144 42 97 D[<12FCA2123CA713FE383F87 80383E01C0003C13E0EB00F0A214F8A514F0A2EB01E0003E13C0383B07803830FE00>21 26 126 153 50 I[17 17 127 144 40 I[14 17 126 144 36 114 D[14 17 127 144 34 I[<1206A4120EA2121EEA3FF012FFEA1E00A81318A5EA0F30EA03E0> 13 24 127 151 34 I E /Fr 47 122 600 300 dfs[<13FFEA0707120E121CA6B5FCEA 1C07AC387F1FC0>18 23 128 150 40 13 D[<120112021204120C1218A21230A2127012 60A312E0AA1260A312701230A21218A2120C120412021201>8 34 125 152 28 40 D[<12801240122012301218A2120CA2120E1206A31207AA1206A3120E 120CA21218A21230122012401280>8 34 126 152 28 I[<126012F0A212701210A21220 A21240A2>4 10 125 131 20 44 D[9 2 128 135 24 I[<126012F0A21260>4 4 125 131 20 I[15 21 127 148 36 48 D[<1206120E12FE120EB1EAFFE0>11 21 125 148 36 I[13 21 126 148 36 I[15 21 127 148 36 I[<1330A2137013F012011370120212041208121812101220124012C0 EAFFFEEA0070A5EA03FE>15 21 127 148 36 I[ 15 21 127 148 36 54 D[<1240EA7FFE13FC13F8EAC008EA80101320EA00401380A2EA 01005AA212021206A2120EA51204>15 22 126 149 36 I[15 21 127 148 36 I[15 21 127 148 36 I[<126012F0A212601200A6126012F0A212701210A21220A21240A2>4 20 125 141 20 59 D[<13101338A3135CA3138EA3EA0107A238020380A33807FFC0EA04 01A2380800E0A2001813F0123838FE03FE>23 23 127 150 52 65 D[20 23 126 150 50 67 D[20 23 127 150 46 70 D[11 23 127 150 26 73 D[19 23 127 150 44 76 D[<00FC13FE001E1338001F13101217EA1380EA11C0A2EA10E01370 1338A2131C130E130F1307EB0390EB01D0A2EB00F014701430123800FE1310>23 23 127 150 52 78 D[<13FCEA0303380E01C0381C00E048137000301330007013380060 131800E0131CA700701338A200301330003813706C13E0380E01C038030300EA00FC>22 23 126 150 54 I[20 23 127 150 48 I[24 23 127 150 52 82 D[15 23 126 150 40 I[16 14 127 141 36 97 D[<12F81238A8EA39F0EA3E0CEA38061307 7F1480A414005B1306EA361CEA21F0>17 23 127 150 40 I[13 14 127 141 32 I[<133E130EA8EA07CEEA1C3EEA300E1270126012E0A412601270EA301EEA182E3807 CF80>17 23 127 150 40 I[13 14 127 141 32 I[12 23 128 150 22 I[16 21 127 141 36 I[<12F81238A813F8EA3B1CEA3C0E1238AA38FE3F80>17 23 127 150 40 I[<12301278A212301200A512F81238AC12FE>7 23 127 150 20 I[<12F81238B3A312FE>7 23 127 150 20 108 D[<38F8F83E383B1CC7393C0F0380EA380EAA39FE3F8FE0>27 14 127 141 60 I[17 14 127 141 40 I[15 14 127 141 36 I[17 20 127 141 40 I[ 12 14 127 141 28 114 D[11 14 127 141 28 I[<1208A31218A21238EAFFC0EA38 00A71340A4EA1C80EA0F00>10 20 127 147 28 I[17 14 127 141 40 I[16 14 127 141 38 I[<38FEFE7C383838381410133C001C132013 4C381E4E60380ECE401387000713801303A200031300EA0201>22 14 127 141 50 I[16 20 127 141 38 121 D E /Fs 1 4 600 300 dfs[<120CA2EACCC012EDEA7F80EA0C00EA7F80EAEDC012CCEA0C00 A2>10 11 125 139 32 3 D E /Ft 52 123 600 300 dfs[<903801F03C9038071C4701 0C13C7EC19C690381C0180140313181338A2EC0700A20003B512F03900700700A3140EA2 13E0A35CA2EA01C0A35CA2EA0380A21430EB0070A248136038C630E038E638C038CC3180 D8781EC7FC>32 37 129 156 50 11 D[<14FE90380301801306EB0C03EB1C0191C7FC13 181338A43803FFFE3800700EA35CA213E0A25CA3EA01C01472A438038034141891C7FC90 C8FCA25A12C612E65A1278>25 37 129 156 46 I[<903801FEE0EB0707130E010C13C0 EB1C01A213189038380380A40003B5120038007007A3140EA213E0A25CA3EA01C01439A4 3803801A140C91C7FC90C8FCA25A12C612E65A1278>27 37 129 156 48 I[<136013C0A3EA3086EA388EEA1DB8EA0F60EA0380A2EA0DE0EA3B70EAE238EA C218EA0600A35A>15 18 120 158 42 42 D[<12181238127812381208A21210A2122012 40A21280>5 12 125 131 26 44 D[10 3 125 137 30 I[<133EEBE180380181C0EA03005A1206000E13E0120C001C13C0A2EA18011238A338 700380A43860070012E01306130EA2130C5BEA60385BEA30C0001FC7FC>19 29 124 155 42 48 D[<1304130C131813381378EA07B8EA0070A413E0A4EA01C0A4EA03 80A4EA0700A45AEAFFF0>14 28 123 155 42 I[<133EEB4180EB80C0EA0100000213E0 EA0440A21208A3381081C0A238110380000E1300EA00065B5B136013800003C7FC120448 13404813805AEB0100EA7F07EA43FEEA81FCEA8078>19 29 125 155 42 I[<1206120FA212061200AA1230127812F01260>8 18 124 145 26 58 D[<1418A21438A21478A214B8EB0138A2EB023C141C1304130C13081310A2 1320A2EB7FFCEBC01C1380EA0100141E0002130EA25A120C001C131EB4EBFFC0>26 29 126 156 62 65 D[<903803F02090381E0C6090383002E09038E003C03801C001EA03 8048C7FC000E1480121E121C123C15005AA35AA41404A35C12705C6C5B00185B6C485AD8 0706C7FCEA01F8>27 30 122 156 60 67 D[<48B512F038003C00013813301520A35BA2 14081500495AA21430EBFFF03801C020A439038040801400A2EC0100EA07005C14021406 000E133CB512FC>28 28 126 155 56 69 D[<48B512F038003C00013813301520A35BA2 14081500495AA21430EBFFF03801C020A448485A91C7FCA348C8FCA45AEAFFF0>28 28 126 155 54 I[<3A01FFC3FF803A003C00780001381370A4495BA449485AA390B5FC 3901C00380A4484848C7FCA43807000EA448131E39FFE1FFC0>33 28 126 155 62 72 D[16 28 125 155 32 I[<3801FFC038003C001338A45BA45BA4485AA438 038002A31404EA0700140C14181438000E13F0B5FC>23 28 126 155 52 76 D[39 28 126 155 74 I[33 28 126 155 62 I[26 30 122 156 64 I[<3801FFFE39003C038090383801C0 EC00E0A3EB7001A315C0EBE0031580EC0700141C3801FFF001C0C7FCA3485AA448C8FCA4 5AEAFFE0>27 28 126 155 56 I[22 30 125 156 46 83 D[<001FB512C0381C07013830 0E0000201480126012405B1280A2000014005BA45BA45BA4485AA41203EA7FFE>26 28 121 155 60 I[<397FF03FE0390F000700000E13061404A3485BA4485BA4485BA448 5BA35CA249C7FCEA60025B6C5AEA1830EA07C0>27 29 120 155 62 I[17 41 126 158 26 91 D[17 41 129 158 26 93 D[16 18 124 145 42 97 D[<123F1207A2120EA45AA4EA39E0EA3A18EA3C0C12381270130EA3EA E01CA31318133813301360EA60C0EA3180EA1E00>15 29 124 156 38 I[<13F8EA0304120EEA1C0EEA181CEA30001270A25AA51304EA60081310EA3060EA0F 80>15 18 124 145 38 I[19 29 124 156 42 I[<13F8EA0704120CEA1802EA38041230EA7008EA7FF0EAE000A5EA60 041308EA30101360EA0F80>15 18 124 145 38 I[20 37 129 156 26 I[18 26 126 145 38 I[18 29 126 156 42 I[9 28 124 155 26 I[<1303130713031300A71378138CEA010C1202 131C12041200A21338A41370A413E0A4EA01C0A2EAC180EAE30012C61278>16 36 129 155 26 I[18 29 126 156 38 I[9 29 125 156 22 I[<391C1E078039266318C0394683A0E0384703C0008E1380A212 0EA2391C0701C0A3EC0380D8380E1388A2EC0708151039701C032039300C01C0>29 18 124 145 68 I[18 18 124 145 46 I[<13F8EA030CEA0E06487E 1218123000701380A238E00700A3130EA25BEA60185BEA30E0EA0F80>17 18 124 145 42 I[<380387803804C860EBD03013E0EA09C014381201A238038070A314 60380700E014C0EB0180EB8300EA0E86137890C7FCA25AA45AB4FC>21 26 128 145 42 I[16 26 124 145 38 I[16 18 124 145 36 I[14 18 125 145 34 I[<12035AA3120EA4EAFFE0EA1C00A35AA45AA4EAE080A2EAE100A212661238>11 26 124 153 28 I[<381C0180EA2E03124EA2388E0700A2121CA2EA380EA438301C80A3 EA383C38184D00EA0F86>17 18 124 145 44 I[15 18 124 145 38 I[<381E0183382703871247148338870701A2120EA2381C0E02A31404EA180C13 1C1408EA1C1E380C26303807C3C0>24 18 124 145 56 I[<38038780380CC840380870 E012103820E0C014001200A2485AA4EA03811263EAE38212C5EA8584EA7878>19 18 126 145 38 I[<381C0180EA2E03124EA2388E0700A2121CA2EA380EA4EA301CA3EA 383CEA1878EA0FB8EA003813301370EAE0605BEA81800043C7FC123C>17 26 124 145 40 I[16 18 126 145 34 I E /Fu 84 125 600 300 dfs[26 29 128 156 48 11 D[<137E3801C180EA0301380703C0120EEB018090C7FCA5B512C0EA0E01B0387F 87F8>21 29 128 156 46 I[21 29 128 156 46 I[<90383F07E03901C09C18380380F0D80701133C000E13E0 0100131892C7FCA5B612FC390E00E01CB03A7FC7FCFF80>33 29 128 156 70 I[13 12 127 156 42 34 D[<126012F012F812681208A31210A2122012401280>5 12 124 156 24 39 D[<1380EA0100120212065AA25AA25AA35AA412E0AC1260A47EA37E A27EA27E12027EEA0080>9 42 124 158 32 I[<7E12407E12307EA27EA27EA37EA41380 AC1300A41206A35AA25AA25A12205A5A>9 42 126 158 32 I[<1306ADB612E0A2D80006 C7FCAD>27 28 126 151 64 43 D[<126012F0A212701210A41220A212401280>4 12 124 131 24 I[11 2 128 137 28 I[<126012F0A21260>4 4 124 131 24 I[<130113031306A3130CA31318A31330A31360A213C0A3EA0180A3EA03 00A31206A25AA35AA35AA35AA35AA2>16 41 126 158 42 I[16 29 126 155 42 I[<5A1207123F12C71207B3A5EAFFF8>13 28 124 155 42 I[16 28 126 155 42 I[ 16 29 126 155 42 I[<130CA2131C133CA2135C13DC139CEA011C120312021204120C12 08121012301220124012C0B512C038001C00A73801FFC0>18 28 127 155 42 I[16 29 126 155 42 I[<13F0EA030CEA0404EA0C0EEA181E1230130CEA7000A21260EAE3E0 EAE430EAE818EAF00C130EEAE0061307A51260A2EA7006EA300E130CEA1818EA0C30EA03 E0>16 29 126 155 42 I[<1240387FFF801400A2EA4002485AA25B485AA25B13601340 13C0A212015BA21203A41207A66CC7FC>17 29 126 155 42 I[16 29 126 155 42 I[ 16 29 126 155 42 I[<126012F0A212601200AA126012F0A21260>4 18 124 145 24 I[<126012F0A212601200AA126012F0A212701210A41220A212401280> 4 26 124 145 24 I[<007FB512C0B612E0C9FCA8B612E06C14C0>27 12 126 143 64 61 D[<1306A3130FA3EB1780A2EB37C01323A2EB43E01341A2EB80F0A3 38010078A2EBFFF83802003CA3487FA2000C131F80001E5BB4EBFFF0>28 29 127 156 62 65 D[25 28 127 155 58 I[<90381F8080EBE0613801801938070007000E13035A14015A00781300A2127000F014 00A8007014801278A212386CEB0100A26C13026C5B380180083800E030EB1FC0>25 30 126 156 60 I[27 28 126 155 64 I[24 28 126 155 56 I[22 28 126 155 54 I[<90381F8080EBE0613801801938 070007000E13035A14015A00781300A2127000F01400A6ECFFF0EC0F80007013071278A2 12387EA27E6C130B380180113800E06090381F8000>28 30 126 156 66 I[<39FFF0FFF0390F000F00AC90B5FCEB000FAD39FFF0FFF0>28 28 127 155 62 I[12 28 127 155 30 I[<3807FF8038007C00133CB3127012F8A21338EA7078EA4070EA30E0EA0F80>17 29 127 155 42 I[<39FFF01FE0390F000780EC060014045C5C5C5C5C49C7FC13021306 130FEB17801327EB43C0EB81E013016D7E1478A280143E141E80158015C039FFF03FF0> 28 28 127 155 64 I[21 28 126 155 52 I[33 28 126 155 76 I[28 28 127 155 62 I[27 30 126 156 64 I[23 28 126 155 56 I[27 37 126 156 64 I[28 29 126 155 62 I[<3807E080EA1C19EA30051303EA600112E01300A36C13007E127CEA 7FC0EA3FF8EA1FFEEA07FFC61380130FEB07C0130313011280A300C01380A238E00300EA D002EACC0CEA83F8>18 30 126 156 46 I[<007FB512C038700F010060130000401440 A200C014201280A300001400B1497E3803FFFC>27 28 127 155 60 I[<39FFF01FF0390F000380EC0100B3A26C1302138000035BEA01C03800E018EB7060 EB0F80>28 29 127 155 62 I[<39FFE00FF0391F0003C0EC01806C1400A238078002A2 13C000035BA2EBE00C00011308A26C6C5AA213F8EB7820A26D5AA36D5AA2131F6DC7FCA2 1306A3>28 29 127 155 62 I[<3AFFE1FFC0FF3A1F003E003C001E013C13186C6D1310 A32607801F1320A33A03C0278040A33A01E043C080A33A00F081E100A39038F900F30179 13F2A2017E137E013E137CA2013C133C011C1338A20118131801081310>40 29 127 155 86 I[<39FFF07FC0390FC01E003807800CEBC00800035B6C6C5A13F00000 5BEB7880137C013DC7FC133E7F7F80A2EB13C0EB23E01321EB40F0497E14783801007C00 027F141E0006131F001F148039FF807FF0>28 28 127 155 62 I[<39FFF003FC390F80 01E00007EB00C06D13800003EB01006D5A000113026C6C5A13F8EB7808EB7C18EB3C10EB 3E20131F6D5A14C06D5AABEB7FF8>30 28 128 155 62 I[<387FFFF0EA7C01007013E0 386003C0A238400780130F1400131E12005B137C13785BA2485A1203EBC010EA0780A2EA 0F00481330001E13205A14604813E0EAF803B5FC>20 28 126 155 50 I[<12FEA212C0B3B312FEA2>7 41 124 158 24 I[13 12 122 156 42 I[<12FEA21206B3B312FE A2>7 41 128 158 24 I[<12E0A4>3 4 124 156 24 95 D[18 18 126 145 42 97 D[<12FC121CAA137CEA1D87381E0180381C00C014E014601470A614 6014E014C0381E018038190700EA10FC>20 29 127 156 46 I[15 18 127 145 36 I[20 29 127 156 46 I[15 18 127 145 36 I[<13F8EA018CEA071E1206EA0E0C1300A6EAFFE0EA0E00B0EA7FE0> 15 29 128 156 26 I[18 28 127 146 42 I[<12FC121CAA137C1387EA1D03001E 1380121CAD38FF9FF0>20 29 127 156 46 I[<1218123CA21218C7FCA712FC121CB0EA FF80>9 29 127 156 24 I[<13C0EA01E0A2EA00C01300A7EA07E01200B3A21260EAF0C0 12F1EA6180EA3E00>11 37 131 156 26 I[<12FC121CAAEB0FE0EB0780EB06005B1310 5B5B13E0121DEA1E70EA1C781338133C131C7F130F148038FF9FE0>19 29 127 156 44 I[<12FC121CB3A9EAFF80>9 29 127 156 24 I[<39FC7E07E0391C83 8838391D019018001EEBE01C001C13C0AD3AFF8FF8FF80>33 18 127 145 72 I[20 18 127 145 46 I[18 18 127 145 42 I[ 20 26 127 145 46 I[<3803E080EA0E19EA1805EA3807EA7003A212E0A61270A2EA3807 1218EA0E1BEA03E3EA0003A7EB1FF0>20 26 127 145 44 I[13 18 127 145 32 I[13 18 127 145 32 I[<1204A4120CA2121C123CEAFFE0EA1C00A91310A5120CEA0E20EA03 C0>12 26 127 153 32 I[<38FC1F80EA1C03AD1307120CEA0E1B3803E3F0>20 18 127 145 46 I[<38FF07E0383C0380381C0100A2EA0E02A2EA0F06EA0704A2EA0388 A213C8EA01D0A2EA00E0A31340>19 18 127 145 44 I[<39FF3FC7E0393C0703C0001C EB01801500130B000E1382A21311000713C4A213203803A0E8A2EBC06800011370A2EB80 3000001320>27 18 127 145 60 I[<38FF0FE0381E0700EA1C06EA0E046C5AEA039013 B0EA01E012007F12011338EA021C1204EA0C0E487E003C138038FE1FF0>20 18 127 145 44 I[<38FF07E0383C0380381C0100A2EA0E02A2EA0F06EA0704A2EA0388 A213C8EA01D0A2EA00E0A31340A25BA212F000F1C7FC12F312661238>19 26 127 145 44 I[14 18 127 145 36 I[20 1 128 139 42 I[41 1 128 139 84 I E /Fv 43 122 600 300 dfs[25 29 128 156 54 12 D[<903801C070A349485AA490380701C0A490380E0380B71280A27E26001C07C7FCEB38 0EA5495A007FB61280B7FCA22600E038C7FC48485AA448485AA4380701C0A3>33 37 125 156 80 35 D[<13201340EA0180120313001206120E5AA2123C1238A21278A312 F85AA97E1278A31238A2123C121CA27E12067E13801201EA00401320>11 41 124 158 38 40 D[<7E12401230123812187E120E7EA213801203A213C0A313E01201 A9120313C0A31380A212071300A2120E120C5A1238123012405A>11 41 125 158 38 I[<127812FCA41278>6 6 125 133 26 46 D[19 27 126 154 48 48 D[<1360EA01E0120F12FF12F31203B3A2387FFF80A2> 17 27 125 154 48 I[19 27 126 154 48 I[19 27 126 154 48 I[21 27 127 154 48 I[<38380180383FFF005B5B5B13C00030C7FCA4EA31F8EA361E38380F 80EA3007000013C014E0A3127812F8A214C012F038600F8038381F00EA1FFEEA07F0>19 27 126 154 48 I[<137EEA03FF38078180380F03C0EA1E07123C387C03800078C7FCA2 12F813F8EAFB0E38FA0780EAFC0314C000F813E0A41278A214C0123CEB0780381E0F00EA 07FEEA03F8>19 27 126 154 48 I[<1260387FFFE0A214C01480A238E00300EAC0065B 5BC65AA25B13E0A212015B1203A41207A66C5A>19 28 125 155 48 I[19 27 126 154 48 I[19 27 126 154 48 I[31 28 126 155 72 65 D[25 28 126 155 60 70 D[24 28 126 155 58 76 D[40 28 126 155 90 I[<39FFE003FFA2390FF000307FEA0DFCEA0C FE137E7FEB1F8014C0EB0FE0EB07F01303EB01F814FCEB00FE147F143FEC1FB015F0140F 1407140314011400A2D8FFC013701530>32 28 126 155 74 I[<007FB512E0A238781F 81007013800060146000E0147000C01430A400001400B03807FFFEA2>28 28 126 155 66 84 D[<39FFFC03FFA2390FC00030B3120715606C6C13E03901F001C039 00FC078090387FFE00EB0FF8>32 28 126 155 74 I[21 18 127 145 46 97 D[23 29 127 156 54 I[17 18 126 145 42 I[23 29 126 156 54 I[19 18 127 145 44 I[<137F3801E3803803C7C0EA0787120FEB8380EB8000A5EAFFF8A2EA 0F80AEEA7FF0A2>18 29 128 156 30 I[<3803F0F0380E1F38EA3C0F38380730007813 80A400381300EA3C0FEA1E1CEA33F00030C7FCA3EA3FFF14C06C13E014F0387801F838F0 0078A300701370007813F0381E03C03807FF00>21 27 127 145 48 I[24 29 127 156 54 I[<121E123FA4121EC7FCA6127FA2121FAEEAFFC0A2>10 30 127 157 28 I[11 29 127 156 28 108 D[<39FF0FC07E903831E18F3A1F40F20780D980FC13C0A2EB00F8AB3AFFE7FF3F F8A2>37 18 127 145 80 I[<38FF0FC0EB31E0381F40F0EB80F8A21300AB38FFE7FFA2> 24 18 127 145 54 I[21 18 127 145 48 I[<38FF3F80EBE1E0381F80F0EB0078147C143C143EA6143C147C1478EB80F0EBC1E0 EB3F0090C7FCA6EAFFE0A2>23 26 127 145 54 I[17 18 127 145 40 114 D[14 18 126 145 38 I[<1203A45AA25AA2EA3FFC12FFEA1F00A9130CA4EA0F08EA0798EA03 F0>14 26 127 153 38 I[<38FF07F8A2EA1F00AC1301120F380786FFEA01F8>24 18 127 145 54 I[<38FFC1FCA2381F00601380000F13C0A23807C180A23803E300A213 F7EA01F613FE6C5AA21378A21330>22 18 127 145 50 I[<39FF8FF8FEA2391F03E030 A3390F87F06013869038C6F8E03907CC78C0A23903FC7D80EBF83D143F3901F01F00A200 00131EEBE00EA2>31 18 127 145 68 I[<38FFC1FCA2381F00601380000F13C0A23807 C180A23803E300A213F7EA01F613FE6C5AA21378A21330A25B1270EAF8E05BEAF9800073 C7FC123E>22 26 127 145 50 121 D E /Fw 17 118 720 300 dfs[<13181378EA01F812FFA21201B3A7387FFFE0A2>19 32 124 159 67 49 D[<1470A214F8A3497EA2497EA3EB067FA2010C7F143FA2496C7EA201307F 140F01707FEB6007A201C07F90B5FC4880EB8001A2D803007F14004880000680A23AFFE0 07FFF8A2>37 34 126 161 101 65 D[33 34 125 161 96 67 D[30 34 126 161 84 70 D[48 34 126 161 127 77 D[39 34 126 161 101 82 D[24 22 126 149 65 97 D[21 22 126 149 60 99 D[<13FE3807FF80380F87C0381E01E0003E13F0EA7C0014F812FCA2 B5FCA200FCC7FCA3127CA2127E003E13186C1330380FC0703803FFC0C61300>21 22 126 149 62 101 D[20 35 128 162 41 I[<121C123E127FA3123E121CC7FCA7 B4FCA2121FB2EAFFE0A2>11 36 126 163 38 105 D[<38FF07E0EB1FF8381F307CEB40 3CEB803EA21300AE39FFE1FFC0A2>26 22 126 149 74 110 D[<13FE3807FFC0380F83 E0381E00F0003E13F848137CA300FC137EA7007C137CA26C13F8381F01F0380F83E03807 FFC03800FE00>23 22 126 149 67 I[19 22 126 149 55 114 D[17 22 126 149 53 I[<487EA41203A21207A2120F123FB5FCA2 EA0F80ABEB8180A5EB8300EA07C3EA03FEEA00F8>17 32 127 159 53 I[<38FF01FEA2381F003EAF147E14FE380F81BE3907FF3FC0EA01FC>26 22 126 149 74 I E /Fx 8 119 600 300 dfs[<127012F8A31270>5 5 124 132 28 58 D[<90B512C090380F0078151C81011E130F811680A249EB0F00A315 1E495B5D15E0EC0380D9FFFCC7FCEBF0076E7E8148486C7EA44848485AA44848485A1680 A29138038100120F39FFF801C6C81278>33 35 125 161 74 82 D[<137EEA038138070080120E5A5A38780100EA7006EAFFF800F0C7FCA25AA41480A238 700300EA3004EA1838EA0FC0>17 21 125 148 46 101 D[<13E0A21201EA00C01300A9 121E1223EA4380A21283EA8700A21207120EA35AA3EA38201340127013801230EA310012 1E>11 34 126 161 34 105 D[<383C07C038461860384720303887403813801300A200 0E1370A44813E0A2EB01C014C1003813C2EB03821484130100701388383000F0>24 21 126 148 58 110 D[<133EEBC180380380C0380700E0120E4813F0123CA25AA338F0 01E0A214C0130300701380EB07001306EA381C6C5AEA07E0>20 21 126 148 46 I[<137E138138030080EA0201EA0603140090C7FC120713F0EA03FC6CB4FC EA003FEB07801303127000F01300A2EAE002EA4004EA3018EA0FE0>17 21 126 148 46 115 D[<001E13E0EA2301384381F01380008313701430EA8700000713 20120EA3481340A21480A2EB0100A21302EA0C04EA0618EA03E0>20 21 126 148 48 118 D E /Fy 1 4 600 300 dfs[<1202A3EAC218EAF278EA3AE0EA0F 80A2EA3AE0EAF278EAC218EA0200A3>13 14 126 142 36 3 D E /Fz 43 122 600 300 dfs[13 2 128 139 32 45 D[<127012F8A31270>5 5 124 132 28 I[19 34 126 160 48 48 D[<13801203120F12F31203B3A9EA07C0EAFFFE>15 33 124 160 48 I[19 33 126 160 48 I[19 34 126 160 48 I[<1303A25BA25B1317A2132713671347138712011307120212061204 1208A212101220A2124012C0B512F838000700A7EB0F80EB7FF0>21 33 127 160 48 I[<137EEA01C138030080380601C0EA0C03121C381801800038C7FCA2 12781270A2EAF0F8EAF30CEAF4067F00F81380EB01C012F014E0A51270A3003813C0A238 180380001C1300EA0C06EA070CEA01F0>19 34 126 160 48 54 D[<12401260387FFFE014C0A23840008038C0010012801302A2485A5BA25B5BA2136013 4013C0A21201A25B1203A41207A76CC7FC>19 35 125 161 48 I[19 34 126 160 48 57 D[<127012F8A312701200AB127012F8A31270>5 21 124 148 28 I[<497EA3497EA3EB05E0A2EB09F01308A2EB1078A3497EA3497EA2EB C01F497EA248B51280EB0007A20002EB03C0A348EB01E0A348EB00F0121C003EEB01F839 FF800FFF>32 35 126 162 74 65 D[<903807E0109038381830EBE0063901C001703903 8000F048C7FC000E1470121E001C1430123CA2007C14101278A200F81400A81278151012 7C123CA2001C1420121E000E14407E6C6C13803901C001003800E002EB381CEB07E0>28 36 125 162 70 67 D[31 34 126 161 74 I[29 34 126 161 66 I[27 34 126 161 64 I[<39FFFC3FFF390FC003F039078001E0AE90B5FCEB8001AF390FC003F039FFFC 3FFF>32 34 126 161 74 72 D[40 34 126 161 90 77 D[<39FF8007FF3907C000F81570D805E01320EA04F0A21378137C133C7F131F7FEB07 80A2EB03C0EB01E0A2EB00F014F81478143C143E141E140FA2EC07A0EC03E0A21401A214 00000E1460121FD8FFE01320>32 34 126 161 74 I[33 35 126 161 72 82 D[<3803F020380C0C60EA1802383001E0EA70000060136012E0A21420A36C1300A21278 127FEA3FF0EA1FFE6C7E0003138038003FC0EB07E01301EB00F0A214707EA46C1360A26C 13C07E38C8018038C60700EA81FC>20 36 125 162 54 I[<007FB512F8397807807800 60141800401408A300C0140C00801404A400001400B3A3497E3801FFFE>30 34 126 161 70 I[<39FFFC07FF390FC000F86C4813701520B3A5000314407FA2000114 806C7E9038600100EB3006EB1C08EB03F0>32 35 126 161 74 I[<3BFFF03FFC03FE3B 1F8007E000F86C486C48137017206E7ED807801540A24A7E2603C0021480A39039E00478 0100011600A2EC083CD800F01402A2EC101E01785CA2EC200F013C5CA20260138890391E 400790A216D090391F8003F0010F5CA2EC00016D5CA20106130001025C>47 35 127 161 100 87 D[21 21 126 148 48 97 D[18 21 126 148 44 99 D[<14E0130F13011300ABEA01F8EA0704EA0C02EA1C01EA38001278127012F0A7 127012781238EA1801EA0C0238070CF03801F0FE>23 35 126 162 54 I[19 21 127 148 44 I[<133E13E33801C780EA0387130748C7FCA9EAFFF80007C7FCB27FEA7FF0>17 35 128 162 30 I[<120E12FE121E120EABEB1F80EB60C0EB80E0380F0070A2120EAF38 FFE7FF>24 35 127 162 54 104 D[<121C123EA3121CC7FCA8120E127E121E120EB1EA FFC0>10 34 127 161 28 I[<120E12FE121E120EABEB03FCEB01F014C01480EB02005B 5B5B133813F8EA0F1CEA0E1E130E7F1480EB03C0130114E0EB00F014F838FFE3FE>23 35 127 162 52 107 D[<120E12FE121E120EB3ADEAFFE0>11 35 127 162 28 I[<390E1FC07F3AFE60E183803A1E807201C03A0F003C00E0A2000E1338AF 3AFFE3FF8FFE>39 21 127 148 84 I[<380E1F8038FE60C0381E80E0380F0070A2120E AF38FFE7FF>24 21 127 148 54 I[21 21 127 148 48 I[23 31 127 148 54 I[16 21 127 148 38 114 D[14 21 126 148 38 I[<1202A41206A3120E121E123EEAFFFCEA0E00AB1304A6EA07081203 EA01F0>14 31 127 158 38 I[<000E137038FE07F0EA1E00000E1370AD14F0A2380601 70380382783800FC7F>24 21 127 148 54 I[<38FF80FE381E00781430000E1320A26C 1340A2EB80C000031380A23801C100A2EA00E2A31374A21338A31310>23 21 127 148 52 I[<38FF80FE381E00781430000E1320A26C1340A2EB80C000031380A2 3801C100A2EA00E2A31374A21338A31310A25BA35B12F05B12F10043C7FC123C>23 31 127 148 52 121 D E /FA 14 118 600 300 dfs[<127812FCA212FEA2127A1202A5 1204A31208A212101220A21240>7 20 122 177 36 39 D[35 49 125 176 82 76 D[53 49 124 176 122 I[42 50 124 176 100 85 D[<13FE380303C0380C00E00010137080003C133C00 3E131C141EA21208C7FCA3EB0FFEEBFC1EEA03E0EA0F80EA1F00123E123C127C481404A3 143EA21278007C135E6CEB8F08390F0307F03903FC03E0>30 31 125 158 66 97 D[33 50 126 177 74 I[25 31 126 158 58 101 D[<120FEA1F80A4EA0F00C7FCABEA0780127FA2120F1207B3A6EA 0FC0EAFFF8A2>13 48 126 175 36 105 D[14 50 126 177 36 108 D[<260780FEEB1FC03BFF83078060F0903A8C03C180 783B0F9001E2003CD807A013E4DA00F47F01C013F8A2495BB3A2486C486C133F3CFFFC1F FF83FFF0A2>52 31 126 158 112 I[<380780FE39FF83078090388C03C0390F9001E0EA 07A06E7E13C0A25BB3A2486C487E3AFFFC1FFF80A2>33 31 126 158 74 I[<380783E038FF8418EB887CEA0F90EA07A01438EBC000A35BB3487EEAFFFEA2 >22 31 126 158 50 114 D[<3801FC10380E0330381800F048137048133012E01410A3 7E6C1300127EEA3FF06CB4FC6C13C0000313E038003FF0EB01F813006C133CA2141C7EA2 7E14186C1338143000CC136038C301C03880FE00>22 31 126 158 52 I[33 31 126 158 74 117 D E end %%EndProlog %%BeginSetup %%Feature: *Resolution 600dpi TeXDict begin %%EndSetup %%Page: 1 1 1 0 bop 1507 872 a FA(Libmaa)41 b(User's)i(Man)l(ual)1803 1112 y Fz(Ric)m(k)-5 b(ard)31 b(E.)h(F)-8 b(aith)2512 1076 y Fy(\003)1445 1229 y Fz(Departmen)m(t)30 b(of)j(Computer)e (Science)1223 1345 y(Univ)m(ersit)m(y)e(of)34 b(North)e(Carolina)i(at)f (Chap)s(el)f(Hill)1948 1539 y(TR96-009)1377 1655 y(DRAFT:)f(W)-8 b(ed)33 b(Ma)m(y)f(21)i(00:49:39)h(1997)1859 1755 y Fx(R)q(ev)t(ision) 25 b Fz(:)i(1)p Fx(:)p Fz(2)515 2237 y Fw(Con)l(ten)l(ts)515 2420 y Fv(1)76 b(F)-8 b(unctions)2704 b(7)639 2519 y Fu(1.1)83 b(General)28 b(Supp)r(ort)72 b(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(7)830 2619 y(1.1.1)92 b Ft(maa)p 1253 2619 26 4 v 31 w(init)34 b Fu(.)41 b(.)g(.)f(.)h(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(7)639 2719 y(1.2)83 b(Argumen)n(t)27 b(List)g(Routines)52 b(.)41 b(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(7)830 2818 y(1.2.1)92 b Ft(ar)l(g)p 1213 2818 V 30 w(cr)l(e)l(ate)54 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(7)830 2918 y(1.2.2)92 b Ft(ar)l(g)p 1213 2918 V 30 w(destr)l(oy)75 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)163 b(7)830 3018 y(1.2.3)92 b Ft(ar)l(g)p 1213 3018 V 30 w(add)75 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)163 b(7)830 3117 y(1.2.4)92 b Ft(ar)l(g)p 1213 3117 V 30 w(addn)29 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(7)830 3217 y(1.2.5)92 b Ft(ar)l(g)p 1213 3217 V 30 w(gr)l(ow)33 b Fu(.)41 b(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(7)830 3316 y(1.2.6)92 b Ft(ar)l(g)p 1213 3316 V 30 w(\014nish)72 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(8)830 3416 y(1.2.7)92 b Ft(ar)l(g)p 1213 3416 V 30 w(get)33 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)163 b(8)830 3516 y(1.2.8)92 b Ft(ar)l(g)p 1213 3516 V 30 w(c)l(ount)72 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(8)830 3615 y(1.2.9)92 b Ft(ar)l(g)p 1213 3615 V 30 w(get)p 1347 3615 V 30 w(ve)l(ctor)45 b Fu(.)c(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(8)830 3715 y(1.2.10)50 b Ft(ar)l(g)p 1213 3715 V 30 w(ar)l(gify)62 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)163 b(8)639 3815 y(1.3)83 b(Base-26)29 b(Routines)45 b(.)c(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(8)639 3914 y(1.4)83 b(Base-64)29 b(Routines)45 b(.)c(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(8)639 4014 y(1.5)83 b(Bit)28 b(manipulation)21 b(routines)58 b(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(9)830 4113 y(1.5.1)92 b Ft(bit)p 1193 4113 V 30 w(set)57 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(9)830 4213 y(1.5.2)92 b Ft(bit)p 1193 4213 V 30 w(clr)61 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)163 b(9)830 4313 y(1.5.3)92 b Ft(bit)p 1193 4313 V 30 w(tst)67 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)163 b(9)830 4412 y(1.5.4)92 b Ft(bit)p 1193 4412 V 30 w(cnt)45 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(9)639 4512 y(1.6)83 b(Debugging)26 b(Supp)r(ort)33 b(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)163 b(9)830 4612 y(1.6.1)92 b Ft(db)l(g)p 1215 4612 V 31 w(r)l(e)l(gister)62 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) h(.)g(.)f(.)h(.)f(.)h(.)f(.)163 b(9)p 515 4681 1314 4 v 606 4734 a Fs(\003)642 4758 y Fr(Cra)n(y)16 b(F)-6 b(ello)n(w;)18 b(supp)r(orted)11 b(b)n(y)16 b(ARP)-6 b(A)19 b(via)c(ONR)k(con)n(tract)12 b(N00014-92-C-0182)o(,)g(b)n(y)k (Rome)e(Labs)i(con)n(tract)c(F30602-)515 4837 y(94-C-0037,)j(and)h(b)n (y)i(a)g(Cra)n(y)g(F)-6 b(ello)n(wship)15 b(from)h(Cra)n(y)i(Researc)n (h,)d(Inc.)28 b(and)16 b(NCSC)21 b(\(North)c(Carolina)e(Sup)r(ercomp)o (u)o(tin)o(g)515 4915 y(Cen)n(ter\)..)2136 5255 y Fu(1)p eop %%Page: 2 2 2 1 bop 830 523 a Fu(1.6.2)92 b Ft(db)l(g)p 1215 523 26 4 v 31 w(set)34 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) g(.)f(.)h(.)f(.)h(.)f(.)122 b(10)830 623 y(1.6.3)92 b Ft(db)l(g)p 1215 623 V 31 w(set)p 1346 623 V 30 w(\015ag)70 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(10)830 722 y(1.6.4)92 b Ft(db)l(g)p 1215 722 V 31 w(unset)p 1436 722 V 32 w(\015ag)42 b Fu(.)f(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(10)830 822 y(1.6.5)92 b Ft(db)l(g)p 1215 822 V 31 w(test)70 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) g(.)f(.)h(.)f(.)h(.)f(.)122 b(10)830 922 y(1.6.6)92 b Ft(db)l(g)p 1215 922 V 31 w(destr)l(oy)72 b Fu(.)40 b(.)h(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(10)639 1021 y(1.7)83 b(Error)29 b(Rep)r(orting)f(Routines)62 b(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(10)830 1121 y(1.7.1)92 b Ft(err)p 1211 1121 V 29 w(set)p 1340 1121 V 30 w(pr)l(o)l(gr)l(am)p 1662 1121 V 29 w(name)76 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(10)830 1220 y(1.7.2)92 b Ft(err)p 1211 1220 V 29 w(pr)l(o)l(gr)l(am)p 1532 1220 V 29 w(name)77 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f (.)122 b(10)830 1320 y(1.7.3)92 b Ft(err)p 1211 1320 V 29 w(fatal)44 b Fu(.)d(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)122 b(11)830 1420 y(1.7.4)92 b Ft(err)p 1211 1420 V 29 w(fatal)p 1400 1420 V 29 w(errno)76 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(11)830 1519 y(1.7.5)92 b Ft(err)p 1211 1519 V 29 w(warning)44 b Fu(.)c(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(11)830 1619 y(1.7.6)92 b Ft(err)p 1211 1619 V 29 w(internal)50 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(11)639 1719 y(1.8)83 b(Flag)26 b(Supp)r(ort)65 b(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(11)830 1818 y(1.8.1)92 b Ft(\015g)p 1187 1818 V 31 w(r)l(e)l(gister)e Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)122 b(11)830 1918 y(1.8.2)92 b Ft(\015g)p 1187 1918 V 31 w(set)62 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(11)830 2017 y(1.8.3)92 b Ft(\015g)p 1187 2017 V 31 w(test)34 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(12)830 2117 y(1.8.4)92 b Ft(\015g)p 1187 2117 V 31 w(destr)l(oy)35 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(12)639 2217 y(1.9)83 b(Hash)29 b(T)-7 b(able)27 b(Routines)44 b(.)d(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(12)830 2316 y(1.9.1)92 b Ft(hsh)p 1219 2316 V 31 w(cr)l(e)l(ate)47 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(12)830 2416 y(1.9.2)92 b Ft(hsh)p 1219 2416 V 31 w(destr)l(oy)68 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(12)830 2516 y(1.9.3)92 b Ft(hsh)p 1219 2516 V 31 w(insert)51 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(14)830 2615 y(1.9.4)92 b Ft(hsh)p 1219 2615 V 31 w(delete)53 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(14)830 2715 y(1.9.5)92 b Ft(hsh)p 1219 2715 V 31 w(r)l(etrieve)50 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(14)830 2814 y(1.9.6)92 b Ft(hsh)p 1219 2814 V 31 w(iter)l(ate)27 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(14)830 2914 y(1.9.7)92 b Ft(hsh)p 1219 2914 V 31 w(iter)l(ate)p 1482 2914 V 29 w(ar)l(g)80 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(14)830 3014 y(1.9.8)92 b Ft(hsh)p 1219 3014 V 31 w(get)p 1354 3014 V 31 w(stats)87 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(15)830 3113 y(1.9.9)92 b Ft(hsh)p 1219 3113 V 31 w(print)p 1428 3113 V 30 w(stats)79 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(15)830 3213 y(1.9.10)50 b Ft(hsh)p 1219 3213 V 31 w(init)p 1376 3213 V 30 w(p)l(osition)79 b Fu(.)41 b(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(15)830 3313 y(1.9.11)50 b Ft(hsh)p 1219 3313 V 31 w(next)p 1400 3313 V 32 w(p)l(osition)j Fu(.)41 b(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)122 b(16)830 3412 y(1.9.12)50 b Ft(hsh)p 1219 3412 V 31 w(get)p 1354 3412 V 31 w(p)l(osition)36 b Fu(.)k(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(16)830 3512 y(1.9.13)50 b Ft(hsh)p 1219 3512 V 31 w(r)l(e)l(adonly)88 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(16)639 3611 y(1.10)41 b(List)28 b(Routines)57 b(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(16)830 3711 y(1.10.1)50 b Ft(lst)p 1185 3711 V 29 w(cr)l(e)l(ate)83 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(16)830 3811 y(1.10.2)50 b Ft(lst)p 1185 3811 V 29 w(destr)l(oy)39 b Fu(.)i(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(16)830 3910 y(1.10.3)50 b Ft(lst)p 1185 3910 V 29 w(app)l(end)d Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(16)830 4010 y(1.10.4)50 b Ft(lst)p 1185 4010 V 29 w(push)68 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) 122 b(17)830 4110 y(1.10.5)50 b Ft(lst)p 1185 4110 V 29 w(p)l(op)44 b Fu(.)c(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)122 b(17)830 4209 y(1.10.6)50 b Ft(lst)p 1185 4209 V 29 w(top)k Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(17)830 4309 y(1.10.7)50 b Ft(lst)p 1185 4309 V 29 w(nth)p 1330 4309 V 31 w(get)44 b Fu(.)d(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(17)830 4408 y(1.10.8)50 b Ft(lst)p 1185 4408 V 29 w(nth)p 1330 4408 V 31 w(set)e Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)122 b(17)830 4508 y(1.10.9)50 b Ft(lst)p 1185 4508 V 29 w(memb)l(er)78 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) g(.)f(.)h(.)f(.)h(.)f(.)122 b(17)830 4608 y(1.10.10)8 b Ft(lst)p 1185 4608 V 29 w(length)81 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(17)830 4707 y(1.10.11)8 b Ft(lst)p 1185 4707 V 29 w(trunc)l(ate)64 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(18)830 4807 y(1.10.12)8 b Ft(lst)p 1185 4807 V 29 w(trunc)l(ate)p 1510 4807 V 31 w(p)l(osition)73 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)122 b(18)830 4907 y(1.10.13)8 b Ft(lst)p 1185 4907 V 29 w(iter)l(ate)63 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)122 b(18)830 5006 y(1.10.14)8 b Ft(lst)p 1185 5006 V 29 w(iter)l(ate)p 1446 5006 V 29 w(ar)l(g)51 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(18)2136 5255 y(2)p eop %%Page: 3 3 3 2 bop 830 523 a Fu(1.10.15)8 b Ft(lst)p 1185 523 26 4 v 29 w(init)p 1340 523 V 30 w(p)l(osition)51 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(18)830 623 y(1.10.16)8 b Ft(lst)p 1185 623 V 29 w(last)p 1340 623 V 30 w(p)l(osition)51 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(18)830 722 y(1.10.17)8 b Ft(lst)p 1185 722 V 29 w(next)p 1364 722 V 32 w(p)l(osition)89 b Fu(.)41 b(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(19)830 822 y(1.10.18)8 b Ft(lst)p 1185 822 V 29 w(nth)p 1330 822 V 31 w(p)l(osition)60 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(19)830 922 y(1.10.19)8 b Ft(lst)p 1185 922 V 29 w(get)p 1318 922 V 31 w(p)l(osition)72 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(19)830 1021 y(1.10.20)8 b Ft(lst)p 1185 1021 V 29 w(set)p 1314 1021 V 30 w(p)l(osition)77 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(19)830 1121 y(1.10.21)p 1101 1121 V 38 w Ft(lst)p 1215 1121 V 30 w(dump)p 1441 1121 V 32 w(no)l(de)66 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(19)639 1220 y(1.11)41 b(Memory)26 b(Managemen)n(t)f(Routines)50 b(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(19)830 1320 y(1.11.1)50 b Ft(mem)p 1275 1320 V 30 w(cr)l(e)l(ate)p 1517 1320 V 30 w(strings)43 b Fu(.)d(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(19)830 1420 y(1.11.2)50 b Ft(mem)p 1275 1420 V 30 w(destr)l(oy)p 1561 1420 V 31 w(strings)62 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) 122 b(20)830 1519 y(1.11.3)50 b Ft(mem)p 1275 1519 V 30 w(str)l(cpy)55 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(20)830 1619 y(1.11.4)50 b Ft(mem)p 1275 1619 V 30 w(strncpy)69 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)122 b(20)830 1719 y(1.11.5)50 b Ft(mem)p 1275 1719 V 30 w(gr)l(ow)36 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) g(.)f(.)h(.)f(.)h(.)f(.)122 b(20)830 1818 y(1.11.6)50 b Ft(mem)p 1275 1818 V 30 w(\014nish)75 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(20)830 1918 y(1.11.7)50 b Ft(mem)p 1275 1918 V 30 w(get)p 1409 1918 V 31 w(string)p 1648 1918 V 29 w(stats)j Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(20)830 2017 y(1.11.8)50 b Ft(mem)p 1275 2017 V 30 w(print)p 1483 2017 V 30 w(string)p 1721 2017 V 30 w(stats)44 b Fu(.)d(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(20)830 2117 y(1.11.9)50 b Ft(mem)p 1275 2117 V 30 w(cr)l(e)l(ate)p 1517 2117 V 30 w(obje)l(cts)45 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)122 b(21)830 2217 y(1.11.10)8 b Ft(mem)p 1275 2217 V 30 w(destr)l(oy)p 1561 2217 V 31 w(obje)l(cts)64 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(21)830 2316 y(1.11.11)8 b Ft(mem)p 1275 2316 V 30 w(get)p 1409 2316 V 31 w(obje)l(ct)57 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)122 b(21)830 2416 y(1.11.12)8 b Ft(mem)p 1275 2416 V 30 w(get)p 1409 2416 V 31 w(empty)p 1656 2416 V 31 w(obje)l(ct)68 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(21)830 2516 y(1.11.13)8 b Ft(mem)p 1275 2516 V 30 w(fr)l(e)l(e)p 1435 2516 V 29 w(obje)l(ct)33 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)122 b(21)830 2615 y(1.11.14)8 b Ft(mem)p 1275 2615 V 30 w(get)p 1409 2615 V 31 w(obje)l(ct)p 1646 2615 V 30 w(stats)54 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(22)830 2715 y(1.11.15)8 b Ft(mem)p 1275 2715 V 30 w(print)p 1483 2715 V 30 w(obje)l(ct)p 1719 2715 V 30 w(stats)46 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(22)639 2814 y(1.12)41 b(P)n(arsing)28 b(\(and)f(Lexing\))h(Supp)r(ort)37 b(.)k(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(22)830 2914 y(1.12.1)50 b Ft(prs)p 1213 2914 V 30 w(set)p 1343 2914 V 30 w(debug)65 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)122 b(22)830 3014 y(1.12.2)50 b Ft(prs)p 1213 3014 V 30 w(set)p 1343 3014 V 30 w(cpp)p 1495 3014 V 32 w(options)45 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(22)830 3113 y(1.12.3)50 b Ft(prs)p 1213 3113 V 30 w(\014le)31 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)122 b(22)830 3213 y(1.12.4)50 b Ft(prs)p 1213 3213 V 30 w(\014le)p 1349 3213 V 30 w(no)l(cpp)j Fu(.)41 b(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(23)830 3313 y(1.12.5)50 b Ft(prs)p 1213 3313 V 30 w(str)l(e)l(am)28 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(23)830 3412 y(1.12.6)50 b Ft(prs)p 1213 3412 V 30 w(make)p 1429 3412 V 31 w(inte)l(ger)61 b Fu(.)41 b(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(23)830 3512 y(1.12.7)50 b Ft(prs)p 1213 3512 V 30 w(make)p 1429 3512 V 31 w(double)81 b Fu(.)41 b(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(23)639 3611 y(1.13)41 b(Pro)r(cess)32 b(Managemen)n(t)26 b(Routines)77 b(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(23)639 3711 y(1.14)41 b(Prime)26 b(Num)n(b)r(er)h(Routines)45 b(.)c(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(23)830 3811 y(1.14.1)50 b Ft(prm)p 1247 3811 V 30 w(is)p 1337 3811 V 30 w(prime)61 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)122 b(23)830 3910 y(1.14.2)50 b Ft(prm)p 1247 3910 V 30 w(next)p 1427 3910 V 31 w(prime)35 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(24)639 4010 y(1.15)41 b(Set)29 b(Routines)82 b(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(24)830 4110 y(1.15.1)50 b Ft(set)p 1201 4110 V 30 w(cr)l(e)l(ate)66 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(24)830 4209 y(1.15.2)50 b Ft(set)p 1201 4209 V 30 w(destr)l(oy)87 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(24)830 4309 y(1.15.3)50 b Ft(set)p 1201 4309 V 30 w(insert)70 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(25)830 4408 y(1.15.4)50 b Ft(set)p 1201 4408 V 30 w(delete)72 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(25)830 4508 y(1.15.5)50 b Ft(set)p 1201 4508 V 30 w(memb)l(er)61 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(25)830 4608 y(1.15.6)50 b Ft(set)p 1201 4608 V 30 w(iter)l(ate)c Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(25)830 4707 y(1.15.7)50 b Ft(set)p 1201 4707 V 30 w(iter)l(ate)p 1463 4707 V 29 w(ar)l(g)34 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)122 b(25)830 4807 y(1.15.8)50 b Ft(set)p 1201 4807 V 30 w(init)p 1357 4807 V 30 w(p)l(osition)34 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(25)830 4907 y(1.15.9)50 b Ft(set)p 1201 4907 V 30 w(next)p 1381 4907 V 32 w(p)l(osition)72 b Fu(.)41 b(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(26)830 5006 y(1.15.10)8 b Ft(set)p 1201 5006 V 30 w(get)p 1335 5006 V 31 w(p)l(osition)55 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(26)2136 5255 y(3)p eop %%Page: 4 4 4 3 bop 830 523 a Fu(1.15.11)8 b Ft(set)p 1201 523 26 4 v 30 w(r)l(e)l(adonly)43 b Fu(.)d(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)122 b(26)830 623 y(1.15.12)8 b Ft(set)p 1201 623 V 30 w(union)74 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)122 b(26)830 722 y(1.15.13)8 b Ft(set)p 1201 722 V 30 w(inter)39 b Fu(.)i(.)g(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(26)830 822 y(1.15.14)8 b Ft(set)p 1201 822 V 30 w(di\013)95 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(26)830 922 y(1.15.15)8 b Ft(set)p 1201 922 V 30 w(e)l(qual)33 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) 122 b(27)830 1021 y(1.15.16)8 b Ft(set)p 1201 1021 V 30 w(get)p 1335 1021 V 31 w(stats)42 b Fu(.)e(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(27)830 1121 y(1.15.17)8 b Ft(set)p 1201 1121 V 30 w(print)p 1409 1121 V 30 w(stats)33 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(27)639 1220 y(1.16)41 b(Skip)27 b(List)h(Routines)64 b(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(27)830 1320 y(1.16.1)50 b Ft(sl)p 1157 1320 V 30 w(cr)l(e)l(ate)45 b Fu(.)c(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(28)830 1420 y(1.16.2)50 b Ft(sl)p 1157 1420 V 30 w(destr)l(oy)66 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(28)830 1519 y(1.16.3)p 1101 1519 V 80 w Ft(sl)p 1187 1519 V 30 w(shutdown)87 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(28)830 1619 y(1.16.4)50 b Ft(sl)p 1157 1619 V 30 w(insert)f Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)122 b(28)830 1719 y(1.16.5)50 b Ft(sl)p 1157 1719 V 30 w(delete)h Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) g(.)f(.)h(.)f(.)h(.)f(.)122 b(28)830 1818 y(1.16.6)50 b Ft(sl)p 1157 1818 V 30 w(\014nd)59 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(29)830 1918 y(1.16.7)50 b Ft(sl)p 1157 1918 V 30 w(iter)l(ate)25 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) 122 b(29)830 2017 y(1.16.8)50 b Ft(sl)p 1157 2017 V 30 w(iter)l(ate)p 1419 2017 V 28 w(ar)l(g)79 b Fu(.)41 b(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(29)830 2117 y(1.16.9)p 1101 2117 V 80 w Ft(sl)p 1187 2117 V 30 w(dump)31 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(29)639 2217 y(1.17)41 b(Source)30 b(Co)r(de)e(Managemen)n(t)47 b(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(29)830 2316 y(1.17.1)50 b Ft(sr)l(c)p 1205 2316 V 29 w(cr)l(e)l(ate)63 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(29)830 2416 y(1.17.2)50 b Ft(sr)l(c)p 1205 2416 V 29 w(destr)l(oy)84 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)122 b(29)830 2516 y(1.17.3)50 b Ft(sr)l(c)p 1205 2516 V 29 w(line)78 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)122 b(30)830 2615 y(1.17.4)50 b Ft(sr)l(c)p 1205 2615 V 29 w(new)p 1374 2615 V 31 w(\014le)63 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(30)830 2715 y(1.17.5)50 b Ft(sr)l(c)p 1205 2715 V 29 w(new)p 1374 2715 V 31 w(line)37 b Fu(.)j(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) g(.)f(.)h(.)f(.)h(.)f(.)122 b(30)830 2814 y(1.17.6)50 b Ft(sr)l(c)p 1205 2814 V 29 w(advanc)l(e)58 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(30)830 2914 y(1.17.7)50 b Ft(sr)l(c)p 1205 2914 V 29 w(get)42 b Fu(.)e(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(30)830 3014 y(1.17.8)50 b Ft(sr)l(c)p 1205 3014 V 29 w(\014lename)40 b Fu(.)g(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)122 b(30)830 3113 y(1.17.9)50 b Ft(sr)l(c)p 1205 3113 V 29 w(linenumb)l(er)71 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)122 b(30)830 3213 y(1.17.10)8 b Ft(sr)l(c)p 1205 3213 V 29 w(o\013set)83 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(30)830 3313 y(1.17.11)8 b Ft(sr)l(c)p 1205 3313 V 29 w(length)61 b Fu(.)41 b(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(31)830 3412 y(1.17.12)8 b Ft(sr)l(c)p 1205 3412 V 29 w(sour)l(c)l(e)p 1458 3412 V 31 w(line)82 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)122 b(31)830 3512 y(1.17.13)8 b Ft(sr)l(c)p 1205 3512 V 29 w(get)p 1338 3512 V 31 w(stats)39 b Fu(.)h(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(31)830 3611 y(1.17.14)8 b Ft(sr)l(c)p 1205 3611 V 29 w(print)p 1412 3611 V 30 w(stats)30 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)122 b(31)830 3711 y(1.17.15)8 b Ft(sr)l(c)p 1205 3711 V 29 w(print)p 1412 3711 V 30 w(line)64 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(31)830 3811 y(1.17.16)8 b Ft(sr)l(c)p 1205 3811 V 29 w(p)l(arse)p 1422 3811 V 31 w(err)l(or)66 b Fu(.)40 b(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(32)830 3910 y(1.17.17)8 b Ft(sr)l(c)p 1205 3910 V 29 w(print)p 1412 3910 V 30 w(err)l(or)77 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) 122 b(32)830 4010 y(1.17.18)8 b Ft(sr)l(c)p 1205 4010 V 29 w(print)p 1412 4010 V 30 w(message)33 b Fu(.)41 b(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(32)639 4110 y(1.18)41 b(Stac)n(k)28 b(Routines)63 b(.)41 b(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(32)830 4209 y(1.18.1)50 b Ft(stk)p 1201 4209 V 30 w(cr)l(e)l(ate)66 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(32)830 4309 y(1.18.2)50 b Ft(stk)p 1201 4309 V 30 w(destr)l(oy)87 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(32)830 4408 y(1.18.3)50 b Ft(stk)p 1201 4408 V 30 w(push)h Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) 122 b(32)830 4508 y(1.18.4)50 b Ft(stk)p 1201 4508 V 30 w(p)l(op)91 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)122 b(33)830 4608 y(1.18.5)50 b Ft(stk)p 1201 4608 V 30 w(top)37 b Fu(.)j(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(33)639 4707 y(1.19)41 b(String)28 b(P)n(o)r(ol)e(Routines)43 b(.)e(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)122 b(33)830 4807 y(1.19.1)50 b Ft(str)p 1199 4807 V 29 w(p)l(o)l(ol)p 1368 4807 V 31 w(cr)l(e)l(ate)27 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)122 b(33)830 4907 y(1.19.2)50 b Ft(str)p 1199 4907 V 29 w(p)l(o)l(ol)p 1368 4907 V 31 w(destr)l(oy)e Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(33)830 5006 y(1.19.3)50 b Ft(str)p 1199 5006 V 29 w(p)l(o)l(ol)p 1368 5006 V 31 w(exists)41 b Fu(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(33)2136 5255 y(4)p eop %%Page: 5 5 5 4 bop 830 523 a Fu(1.19.4)50 b Ft(str)p 1199 523 26 4 v 29 w(p)l(o)l(ol)p 1368 523 V 31 w(\014nd)41 b Fu(.)f(.)h(.)f(.)h(.) f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(33)830 623 y(1.19.5)50 b Ft(str)p 1199 623 V 29 w(p)l(o)l(ol)p 1368 623 V 31 w(c)l(opy)81 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(34)830 722 y(1.19.6)50 b Ft(str)p 1199 722 V 29 w(p)l(o)l(ol)p 1368 722 V 31 w(c)l(opyn)35 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(34)830 822 y(1.19.7)50 b Ft(str)p 1199 822 V 29 w(p)l(o)l(ol)p 1368 822 V 31 w(gr)l(ow)71 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)122 b(34)830 922 y(1.19.8)50 b Ft(str)p 1199 922 V 29 w(p)l(o)l(ol)p 1368 922 V 31 w(\014nish)45 b Fu(.)c(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(34)830 1021 y(1.19.9)50 b Ft(str)p 1199 1021 V 29 w(p)l(o)l(ol)p 1368 1021 V 31 w(get)p 1503 1021 V 30 w(stats)68 b Fu(.)41 b(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(34)830 1121 y(1.19.10)8 b Ft(str)p 1199 1121 V 29 w(p)l(o)l(ol)p 1368 1121 V 31 w(print)p 1577 1121 V 29 w(stats)60 b Fu(.)40 b(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(34)830 1220 y(1.19.11)8 b Ft(str)p 1199 1220 V 29 w(exists)83 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(35)830 1320 y(1.19.12)8 b Ft(str)p 1199 1320 V 29 w(\014nd)82 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) 122 b(35)830 1420 y(1.19.13)8 b Ft(str)p 1199 1420 V 29 w(\014ndn)36 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)122 b(35)830 1519 y(1.19.14)8 b Ft(str)p 1199 1519 V 29 w(c)l(opy)58 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(35)830 1619 y(1.19.15)8 b Ft(str)p 1199 1619 V 29 w(c)l(opyn)77 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(35)830 1719 y(1.19.16)8 b Ft(str)p 1199 1719 V 29 w(gr)l(ow)48 b Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.) 122 b(36)830 1818 y(1.19.17)8 b Ft(str)p 1199 1818 V 29 w(\014nish)87 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)122 b(36)830 1918 y(1.19.18)8 b Ft(str)p 1199 1918 V 29 w(unique)45 b Fu(.)c(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)122 b(36)830 2017 y(1.19.19)8 b Ft(str)p 1199 2017 V 29 w(destr)l(oy)90 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) g(.)f(.)h(.)f(.)h(.)f(.)122 b(36)830 2117 y(1.19.20)8 b Ft(str)p 1199 2117 V 29 w(get)p 1332 2117 V 30 w(stats)46 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(36)830 2217 y(1.19.21)8 b Ft(str)p 1199 2217 V 29 w(print)p 1406 2217 V 30 w(stats)36 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.) h(.)f(.)h(.)f(.)122 b(36)830 2316 y(1.19.22)8 b Ft(txt)p 1195 2316 V 30 w(soundex)65 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.) f(.)h(.)f(.)h(.)f(.)122 b(37)639 2416 y(1.20)41 b(Timer)26 b(Supp)r(ort)67 b(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)f(.)122 b(37)830 2516 y(1.20.1)50 b Ft(tim)p 1223 2516 V 29 w(start)89 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) g(.)f(.)h(.)f(.)h(.)f(.)122 b(37)830 2615 y(1.20.2)50 b Ft(tim)p 1223 2615 V 29 w(stop)c Fu(.)41 b(.)g(.)f(.)h(.)f(.)h(.)f(.) h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(37)830 2715 y(1.20.3)50 b Ft(tim)p 1223 2715 V 29 w(r)l(eset)87 b Fu(.)41 b(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(37)830 2814 y(1.20.4)50 b Ft(tim)p 1223 2814 V 29 w(get)p 1356 2814 V 31 w(r)l(e)l(al)57 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) g(.)f(.)h(.)f(.)h(.)f(.)122 b(37)830 2914 y(1.20.5)50 b Ft(tim)p 1223 2914 V 29 w(get)p 1356 2914 V 31 w(user)35 b Fu(.)40 b(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(37)830 3014 y(1.20.6)50 b Ft(tim)p 1223 3014 V 29 w(get)p 1356 3014 V 31 w(system)74 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h (.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.) f(.)h(.)f(.)122 b(38)830 3113 y(1.20.7)50 b Ft(tim)p 1223 3113 V 29 w(print)p 1430 3113 V 30 w(timer)d Fu(.)40 b(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)122 b(38)830 3213 y(1.20.8)50 b Ft(tim)p 1223 3213 V 29 w(print)p 1430 3213 V 30 w(timers)77 b Fu(.)41 b(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f (.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.) h(.)f(.)122 b(38)830 3313 y(1.20.9)p 1101 3313 V 80 w Ft(tim)p 1253 3313 V 30 w(shutdown)86 b Fu(.)40 b(.)h(.)f(.)h(.)g(.)f (.)h(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)g(.)f(.)h(.)f(.)h(.)f(.)h(.) g(.)f(.)h(.)f(.)h(.)f(.)122 b(38)515 3495 y Fv(A)52 b(Maa)2883 b(39)2136 5255 y Fu(5)p eop %%Page: 6 6 6 5 bop 1988 523 a Fq(Abstract)837 653 y Fp(The)28 b Fo(libmaa)g Fp(library)k(pro)n(vides)e(man)n(y)f(lo)n(w-lev)n(el)i (data)d(structures)h(whic)n(h)g(are)e(helpful)32 b(for)722 745 y(writing)h(compilers,)g(includin)q(g)j(hash)31 b(tables,)h(sets,)e (lists,)j(debugging)h(supp)r(ort,)e(and)f(memory)722 836 y(managemen)n(t.)55 b(Although)35 b Fo(libmaa)e Fp(w)n(as)f (designed)k(and)d(implemen)n(ted)k(as)32 b(a)g(foundation)37 b(for)722 927 y(the)27 b Fo(Khepera)i Fp(T)-6 b(ransformation)29 b(System,)e(the)g(data)g(structures)h(are)e(generally)31 b(applicabl)q(e)h(to)722 1018 y(a)26 b(wide)i(range)f(of)e(programming) 30 b(problems.)837 1110 y(The)25 b(memory)g(managemen)n(t)i(routines)h (are)d(esp)r(ecially)31 b(helpful)d(for)c(impro)n(ving)30 b(the)25 b(p)r(erfor-)722 1201 y(mance)i(of)f(memory-in)n(tensiv)n(e)31 b(application)q(s.)2136 5255 y Fu(6)p eop %%Page: 7 7 7 6 bop 515 523 a Fw(1)134 b(F)-11 b(unctions)515 721 y Fn(1.1)111 b(General)35 b(Supp)s(ort)515 875 y Fv(1.1.1)95 b Fm(maa)p 990 875 30 4 v 34 w(init)722 1028 y Fv(v)m(oid)42 b Ft(maa)p 1098 1028 V 35 w(init)8 b Fl(\()43 b Fv(const)f(c)m(har)h Fk(\003)p Ft(pr)l(o)l(gr)l(amName)48 b Fl(\))515 1199 y Ft(maa)p 672 1199 26 4 v 31 w(init)41 b Fu(should)33 b(b)r(e)i(called)e(at)g(the)i(start)f(of)39 b Fv(main\(\))p Fu(,)30 b(and)j(serv)n(es)k(to)c(initialize)e(debugging)h(and)515 1299 y(other)d(supp)r(ort)g(for)e Fj(libmaa)p Fu(.)515 1531 y Fn(1.2)111 b(Argumen)m(t)34 b(List)i(Routines)515 1684 y Fu(Argumen)n(t)31 b(lists)j(are)g(v)n(ectors)h(of)d(p)r(oin)n (ters)j(to)d(strings)j(\(e.g.,)d(the)i(standard)h Ft(char)f(**ar)l(gv)9 b Fu(\).)53 b(These)515 1784 y(routines)29 b(manage)24 b(the)29 b(e\016cien)n(t)g(creation,)e(manipulation,)21 b(and)27 b(deletion)h(of)e(these)31 b(sorts)e(of)e(lists.)515 2000 y Fv(1.2.1)95 b Fm(ar)-5 b(g)p 943 2000 30 4 v 35 w(cr)g(e)g(ate)722 2153 y Ft(ar)l(g)p 839 2153 V 34 w(List)51 b(ar)l(g)p 1176 2153 V 34 w(cr)l(e)l(ate)6 b Fl(\()43 b Fv(v)m(oid)f Fl(\))515 2324 y Fu(Create)29 b(an)f Ft(ar)l(g)p 1015 2324 26 4 v 30 w(List)34 b Fu(ob)5 b(ject.)515 2540 y Fv(1.2.2)95 b Fm(ar)-5 b(g)p 943 2540 30 4 v 35 w(destr)g(oy)722 2693 y Fv(v)m(oid)42 b Ft(ar)l(g)p 1058 2693 V 34 w(destr)l(oy)7 b Fl(\()44 b Ft(ar)l(g)p 1543 2693 V 34 w(List)51 b(ar)l(g)f Fl(\))515 2864 y Fu(F)-7 b(ree)30 b(all)25 b(memory)e(asso)r(ciated)29 b(with)e Ft(ar)l(g)p Fu(,)g(including)e(the)k(memory)23 b(used)30 b(for)d(the)i(strings.)515 3080 y Fv(1.2.3)95 b Fm(ar)-5 b(g)p 943 3080 V 35 w(add)722 3233 y Ft(ar)l(g)p 839 3233 V 34 w(List)51 b(ar)l(g)p 1176 3233 V 34 w(add)9 b Fl(\()45 b Ft(ar)l(g)p 1534 3233 V 34 w(List)51 b(ar)l(g)p Fl(,)42 b Fv(const)f(c)m(har)i Fk(\003)p Ft(string)50 b Fl(\))515 3404 y Fu(Add)28 b Ft(string)34 b Fu(as)28 b(the)h(next)g(item)c(in)h Ft(ar)l(g)p Fu(.)515 3620 y Fv(1.2.4)95 b Fm(ar)-5 b(g)p 943 3620 V 35 w(addn)722 3774 y Ft(ar)l(g)p 839 3774 V 34 w(List)51 b(ar)l(g)p 1176 3774 V 34 w(addn)6 b Fl(\()46 b Ft(ar)l(g)p 1578 3774 V 35 w(List)k(ar)l(g)p Fl(,)42 b Fv(const)g(c)m(har)h Fk(\003)p Ft(string)p Fl(,)e Fv(in)m(t)g Ft(length)50 b Fl(\))515 3945 y Fu(Add)28 b Ft(length)34 b Fu(c)n(haracters)d(of)26 b Ft(string)34 b Fu(as)28 b(the)h(next)f(item)d(in)i Ft(ar)l(g)p Fu(.)35 b(A)28 b(terminating)d Fv(NULL)i Fu(is)g(added)h(to)515 4044 y(the)h(copied)f Ft(string)p Fu(.)515 4260 y Fv(1.2.5)95 b Fm(ar)-5 b(g)p 943 4260 V 35 w(gr)g(ow)722 4413 y Fv(v)m(oid)42 b Ft(ar)l(g)p 1058 4413 V 34 w(gr)l(ow)9 b Fl(\()42 b Ft(ar)l(g)p 1455 4413 V 35 w(List)50 b(ar)l(g)p Fl(,)42 b Fv(const)g(c)m(har)h Fk(\003)p Ft(string)p Fl(,)e Fv(in)m(t)g Ft(length)50 b Fl(\))515 4584 y Fu(Gro)n(w)23 b(the)j(next)f(item)d(of)h Ft(ar)l(g)31 b Fu(with)24 b Ft(length)31 b Fu(c)n(haracters)d(of)23 b Ft(string)p Fu(.)34 b(Sev)n(eral)25 b(calls)e(to)i Ft(ar)l(g)p 3339 4584 26 4 v 29 w(gr)l(ow)32 b Fu(should)515 4684 y(b)r(e)i(follo)n(w)n(ed)d(b)n(y)i(a)f(single)h(call)f(to)h Ft(ar)l(g)p 1774 4684 V 30 w(\014nish)41 b Fu(without)33 b(an)n(y)f(in)n(terv)n(ening)h(calls)g(to)g(other)i(functions)515 4784 y(whic)n(h)27 b(mo)r(dify)c Ft(ar)l(g)p Fu(.)2136 5255 y(7)p eop %%Page: 8 8 8 7 bop 515 523 a Fv(1.2.6)95 b Fm(ar)-5 b(g)p 943 523 30 4 v 35 w(\014nish)722 676 y Ft(ar)l(g)p 839 676 V 34 w(List)51 b(ar)l(g)p 1176 676 V 34 w(\014nish)6 b Fl(\()46 b Ft(ar)l(g)p 1600 676 V 34 w(List)k(ar)l(g)h Fl(\))515 847 y Fu(Finish)27 b(the)i(gro)n(wth)e(of)g(the)i(next)f (item)d(in)i Ft(ar)l(g)35 b Fu(started)30 b(b)n(y)d Ft(ar)l(g)p 2561 847 26 4 v 30 w(gr)l(ow)p Fu(.)515 1063 y Fv(1.2.7)95 b Fm(ar)-5 b(g)p 943 1063 30 4 v 35 w(get)722 1216 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(ar)l(g)p 1365 1216 V 34 w(get)8 b Fl(\()43 b Ft(ar)l(g)p 1698 1216 V 35 w(List)50 b(ar)l(g)p Fl(,)42 b Fv(in)m(t)f Ft(item)49 b Fl(\))515 1388 y Fu(Return)28 b Ft(item)34 b Fu(from)24 b Ft(ar)l(g)p Fu(.)35 b Ft(ar)l(g)g Fu(is)27 b(0-based.)515 1603 y Fv(1.2.8)95 b Fm(ar)-5 b(g)p 943 1603 V 35 w(c)g(ount)722 1757 y Fv(in)m(t)41 b Ft(ar)l(g)p 997 1757 V 34 w(c)l(ount)8 b Fl(\()45 b Ft(ar)l(g)p 1422 1757 V 34 w(List)51 b(ar)l(g)f Fl(\))515 1928 y Fu(Return)28 b(the)h(n)n(um)n(b)r(er)e(of)f(items)g (in)h Ft(ar)l(g)p Fu(.)515 2144 y Fv(1.2.9)95 b Fm(ar)-5 b(g)p 943 2144 V 35 w(get)p 1098 2144 V 35 w(ve)g(ctor)722 2297 y Fv(v)m(oid)42 b Ft(ar)l(g)p 1058 2297 V 34 w(get)p 1196 2297 V 35 w(ve)l(ctor)9 b Fl(\()43 b Ft(ar)l(g)p 1643 2297 V 34 w(List)51 b(ar)l(g)p Fl(,)42 b Fv(in)m(t)e Fk(\003)p Ft(ar)l(gc)p Fl(,)i Fv(c)m(har)h Fk(\003\003\003)p Ft(ar)l(gv)51 b Fl(\))515 2468 y Fu(Get)24 b(an)g Ft(ar)l(gc)k Fu(and)c Ft(ar)l(gv)32 b Fu(from)21 b Ft(ar)l(g)p Fu(.)34 b(These)27 b(are)d(suitable)g(for)g(use)h(in)f(calls)f(to)h Ft(exe)l(c)p Fu(.)35 b(The)25 b Ft(ar)l(gc)5 b Fu(+1)24 b(item)515 2568 y(in)j Ft(ar)l(gv)36 b Fu(is)27 b Fv(NULL)p Fu(.)515 2783 y Fv(1.2.10)95 b Fm(ar)-5 b(g)p 991 2783 V 35 w(ar)g(gify)722 2937 y Ft(ar)l(g)p 839 2937 V 34 w(List)51 b(ar)l(g)p 1176 2937 V 34 w(ar)l(gify)7 b Fl(\()43 b Fv(const)f(c)m(har)h Fk(\003)p Ft(string)p Fl(,)e Fv(in)m(t)f Ft(quoteStyle)51 b Fl(\))515 3108 y Fu(Break)24 b(up)g Ft(string)29 b Fu(in)n(to)22 b(argumen)n(ts,)g(placing)f(them)h(as)h (items)e(in)i Ft(ar)l(g)p Fu(.)33 b(Items)23 b(within)e(single)i(or)g (double)515 3207 y(quotes)35 b(ma)n(y)29 b(con)n(tain)k(spaces.)56 b(The)35 b(quotes)g(are)f(stripp)r(ed)i(as)e(in)e(shell)i(argumen)n(t)d (pro)r(cessing.)56 b(In)515 3307 y(this)28 b(v)n(ersion,)f(bac)n (kslash)h(is)f Fv(not)f Fu(a)h(sp)r(ecial)h(quoting)e(c)n(haracter.)515 3539 y Fn(1.3)111 b(Base-26)36 b(Routines)515 3693 y Fu(These)30 b(routines)f(p)r(erform)d(enco)r(ding)i(and)f(deco)r (dingusing)h(the)g(26)f(lo)n(w)n(ercase)i(c)n(haracters,)h(a-z.)36 b(This)515 3792 y(is)27 b(sometimes)d(useful)k(for)f(generating)i (unique)e(iden)n(ti\014ers)j(that)e(do)f(not)g(con)n(tain)g(n)n(um)n(b) r(ers.)515 4025 y Fn(1.4)111 b(Base-64)36 b(Routines)515 4178 y Fu(These)27 b(routines)e(use)i(the)e(64-c)n(haracter)h(subset)i (of)23 b(In)n(ternational)g(Alphab)r(et)i(IA5)g(discussed)i(in)d(RF)n (C)515 4277 y(1421)h(\(prin)n(teable)k(enco)r(ding\))f(and)g(RF)n(C)e (1522)g(\(base64)i(MIME\).)639 4377 y(V)-7 b(alue)30 b(Enco)r(ding)f(V)-7 b(alue)30 b(Enco)r(ding)f(V)-7 b(alue)30 b(Enco)r(ding)g(V)-7 b(alue)29 b(Enco)r(ding)h(0)f(A)g(17)g(R)g(34)f(i) h(51)f(z)i(1)515 4477 y(B)e(18)e(S)h(35)f(j)g(52)g(0)h(2)f(C)h(19)g(T)g (36)f(k)g(53)h(1)f(3)h(D)f(20)g(U)h(37)f(l)h(54)f(2)g(4)h(E)g(21)f(V)i (38)e(m)e(55)i(3)h(5)f(F)h(22)f(W)h(39)f(n)515 4576 y(56)f(4)h(6)g(G)f (23)h(X)g(40)f(o)h(57)g(5)f(7)h(H)h(24)e(Y)i(41)e(p)i(58)e(6)h(8)g(I)g (25)f(Z)i(42)f(q)g(59)f(7)h(9)g(J)h(26)e(a)h(43)f(r)i(60)e(8)h(10)g(K)h (27)e(b)515 4676 y(44)i(s)i(61)e(9)h(11)f(L)h(28)f(c)i(45)f(t)g(62)f(+) i(12)e(M)i(29)e(d)h(46)f(u)i(63)e(/)h(13)f(N)h(30)f(e)j(47)d(v)h(14)f (O)i(31)e(f)h(48)f(w)h(\(pad\))g(=)515 4776 y(15)e(P)j(32)d(g)h(49)g(x) h(16)e(Q)j(33)d(h)i(50)f(y)2136 5255 y(8)p eop %%Page: 9 9 9 8 bop 515 523 a Fn(1.5)111 b(Bit)36 b(manipulation)e(routines)515 676 y Fu(These)c(are)f(a)e(set)i(of)e(simple)e(routine)j(to)f (manipulate)d(bits)k(in)f(an)g(in)n(teger.)515 892 y Fv(1.5.1)95 b Fm(bit)p 918 892 30 4 v 35 w(set)p 727 1045 V 762 1045 V 792 1045 a Ft(inline)p 1001 1045 V 1035 1045 V 113 w Fv(v)m(oid)41 b Ft(bit)p 1424 1045 V 34 w(set)8 b Fl(\()44 b Fv(unsigned)37 b(long)42 b Fk(\003)p Ft(\015ags)p Fl(,)i Fv(in)m(t)c Ft(bit)51 b Fl(\))515 1216 y Fu(Set)29 b Ft(bit)34 b Fu(in)27 b Ft(\015ags)p Fu(.)515 1432 y Fv(1.5.2)95 b Fm(bit)p 918 1432 V 35 w(clr)p 727 1585 V 762 1585 V 792 1585 a Ft(inline)p 1001 1585 V 1035 1585 V 113 w Fv(v)m(oid)41 b Ft(bit)p 1424 1585 V 34 w(clr)9 b Fl(\()43 b Fv(unsigned)37 b(long)42 b Fk(\003)p Ft(\015ags)p Fl(,)i Fv(in)m(t)c Ft(bit)51 b Fl(\))515 1757 y Fu(Clear)27 b Ft(bit)35 b Fu(in)27 b Ft(\015ags)p Fu(.)515 1972 y Fv(1.5.3)95 b Fm(bit)p 918 1972 V 35 w(tst)p 727 2126 V 762 2126 V 792 2126 a Ft(inline)p 1001 2126 V 1035 2126 V 113 w Fv(in)m(t)40 b Ft(bit)p 1363 2126 V 34 w(tst)8 b Fl(\()43 b Fv(unsigned)38 b(long)k Fk(\003)p Ft(\015ags)p Fl(,)h Fv(in)m(t)e Ft(bit)50 b Fl(\))515 2297 y Fu(T)-7 b(est)29 b Ft(bit)35 b Fu(in)27 b Ft(\015ags)p Fu(,)h(returning)h(non-zero)g(if)d(the)j(bit)e(is)h(set) h(and)f(zero)h(if)d(the)j(bit)e(is)h(clear.)515 2513 y Fv(1.5.4)95 b Fm(bit)p 918 2513 V 35 w(cnt)p 727 2666 V 762 2666 V 792 2666 a Ft(inline)p 1001 2666 V 1035 2666 V 113 w Fv(in)m(t)40 b Ft(bit)p 1363 2666 V 34 w(cnt)8 b Fl(\()45 b Fv(unsigned)37 b(long)42 b Fk(\003)p Ft(\015ags)51 b Fl(\))515 2837 y Fu(Return)28 b(a)g(coun)n(t)g(of)f(the)i(n)n(um)n(b) r(er)d(of)g(bits)i(set)i(in)d Ft(\015ags)p Fu(.)515 3069 y Fn(1.6)111 b(Debugging)36 b(Supp)s(ort)515 3223 y Fu(These)30 b(routines)f(pro)n(vide)f(lo)n(w-lev)n(el)d(supp)r(ort)30 b(for)d(run-time)f(debugging)h(messages.)37 b(A)28 b(set)h(of)e(global) 515 3322 y(\015ags)40 b(are)h(main)n(tained)35 b(using)41 b Fv(#de\014ne)c Fu(statemen)n(ts.)73 b(These)43 b(\015ags)d(are)h (assumed)f(to)f(b)r(e)j(32-bit)515 3422 y(in)n(tegers,)37 b(the)f(top)f(t)n(w)n(o)e(bits)i(of)f(whic)n(h)g(are)i(used)h(to)d (select)k(one)d(of)e(four)i(sets)i(of)c(debugging)h(lags.)515 3521 y(Eac)n(h)25 b(set,)i(therefore,)g(has)e(30)f(bits)h(of)f(\015ag)f (information.)30 b(The)25 b(last)g(set)h(\(i.e.,)d(when)j(the)g(top)f (t)n(w)n(o)f(bits)515 3621 y(are)33 b(b)r(oth)g(set\))h(is)e(reserv)n (ed)37 b(for)31 b(in)n(ternal)h(use)i(b)n(y)e(the)i Fj(Khepera)h Fu(library)-7 b(.)48 b(F)-7 b(or)33 b(con)n(v)n(enience,)i(eac)n(h)515 3721 y(\015ag)24 b(can)h(b)r(e)h(giv)n(en)f(a)f(unique)h(name,)d(so)j (that)h(\015ags)e(can)i(b)r(e)g(set)h(easily)d(with)g(command-li)o(ne)c (options.)515 3937 y Fv(1.6.1)95 b Fm(db)-5 b(g)p 945 3937 V 35 w(r)g(e)g(gister)722 4090 y Fv(v)m(oid)42 b Ft(db)l(g)p 1060 4090 V 35 w(r)l(e)l(gister)9 b Fl(\()41 b Ft(db)l(g)p 1557 4090 V 36 w(T)-6 b(yp)l(e)49 b(\015ag)p Fl(,)44 b Fv(const)e(c)m(har)h Fk(\003)p Ft(name)50 b Fl(\))515 4261 y Ft(db)l(g)p 634 4261 26 4 v 31 w(r)l(e)l(gister)29 b Fu(is)22 b(used)j(to)d(set)j(up)e(an)f(aso)r(ciated)h(b)r(et)n(w)n (een)j(a)c Ft(\015ag)32 b Fu(and)22 b(a)g Ft(name)p Fu(.)36 b(After)24 b(this)f(asso)r(ciation)515 4360 y(is)30 b(made,)f(calls)h (to)g Ft(db)l(g)p 1261 4360 V 31 w(set)39 b Fu(can)31 b(use)i Ft(name)38 b Fu(to)30 b(set)j(the)f(global)c(debugging)i (\015ag.)44 b(Both)31 b(of)f(the)i(high)515 4460 y(bits)22 b(cannot)h(b)r(e)g(set)h(sim)n(ultaneously|these)c(\015ags)i(are)h (reserv)n(ed)j(for)c(in)n(ternal)f(use)j(b)n(y)e(the)h Fj(Khepera)515 4560 y Fu(library)-7 b(.)776 4530 y Fi(1)p 515 4629 1314 4 v 607 4683 a Fh(1)642 4706 y Fr(F)h(or)22 b(in)n(ternal)c Fg(Khepera)25 b Fr(library)19 b(use,)p 1714 4706 22 4 v 47 w Ff(db)l(g)p 1836 4706 V 29 w(r)l(e)l(gister)32 b Fr(can)20 b(b)r(e)i(used)f(to)g(register)e(\015ags)i(whic)n(h)g(ha)n (v)n(e)f(b)r(oth)h(high)f(bits)515 4785 y(set.)2136 5255 y Fu(9)p eop %%Page: 10 10 10 9 bop 515 523 a Fv(1.6.2)95 b Fm(db)-5 b(g)p 945 523 30 4 v 35 w(set)722 676 y Fv(v)m(oid)42 b Ft(db)l(g)p 1060 676 V 35 w(set)8 b Fl(\()44 b Fv(const)d(c)m(har)i Fk(\003)p Ft(name)51 b Fl(\))515 847 y Ft(db)l(g)p 634 847 26 4 v 31 w(set)35 b Fu(sets)30 b(the)f Ft(name)36 b Fu(\015ag.)f(If)27 b Ft(name)35 b Fu(is)27 b(\\none,")g(then)i(all)c (\015ags)j(are)g(cleared.)515 1063 y Fv(1.6.3)95 b Fm(db)-5 b(g)p 945 1063 30 4 v 35 w(set)p 1096 1063 V 36 w(\015ag)722 1216 y Fv(v)m(oid)42 b Ft(db)l(g)p 1060 1216 V 35 w(set)p 1195 1216 V 35 w(\015ag)7 b Fl(\()45 b Ft(db)l(g)p 1556 1216 V 36 w(T)-6 b(yp)l(e)49 b(\015ag)k Fl(\))515 1388 y Fu(Used)29 b(to)f(set)i(the)f(\015ag)d(using)i(the)h(prede\014ned)i (macro)25 b(instead)k(of)d(the)j(string)f(name.)515 1603 y Fv(1.6.4)95 b Fm(db)-5 b(g)p 945 1603 V 35 w(unset)p 1202 1603 V 36 w(\015ag)722 1757 y Fv(v)m(oid)42 b Ft(db)l(g)p 1060 1757 V 35 w(unset)p 1285 1757 V 36 w(\015ag)7 b Fl(\()46 b Ft(db)l(g)p 1648 1757 V 35 w(T)-6 b(yp)l(e)50 b(\015ag)i Fl(\))515 1928 y Fu(Used)29 b(to)f(unset)i(the)f(\015ag)e (using)g(the)i(prede\014ned)i(macro)26 b(instead)i(of)f(the)i(string)e (name.)515 2144 y Fv(1.6.5)95 b Fm(db)-5 b(g)p 945 2144 V 35 w(test)p 727 2297 V 762 2297 V 792 2297 a Ft(inline)p 1001 2297 V 1035 2297 V 113 w Fv(in)m(t)40 b Ft(db)l(g)p 1385 2297 V 36 w(test)8 b Fl(\()43 b Ft(db)l(g)p 1746 2297 V 35 w(T)-6 b(yp)l(e)50 b(\015ag)i Fl(\))515 2468 y Fu(Thsi)24 b(inlined)f(function)i(tests)i(the)f Ft(\015ag)p Fu(,)g(returning)g(non-zero)g(if)d(the)j Ft(\015ag)33 b Fu(is)25 b(set,)h(and)e(zero)j(otherwise.)515 2684 y Fv(1.6.6)95 b Fm(db)-5 b(g)p 945 2684 V 35 w(destr)g(oy)722 2837 y Fv(v)m(oid)42 b Ft(db)l(g)p 1060 2837 V 35 w(destr)l(oy)7 b Fl(\()44 b Fv(v)m(oid)e Fl(\))515 3008 y Ft(db)l(g)p 634 3008 26 4 v 31 w(destr)l(oy)i Fu(destro)n(ys)c(the)f(memory)32 b(asso)r(ciated)39 b(with)e(the)h(debugging)f(supp)r(ort)i(routines.)66 b(This)515 3108 y(routine)32 b(should)g Ft(never)41 b Fu(b)r(e)33 b(called)f(b)n(y)g(the)h(programmer:)40 b(it)31 b(is)h(automatically)26 b(called)31 b(at)h(program)515 3207 y(termination)24 b(on)j(systems)h(that)g(supp)r(ort)i(the)f Ft(atexit)35 b Fu(or)28 b Ft(on)p 2451 3207 V 31 w(exit)36 b Fu(calls.)515 3440 y Fn(1.7)111 b(Error)36 b(Rep)s(orting)g(Routines) 515 3593 y Fu(Sev)n(eral)22 b(error)j(rep)r(orting)e(routines)g(are)g (pro)n(vided.)34 b(These)25 b(routines)e(are)g(alw)n(a)n(ys)d(used)k (to)e(prin)n(t)g(errors)515 3693 y(generated)30 b(within)c(the)j Fj(Khepera)i Fu(library)-7 b(,)25 b(and)j(are)g(a)n(v)-5 b(ailable)25 b(for)i(the)i(programmer)23 b(as)28 b(w)n(ell.)515 3908 y Fv(1.7.1)95 b Fm(err)p 940 3908 30 4 v 35 w(set)p 1091 3908 V 36 w(pr)-5 b(o)g(gr)g(am)p 1468 3908 V 33 w(name)722 4062 y Fv(v)m(oid)42 b Ft(err)p 1056 4062 V 33 w(set)p 1189 4062 V 34 w(pr)l(o)l(gr)l(am)p 1515 4062 V 34 w(name)6 b Fl(\()45 b Fv(const)d(c)m(har)h Fk(\003)p Ft(pr)l(o)l(gr)l(amName)48 b Fl(\))515 4233 y Ft(err)p 630 4233 26 4 v 28 w(set)p 758 4233 V 31 w(pr)l(o)l(gr)l(am) p 1081 4233 V 29 w(name)37 b Fu(records)c(the)f(v)-5 b(alue)29 b(of)g Ft(ar)l(gv[0])38 b Fu(for)29 b(the)i(calling)c (program.)40 b(If)29 b(this)h(v)-5 b(alue)30 b(is)515 4332 y(not)d Fv(NULL)p Fu(,)f(then)j(it)e(will)e(b)r(e)k(used)h(when)e (prin)n(ting)f(errors)j(and)d(w)n(arnings.)515 4548 y Fv(1.7.2)95 b Fm(err)p 940 4548 30 4 v 35 w(pr)-5 b(o)g(gr)g(am)p 1316 4548 V 33 w(name)722 4701 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(err)p 1363 4701 V 33 w(pr)l(o)l(gr)l(am)p 1688 4701 V 33 w(name)6 b Fl(\()45 b Fv(v)m(oid)d Fl(\))515 4873 y Ft(err)p 630 4873 26 4 v 28 w(pr)l(o)l(gr)l(am)p 950 4873 V 30 w(name)26 b Fu(returns)21 b(the)f(v)-5 b(alue)18 b(of)g Ft(pr)l(o)l(gr)l(amName)23 b Fu(that)c(w)n(as)f (previously)g(set)j(with)d Ft(err)p 3547 4873 V 28 w(set)p 3675 4873 V 31 w(pr)l(o)l(gr)l(am)p 3998 4873 V 29 w(name)p Fu(.)p 4240 4889 42 74 v 515 4972 a(This)27 b(v)-5 b(alue)28 b(ma)n(y)c(b)r(e)29 b Fv(NULL)p Fu(.)2115 5255 y(10)p eop %%Page: 11 11 11 10 bop 515 523 a Fv(1.7.3)95 b Fm(err)p 940 523 30 4 v 35 w(fatal)722 676 y Fv(v)m(oid)42 b Ft(err)p 1056 676 V 33 w(fatal)9 b Fl(\()42 b Fv(const)g(c)m(har)h Fk(\003)p Ft(r)l(outine)p Fl(,)f Fv(const)g(c)m(har)h Fk(\003)p Ft(format)p Fl(,)e(.)13 b(.)g(.)42 b(\))515 847 y Ft(err)p 630 847 26 4 v 28 w(fatal)36 b Fu(\015ushes)30 b Fv(stdout)p Fu(,)22 b(prin)n(ts)28 b(a)f(fatal)f(error)j(rep)r(ort)h (on)d Fv(stderr)p Fu(,)c(\015ushes)30 b Fv(stderr)24 b Fu(and)j Fv(stdout)p Fu(,)515 947 y(and)g(calls)g Ft(exit)p Fu(.)36 b Ft(r)l(outine)d Fu(is)28 b(the)h(name)c(of)i(the)i(routine)f (in)f(whic)n(h)g(the)i(error)h(to)r(ok)d(place.)515 1159 y Fv(1.7.4)95 b Fm(err)p 940 1159 30 4 v 35 w(fatal)p 1165 1159 V 34 w(errno)722 1312 y Fv(v)m(oid)42 b Ft(err)p 1056 1312 V 33 w(fatal)p 1249 1312 V 34 w(errno)5 b Fl(\()43 b Fv(const)f(c)m(har)h Fk(\003)p Ft(r)l(outine)p Fl(,)f Fv(const)f(c)m(har)j Fk(\003)p Ft(format)p Fl(,)d(.)12 b(.)h(.)43 b(\))515 1483 y Ft(err)p 630 1483 26 4 v 28 w(fatal)p 818 1483 V 30 w(errno)27 b Fu(\015ushes)f Fv(stdout)p Fu(,)18 b(prin)n(ts)24 b(a)e(fatal)e(error)25 b(rep)r(ort)g(on)d Fv(stderr)p Fu(,)d(prin)n(ts)24 b(the)g(system)e(error)515 1583 y(corresp)r(onding)32 b(to)d Ft(errno)p Fu(,)g(\015ushes)k Fv(stderr)26 b Fu(and)j Fv(stdout)p Fu(,)d(and)j(calls)h Ft(exit)p Fu(.)42 b Ft(r)l(outine)36 b Fu(is)29 b(the)j(name)27 b(of)515 1683 y(the)i(routine)f(in)f(whic)n(h)g(the)i(error)h(to)r(ok)d (place.)515 1894 y Fv(1.7.5)95 b Fm(err)p 940 1894 30 4 v 35 w(warning)722 2048 y Fv(v)m(oid)42 b Ft(err)p 1056 2048 V 33 w(warning)7 b Fl(\()44 b Fv(const)d(c)m(har)i Fk(\003)p Ft(r)l(outine)p Fl(,)f Fv(const)g(c)m(har)h Fk(\003)p Ft(format)p Fl(,)e(.)13 b(.)g(.)42 b(\))515 2219 y Ft(err)p 630 2219 26 4 v 28 w(warning)30 b Fu(\015ushes)25 b Fv(stdout)p Fu(,)18 b(prin)n(ts)23 b(a)f(non-fatal)e(w)n(arning)h(on) h Fv(stderr)p Fu(,)c(and)k(returns)k(to)c(the)i(caller.)515 2318 y Ft(r)l(outine)33 b Fu(is)28 b(the)h(name)c(of)i(the)i(calling)c (routine.)515 2530 y Fv(1.7.6)95 b Fm(err)p 940 2530 30 4 v 35 w(internal)722 2684 y Fv(v)m(oid)42 b Ft(err)p 1056 2684 V 33 w(internal)9 b Fl(\()43 b Fv(const)e(c)m(har)i Fk(\003)p Ft(r)l(outine)p Fl(,)f Fv(const)g(c)m(har)h Fk(\003)p Ft(format)p Fl(,)e(.)13 b(.)g(.)42 b(\))515 2855 y Ft(err)p 630 2855 26 4 v 28 w(internal)33 b Fu(\015ushes)27 b Fv(stdout)p Fu(,)20 b(prin)n(ts)25 b(the)h(fatal)d(error)j(message,)e (\015ushes)j Fv(stderr)21 b Fu(and)j Fv(stdout)p Fu(,)c(and)515 2954 y(calls)27 b Ft(ab)l(ort)35 b Fu(so)28 b(that)f(a)h(core)h(dump)c (is)j(generated.)515 3183 y Fn(1.8)111 b(Flag)37 b(Supp)s(ort)515 3336 y Fu(These)23 b(routines)f(pro)n(vide)e(lo)n(w-lev)n(el)e(supp)r (ort)23 b(for)d(run-time)e(program)g(\015o)n(w)i(con)n(trol.)33 b(The)22 b(mec)n(hanism)515 3436 y(used)33 b(is)f(similar)27 b(to)k(that)h(used)i(for)d(debugging)g(messages.)48 b(A)32 b(set)i(of)d(global)d(\015ags)k(are)g(main)n(tained)515 3535 y(using)c Fv(#de\014ne)23 b Fu(statemen)n(ts.)36 b(These)30 b(\015ags)d(are)h(assumed)f(to)g(b)r(e)h(32-bit)e(in)n (tegers,)i(the)g(top)f(t)n(w)n(o)g(bits)515 3635 y(of)i(whic)n(h)i(are) h(used)h(to)d(select)k(one)d(of)f(four)g(sets)k(of)c(debugging)g(lags.) 44 b(Eac)n(h)31 b(set,)i(therefore,)h(has)d(30)515 3734 y(bits)i(of)g(\015ag)f(information.)47 b(F)-7 b(or)34 b(con)n(v)n(enience,)i(eac)n(h)f(\015ag)d(can)i(b)r(e)h(giv)n(en)d(a)h (unique)h(name,)d(so)j(that)515 3834 y(\015ags)27 b(can)i(b)r(e)g(set)g (easily)e(with)g(command-l)o(i)o(ne)c(options.)515 4046 y Fv(1.8.1)95 b Fm(\015g)p 914 4046 30 4 v 36 w(r)-5 b(e)g(gister)722 4199 y Fv(v)m(oid)42 b Ft(\015g)p 1032 4199 V 36 w(r)l(e)l(gister)9 b Fl(\()41 b Ft(\015g)p 1502 4199 V 35 w(T)-6 b(yp)l(e)50 b(\015ag)p Fl(,)44 b Fv(const)e(c)m(har)h Fk(\003)p Ft(name)50 b Fl(\))515 4370 y Ft(\015g)p 606 4370 26 4 v 31 w(r)l(e)l(gister)31 b Fu(is)24 b(used)i(to)f(set)h(up)f(an)f(aso)r(ciated)h(b)r(et)n(w)n (een)j(a)c Ft(\015ag)33 b Fu(and)24 b(a)g Ft(name)p Fu(.)36 b(After)26 b(this)f(asso)r(ciation)515 4470 y(is)i(made,)e(calls)i(to)g Ft(\015g)p 1220 4470 V 32 w(set)35 b Fu(can)28 b(use)i Ft(name)35 b Fu(to)27 b(set)j(the)f(global)24 b(\015ag.)515 4682 y Fv(1.8.2)95 b Fm(\015g)p 914 4682 30 4 v 36 w(set)722 4835 y Fv(v)m(oid)42 b Ft(\015g)p 1032 4835 V 36 w(set)8 b Fl(\()43 b Fv(const)f(c)m(har)h Fk(\003)p Ft(name)50 b Fl(\))515 5006 y Ft(\015g)p 606 5006 26 4 v 31 w(set)36 b Fu(sets)30 b(the)f Ft(name)35 b Fu(\015ag.)g(If)27 b Ft(name)35 b Fu(is)28 b(\\none,")e(then)j(all)d(\015ags)h(are)i (cleared.)2115 5255 y(11)p eop %%Page: 12 12 12 11 bop 515 523 a Fv(1.8.3)95 b Fm(\015g)p 914 523 30 4 v 36 w(test)p 727 676 V 762 676 V 792 676 a Ft(inline)p 1001 676 V 1035 676 V 113 w Fv(in)m(t)40 b Ft(\015g)p 1357 676 V 36 w(test)8 b Fl(\()43 b Ft(\015g)p 1690 676 V 36 w(T)-6 b(yp)l(e)50 b(\015ag)i Fl(\))515 847 y Fu(Thsi)24 b(inlined)f(function)i(tests)i(the)f Ft(\015ag)p Fu(,)g(returning)g (non-zero)g(if)d(the)j Ft(\015ag)33 b Fu(is)25 b(set,)h(and)e(zero)j (otherwise.)515 1063 y Fv(1.8.4)95 b Fm(\015g)p 914 1063 V 36 w(destr)-5 b(oy)722 1216 y Fv(v)m(oid)42 b Ft(\015g)p 1032 1216 V 36 w(destr)l(oy)7 b Fl(\()44 b Fv(v)m(oid)d Fl(\))515 1388 y Ft(\015g)p 606 1388 26 4 v 31 w(destr)l(oy)h Fu(destro)n(ys)c(the)e(memory)31 b(asso)r(ciated)36 b(with)f(the)i (\015ag)d(supp)r(ort)j(routines.)59 b(This)35 b(routine)515 1487 y(should)19 b Ft(never)28 b Fu(b)r(e)21 b(called)d(b)n(y)h(the)i (programmer:)27 b(it)18 b(is)i(automatically)13 b(called)18 b(at)h(program)d(termination)515 1587 y(on)27 b(systems)h(that)g(supp)r (ort)h(the)g Ft(atexit)36 b Fu(or)27 b Ft(on)p 1998 1587 V 32 w(exit)35 b Fu(calls.)515 1819 y Fn(1.9)111 b(Hash)38 b(T)-9 b(able)36 b(Routines)515 1972 y Fu(Generic)31 b(hash)f(table)f(supp)r(ort)i(is)f(pro)n(vided)f(for)g(storing)g (generic)j(data)d(asso)r(ciated)i(with)e(k)n(eys.)42 b(The)515 2072 y(hash)27 b(table)g(has)g(prime)e(length,)h(with)g (self-organizing)f(link)n(ed)g(lists)i([Kn)n(uth73)o(,)f(pp.)g(398{9])e (used)29 b(for)515 2172 y(collision)f(resolution.)46 b(The)33 b(hash)e(table)h(automatically)25 b(gro)n(ws)31 b(as)g(necessary)36 b(to)31 b(preserv)n(e)k(e\016cien)n(t)515 2271 y(access.)515 2487 y Fv(1.9.1)95 b Fm(hsh)p 952 2487 30 4 v 34 w(cr)-5 b(e)g(ate)722 2640 y Ft(hsh)p 845 2640 V 36 w(HashT)f(able)49 b(hsh)p 1422 2640 V 36 w(cr)l(e)l(ate)6 b Fl(\()43 b Fv(unsigned)38 b(long)k Fl(\()p Fk(\003)p Ft(hash)6 b Fl(\)\()45 b Fv(const)d(v)m(oid)f Fk(\003)i Fl(\),)1856 2740 y Fv(in)m(t)d Fl(\()p Fk(\003)p Ft(c)l(omp)l(ar)l(e)6 b Fl(\)\()44 b Fv(const)e(v)m(oid)f Fk(\003)p Fl(,)2553 2840 y Fv(const)h(v)m(oid)f Fk(\003)i Fl(\))h(\))515 3011 y Fu(The)26 b Ft(hsh)p 806 3011 26 4 v 31 w(cr)l(e)l(ate)31 b Fu(function)25 b(initilizes)e(a)i(generic)i (hash)f(table.)35 b(Keys)27 b(and)e(data)g(are)h(p)r(oin)n(ters)h(to)e Fv(v)m(oid)p Fu(.)639 3110 y(The)i(in)n(ternal)d(represen)n(tation)29 b(of)24 b(the)j(hash)f(table)f(will)d(gro)n(w)j(automatically)19 b(when)27 b(an)e(insertion)515 3210 y(is)i(p)r(erformed)g(and)h(the)h (table)e(is)h(more)e(than)h(half)f(full.)639 3310 y(The)j Ft(hash)35 b Fu(function)27 b(should)g(tak)n(e)h(a)f(p)r(oin)n(ter)h (to)g(a)f Ft(key)36 b Fu(and)27 b(return)j(an)d Fv(unsigned)f(in)m(t)p Fu(.)33 b(If)27 b Ft(hash)515 3409 y Fu(is)35 b Fv(NULL)p Fu(,)e(then)k(the)f Ft(key)43 b Fu(is)35 b(assumed)g(to)g(b)r(e)h(a)f (p)r(oin)n(ter)h(to)f(a)g(n)n(ull-terminated)c(string,)37 b(and)e(the)515 3509 y(function)d(sho)n(wn)g(in)g(Figure)h(1)f(will)e (b)r(e)k(used)g(for)e Ft(hash)40 b Fu(\(the)34 b(algorithm)27 b(for)32 b(this)h(function)f(is)g(from)515 3609 y([Aho88)n(,)26 b(p.)h(435]\).)639 3708 y(The)h Ft(c)l(omp)l(ar)l(e)33 b Fu(function)27 b(should)g(tak)n(e)g(a)g(pair)f(of)g(p)r(oin)n(ters)i (to)f(k)n(eys)h(and)f(return)i(zero)g(if)d(the)i(k)n(eys)515 3808 y(are)39 b(equal)f(and)g(non-zero)i(if)d(the)i(k)n(eys)h(are)f (not)g(equal.)67 b(If)38 b Ft(c)l(omp)l(ar)l(e)45 b Fu(is)38 b Fv(NULL)p Fu(,)e(then)k(the)g(k)n(eys)515 3907 y(are)32 b(assumed)e(to)i(p)r(oin)n(t)e(to)h(n)n(ull-terminated)d(strings,)k (and)f(the)h Ft(str)l(cmp)k Fu(function)31 b(will)d(b)r(e)k(used)i(for) 515 4007 y Ft(c)l(omp)l(ar)l(e)p Fu(.)639 4107 y(Additionally)-7 b(,)23 b(the)29 b Ft(hsh)p 1401 4107 V 31 w(p)l(ointer)p 1686 4107 V 30 w(hash)35 b Fu(and)27 b Ft(hsh)p 2190 4107 V 32 w(p)l(ointer)p 2476 4107 V 30 w(c)l(omp)l(ar)l(e)33 b Fu(functions)28 b(are)g(a)n(v)-5 b(ailable)24 b(and)515 4206 y(can)33 b(b)r(e)h(used)h(to)e(treat)h(the)g Ft(value)40 b Fu(of)31 b(the)j Fv(v)m(oid)d Fu(p)r(oin)n(ter)j(as)f(the)h(k)n(ey)-7 b(.)52 b(These)35 b(functions)e(are)h(often)515 4306 y(useful)28 b(for)f(main)n(taini)o(ng)22 b(sets)30 b(of)d(ob)5 b(jects.)515 4522 y Fv(1.9.2)95 b Fm(hsh)p 952 4522 30 4 v 34 w(destr)-5 b(oy)722 4675 y Fv(v)m(oid)42 b Ft(hsh)p 1064 4675 V 36 w(destr)l(oy)7 b Fl(\()43 b Ft(hsh)p 1556 4675 V 36 w(HashT)-6 b(able)49 b(table)h Fl(\))515 4846 y Ft(hsh)p 638 4846 26 4 v 31 w(destr)l(oy)35 b Fu(frees)30 b(all)25 b(of)i(the)i(memory)23 b(asso)r(ciated)29 b(with)e(the)i(hash) f(table.)2115 5255 y(12)p eop %%Page: 13 13 13 12 bop 722 1673 a Fv(unsigned)38 b(long)k Ft(hsh)p 1477 1673 30 4 v 35 w(string)p 1720 1673 V 34 w(hash)6 b Fl(\()45 b Fv(const)d(v)m(oid)g Fk(\003)p Ft(key)51 b Fl(\))722 1773 y Fk(f)853 1872 y Fv(const)42 b(c)m(har)479 b Fk(\003)p Ft(pt)51 b Fl(=)44 b(\()p Fv(const)e(c)m(har)h Fk(\003)p Fl(\))p Ft(key)7 b Fl(;)853 1972 y Fv(unsigned)37 b(long)348 b Ft(h)94 b Fl(=)44 b(0;)853 2071 y Fv(static)d(const)h(c)m (har)173 b Fk(\003)p Ft(pr)l(ev)p 1935 2071 V 34 w(pt)52 b Fl(=)44 b Ft(NULL)p Fl(;)853 2171 y Fv(static)d(unsigned)c(long)42 b Ft(pr)l(ev)p 1910 2171 V 35 w(h)50 b Fl(=)44 b(0;)853 2370 y Fv(if)50 b Fl(\(!)p Ft(pt)8 b Fl(\))984 2470 y Ft(err)p 1099 2470 V 33 w(internal)h Fl(\()p 1500 2470 V 1534 2470 V 112 w Ft(FUNCTION)p 2025 2470 V 2058 2470 V 67 w Fl(,)43 b Fe("String-valued)38 b(keys)k(may)g(not)h(be)f (NULL\\n")f Fl(\);)p 3909 2491 42 84 v 3830 2570 a Fd(1)r(0)853 2669 y Fv(if)50 b Fl(\()p Ft(pr)l(ev)p 1148 2669 30 4 v 35 w(pt)i Fl(==)44 b Ft(pt)8 b Fl(\))44 b Fv(return)39 b Ft(pr)l(ev)p 2090 2669 V 35 w(h)6 b Fl(;)853 2868 y Fv(while)40 b Fl(\()p Fk(\003)p Ft(pt)8 b Fl(\))44 b Fk(f)984 2968 y Ft(h)50 b Fl(+=)45 b Fk(\003)p Ft(pt)8 b Fl(++;)722 3068 y Fe(#)p Fv(if)50 b Fl(0)984 3167 y Ft(h)g Fk(\003)p Fl(=)44 b(65599L;)613 b Fc(=)p Fk(\003)27 b Fu(prime)e(near)k(2)2690 3137 y Fi(16)2787 3167 y Fk(\003)p Fc(=)722 3267 y Fe(#)p Fv(else)984 3392 y Ft(h)50 b Fk(\003)p Fl(=)44 b(2654435789U;)389 b Fc(=)p Fk(\003)27 b Fu(prime)e(near)2658 3311 y Fb(p)p 2712 3311 34 3 v 48 x Fi(5)p Fb(\000)p Fi(1)p 2658 3373 173 4 v 2728 3421 a(2)2840 3392 y Fu(2)2882 3362 y Fi(32)2980 3392 y Fk(\003)p Fc(=)722 3492 y Fe(#)p Fv(endif)853 3591 y Fk(g)2935 b Fd(2)r(0)1698 3774 y Fu(Figure)28 b(1:)35 b Ft(hsh)p 2184 3774 26 4 v 32 w(string)p 2424 3774 V 29 w(hash)2115 5255 y Fu(13)p eop %%Page: 14 14 14 13 bop 639 523 a Fu(The)32 b(memory)26 b(used)33 b(b)n(y)e(k)n(eys)h (and)f(data)f(is)h Ft(not)40 b Fu(freed|this)32 b(memory)26 b(is)31 b(the)h(resp)r(onsibilit)n(y)e(of)515 623 y(the)25 b(user.)37 b(Ho)n(w)n(ev)n(er,)25 b(a)f(call)f(to)h Ft(hsh)p 1652 623 26 4 v 31 w(iter)l(ate)29 b Fu(can)c(b)r(e)g(used)h(to)e(free) i(this)f(memory)19 b Ft(imme)l(diately)30 b Fu(b)r(efore)515 722 y(a)d(call)f(to)i Ft(hsh)p 961 722 V 31 w(destr)l(oy)p Fu(.)515 938 y Fv(1.9.3)95 b Fm(hsh)p 952 938 30 4 v 34 w(insert)722 1091 y Fv(in)m(t)41 b Ft(hsh)p 1003 1091 V 36 w(insert)8 b Fl(\()42 b Ft(hsh)p 1447 1091 V 36 w(HashT)-6 b(able)49 b(table)p Fl(,)1420 1191 y Fv(const)41 b(v)m(oid)h Fk(\003)p Ft(key)p Fl(,)1420 1291 y Fv(const)f(v)m(oid)h Fk(\003)p Ft(datum)50 b Fl(\))515 1462 y Ft(hsh)p 638 1462 26 4 v 31 w(insert)32 b Fu(inserts)27 b(a)e(new)h Ft(key)33 b Fu(in)n(to)24 b(the)i Ft(table)p Fu(.)35 b(If)24 b(the)j(insertion)e(is)g(successful,)j(zero)f(is)e(returned.)39 b(If)515 1561 y(the)29 b Ft(key)36 b Fu(already)28 b(exists,)g(1)g(is)g (returned.)40 b(Hence,)31 b(the)e(w)n(a)n(y)e(to)g(c)n(hange)i(the)h Ft(datum)35 b Fu(asso)r(ciated)30 b(with)515 1661 y(a)d Ft(key)36 b Fu(is)27 b(\014rst)i(to)f(call)e Ft(hsh)p 1367 1661 V 32 w(delete)p Fu(.)639 1761 y(If)31 b(the)h(in)n(ternal)e (represen)n(tation)35 b(of)30 b(the)i(hash)g(table)f(b)r(ecomes)g(more) e(than)j(half)d(full,)f(its)j(size)i(is)515 1860 y(increased)k (automatically)-8 b(.)50 b(A)n(t)34 b(presen)n(t,)k(this)d(requires)h (that)f(all)c(of)i(the)j(k)n(ey)e(p)r(oin)n(ters)h(are)g(copied)515 1960 y(in)n(to)28 b(a)h(new)i(table.)42 b(Rehashing)29 b(is)h(not)f(required,)j(ho)n(w)n(ev)n(er,)e(since)h(the)g(hash)g(v)-5 b(alues)30 b(are)h(stored)h(for)515 2059 y(eac)n(h)d(k)n(ey)-7 b(.)515 2275 y Fv(1.9.4)95 b Fm(hsh)p 952 2275 30 4 v 34 w(delete)722 2429 y Fv(in)m(t)41 b Ft(hsh)p 1003 2429 V 36 w(delete)6 b Fl(\()43 b Ft(hsh)p 1444 2429 V 36 w(HashT)-6 b(able)49 b(table)p Fl(,)43 b Fv(const)e(v)m(oid)h Fk(\003)p Ft(key)51 b Fl(\))515 2600 y Ft(hsh)p 638 2600 26 4 v 31 w(delete)35 b Fu(remo)n(v)n(es)29 b(a)f Ft(key)38 b Fu(and)29 b(the)h(asso)r(ciated)h(datum)c(from)e(the)31 b Ft(table)p Fu(.)40 b(Zero)31 b(is)e(returned)k(if)28 b(the)515 2699 y Ft(key)35 b Fu(w)n(as)28 b(presen)n(t.)39 b(Otherwise,)30 b(1)d(is)h(returned.)515 2915 y Fv(1.9.5)95 b Fm(hsh)p 952 2915 30 4 v 34 w(r)-5 b(etrieve)722 3068 y Fv(const)42 b(v)m(oid)g Fk(\003)p Ft(hsh)p 1368 3068 V 35 w(r)l(etrieve)6 b Fl(\()41 b Ft(hsh)p 1874 3068 V 36 w(HashT)-6 b(able)49 b(table)p Fl(,)1856 3168 y Fv(const)41 b(v)m(oid)h Fk(\003)p Ft(key)51 b Fl(\))515 3339 y Ft(hsh)p 638 3339 26 4 v 31 w(r)l(etrieve)27 b Fu(retriev)n(es)g(the)d(datum)d(asso)r(ciated)k(with)d(a)h Ft(key)p Fu(.)35 b(If)23 b(the)h Ft(key)32 b Fu(is)23 b(not)g(presen)n(t)j(in)d(the)h Ft(table)p Fu(,)515 3439 y(then)29 b Fv(NULL)e Fu(is)g(returned.)515 3654 y Fv(1.9.6)95 b Fm(hsh)p 952 3654 30 4 v 34 w(iter)-5 b(ate)722 3808 y Fv(in)m(t)41 b Ft(hsh)p 1003 3808 V 36 w(iter)l(ate)6 b Fl(\()42 b Ft(hsh)p 1469 3808 V 35 w(HashT)-6 b(able)50 b(table)p Fl(,)1463 3907 y Fv(in)m(t)41 b Fl(\()p Fk(\003)p Ft(iter)l(ator)9 b Fl(\)\()41 b Fv(const)h(v)m(oid)f Fk(\003)p Ft(key)p Fl(,)2204 4007 y Fv(const)h(v)m(oid)f Fk(\003)p Ft(datum)51 b Fl(\))44 b(\))515 4178 y Ft(hsh)p 638 4178 26 4 v 31 w(iter)l(ate)29 b Fu(is)23 b(used)j(to)e(iterate)i (a)d(function)h(o)n(v)n(er)g(ev)n(ery)h(v)-5 b(alue)24 b(in)f(the)j Ft(table)p Fu(.)34 b(The)25 b(function,)e Ft(iter)l(ator)p Fu(,)515 4278 y(is)j(passed)j(the)f Ft(key)35 b Fu(and)27 b Ft(datum)34 b Fu(pair)26 b(for)g(eac)n(h)i(en)n (try)g(in)e(the)i(table.)36 b(If)26 b Ft(iter)l(ator)33 b Fu(returns)d(a)d(non-zero)515 4377 y(v)-5 b(alue,)25 b(the)i(iterations)f(stop,)g(and)g Ft(hsh)p 1745 4377 V 31 w(iter)l(ate)31 b Fu(returns)e(non-zero.)36 b(Note)27 b(that)f(the)i(k)n(eys)f(are)g(in)e(some)515 4477 y(arbitrary)g(order,) h(and)e(that)i(this)f(order)h(ma)n(y)21 b(c)n(hange)26 b(b)r(et)n(w)n(een)i(t)n(w)n(o)c(successiv)n(e)29 b(calls)c(to)f Ft(hsh)p 3519 4477 V 32 w(iter)l(ate)p Fu(.)515 4693 y Fv(1.9.7)95 b Fm(hsh)p 952 4693 30 4 v 34 w(iter)-5 b(ate)p 1255 4693 V 34 w(ar)g(g)722 4846 y Fv(in)m(t)41 b Ft(hsh)p 1003 4846 V 36 w(iter)l(ate)p 1271 4846 V 33 w(ar)l(g)7 b Fl(\()43 b Ft(hsh)p 1616 4846 V 36 w(HashT)-6 b(able)49 b(table)p Fl(,)1638 4946 y Fv(in)m(t)40 b Fl(\()p Fk(\003)p Ft(iter)l(ator)9 b Fl(\)\()42 b Fv(const)f(v)m(oid)h Fk(\003)p Ft(key)p Fl(,)2115 5255 y Fu(14)p eop %%Page: 15 15 15 14 bop 2379 523 a Fv(const)41 b(v)m(oid)h Fk(\003)p Ft(datum)p Fl(,)2379 623 y Fv(v)m(oid)f Fk(\003)p Ft(ar)l(g)50 b Fl(\),)1638 722 y Fv(v)m(oid)41 b Fk(\003)p Ft(ar)l(g)50 b Fl(\))515 893 y Ft(hsh)p 638 893 26 4 v 31 w(iter)l(ate)p 901 893 V 29 w(ar)l(g)42 b Fu(is)35 b(used)j(to)d(iterate)i(a)e (function)g(o)n(v)n(er)h(ev)n(ery)h(v)-5 b(alue)35 b(in)g(the)i Ft(table)p Fu(.)59 b(The)36 b(function,)515 993 y Ft(iter)l(ator)p Fu(,)29 b(is)i(passed)j(the)f Ft(key)40 b Fu(and)31 b Ft(datum)39 b Fu(pair)31 b(for)g(eac)n(h)h(en)n(try)h(in)e(the)i (table.)48 b(If)31 b Ft(iter)l(ator)38 b Fu(returns)515 1093 y(a)28 b(non-zero)i(v)-5 b(alue,)28 b(the)h(iterations)g(stop,)g (and)f Ft(hsh)p 2166 1093 V 32 w(iter)l(ate)33 b Fu(returns)e (non-zero.)41 b(Note)29 b(that)g(the)h(k)n(eys)515 1192 y(are)i(in)f(some)e(arbitrary)j(order,)h(and)e(that)g(this)h(order)h (ma)n(y)28 b(c)n(hange)k(b)r(et)n(w)n(een)i(t)n(w)n(o)d(successiv)n(e) 36 b(calls)515 1292 y(to)27 b Ft(hsh)p 739 1292 V 32 w(iter)l(ate)p Fu(.)515 1508 y Fv(1.9.8)95 b Fm(hsh)p 952 1508 30 4 v 34 w(get)p 1106 1508 V 36 w(stats)722 1661 y Ft(hsh)p 845 1661 V 36 w(Stats)51 b(hsh)p 1228 1661 V 35 w(get)p 1367 1661 V 35 w(stats)7 b Fl(\()43 b Ft(hsh)p 1768 1661 V 36 w(HashT)-6 b(able)49 b(table)h Fl(\))515 1832 y Ft(hsh)p 638 1832 26 4 v 31 w(get)p 773 1832 V 31 w(stats)26 b Fu(returns)e(statistics)e(ab)r(out)e(the)i Ft(table)p Fu(.)33 b(The)22 b Ft(hsh)p 2489 1832 V 31 w(Stats)27 b Fu(structure)e(is)20 b(sho)n(wn)h(in)f(Figure)g(2.)722 2047 y Fv(t)m(yp)s(edef)49 b(struct)41 b Ft(hsh)p 1499 2047 30 4 v 35 w(Stats)51 b Fk(f)853 2147 y Fv(unsigned)37 b(long)42 b Ft(size)6 b Fl(;)515 b Fc(=)p Fk(\003)26 b Fu(Size)j(of)e(table)g Fk(\003)p Fc(=)853 2247 y Fv(unsigned)37 b(long)42 b Ft(r)l(esizings)7 b Fl(;)338 b Fc(=)p Fk(\003)26 b Fu(Num)n(b)r(er)h(of)g(resizings)i Fk(\003)p Fc(=)853 2346 y Fv(unsigned)37 b(long)42 b Ft(entries)7 b Fl(;)400 b Fc(=)p Fk(\003)26 b Fu(T)-7 b(otal)26 b(en)n(tries)k(in)d(table)h Fk(\003)p Fc(=)853 2446 y Fv(unsigned)37 b(long)42 b Ft(buckets)p 1747 2446 V 36 w(use)l(d)9 b Fl(;)196 b Fc(=)p Fk(\003)26 b Fu(Num)n(b)r(er)h(of)g(hash)h(buc)n(k)n(ets)i(in)d (use)i Fk(\003)p Fc(=)853 2546 y Fv(unsigned)37 b(long)42 b Ft(singletons)7 b Fl(;)292 b Fc(=)p Fk(\003)26 b Fu(Num)n(b)r(er)h (of)g(length)g(one)i(lists)e Fk(\003)p Fc(=)853 2645 y Fv(unsigned)37 b(long)42 b Ft(maximum)p 1843 2645 V 36 w(length)6 b Fl(;)43 b Fc(=)p Fk(\003)27 b Fu(Maxim)n(um)20 b(list)27 b(length)h Fk(\003)p Fc(=)853 2844 y Fv(unsigned)37 b(long)42 b Ft(r)l(etrievals)7 b Fl(;)312 b Fc(=)p Fk(\003)26 b Fu(T)-7 b(otal)26 b(n)n(um)n(b)r(er)h(of)f(retriev)-5 b(als)30 b Fk(\003)p Fc(=)853 2944 y Fv(unsigned)37 b(long)42 b Ft(hits)7 b Fl(;)516 b Fc(=)p Fk(\003)26 b Fu(Num)n(b)r(er)h(of)g (retriev)-5 b(als)29 b(from)24 b(top)k(of)e(a)i(list)e Fk(\003)p Fc(=)55 b Fd(1)r(0)853 3044 y Fv(unsigned)37 b(long)42 b Ft(misses)7 b Fl(;)412 b Fc(=)p Fk(\003)26 b Fu(Num)n(b)r(er)h(of)g(unsuccessful)k(retriev)-5 b(als)30 b Fk(\003)p Fc(=)722 3143 y Fk(g)43 b(\003)p Ft(hsh)p 972 3143 V 36 w(Stats)7 b Fl(;)1808 3326 y Fu(Figure)28 b(2:)35 b Ft(hsh)p 2294 3326 26 4 v 32 w(Stats)515 3724 y Fv(1.9.9)95 b Fm(hsh)p 952 3724 30 4 v 34 w(print)p 1194 3724 V 34 w(stats)722 3878 y Fv(v)m(oid)42 b Ft(hsh)p 1064 3878 V 36 w(print)p 1278 3878 V 33 w(stats)7 b Fl(\()44 b Ft(hsh)p 1678 3878 V 35 w(HashT)-6 b(able)50 b(table)p Fl(,)42 b Ft(FILE)54 b Fk(\003)p Ft(str)l(e)l(am)48 b Fl(\))515 4049 y Ft(hsh)p 638 4049 26 4 v 31 w(print)p 847 4049 V 30 w(stats)38 b Fu(prin)n(ts)32 b(the)g(statistics)i(for)c Ft(table)38 b Fu(on)31 b(the)i(sp)r(eci\014ed)h Ft(str)l(e)l(am)p Fu(.)46 b(If)31 b Ft(str)l(e)l(am)37 b Fu(is)31 b Fv(NULL)p Fu(,)515 4148 y(then)e Fv(stdout)23 b Fu(will)i(b)r(e)k(used.)515 4364 y Fv(1.9.10)95 b Fm(hsh)p 1000 4364 30 4 v 34 w(init)p 1180 4364 V 34 w(p)-5 b(osition)722 4517 y Ft(hsh)p 845 4517 V 36 w(Position)50 b(hsh)p 1349 4517 V 36 w(init)p 1511 4517 V 34 w(p)l(osition)6 b Fl(\()44 b Ft(hsh)p 2027 4517 V 36 w(HashT)-6 b(able)49 b(table)h Fl(\))515 4689 y Ft(hsh)p 638 4689 26 4 v 31 w(init)p 795 4689 V 30 w(p)l(osition)29 b Fu(returns)c(a)d(p)r(osition)f(mark)n(er)f(for) i(some)e(arbitary)i(\014rst)i(elemen)n(t)d(in)h(the)h(table.)34 b(This)515 4788 y(mark)n(er)26 b(can)i(b)r(e)h(used)g(with)e Ft(hsh)p 1563 4788 V 32 w(next)p 1745 4788 V 31 w(p)l(osition)35 b Fu(and)27 b Ft(hsh)p 2372 4788 V 31 w(get)p 2507 4788 V 31 w(p)l(osition)p Fu(.)2115 5255 y(15)p eop %%Page: 16 16 16 15 bop 515 523 a Fv(1.9.11)95 b Fm(hsh)p 1000 523 30 4 v 34 w(next)p 1210 523 V 36 w(p)-5 b(osition)722 676 y Ft(hsh)p 845 676 V 36 w(Position)50 b(hsh)p 1349 676 V 36 w(next)p 1535 676 V 36 w(p)l(osition)6 b Fl(\()44 b Ft(hsh)p 2053 676 V 36 w(HashT)-6 b(able)49 b(table)p Fl(,)42 b Ft(hsh)p 2864 676 V 36 w(Position)50 b(p)l(osition)g Fl(\))515 847 y Ft(hsh)p 638 847 26 4 v 31 w(next)p 819 847 V 32 w(p)l(osition)31 b Fu(returns)e(a)c(p)r(osition)e(mark)n(er)h (for)g(the)j(next)f(elemen)n(t)f(in)f(the)i(table.)35 b(Elemen)n(ts)25 b(are)515 947 y(in)i(arbitrary)g(order)i(based)g(on)f (their)g(p)r(ositions)f(in)g(the)i(hash)f(table.)515 1163 y Fv(1.9.12)95 b Fm(hsh)p 1000 1163 30 4 v 34 w(get)p 1154 1163 V 36 w(p)-5 b(osition)722 1316 y Fv(v)m(oid)42 b Fk(\003)p Ft(hsh)p 1106 1316 V 35 w(get)p 1245 1316 V 35 w(p)l(osition)6 b Fl(\()44 b Ft(hsh)p 1762 1316 V 36 w(Position)50 b(p)l(osition)p Fl(,)43 b Fv(v)m(oid)f Fk(\003\003)p Ft(key)50 b Fl(\))515 1487 y Ft(hsh)p 638 1487 26 4 v 31 w(get)p 773 1487 V 31 w(p)l(osition)33 b Fu(returns)d(the)e(datum)c(asso)r(ciated)29 b(with)d(the)i Ft(p)l(osition)33 b Fu(mark)n(er,)24 b(or)j Fv(NULL)f Fu(if)f(there)515 1587 y(is)31 b(no)f(suc)n(h)j(datum.)43 b Ft(key)c Fu(is)31 b(set)i(to)e(the)h(k)n(ey)f(asso)r(ciated)i(with)d (this)h(datum,)e(or)i Fv(NULL)f Fu(is)g(there)k(is)515 1686 y(no)27 b(suc)n(h)i(datum.)515 1902 y Fv(1.9.13)95 b Fm(hsh)p 1000 1902 30 4 v 34 w(r)-5 b(e)g(adonly)722 2055 y Fv(in)m(t)41 b Ft(hsh)p 1003 2055 V 36 w(r)l(e)l(adonly)7 b Fl(\()44 b Ft(hsh)p 1540 2055 V 36 w(HashT)-6 b(able)49 b(table)p Fl(,)42 b Fv(in)m(t)f Ft(\015ag)52 b Fl(\))515 2227 y Ft(hsh)p 638 2227 26 4 v 31 w(r)l(e)l(adonly)34 b Fu(sets)29 b(the)e Ft(r)l(e)l(adonly)34 b Fu(\015ag)25 b(for)h(the)h Ft(table)32 b Fu(to)26 b Ft(\015ag)p Fu(.)37 b Ft(\015ag)e Fu(should)26 b(b)r(e)h(0)f(or)g(1.)35 b(The)27 b(v)-5 b(alue)26 b(of)515 2326 y(the)33 b(previous)f(\015ag)e(is)i (returned.)51 b(When)32 b(a)f(hash)h(table)f(is)g(mark)n(ed)f(as)h (readonly)-7 b(,)32 b(self-organization)515 2426 y(of)g(the)j(buc)n(k)n (et-o)n(v)n(er\015o)n(w)f(lists)f(will)e(not)i(tak)n(e)h(place,)h(and)e (an)n(y)f(attempt)h(to)g(mo)r(dify)c(the)34 b(list)f(\(e.g.,)515 2525 y(insertion)28 b(or)f(deletion\))h(will)d(result)k(in)e(an)h (error.)515 2758 y Fn(1.10)111 b(List)36 b(Routines)515 2911 y Fu(The)42 b(list)f(routines)h(pro)n(vide)g(supp)r(ort)h(for)e(a) g(general)g(link)n(ed)g(list)f(con)n(tain)n(ting)g(ob)5 b(jects)42 b(that)g(are)515 3011 y(p)r(oin)n(ters)32 b(to)f Fv(v)m(oid)p Fu(.)45 b(The)32 b(list)e(can)i(b)r(e)h(view)n(ed)e (as)h(a)f(stac)n(k)h(or)f(queue)i({)e(data)f(can)i(b)r(e)h(added)f(to)f (the)515 3110 y(head)d(or)h(the)g(tail,)c(but)k(can)f(only)f(b)r(e)i (remo)n(v)n(ed)d(from)f(the)k(head)g(\(this)g(data)e(structure)33 b(is)27 b(sometimes)515 3210 y(called)g(a)g(\\qstac)n(k"\).)36 b(\(If)28 b(only)e(a)h(stac)n(k)i(is)e(needed,)j(the)f(stac)n(k)f (routines)h(are)g(more)d(e\016cien)n(t.\))515 3426 y Fv(1.10.1)95 b Fm(lst)p 956 3426 30 4 v 37 w(cr)-5 b(e)g(ate)722 3579 y Ft(lst)p 811 3579 V 34 w(List)50 b(lst)p 1119 3579 V 34 w(cr)l(e)l(ate)6 b Fl(\()43 b Fv(v)m(oid)f Fl(\))515 3750 y Ft(lst)p 604 3750 26 4 v 29 w(cr)l(e)l(ate)33 b Fu(initializes)25 b(a)j(list)f(ob)5 b(ject.)515 3966 y Fv(1.10.2)95 b Fm(lst)p 956 3966 30 4 v 37 w(destr)-5 b(oy)722 4119 y Fv(v)m(oid)42 b Ft(lst)p 1030 4119 V 33 w(destr)l(oy)7 b Fl(\()44 b Ft(lst)p 1486 4119 V 34 w(List)50 b(list)g Fl(\))515 4290 y Ft(lst)p 604 4290 26 4 v 29 w(destr)l(oy)37 b Fu(destro)n(ys)c(all)27 b(memory)f(asso)r (ciated)31 b(with)f(the)h Ft(list)p Fu(.)42 b(The)31 b(memory)25 b(used)32 b(b)n(y)e(data)f(is)h Ft(not)515 4390 y Fu(freed|this)e(memory)23 b(is)28 b(the)h(resp)r(onsibilit)n(y)e (of)f(the)j(user.)515 4606 y Fv(1.10.3)95 b Fm(lst)p 956 4606 30 4 v 37 w(app)-5 b(end)722 4759 y Fv(v)m(oid)42 b Ft(lst)p 1030 4759 V 33 w(app)l(end)9 b Fl(\()46 b Ft(lst)p 1482 4759 V 34 w(List)k(list)p Fl(,)41 b Fv(const)h(v)m(oid)f Fk(\003)p Ft(datum)51 b Fl(\))515 4930 y Ft(lst)p 604 4930 26 4 v 29 w(app)l(end)39 b Fu(app)r(ends)29 b Ft(datum)35 b Fu(on)28 b(the)h Ft(list)p Fu(.)2115 5255 y(16)p eop %%Page: 17 17 17 16 bop 515 523 a Fv(1.10.4)95 b Fm(lst)p 956 523 30 4 v 37 w(push)722 676 y Fv(v)m(oid)42 b Ft(lst)p 1030 676 V 33 w(push)6 b Fl(\()46 b Ft(lst)p 1393 676 V 34 w(List)k(list)p Fl(,)41 b Fv(const)h(v)m(oid)f Fk(\003)p Ft(datum)51 b Fl(\))515 847 y Ft(lst)p 604 847 26 4 v 29 w(push)35 b Fu(prep)r(ends)d Ft(datum)j Fu(on)27 b(the)i Ft(list)p Fu(.)515 1063 y Fv(1.10.5)95 b Fm(lst)p 956 1063 30 4 v 37 w(p)-5 b(op)722 1216 y Fv(v)m(oid)42 b Fk(\003)p Ft(lst)p 1072 1216 V 33 w(p)l(op)5 b Fl(\()45 b Ft(lst)p 1393 1216 V 34 w(List)50 b(list)g Fl(\))515 1388 y Ft(lst)p 604 1388 26 4 v 29 w(p)l(op)40 b Fu(remo)n(v)n(es)33 b(the)j(\014rst)f(datum)d(on)h(the)i Ft(list)41 b Fu(and)33 b(returns)38 b(the)d(p)r(oin)n(ter.)55 b(If)34 b(the)h Ft(list)40 b Fu(is)34 b(empt)n(y)-7 b(,)515 1487 y Ft(lst)p 604 1487 V 29 w(p)l(op)34 b Fu(returns)d Fv(NULL)p Fu(.)515 1703 y Fv(1.10.6)95 b Fm(lst)p 956 1703 30 4 v 37 w(top)722 1856 y Fv(v)m(oid)42 b Fk(\003)p Ft(lst)p 1072 1856 V 33 w(top)5 b Fl(\()45 b Ft(lst)p 1383 1856 V 33 w(List)51 b(list)e Fl(\))515 2027 y Ft(lst)p 604 2027 26 4 v 29 w(top)41 b Fu(returns)e(a)d(p)r(oin)n(ter)g(to)f(the)i(datum)c(that)j (is)g(the)h(\014rst)g(elemen)n(t)e(of)g(the)i Ft(list)p Fu(,)e(but)h(do)r(es)h Ft(not)515 2127 y Fu(remo)n(v)n(e)26 b(this)i(datum)c(from)h(the)k Ft(list)p Fu(.)34 b(If)27 b(the)i Ft(list)34 b Fu(is)27 b(empt)n(y)-7 b(,)25 b Ft(lst)p 2543 2127 V 29 w(top)34 b Fu(returns)c Fv(NULL)p Fu(.)515 2343 y Fv(1.10.7)95 b Fm(lst)p 956 2343 30 4 v 37 w(nth)p 1129 2343 V 34 w(get)722 2496 y Fv(v)m(oid)42 b Fk(\003)p Ft(lst)p 1072 2496 V 33 w(nth)p 1221 2496 V 35 w(get)8 b Fl(\()44 b Ft(lst)p 1528 2496 V 34 w(List)50 b(list)p Fl(,)41 b Fv(unsigned)d(in)m(t)i Ft(n)51 b Fl(\))515 2667 y Ft(lst)p 604 2667 26 4 v 29 w(nth)p 749 2667 V 31 w(get)42 b Fu(returns)c(a)33 b(p)r(oin)n(ter)i(to)f(the)i Fc(n)p Fu(-th)e(datum)d(in)i(the)j Ft(list)p Fu(,)d(or)h Fv(NULL)f Fu(if)g(the)j Fc(n)p Fu(th)e(elemen)n(t)515 2767 y(do)r(es)29 b(not)f(exist.)515 2983 y Fv(1.10.8)95 b Fm(lst)p 956 2983 30 4 v 37 w(nth)p 1129 2983 V 34 w(set)722 3136 y Fv(v)m(oid)42 b Ft(lst)p 1030 3136 V 33 w(nth)p 1179 3136 V 36 w(set)8 b Fl(\()43 b Ft(lst)p 1482 3136 V 34 w(List)50 b(list)p Fl(,)41 b Fv(unsigned)d(in)m(t)i Ft(n)p Fl(,)k Fv(const)d(v)m(oid)h Fk(\003)p Ft(datum)50 b Fl(\))515 3307 y Ft(lst)p 604 3307 26 4 v 29 w(nth)p 749 3307 V 31 w(set)38 b Fu(lo)r(cates)32 b(the)g Fc(n)p Fu(-th)f(datum)d(in)h(the)j Ft(list)37 b Fu(and)30 b(replaces)j(that)e (datum)d(with)i Ft(datum)p Fu(.)46 b(If)30 b(the)515 3407 y Fc(n)p Fu(th)22 b(elemen)n(t)g(do)r(es)h(not)g(exist,)g(the)g (program)c(will)h(halt)h(with)h(an)g(error.)36 b(\(I.e.,)21 b(it)h(is)g(the)i(programmer's)515 3506 y(resp)r(onsibilit)n(y)j(to)g (c)n(hec)n(k)j Ft(lst)p 1440 3506 V 29 w(length)k Fu(and)28 b(only)e(pass)j(v)-5 b(alid)25 b(v)-5 b(alues)29 b(of)d Ft(n)p Fu(.\))515 3722 y Fv(1.10.9)95 b Fm(lst)p 956 3722 30 4 v 37 w(memb)-5 b(er)722 3875 y Fv(in)m(t)41 b Ft(lst)p 969 3875 V 33 w(memb)l(er)9 b Fl(\()43 b Ft(lst)p 1452 3875 V 34 w(List)50 b(list)p Fl(,)41 b Fv(const)h(v)m(oid)g Fk(\003)p Ft(datum)50 b Fl(\))515 4046 y Ft(lst)p 604 4046 26 4 v 29 w(memb)l(er)38 b Fu(returns)32 b(non-zero)f(if)d(the)j (p)r(oin)n(ter)f(to)f Ft(datum)37 b Fu(is)29 b(also)f(a)h(p)r(oin)n (ter)h(on)f(the)i(list,)d(and)h(zero)515 4146 y(otherwise.)37 b(Note)27 b(that)f(only)e(p)r(oin)n(ters)j(are)g(compared,)d(so)i(iden) n(tical)f(copies)i(of)e(data)g(structures)31 b(will)515 4246 y(b)r(e)e(view)n(ed)f(as)g(non-equal.)515 4461 y Fv(1.10.10)95 b Fm(lst)p 1004 4461 30 4 v 36 w(length)722 4615 y Fv(unsigned)38 b(in)m(t)i Ft(lst)p 1380 4615 V 34 w(length)6 b Fl(\()44 b Ft(lst)p 1794 4615 V 34 w(List)50 b(list)g Fl(\))515 4786 y Ft(lst)p 604 4786 26 4 v 29 w(length)34 b Fu(returns)d(the)e(n)n(um)n(b)r(er)e(of)f(elemen)n(ts)i (in)e(the)j(list.)2115 5255 y(17)p eop %%Page: 18 18 18 17 bop 515 523 a Fv(1.10.11)95 b Fm(lst)p 1004 523 30 4 v 36 w(trunc)-5 b(ate)722 676 y Fv(v)m(oid)42 b Ft(lst)p 1030 676 V 33 w(trunc)l(ate)6 b Fl(\()45 b Ft(lst)p 1526 676 V 33 w(List)51 b(list)p Fl(,)40 b Fv(unsigned)e(in)m(t)j Ft(length)50 b Fl(\))515 847 y Ft(lst)p 604 847 26 4 v 29 w(trunc)l(ate)31 b Fu(truncates)e(a)c(list)f(to)h Ft(length)32 b Fu(elemen)n(ts.)j(If)25 b(the)h(list)f(is)g(not)g (longer)g(than)g Ft(length)p Fu(,)g(nothing)515 947 y(it)i(done.)515 1163 y Fv(1.10.12)95 b Fm(lst)p 1004 1163 30 4 v 36 w(trunc)-5 b(ate)p 1385 1163 V 34 w(p)g(osition)722 1316 y Fv(v)m(oid)42 b Ft(lst)p 1030 1316 V 33 w(trunc)l(ate)p 1359 1316 V 35 w(p)l(osition)6 b Fl(\()45 b Ft(lst)p 1843 1316 V 33 w(List)51 b(list)p Fl(,)41 b Ft(lst)p 2326 1316 V 33 w(Position)50 b(p)l(osition)h Fl(\))515 1487 y Ft(lst)p 604 1487 26 4 v 29 w(trunc)l(ate)p 929 1487 V 31 w(p)l(osition)45 b Fu(truncates)d(a)d(list)f(b)r(ey)n(ond)i Ft(p)l(osition)45 b Fu(\(i.e.,)40 b Ft(p)l(osition)45 b Fu(is)39 b(alw)n(a)n(ys)e(left)i (in)f(the)515 1587 y(list.)43 b(If)30 b Ft(p)l(ostition)36 b Fu(is)30 b Fv(NULL)p Fu(,)f(then)j(the)f(list)f(is)g(emptied.)43 b(This)30 b(con)n(v)n(en)n(tion)g(is)g(useful)h(when)g(using)515 1686 y Ft(lst)p 604 1686 V 29 w(last)p 759 1686 V 30 w(p)l(ostition)j Fu(to)27 b(get)h(a)g(mark)n(er)d(allo)n(wing)f(an)j (older)h(state)h(of)e(a)g(list)g(to)g(b)r(e)i(restored.)515 1902 y Fv(1.10.13)95 b Fm(lst)p 1004 1902 30 4 v 36 w(iter)-5 b(ate)722 2055 y Fv(in)m(t)41 b Ft(lst)p 969 2055 V 33 w(iter)l(ate)6 b Fl(\()43 b Ft(lst)p 1399 2055 V 33 w(List)51 b(list)p Fl(,)41 b Fv(in)m(t)f Fl(\()p Fk(\003)p Ft(iter)l(ator)9 b Fl(\)\()42 b Fv(const)f(v)m(oid)h Fk(\003)p Ft(datum)50 b Fl(\))44 b(\))515 2227 y Ft(lst)p 604 2227 26 4 v 29 w(iter)l(ate)29 b Fu(is)24 b(used)i(to)e(iterate)i(a)d(function)h(o)n (v)n(er)h(ev)n(ery)g(elemen)n(t)f(in)f(the)j Ft(list)p Fu(.)33 b(The)25 b(function,)e Ft(iter)l(ator)p Fu(,)515 2326 y(is)g(passed)j(a)e(p)r(oin)n(ter)g(to)g(eac)n(h)h(elemen)n(t.)34 b(If)23 b Ft(iter)l(ator)30 b Fu(returns)d(a)d(non-zero)h(v)-5 b(alue,)23 b(the)i(iterations)f(stop,)515 2426 y(and)j Ft(lst)p 765 2426 V 29 w(iter)l(ate)33 b Fu(returns.)515 2642 y Fv(1.10.14)95 b Fm(lst)p 1004 2642 30 4 v 36 w(iter)-5 b(ate)p 1309 2642 V 34 w(ar)g(g)722 2795 y Fv(in)m(t)41 b Ft(lst)p 969 2795 V 33 w(iter)l(ate)p 1234 2795 V 33 w(ar)l(g)7 b Fl(\()44 b Ft(lst)p 1546 2795 V 34 w(List)50 b(list)p Fl(,)1638 2895 y Fv(in)m(t)40 b Fl(\()p Fk(\003)p Ft(iter)l(ator)9 b Fl(\)\()42 b Fv(const)f(v)m(oid)h Fk(\003)p Ft(datum)p Fl(,)h Fv(v)m(oid)e Fk(\003)p Ft(ar)l(g)50 b Fl(\),)1638 2994 y Fv(v)m(oid)41 b Fk(\003)p Ft(ar)l(g)50 b Fl(\))515 3165 y Ft(lst)p 604 3165 26 4 v 29 w(iter)l(ate)p 865 3165 V 29 w(ar)l(g)42 b Fu(is)36 b(used)h(to)f(iterate)h(a)e (function)h(o)n(v)n(er)f(ev)n(ery)j(elemen)n(t)c(in)h(the)i Ft(list)p Fu(.)59 b(The)36 b(function,)515 3265 y Ft(iter)l(ator)p Fu(,)j(is)h(passed)h(a)f(p)r(oin)n(ter)g(to)g(eac)n(h)g(elemen)n(t.)72 b(If)39 b Ft(iter)l(ator)46 b Fu(returns)d(a)c(non-zero)i(v)-5 b(alue,)42 b(the)515 3365 y(iterations)27 b(stop,)h(and)f Ft(lst)p 1338 3365 V 30 w(iter)l(ate)32 b Fu(returns.)515 3580 y Fv(1.10.15)95 b Fm(lst)p 1004 3580 30 4 v 36 w(init)p 1186 3580 V 35 w(p)-5 b(osition)722 3734 y Ft(lst)p 811 3734 V 34 w(Position)50 b(lst)p 1279 3734 V 34 w(init)p 1439 3734 V 34 w(p)l(osition)6 b Fl(\()44 b Ft(lst)p 1921 3734 V 34 w(List)50 b(list)g Fl(\))515 3905 y Ft(lst)p 604 3905 26 4 v 29 w(init)p 759 3905 V 30 w(p)l(osition)32 b Fu(returns)d(a)c(p)r(osition)f(mark)n(er)g(for)g(the)j(head)f(of)f (the)i(list.)34 b(This)26 b(mark)n(er)d(can)j(b)r(e)h(used)515 4004 y(with)g Ft(lst)p 793 4004 V 29 w(next)p 972 4004 V 32 w(p)l(osition)34 b Fu(and)27 b Ft(lst)p 1565 4004 V 30 w(get)p 1699 4004 V 30 w(p)l(osition)p Fu(.)515 4220 y Fv(1.10.16)95 b Fm(lst)p 1004 4220 30 4 v 36 w(last)p 1186 4220 V 36 w(p)-5 b(osition)722 4373 y Ft(lst)p 811 4373 V 34 w(Position)50 b(lst)p 1279 4373 V 34 w(last)p 1439 4373 V 34 w(p)l(osition)6 b Fl(\()44 b Ft(lst)p 1921 4373 V 34 w(List)50 b(list)g Fl(\))515 4544 y Ft(lst)p 604 4544 26 4 v 29 w(last)p 759 4544 V 30 w(p)l(osition)35 b Fu(returns)d(a)d(p)r(osition)e(mark)n(er)g(for)h(the)j(tail)26 b(of)i(the)i(list.)39 b(This)29 b(mark)n(er)e(can)i(b)r(e)h(used)515 4644 y(with)d Ft(lst)p 793 4644 V 29 w(trunc)l(ate)p 1118 4644 V 31 w(p)l(osition)34 b Fu(to)27 b(restore)k(a)d(previous)g (state)h(of)e(the)i(list.)2115 5255 y(18)p eop %%Page: 19 19 19 18 bop 515 523 a Fv(1.10.17)95 b Fm(lst)p 1004 523 30 4 v 36 w(next)p 1216 523 V 36 w(p)-5 b(osition)722 676 y Ft(lst)p 811 676 V 34 w(Position)50 b(lst)p 1279 676 V 34 w(next)p 1463 676 V 35 w(p)l(osition)6 b Fl(\()45 b Ft(lst)p 1947 676 V 33 w(Position)51 b(p)l(osition)f Fl(\))515 847 y Ft(lst)p 604 847 26 4 v 29 w(next)p 783 847 V 32 w(p)l(osition)43 b Fu(returns)e(a)36 b(p)r(osition)g(mark)n (er)f(for)i(the)h(elemen)n(t)e(after)i(the)g(elemen)n(t)f(mark)n(ed)d (b)n(y)515 947 y Ft(p)l(osition)p Fu(,)27 b(or)g Fv(NULL)g Fu(if)f Ft(p)l(osition)34 b Fu(is)28 b(the)h(last)e(elemen)n(t)g(in)g (the)i(list.)515 1163 y Fv(1.10.18)95 b Fm(lst)p 1004 1163 30 4 v 36 w(nth)p 1176 1163 V 35 w(p)-5 b(osition)722 1316 y Ft(lst)p 811 1316 V 34 w(Position)50 b(lst)p 1279 1316 V 34 w(nth)p 1429 1316 V 35 w(p)l(osition)6 b Fl(\()45 b Ft(lst)p 1913 1316 V 33 w(List)51 b(list)p Fl(,)40 b Fv(unsigned)e(in)m(t)j Ft(n)50 b Fl(\))515 1487 y Ft(lst)p 604 1487 26 4 v 29 w(nth)p 749 1487 V 31 w(p)l(osition)37 b Fu(returns)c(a)c(p)r(osition)g(mark)n(er)f(for)i(the)h Fc(n)p Fu(th)f(elemen)n(t)f(in)g(the)j(list,)c(or)i Fv(NULL)f Fu(if)g(the)515 1587 y Fc(n)p Fu(th)f(elemen)n(t)e(do)r(es)k(not)d (exist.)515 1803 y Fv(1.10.19)95 b Fm(lst)p 1004 1803 30 4 v 36 w(get)p 1160 1803 V 36 w(p)-5 b(osition)722 1956 y Fv(v)m(oid)42 b Fk(\003)p Ft(lst)p 1072 1956 V 33 w(get)p 1209 1956 V 35 w(p)l(osition)6 b Fl(\()44 b Ft(lst)p 1692 1956 V 34 w(Position)50 b(p)l(osition)g Fl(\))515 2127 y Ft(lst)p 604 2127 26 4 v 29 w(get)p 737 2127 V 31 w(p)l(osition)36 b Fu(returns)d(the)e(datum)c(asso)r (ciated)k(with)f(the)h Ft(p)l(osition)36 b Fu(mark)n(er,)27 b(or)j Fv(NULL)f Fu(if)f(there)515 2227 y(is)f(no)h(suc)n(h)h(elemen)n (t.)515 2442 y Fv(1.10.20)95 b Fm(lst)p 1004 2442 30 4 v 36 w(set)p 1156 2442 V 36 w(p)-5 b(osition)722 2596 y Fv(v)m(oid)42 b Ft(lst)p 1030 2596 V 33 w(set)p 1163 2596 V 35 w(p)l(osition)6 b Fl(\()44 b Ft(lst)p 1646 2596 V 34 w(Position)50 b(p)l(osition)p Fl(,)43 b Fv(const)f(v)m(oid)f Fk(\003)p Ft(datum)51 b Fl(\))515 2767 y Ft(lst)p 604 2767 26 4 v 29 w(set)p 733 2767 V 30 w(p)l(osition)35 b Fu(sets)30 b(the)f Ft(datum)35 b Fu(asso)r(ciated)29 b(with)e(the)i Ft(p)l(osition)34 b Fu(mark)n(er.)515 2983 y Fv(1.10.21)p 908 2983 30 4 v 130 w Fm(lst)p 1039 2983 V 37 w(dump)p 1306 2983 V 33 w(no)-5 b(de)722 3136 y Fv(static)41 b(in)m(t)p 1156 3136 V 76 w Ft(lst)p 1275 3136 V 33 w(dump)p 1504 3136 V 36 w(no)l(de)6 b Fl(\()46 b Fv(const)41 b(v)m(oid)h Fk(\003)p Ft(datum)50 b Fl(\))515 3307 y Ft(lst)p 604 3307 26 4 v 29 w(dump)34 b Fu(prin)n(ts)28 b(eac)n(h)h Ft(datum)35 b Fu(on)28 b(the)h(list)d(in)h(hex)515 3539 y Fn(1.11)111 b(Memory)33 b(Managemen)m(t)i(Routines)515 3693 y Fu(The)26 b(memory)21 b(managemen)n(t)g(routines)27 b(pro)n(vide)e(simple)e(supp)r(ort)28 b(for)d(string)h(ob)5 b(ject)26 b(storage.)36 b(These)515 3792 y(routines)28 b(are)f(generally)f(used)j(as)e(building)d(blo)r(c)n(ks)j(b)n(y)f (other)i(parts)g(of)d(the)j Fj(Khepera)i Fu(library)25 b(\(e.g.,)515 3892 y(string)j(p)r(o)r(ols)f(and)g(abstract)j(syn)n(tax) e(trees\).)515 4108 y Fv(1.11.1)95 b Fm(mem)p 1060 4108 30 4 v 37 w(cr)-5 b(e)g(ate)p 1343 4108 V 34 w(strings)722 4261 y Ft(mem)p 901 4261 V 35 w(String)51 b(mem)p 1381 4261 V 34 w(cr)l(e)l(ate)p 1627 4261 V 34 w(strings)7 b Fl(\()43 b Fv(v)m(oid)e Fl(\))515 4432 y Ft(mem)p 694 4432 26 4 v 30 w(cr)l(e)l(ate)p 936 4432 V 30 w(strings)33 b Fu(creates)f(a)27 b(memory)c(ob)5 b(ject)28 b(for)f(storing)g (strings.)2115 5255 y(19)p eop %%Page: 20 20 20 19 bop 515 523 a Fv(1.11.2)95 b Fm(mem)p 1060 523 30 4 v 37 w(destr)-5 b(oy)p 1396 523 V 34 w(strings)722 676 y Fv(v)m(oid)42 b Ft(mem)p 1120 676 V 35 w(destr)l(oy)p 1411 676 V 34 w(strings)7 b Fl(\()43 b Ft(mem)p 1943 676 V 34 w(String)51 b(info)e Fl(\))515 847 y Ft(mem)p 694 847 26 4 v 30 w(destr)l(oy)p 980 847 V 30 w(strings)43 b Fu(destro)n(ys)c(the)f(memory)32 b(ob)5 b(ject)37 b(returned)j(from) 34 b Ft(mem)p 3096 847 V 30 w(cr)l(e)l(ate)p 3338 847 V 30 w(strings)p Fu(.)62 b(All)515 947 y(memory)25 b(if)k(freed,)j (including)c(that)j(used)h(for)e(the)h(strings.)45 b(Therefore,)33 b(an)n(y)d(p)r(oin)n(ters)h(to)f(strings)i(in)515 1047 y(the)d(table)e(will)e(b)r(e)k(left)e(dangling.)515 1262 y Fv(1.11.3)95 b Fm(mem)p 1060 1262 30 4 v 37 w(str)-5 b(cpy)722 1416 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(mem)p 1427 1416 V 34 w(str)l(cpy)7 b Fl(\()44 b Ft(mem)p 1932 1416 V 35 w(String)50 b(info)p Fl(,)43 b Fv(const)e(c)m(har)i Fk(\003)p Ft(string)50 b Fl(\))515 1587 y Ft(mem)p 694 1587 26 4 v 30 w(str)l(cpy)35 b Fu(copies)28 b(a)g Ft(string)33 b Fu(in)n(to)27 b(the)i(memory)23 b(ob)5 b(ject)28 b(p)r(oin)n(ted)g (to)f(b)n(y)h Ft(info)p Fu(.)515 1803 y Fv(1.11.4)95 b Fm(mem)p 1060 1803 30 4 v 37 w(strncpy)722 1956 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(mem)p 1427 1956 V 34 w(strncpy)7 b Fl(\()45 b Ft(mem)p 1983 1956 V 34 w(String)51 b(info)p Fl(,)1812 2055 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(string)p Fl(,)e Fv(in)m(t)f Ft(len)50 b Fl(\))515 2227 y Ft(mem)p 694 2227 26 4 v 30 w(strncpy)36 b Fu(copies)30 b Ft(len)35 b Fu(b)n(ytes)30 b(of)e Ft(string)35 b Fu(in)n(to)27 b(the)j(memory)24 b(ob)5 b(ject)29 b(p)r(oin)n(ted)g(to)f(b)n(y)g Ft(info)p Fu(.)39 b(A)29 b(n)n(ull)515 2326 y(is)e(added)i(to)e(the)i (end)g(of)e(the)h(copied)h(sequence.)515 2542 y Fv(1.11.5)95 b Fm(mem)p 1060 2542 30 4 v 37 w(gr)-5 b(ow)722 2695 y Fv(v)m(oid)42 b Ft(mem)p 1120 2695 V 35 w(gr)l(ow)9 b Fl(\()42 b Ft(mem)p 1580 2695 V 35 w(String)50 b(info)p Fl(,)43 b Fv(const)f(c)m(har)h Fk(\003)p Ft(string)p Fl(,)e Fv(in)m(t)f Ft(len)50 b Fl(\))515 2866 y Ft(mem)p 694 2866 26 4 v 30 w(gr)l(ow)28 b Fu(copies)22 b Ft(len)28 b Fu(of)19 b Ft(string)27 b Fu(on)n(to)20 b(the)i(top)e(of)g(the)i (memory)16 b(ob)5 b(ject)21 b(p)r(oin)n(ted)g(to)f(b)n(y)h Ft(info)p Fu(.)33 b(Sev)n(eral)515 2966 y(calls)21 b(to)h Ft(mem)p 969 2966 V 30 w(gr)l(ow)30 b Fu(should)22 b(b)r(e)h(follo)n(w) n(ed)c(b)n(y)i(a)h(single)f(call)g(to)h Ft(mem)p 2692 2966 V 30 w(\014nish)30 b Fu(without)21 b(an)n(y)g(in)n(terv)n(ening) 515 3066 y(calls)27 b(to)g(other)i(functions)f(whic)n(h)g(mo)r(dify)23 b Ft(info)p Fu(.)515 3281 y Fv(1.11.6)95 b Fm(mem)p 1060 3281 30 4 v 37 w(\014nish)722 3435 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(mem)p 1427 3435 V 34 w(\014nish)6 b Fl(\()46 b Ft(mem)p 1913 3435 V 35 w(String)k(info)f Fl(\))515 3606 y Ft(mem)p 694 3606 26 4 v 30 w(\014nish)36 b Fu(\014nishes)29 b(the)g(gro)n(wth)e(of)g(the)i(ob)5 b(ject)28 b(p)r(erformed)f(b)n(y)h Ft(mem)p 2843 3606 V 30 w(gr)l(ow)p Fu(.)515 3822 y Fv(1.11.7)95 b Fm(mem)p 1060 3822 30 4 v 37 w(get)p 1217 3822 V 35 w(string)p 1494 3822 V 35 w(stats)722 3975 y Ft(mem)p 901 3975 V 35 w(StringStats)50 b(mem)p 1558 3975 V 35 w(get)p 1697 3975 V 35 w(string)p 1940 3975 V 33 w(stats)7 b Fl(\()44 b Ft(mem)p 2396 3975 V 34 w(String)51 b(info)e Fl(\))515 4146 y Ft(mem)p 694 4146 26 4 v 30 w(get)p 828 4146 V 31 w(string)p 1067 4146 V 29 w(stats)39 b Fu(returns)d(statistics)e(ab)r(out)e(the)h(memory)28 b(ob)5 b(ject)33 b(p)r(oin)n(ted)g(to)f(b)n(y)g Ft(info)p Fu(.)50 b(The)515 4246 y Ft(mem)p 694 4246 V 30 w(StringStats)35 b Fu(structure)d(is)27 b(sho)n(wn)h(in)f(Figure)h(3.)515 4461 y Fv(1.11.8)95 b Fm(mem)p 1060 4461 30 4 v 37 w(print)p 1305 4461 V 33 w(string)p 1580 4461 V 35 w(stats)722 4615 y Fv(v)m(oid)42 b Ft(mem)p 1120 4615 V 35 w(print)p 1333 4615 V 34 w(string)p 1575 4615 V 33 w(stats)7 b Fl(\()43 b Ft(mem)p 2030 4615 V 35 w(String)51 b(info)p Fl(,)42 b Ft(FILE)55 b Fk(\003)p Ft(str)l(e)l(am)48 b Fl(\))515 4786 y Ft(mem)p 694 4786 26 4 v 30 w(print)p 902 4786 V 30 w(string)p 1140 4786 V 29 w(stats)30 b Fu(prin)n(ts)24 b(the)h(statistics)g(for)d(the)j(memory)18 b(ob)5 b(ject)24 b(p)r(oin)n(ted)g(to)f(b)n(y)g Ft(info)29 b Fu(on)23 b(the)515 4885 y(sp)r(eci\014ed)31 b Ft(str)l(e)l(am)p Fu(.)j(If)27 b Ft(str)l(e)l(am)33 b Fu(is)27 b Fv(NULL)p Fu(,)f(then)j Fv(stdout)24 b Fu(will)g(b)r(e)29 b(used.)2115 5255 y(20)p eop %%Page: 21 21 21 20 bop 722 540 a Fv(t)m(yp)s(edef)49 b(struct)41 b Ft(mem)p 1555 540 30 4 v 34 w(StringStats)51 b Fk(f)853 639 y Fv(in)m(t)41 b Ft(c)l(ount)8 b Fl(;)880 b Fc(=)p Fk(\003)27 b Fu(Num)n(b)r(er)g(of)f(strings)j(or)e(ob)5 b(jects)30 b Fk(\003)p Fc(=)853 739 y Fv(in)m(t)41 b Ft(bytes)7 b Fl(;)897 b Fc(=)p Fk(\003)27 b Fu(Num)n(b)r(er)g(of)f(b)n (ytes)j(allo)r(cated)e Fk(\003)p Fc(=)722 839 y Fk(g)43 b(\003)p Ft(mem)p 1028 839 V 35 w(StringStats)7 b Fl(;)1671 1021 y Fu(Figure)28 b(3:)35 b Ft(mem)p 2213 1021 26 4 v 31 w(StringStats)515 1369 y Fv(1.11.9)95 b Fm(mem)p 1060 1369 30 4 v 37 w(cr)-5 b(e)g(ate)p 1343 1369 V 34 w(obje)g(cts)722 1523 y Ft(mem)p 901 1523 V 35 w(Obje)l(ct)51 b(mem)p 1389 1523 V 34 w(cr)l(e)l(ate)p 1635 1523 V 34 w(obje)l(cts)7 b Fl(\()44 b Fv(in)m(t)c Ft(size)50 b Fl(\))515 1694 y Ft(mem)p 694 1694 26 4 v 30 w(cr)l(e)l(ate)p 936 1694 V 30 w(obje)l(cts)34 b Fu(creates)e(a)27 b(memory)c(storage)28 b(ob)5 b(ject)29 b(for)e(ob)5 b(ject)28 b(of)f Ft(size)33 b Fu(b)n(ytes.)515 1910 y Fv(1.11.10)95 b Fm(mem)p 1108 1910 30 4 v 36 w(destr)-5 b(oy)p 1443 1910 V 35 w(obje)g(cts)722 2063 y Fv(v)m(oid)42 b Ft(mem)p 1120 2063 V 35 w(destr)l(oy)p 1411 2063 V 34 w(obje)l(cts)7 b Fl(\()44 b Ft(mem)p 1942 2063 V 34 w(Obje)l(ct)51 b(info)e Fl(\))515 2234 y Ft(mem)p 694 2234 26 4 v 30 w(destr)l(oy)p 980 2234 V 30 w(obje)l(cts)44 b Fu(destro)n(ys)39 b(the)f(memory)32 b(ob)5 b(ject)38 b(returned)i(from)34 b Ft(mem)p 3096 2234 V 31 w(cr)l(e)l(ate)p 3339 2234 V 29 w(obje)l(cts)p Fu(.)64 b(All)515 2334 y(memory)32 b(if)j(freed,)40 b(including)35 b(that)i(used)i(for)d(the)i (ob)5 b(ject.)65 b(Therefore,)41 b(an)n(y)36 b(p)r(oin)n(ters)i(to)f (ob)5 b(jects)515 2433 y(stored)29 b(b)n(y)f Ft(info)33 b Fu(will)25 b(b)r(e)k(left)e(dangling.)515 2649 y Fv(1.11.11)95 b Fm(mem)p 1108 2649 30 4 v 36 w(get)p 1264 2649 V 36 w(obje)-5 b(ct)722 2802 y Fv(v)m(oid)42 b Fk(\003)p Ft(mem)p 1162 2802 V 34 w(get)p 1300 2802 V 35 w(obje)l(ct)8 b Fl(\()44 b Ft(mem)p 1799 2802 V 34 w(Obje)l(ct)51 b(info)e Fl(\))515 2973 y Ft(mem)p 694 2973 26 4 v 30 w(get)p 828 2973 V 31 w(obje)l(ct)39 b Fu(returns)34 b(a)d(p)r(oin)n(ter)h(to)g (a)e(blo)r(c)n(k)h(of)g(memory)26 b(whic)n(h)31 b(is)h Ft(size)37 b Fu(b)n(ytes)c(long)c(\(as)j(sp)r(ec-)515 3073 y(i\014ed)i(in)f(the)j(call)c(to)i Ft(mem)p 1399 3073 V 30 w(cr)l(e)l(ate)p 1641 3073 V 30 w(obje)l(cts)7 b Fu(\).)55 b(This)34 b(blo)r(c)n(k)f(is)h(either)i(newly)e(allo)r (cated)f(memory)-7 b(,)30 b(or)515 3173 y(is)35 b(memory)c(whic)n(h)36 b(w)n(as)g(previously)g(allo)r(cated)f(b)n(y)g Ft(mem)p 2418 3173 V 31 w(get)p 2553 3173 V 30 w(obje)l(ct)44 b Fu(and)35 b(subsequen)n(tly)k(freed)e(b)n(y)515 3272 y Ft(mem)p 694 3272 V 30 w(fr)l(e)l(e)p 854 3272 V 29 w(obje)l(ct)p Fu(.)515 3488 y Fv(1.11.12)95 b Fm(mem)p 1108 3488 30 4 v 36 w(get)p 1264 3488 V 36 w(empty)p 1550 3488 V 36 w(obje)-5 b(ct)722 3641 y Fv(v)m(oid)42 b Fk(\003)p Ft(mem)p 1162 3641 V 34 w(get)p 1300 3641 V 35 w(empty)p 1551 3641 V 35 w(obje)l(ct)8 b Fl(\()44 b Ft(mem)p 2050 3641 V 34 w(Obje)l(ct)51 b(info)e Fl(\))515 3812 y Ft(mem)p 694 3812 26 4 v 30 w(get)p 828 3812 V 31 w(empty)p 1075 3812 V 31 w(obje)l(ct)41 b Fu(is)34 b(exactly)h(lik)n(e)d Ft(mem)p 2068 3812 V 31 w(get)p 2203 3812 V 30 w(obje)l(ct)p Fu(,)j(except)i(the)e(memory)29 b(asso)r(ciated)36 b(with)515 3912 y(the)29 b(ob)5 b(ject)28 b(is)g(set)h(to)f(all)d(zeros.)515 4128 y Fv(1.11.13)95 b Fm(mem)p 1108 4128 30 4 v 36 w(fr)-5 b(e)g(e)p 1298 4128 V 35 w(obje)g(ct)722 4281 y Fv(v)m(oid)42 b Ft(mem)p 1120 4281 V 35 w(fr)l(e)l(e)p 1285 4281 V 33 w(obje)l(ct)8 b Fl(\()43 b Ft(mem)p 1781 4281 V 35 w(Obje)l(ct)51 b(info)p Fl(,)42 b Fv(v)m(oid)g Fk(\003)p Ft(obj)55 b Fl(\))515 4452 y Ft(mem)p 694 4452 26 4 v 30 w(fr)l(e)l(e)p 854 4452 V 29 w(obje)l(ct)28 b Fu(\\frees")22 b(the)g(ob)5 b(ject,)21 b Ft(obj)p Fu(,)g(whic)n(h)g(w)n(as)f(previously)g(obtained) g(from)d Ft(mem)p 3410 4452 V 31 w(get)p 3545 4452 V 30 w(obje)l(ct)p Fu(.)515 4552 y(The)22 b(memory)16 b(asso)r(ciated)22 b(with)f(the)h(ob)5 b(ject)21 b(is)g(not)g(actually)e(freed,)k(but)f (the)g(ob)5 b(ject)22 b(p)r(oin)n(ter)f(is)g(stored)515 4651 y(on)27 b(a)g(stac)n(k,)h(and)f(is)h(a)n(v)-5 b(ailable)24 b(for)j(subsequen)n(t)k(calls)c(to)h Ft(mem)p 2539 4651 V 30 w(get)p 2673 4651 V 31 w(obje)l(ct)p Fu(.)2115 5255 y(21)p eop %%Page: 22 22 22 21 bop 515 523 a Fv(1.11.14)95 b Fm(mem)p 1108 523 30 4 v 36 w(get)p 1264 523 V 36 w(obje)-5 b(ct)p 1539 523 V 35 w(stats)722 676 y Ft(mem)p 901 676 V 35 w(Obje)l(ctStats)50 b(mem)p 1566 676 V 34 w(get)p 1704 676 V 35 w(obje)l(ct)p 1945 676 V 35 w(stats)7 b Fl(\()43 b Ft(mem)p 2402 676 V 35 w(Obje)l(ct)50 b(info)f Fl(\))515 847 y Ft(mem)p 694 847 26 4 v 30 w(get)p 828 847 V 31 w(obje)l(ct)p 1065 847 V 30 w(stats)39 b Fu(returns)d(statistics)e(ab)r(out)e(the)i (memory)27 b(ob)5 b(ject)34 b(p)r(oin)n(ted)e(to)g(b)n(y)h Ft(info)p Fu(.)50 b(The)515 947 y Ft(mem)p 694 947 V 30 w(Obje)l(ctStats)34 b Fu(structure)e(is)c(sho)n(wn)f(in)g(Figure)h (4.)722 1162 y Fv(t)m(yp)s(edef)49 b(struct)41 b Ft(mem)p 1555 1162 30 4 v 34 w(Obje)l(ctStats)50 b Fk(f)853 1262 y Fv(in)m(t)41 b Ft(total)9 b Fl(;)911 b Fc(=)p Fk(\003)27 b Fu(T)-7 b(otal)26 b(ob)5 b(jects)29 b(requested)j Fk(\003)p Fc(=)853 1362 y Fv(in)m(t)41 b Ft(use)l(d)9 b Fl(;)919 b Fc(=)p Fk(\003)27 b Fu(T)-7 b(otal)26 b(curren)n(tly)j(in)e(use)j Fk(\003)p Fc(=)853 1461 y Fv(in)m(t)41 b Ft(r)l(euse)l(d)9 b Fl(;)849 b Fc(=)p Fk(\003)27 b Fu(T)-7 b(otal)26 b(reused)31 b Fk(\003)p Fc(=)853 1561 y Fv(in)m(t)41 b Ft(size)6 b Fl(;)944 b Fc(=)p Fk(\003)27 b Fu(Size)h(of)f(eac)n(h)i(ob)5 b(ject)28 b Fk(\003)p Fc(=)722 1661 y Fk(g)43 b(\003)p Ft(mem)p 1028 1661 V 35 w(Obje)l(ctStats)7 b Fl(;)1667 1843 y Fu(Figure)28 b(4:)35 b Ft(mem)p 2209 1843 26 4 v 31 w(Obje)l(ctStats)515 2242 y Fv(1.11.15)95 b Fm(mem)p 1108 2242 30 4 v 36 w(print)p 1352 2242 V 34 w(obje)-5 b(ct)p 1625 2242 V 34 w(stats)722 2395 y Fv(v)m(oid)42 b Ft(mem)p 1120 2395 V 35 w(print)p 1333 2395 V 34 w(obje)l(ct)p 1573 2395 V 34 w(stats)7 b Fl(\()43 b Ft(mem)p 2029 2395 V 35 w(Obje)l(ct)51 b(info)p Fl(,)42 b Ft(FILE)55 b Fk(\003)p Ft(str)l(e)l(am)48 b Fl(\))515 2566 y Ft(mem)p 694 2566 26 4 v 30 w(print)p 902 2566 V 30 w(obje)l(ct)p 1138 2566 V 30 w(stats)30 b Fu(prin)n(ts)24 b(the)h(statistics)g(for)e(the)h (memory)19 b(ob)5 b(ject)24 b(p)r(oin)n(ted)g(to)f(b)n(y)g Ft(info)29 b Fu(on)23 b(the)515 2666 y(sp)r(eci\014ed)31 b Ft(str)l(e)l(am)p Fu(.)j(If)27 b Ft(str)l(e)l(am)33 b Fu(is)27 b Fv(NULL)p Fu(,)f(then)j Fv(stdout)24 b Fu(will)g(b)r(e)29 b(used.)515 2898 y Fn(1.12)111 b(P)m(arsing)38 b(\(and)g(Lexing\))c (Supp)s(ort)515 3051 y Fv(1.12.1)95 b Fm(prs)p 992 3051 30 4 v 35 w(set)p 1143 3051 V 36 w(debug)722 3205 y Fv(v)m(oid)42 b Ft(prs)p 1058 3205 V 34 w(set)p 1192 3205 V 35 w(debug)7 b Fl(\()45 b Fv(in)m(t)c Ft(debug)p 1869 3205 V 36 w(\015ag)53 b Fl(\))515 3376 y Ft(prs)p 632 3376 26 4 v 30 w(set)p 762 3376 V 30 w(debug)37 b Fu(sp)r(eci\014es)31 b(the)e(v)-5 b(alue)27 b(of)g Ft(yyerr)l(or)35 b Fu(that)28 b Ft(prs)p 2393 3376 V 29 w(\014le)34 b Fu(will)25 b(use.)515 3591 y Fv(1.12.2)95 b Fm(prs)p 992 3591 30 4 v 35 w(set)p 1143 3591 V 36 w(cpp)p 1323 3591 V 33 w(options)722 3745 y Fv(v)m(oid)42 b Ft(prs)p 1058 3745 V 34 w(set)p 1192 3745 V 35 w(cpp)p 1349 3745 V 35 w(options)7 b Fl(\()45 b Fv(const)d(c)m(har)h Fk(\003)p Ft(cpp)p 2376 3745 V 35 w(options)52 b Fl(\))515 3916 y Ft(prs)p 632 3916 26 4 v 30 w(set)p 762 3916 V 30 w(cpp)p 914 3916 V 32 w(options)39 b Fu(sets)34 b(the)f(options)f(for)f Ft(cpp)38 b Fu(to)31 b Ft(cpp)p 2372 3916 V 32 w(options)p Fu(,)i(ensuring)f (that)g Ft(prs)p 3353 3916 V 30 w(\014le)38 b Fu(will)29 b(use)515 4015 y Ft(cpp)34 b Fu(as)28 b(a)f(\014lter.)37 b(If)27 b Ft(cpp)p 1283 4015 V 31 w(options)36 b Fu(is)27 b Fv(NULL)p Fu(,)f(then)j Ft(cpp)34 b Fu(will)25 b(not)i(b)r(e)i(used)h (at)e(a)f(\014lter.)515 4231 y Fv(1.12.3)95 b Fm(prs)p 992 4231 30 4 v 35 w(\014le)722 4384 y Fv(v)m(oid)42 b Ft(prs)p 1058 4384 V 34 w(\014le)6 b Fl(\()44 b Fv(const)e(c)m(har)h Fk(\003)p Ft(\014lename)51 b Fl(\))515 4556 y Ft(prs)p 632 4556 26 4 v 30 w(\014le)34 b Fu(calls)28 b(op)r(ens)i Ft(\014lename)36 b Fu(for)28 b(input,)g(sets)j Ft(yyerr)l(or)k Fu(to)28 b(the)i(v)-5 b(alue)28 b(sp)r(eci\014ed)k(b)n(y)c Ft(prs)p 3419 4556 V 30 w(set)p 3549 4556 V 30 w(debug)p Fu(,)515 4655 y(and)f(calls)g Ft(yyp)l(arse)p Fu(,)g(p)r(erhaps)j (using)e Ft(cpp)33 b Fu(as)28 b(an)g(input)f(\014lter.)639 4755 y(A)39 b(similar)34 b(function)k(should)h(deal)f(with)g(m)n (ultiple)c(parsers)42 b(in)c(the)i(same)d(program,)h(but)h(this)515 4854 y(has)31 b(not)h(b)r(een)h(implemen)n(ted.)42 b(Also,)31 b(either)i(this)f(function)f(or)g(another)h(function)f(should)g(start)h (an)515 4954 y(in)n(teractiv)n(e)c(parse)i(session.)2115 5255 y(22)p eop %%Page: 23 23 23 22 bop 515 523 a Fv(1.12.4)95 b Fm(prs)p 992 523 30 4 v 35 w(\014le)p 1151 523 V 36 w(no)-5 b(cpp)722 676 y Fv(v)m(oid)42 b Ft(prs)p 1058 676 V 34 w(\014le)p 1198 676 V 35 w(no)l(cpp)5 b Fl(\()46 b Fv(const)c(c)m(har)h Fk(\003)p Ft(\014lename)50 b Fl(\))515 847 y Ft(prs)p 632 847 26 4 v 30 w(\014le)p 768 847 V 30 w(no)l(cpp)26 b Fu(calls)18 b(op)r(ens)i Ft(\014lename)26 b Fu(for)18 b(input,)h(sets)i Ft(yyerr)l(or)k Fu(to)18 b(the)i(v)-5 b(alue)18 b(sp)r(eci\014ed)k(b)n(y)c Ft(prs)p 3528 847 V 30 w(set)p 3658 847 V 30 w(debug)p Fu(,)p 3907 864 42 74 v 515 947 a(and)27 b(calls)g Ft(yyp)l(arse)p Fu(.)639 1047 y(A)39 b(similar)34 b(function)k(should)h(deal)f(with)g(m)n (ultiple)c(parsers)42 b(in)c(the)i(same)d(program,)h(but)h(this)515 1146 y(has)31 b(not)h(b)r(een)h(implemen)n(ted.)42 b(Also,)31 b(either)i(this)f(function)f(or)g(another)h(function)f(should)g(start)h (an)515 1246 y(in)n(teractiv)n(e)c(parse)i(session.)515 1462 y Fv(1.12.5)95 b Fm(prs)p 992 1462 30 4 v 35 w(str)-5 b(e)g(am)722 1615 y Fv(v)m(oid)42 b Ft(prs)p 1058 1615 V 34 w(str)l(e)l(am)6 b Fl(\()43 b Ft(FILE)54 b Fk(\003)p Ft(str)p Fl(,)41 b Fv(const)g(c)m(har)i Fk(\003)p Ft(name)51 b Fl(\))515 1786 y Ft(prs)p 632 1786 26 4 v 30 w(str)l(e)l(am)32 b Fu(parses)f(an)c(already)g(op)r(ened)j(stream)c(called)i Ft(name)p Fu(.)515 2002 y Fv(1.12.6)95 b Fm(prs)p 992 2002 30 4 v 35 w(make)p 1243 2002 V 35 w(inte)-5 b(ger)722 2155 y Fv(in)m(t)41 b Ft(prs)p 997 2155 V 34 w(make)p 1217 2155 V 36 w(inte)l(ger)9 b Fl(\()42 b Fv(const)g(c)m(har)h Fk(\003)p Ft(string)p Fl(,)e Fv(in)m(t)g Ft(length)50 b Fl(\))515 2326 y Ft(prs)p 632 2326 26 4 v 30 w(make)p 848 2326 V 31 w(inte)l(ger)35 b Fu(con)n(v)n(erts)30 b(a)d Ft(string)33 b Fu(of)27 b(sp)r(eci\014ed)j Ft(length)k Fu(to)27 b(an)g(in)n(teger.)37 b(This)28 b(function)e(is)i(useful)515 2426 y(in)f(scanners)k(that)d(do)f(not)h Fv(NULL)p Fu(-terminate)d Ft(yytext)p Fu(.)515 2642 y Fv(1.12.7)95 b Fm(prs)p 992 2642 30 4 v 35 w(make)p 1243 2642 V 35 w(double)722 2795 y Fv(double)39 b Ft(prs)p 1160 2795 V 34 w(make)p 1380 2795 V 36 w(double)6 b Fl(\()45 b Fv(const)c(c)m(har)j Fk(\003)p Ft(string)p Fl(,)d Fv(in)m(t)f Ft(length)50 b Fl(\))515 2966 y Ft(prs)p 632 2966 26 4 v 30 w(make)p 848 2966 V 31 w(double)33 b Fu(con)n(v)n(erts)28 b(a)d Ft(string)32 b Fu(of)24 b(sp)r(eci\014ed)29 b Ft(length)k Fu(to)25 b(a)g(double.)36 b(This)25 b(function)g(is)h(useful)g(in)515 3066 y(scanners)31 b(that)d(do)f(not)h Fv(NULL)p Fu(-terminate)d Ft(yytext)p Fu(.)515 3298 y Fn(1.13)111 b(Pro)s(cess)37 b(Managemen)m(t)e(Routines)515 3451 y Fu(The)30 b(pro)r(cess)j (managemen)n(t)24 b(routines)30 b(are)g(designed)h(to)e(facilitate)e (the)j(creation)g(and)f(managemen)n(t)515 3551 y(of)20 b(c)n(hild)g(pro)r(cesses,)28 b(copro)r(cesses,)f(and)21 b(asso)r(ciated)i(pip)r(elines)f(and)f(I/O.)g(Some)e(supp)r(ort)k(for)e (daemons)515 3651 y(and)27 b(so)r(c)n(k)n(et)j(connections)g(is)d(also) g(pro)n(vided.)515 3883 y Fn(1.14)111 b(Prime)33 b(Num)m(b)s(er)h (Routines)515 4036 y Fu(These)j(routines)g(are)e(used)i(to)e(\014nd)g (the)i(next)f(larger)f(prime)e(n)n(um)n(b)r(er)g(for)h(expansion)h(of)f (the)i(hash)515 4136 y(tables)25 b(used)h(b)n(y)f(the)h(hash)f(and)f (set)j(routines.)36 b(These)27 b(routines)f(are)f(only)f(useful)h(for)f (32-bit)e(unsigned)515 4235 y(v)-5 b(alues.)515 4451 y Fv(1.14.1)95 b Fm(prm)p 1030 4451 30 4 v 35 w(is)p 1135 4451 V 35 w(prime)722 4604 y Fv(in)m(t)41 b Ft(prm)p 1031 4604 V 34 w(is)p 1125 4604 V 34 w(prime)6 b Fl(\()43 b Fv(unsigned)38 b(in)m(t)i Ft(value)51 b Fl(\))515 4776 y Ft(prm)p 666 4776 26 4 v 30 w(is)p 756 4776 V 30 w(prime)26 b Fu(returns)e(1)d(if)f Ft(value)28 b Fu(is)21 b(prime;)f(0)h (otherwise.)35 b(Primalit)n(y)16 b(is)21 b(determined)h(b)n(y)f (testings)h(all)515 4875 y(o)r(dd)27 b(divisors)g(less)h(than)g(the)g (square)h(ro)r(ot)e(of)f Ft(value)p Fu(.)37 b(F)-7 b(or)27 b(32-bit)e(in)n(tegers,)j(this)g(ma)n(y)23 b(mean)i(that)i(w)n(e)515 4986 y(will)f(test)31 b(ab)r(out)1085 4905 y Fb(p)p 1139 4905 179 3 v 48 x Fi(2)1173 4937 y Fa(32)1233 4953 y Fb(\000)p Fi(1)p 1085 4967 234 4 v 1185 5015 a(2)1353 4986 y Fu(=)26 b(32768)h(o)r(dd)i(v)-5 b(alues)29 b(instead)h(of)e(the) i(6542)d(primes)h(that)h(w)n(ould)f(actually)2115 5255 y(23)p eop %%Page: 24 24 24 23 bop 515 523 a Fu(need)29 b(to)e(b)r(e)i(tested.)39 b(\(A)27 b(table)h(of)e(pre-computed)h(primes)f(using)h(less)i(than)e (26kB)g(of)f(memory)c(could)515 623 y(b)r(e)29 b(used)g(to)f(reco)n(v)n (er)i(this)e(factor)g(of)e(5)h(p)r(erformance)h(loss.\))515 838 y Fv(1.14.2)95 b Fm(prm)p 1030 838 30 4 v 35 w(next)p 1241 838 V 36 w(prime)722 992 y Fv(unsigned)38 b(long)k Ft(prm)p 1505 992 V 34 w(next)p 1689 992 V 36 w(prime)6 b Fl(\()43 b Fv(unsigned)37 b(in)m(t)k Ft(start)50 b Fl(\))515 1163 y Ft(prm)p 666 1163 26 4 v 30 w(next)p 846 1163 V 31 w(prime)33 b Fu(returns)e(the)e(smallest)c(o)r(dd)j (prime)d(greater)30 b(than)e(or)g(equal)f(to)g Ft(start)p Fu(.)515 1395 y Fn(1.15)111 b(Set)36 b(Routines)515 1548 y Fu(The)f(set)h(implemen)n(tatio)o(n)29 b(is)34 b(similar)29 b(to)34 b(the)i(hash)f(table)f(implem)o(en)n(tation,)29 b(except)37 b(that)d(the)i(set)515 1648 y(ob)5 b(ject)27 b(do)r(es)g(not)g(asso)r(ciate)g(a)f Ft(datum)33 b Fu(with)26 b(a)g Ft(key)p Fu(.)36 b(F)-7 b(or)26 b(sets,)j(k)n(eys)e(are)g(called) f(elemen)n(ts.)35 b(All)25 b(of)g(the)515 1748 y(hash)i(table)f (functions)h(are)h(supp)r(orted,)g(with)e(the)i(addition)c(of)i(a)g (mem)n(b)r(ership)d(test)29 b(and)d(sev)n(eral)i(set)515 1847 y(op)r(erations.)639 1947 y(The)22 b(underlying)f(data)g (structure)k(is)c(a)g(hash)g(table)g(of)f(prime)f(length,)j(with)e (self-organizing)f(link)n(ed)515 2047 y(lists)25 b([Kn)n(uth73)o(,)f (pp.)g(398{9])e(used)k(for)f(collision)d(resolution.)34 b(The)26 b(hash)g(table)e(automatically)19 b(gro)n(ws)515 2146 y(as)28 b(necessary)k(to)27 b(preserv)n(e)32 b(e\016cien)n(t)c (access.)515 2362 y Fv(1.15.1)95 b Fm(set)p 976 2362 30 4 v 36 w(cr)-5 b(e)g(ate)722 2515 y Ft(set)p 827 2515 V 35 w(Set)52 b(set)p 1126 2515 V 34 w(cr)l(e)l(ate)6 b Fl(\()43 b Ft(set)p 1553 2515 V 35 w(HashF)-6 b(unction)52 b(hash)p Fl(,)44 b Ft(set)p 2466 2515 V 34 w(Comp)l(ar)l(eF)-6 b(unction)51 b(c)l(omp)l(ar)l(e)f Fl(\))515 2686 y Fu(The)28 b Ft(set)p 790 2686 26 4 v 31 w(cr)l(e)l(ate)33 b Fu(function)27 b(initilizes)f(a)h(set)j(ob)5 b(ject.)36 b(Elemen)n(ts)27 b(are)i(p)r(oin)n(ters)g(to)e Fv(v)m(oid)p Fu(.)639 2786 y(The)42 b(in)n(ternal)f(represen)n(tation)j(of)c(the)i(set)h(will)c (gro)n(w)h(automatically)35 b(when)42 b(an)f(insertion)g(is)515 2886 y(p)r(erformed)27 b(and)g(the)i(table)f(is)f(more)f(than)i(half)e (full.)639 2985 y(The)g Ft(hash)32 b Fu(function)24 b(should)g(tak)n(e) h(a)f(p)r(oin)n(ter)h(to)f(a)g Ft(elem)31 b Fu(and)24 b(return)j(an)d Fv(unsigned)e(in)m(t)p Fu(.)32 b(If)24 b Ft(hash)515 3085 y Fu(is)32 b Fv(NULL)p Fu(,)e(then)k(the)f Ft(elem)38 b Fu(is)33 b(assumed)e(to)h(b)r(e)i(a)e(p)r(oin)n(ter)g(to)g (a)g(n)n(ull-terminated)d(string,)k(and)f(the)515 3185 y(function)27 b(sho)n(wn)h(in)f(Figure)h(1)f(will)e(b)r(e)k(used)g(for) e Ft(hash)p Fu(.)639 3284 y(The)j Ft(c)l(omp)l(ar)l(e)35 b Fu(function)28 b(should)g(tak)n(e)h(a)g(pair)f(of)f(p)r(oin)n(ters)j (to)f(elemen)n(ts)f(and)h(return)i(zero)g(if)c(the)515 3384 y(elemen)n(ts)32 b(are)i(the)f(same)e(and)i(non-zero)g(if)e(they)j (are)g(di\013eren)n(t.)52 b(If)32 b Ft(c)l(omp)l(ar)l(e)39 b Fu(is)32 b Fv(NULL)p Fu(,)f(then)j(the)515 3483 y(elemen)n(ts)29 b(are)i(assumed)e(to)h(p)r(oin)n(t)f(to)g(n)n(ull-terminated)e (strings,)j(and)g(the)h Ft(str)l(cmp)i Fu(function)d(will)d(b)r(e)515 3583 y(used)i(for)e Ft(c)l(omp)l(ar)l(e)p Fu(.)639 3683 y(Additionally)-7 b(,)23 b(the)29 b Ft(hsh)p 1401 3683 V 31 w(p)l(ointer)p 1686 3683 V 30 w(hash)35 b Fu(and)27 b Ft(hsh)p 2190 3683 V 32 w(p)l(ointer)p 2476 3683 V 30 w(c)l(omp)l(ar)l(e)33 b Fu(functions)28 b(are)g(a)n(v)-5 b(ailable)24 b(and)515 3782 y(can)g(b)r(e)h(used)g(to)f(treat)h(the)g Ft(value)30 b Fu(of)23 b(the)i Fv(v)m(oid)c Fu(p)r(oin)n(ter)k(as)f (the)g(elemen)n(t.)34 b(These)26 b(functions)e(are)h(often)515 3882 y(useful)j(for)f(main)n(taini)o(ng)22 b(sets)30 b(of)d(ob)5 b(jects.)515 4098 y Fv(1.15.2)95 b Fm(set)p 976 4098 30 4 v 36 w(destr)-5 b(oy)722 4251 y Fv(v)m(oid)42 b Ft(set)p 1046 4251 V 34 w(destr)l(oy)7 b Fl(\()44 b Ft(set)p 1519 4251 V 35 w(Set)52 b(set)f Fl(\))515 4422 y Ft(set)p 620 4422 26 4 v 30 w(destr)l(oy)35 b Fu(frees)30 b(all)25 b(of)i(the)i(memory)22 b(asso)r(ciated)30 b(with)d(the)i(set)g (ob)5 b(ject.)639 4522 y(The)36 b(memory)31 b(used)37 b(b)n(y)e(elemen)n(ts)g(is)g Ft(not)43 b Fu(freed|this)37 b(memory)30 b(is)35 b(the)h(resp)r(onsibilit)n(y)f(of)f(the)515 4621 y(user.)46 b(Ho)n(w)n(ev)n(er,)31 b(a)e(call)g(to)h Ft(set)p 1527 4621 V 30 w(iter)l(ate)35 b Fu(can)c(b)r(e)g(used)h(to)f (free)g(this)g(memory)25 b Ft(imme)l(diately)37 b Fu(b)r(efore)31 b(a)515 4721 y(call)26 b(to)h Ft(set)p 873 4721 V 31 w(destr)l(oy)p Fu(.)2115 5255 y(24)p eop %%Page: 25 25 25 24 bop 515 523 a Fv(1.15.3)95 b Fm(set)p 976 523 30 4 v 36 w(insert)722 676 y Fv(in)m(t)41 b Ft(set)p 985 676 V 34 w(insert)8 b Fl(\()43 b Ft(set)p 1410 676 V 35 w(Set)51 b(set)p Fl(,)43 b Fv(const)e(v)m(oid)h Fk(\003)p Ft(elem)49 b Fl(\))515 847 y Ft(set)p 620 847 26 4 v 30 w(insert)34 b Fu(inserts)d(a)c(new)i Ft(elem)k Fu(in)n(to)27 b(the)i Ft(set)p Fu(.)36 b(If)27 b(the)i(insertion)f(is)f(successful,)k (zero)e(is)f(returned.)40 b(If)515 947 y(the)29 b Ft(elem)k Fu(already)27 b(exists,)i(1)e(is)g(returned.)639 1047 y(If)e(the)h(in)n(ternal)f(represen)n(tation)j(of)c(the)j(set)g(b)r (ecomes)f(more)d(than)i(half)f(full,)e(its)j(size)i(is)e(increased)515 1146 y(automatically)-7 b(.)56 b(A)n(t)36 b(presen)n(t,)41 b(this)c(requires)i(that)e(all)d(of)h(the)j(elemen)n(t)d(p)r(oin)n (ters)j(are)f(copied)g(in)n(to)515 1246 y(a)32 b(new)j(set.)54 b(Rehashing)32 b(is)h(not)g(required,)j(ho)n(w)n(ev)n(er,)e(since)h (the)g(hash)e(v)-5 b(alues)34 b(are)g(stored)h(for)e(eac)n(h)515 1346 y(elemen)n(t.)515 1561 y Fv(1.15.4)95 b Fm(set)p 976 1561 30 4 v 36 w(delete)722 1715 y Fv(in)m(t)41 b Ft(set)p 985 1715 V 34 w(delete)6 b Fl(\()44 b Ft(set)p 1407 1715 V 35 w(Set)52 b(set)p Fl(,)42 b Fv(const)g(v)m(oid)f Fk(\003)p Ft(elem)49 b Fl(\))515 1886 y Ft(set)p 620 1886 26 4 v 30 w(delete)25 b Fu(remo)n(v)n(es)19 b(an)g Ft(elem)25 b Fu(from)16 b(the)21 b Ft(set)p Fu(.)32 b(Zero)21 b(is)f(returned)i(if)c(the)j Ft(elem)k Fu(w)n(as)19 b(presen)n(t.)37 b(Otherwise,)515 1985 y(1)27 b(is)g(returned.)515 2201 y Fv(1.15.5)95 b Fm(set)p 976 2201 30 4 v 36 w(memb)-5 b(er)722 2354 y Fv(in)m(t)41 b Ft(set)p 985 2354 V 34 w(memb)l(er)9 b Fl(\()43 b Ft(set)p 1485 2354 V 35 w(Set)52 b(set)p Fl(,)42 b Fv(const)g(v)m(oid)f Fk(\003)p Ft(elem)49 b Fl(\))515 2525 y Ft(set)p 620 2525 26 4 v 30 w(memb)l(er)36 b Fu(returns)31 b(1)c(if)f Ft(elem)33 b Fu(is)28 b(in)f Ft(set)p Fu(.)35 b(Otherwise,)30 b(zero)g(is)d(returned.)515 2741 y Fv(1.15.6)95 b Fm(set)p 976 2741 30 4 v 36 w(iter)-5 b(ate)722 2895 y Fv(in)m(t)41 b Ft(set)p 985 2895 V 34 w(iter)l(ate)6 b Fl(\()43 b Ft(set)p 1432 2895 V 34 w(Set)52 b(set)p Fl(,)1463 2994 y Fv(in)m(t)41 b Fl(\()p Fk(\003)p Ft(iter)l(ator)9 b Fl(\)\()41 b Fv(const)h(v)m(oid)f Fk(\003)p Ft(elem)49 b Fl(\))44 b(\))515 3165 y Ft(set)p 620 3165 26 4 v 30 w(iter)l(ate)30 b Fu(is)25 b(used)i(to)f(iterate)h (a)e(function)g(o)n(v)n(er)g(ev)n(ery)i Ft(elem)32 b Fu(in)24 b(the)j Ft(set)p Fu(.)35 b(The)26 b(function,)f Ft(iter)l(ator)p Fu(,)d(is)515 3265 y(passed)33 b(eac)n(h)f Ft(elem)p Fu(.)45 b(If)30 b Ft(iter)l(ator)38 b Fu(returns)c(a)c (non-zero)j(v)-5 b(alue,)30 b(the)i(iterations)f(stop,)h(and)f Ft(set)p 3544 3265 V 30 w(iter)l(ate)515 3365 y Fu(returns.)37 b(Note)23 b(that)f(the)h(elemen)n(ts)f(are)g(in)f(some)g(arbitrary)g (order,)j(and)e(that)g(this)g(order)h(ma)n(y)18 b(c)n(hange)515 3464 y(b)r(et)n(w)n(een)30 b(t)n(w)n(o)d(successiv)n(e)32 b(calls)27 b(to)h Ft(set)p 1768 3464 V 30 w(iter)l(ate)p Fu(.)515 3680 y Fv(1.15.7)95 b Fm(set)p 976 3680 30 4 v 36 w(iter)-5 b(ate)p 1281 3680 V 34 w(ar)g(g)722 3833 y Fv(in)m(t)41 b Ft(set)p 985 3833 V 34 w(iter)l(ate)p 1251 3833 V 33 w(ar)l(g)7 b Fl(\()44 b Ft(set)p 1579 3833 V 35 w(Set)51 b(set)p Fl(,)1638 3933 y Fv(in)m(t)40 b Fl(\()p Fk(\003)p Ft(iter)l(ator)9 b Fl(\)\()42 b Fv(const)f(v)m(oid) h Fk(\003)p Ft(elem)p Fl(,)f Fv(v)m(oid)h Fk(\003)p Ft(ar)l(g)50 b Fl(\),)1638 4032 y Fv(v)m(oid)41 b Fk(\003)p Ft(ar)l(g)50 b Fl(\))515 4204 y Ft(set)p 620 4204 26 4 v 30 w(iter)l(ate)p 882 4204 V 29 w(ar)l(g)28 b Fu(is)21 b(used)i(to)d(iterate)j(a)e (function)f(o)n(v)n(er)h(ev)n(ery)i Ft(elem)k Fu(in)20 b(the)j Ft(set)p Fu(.)33 b(The)22 b(function,)f Ft(iter)l(ator)p Fu(,)515 4303 y(is)k(passed)i(eac)n(h)f Ft(elem)p Fu(.)35 b(If)24 b Ft(iter)l(ator)32 b Fu(returns)c(a)d(non-zero)h(v)-5 b(alue,)25 b(the)h(iterations)f(stop,)h(and)f Ft(set)p 3544 4303 V 30 w(iter)l(ate)515 4403 y Fu(returns.)37 b(Note)23 b(that)f(the)h(elemen)n(ts)f(are)g(in)f(some)g(arbitrary)g (order,)j(and)e(that)g(this)g(order)h(ma)n(y)18 b(c)n(hange)515 4502 y(b)r(et)n(w)n(een)30 b(t)n(w)n(o)d(successiv)n(e)32 b(calls)27 b(to)h Ft(set)p 1768 4502 V 30 w(iter)l(ate)p Fu(.)515 4718 y Fv(1.15.8)95 b Fm(set)p 976 4718 30 4 v 36 w(init)p 1158 4718 V 34 w(p)-5 b(osition)722 4871 y Ft(set)p 827 4871 V 35 w(Position)50 b(set)p 1312 4871 V 35 w(init)p 1473 4871 V 34 w(p)l(osition)6 b Fl(\()44 b Ft(set)p 1971 4871 V 34 w(Set)52 b(set)g Fl(\))2115 5255 y Fu(25)p eop %%Page: 26 26 26 25 bop 515 523 a Ft(set)p 620 523 26 4 v 30 w(init)p 776 523 V 30 w(p)l(osition)36 b Fu(returns)d(a)c(p)r(osition)f(mark)n (er)g(for)h(some)f(arbitary)h(\014rst)j(elemen)n(t)c(in)h(the)i(set.)44 b(This)515 623 y(mark)n(er)26 b(can)i(b)r(e)h(used)g(with)e Ft(set)p 1545 623 V 31 w(next)p 1726 623 V 31 w(p)l(osition)34 b Fu(and)28 b Ft(set)p 2335 623 V 30 w(get)p 2469 623 V 31 w(p)l(osition)p Fu(.)515 838 y Fv(1.15.9)95 b Fm(set)p 976 838 30 4 v 36 w(next)p 1188 838 V 36 w(p)-5 b(osition)722 992 y Ft(set)p 827 992 V 35 w(Position)50 b(set)p 1312 992 V 35 w(next)p 1497 992 V 35 w(p)l(osition)6 b Fl(\()45 b Ft(set)p 1997 992 V 34 w(Set)52 b(set)p Fl(,)43 b Ft(set)p 2462 992 V 34 w(Position)50 b(p)l(osition)g Fl(\))515 1163 y Ft(set)p 620 1163 26 4 v 30 w(next)p 800 1163 V 32 w(p)l(osition)31 b Fu(returns)e(a)c(p)r(osition)f(mark)n(er)g(for) h(the)h(next)h(elemen)n(t)d(in)h(the)i(set.)37 b(Elemen)n(ts)24 b(are)j(in)515 1262 y(arbitrary)g(order)j(based)f(on)e(their)h(p)r (ositions)g(in)e(the)j(hash)g(table.)515 1478 y Fv(1.15.10)95 b Fm(set)p 1024 1478 30 4 v 36 w(get)p 1180 1478 V 36 w(p)-5 b(osition)722 1631 y Fv(v)m(oid)42 b Fk(\003)p Ft(set)p 1088 1631 V 34 w(get)p 1226 1631 V 35 w(p)l(osition)6 b Fl(\()44 b Ft(set)p 1725 1631 V 35 w(Position)50 b(p)l(osition)g Fl(\))515 1803 y Ft(set)p 620 1803 26 4 v 30 w(get)p 754 1803 V 31 w(p)l(osition)31 b Fu(returns)d(the)e(elemen)n(t)d(asso)r (ciated)k(with)d(the)i Ft(p)l(osition)31 b Fu(mark)n(er,)23 b(or)h Fv(NULL)g Fu(if)f(there)515 1902 y(is)k(no)h(suc)n(h)h(elemen)n (t.)515 2118 y Fv(1.15.11)95 b Fm(set)p 1024 2118 30 4 v 36 w(r)-5 b(e)g(adonly)722 2271 y Fv(in)m(t)41 b Ft(set)p 985 2271 V 34 w(r)l(e)l(adonly)7 b Fl(\()45 b Ft(set)p 1503 2271 V 34 w(Set)52 b(set)p Fl(,)43 b Fv(in)m(t)d Ft(\015ag)53 b Fl(\))515 2442 y Ft(set)p 620 2442 26 4 v 30 w(r)l(e)l(adonly)38 b Fu(sets)33 b(the)f Ft(r)l(e)l(adonly)38 b Fu(\015ag)29 b(for)h(the)i Ft(set)38 b Fu(to)30 b Ft(\015ag)p Fu(.)46 b Ft(\015ag)39 b Fu(should)30 b(b)r(e)i(0)d(or)i(1.)44 b(The)31 b(v)-5 b(alue)30 b(of)515 2542 y(the)k(previous)h(\015ag)d(is)h(returned.)57 b(When)34 b(a)f(set)i(is)e(mark)n(ed)e(as)j(readonly)-7 b(,)34 b(self-organization)c(of)j(the)515 2642 y(buc)n(k)n(et-o)n(v)n(er\015o) n(w)27 b(lists)f(will)e(not)i(tak)n(e)h(place,)f(and)h(an)n(y)e (attempt)g(to)i(mo)r(dify)22 b(the)27 b(list)f(\(e.g.,)f(insertion)515 2741 y(or)i(deletion\))h(will)d(result)k(in)e(an)h(error.)515 2957 y Fv(1.15.12)95 b Fm(set)p 1024 2957 30 4 v 36 w(union)722 3110 y Ft(set)p 827 3110 V 35 w(Set)52 b(set)p 1126 3110 V 34 w(union)6 b Fl(\()46 b Ft(set)p 1548 3110 V 35 w(Set)52 b(set1)p Fl(,)42 b Ft(set)p 2055 3110 V 35 w(Set)52 b(set2)j Fl(\))515 3281 y Ft(set)p 620 3281 26 4 v 30 w(union)35 b Fu(returns)30 b(a)c(new)i(set)h(whic)n(h)d(is)h(the)h(union)e(of)g Ft(set1)38 b Fu(and)26 b Ft(set2)p Fu(.)36 b(Only)27 b(p)r(oin)n(ters)h(to)e(elemen)n(ts)515 3381 y(are)33 b(copied,)g Ft(not)41 b Fu(the)34 b(data)e(p)r(oin)n(ted)h(\(this)f (has)h(memory)28 b(managemen)n(t)f(implications\).)45 b(The)34 b Ft(hash)515 3481 y Fu(and)27 b Ft(c)l(omp)l(ar)l(e)34 b Fu(functions)28 b(m)n(ust)e(b)r(e)j(iden)n(tical)d(for)h(the)i(t)n(w) n(o)e(sets.)515 3696 y Fv(1.15.13)95 b Fm(set)p 1024 3696 30 4 v 36 w(inter)722 3850 y Ft(set)p 827 3850 V 35 w(Set)52 b(set)p 1126 3850 V 34 w(inter)9 b Fl(\()43 b Ft(set)p 1518 3850 V 34 w(Set)52 b(set1)p Fl(,)43 b Ft(set)p 2025 3850 V 35 w(Set)52 b(set2)j Fl(\))515 4021 y Ft(set)p 620 4021 26 4 v 30 w(inter)44 b Fu(returns)39 b(a)d(new)g(set)i(whic)n(h)e(is)g(the)h(in)n(tersection)h(of)d Ft(set1)48 b Fu(and)35 b Ft(set2)p Fu(.)61 b(Only)36 b(p)r(oin)n(ters)h(to)515 4120 y(elemen)n(ts)f(are)h(copied,)h Ft(not)45 b Fu(the)38 b(data)d(p)r(oin)n(ted)i(\(this)g(has)f(memory)c (managemen)n(t)f(implications\).)515 4220 y(The)d Ft(hash)36 b Fu(and)27 b Ft(c)l(omp)l(ar)l(e)34 b Fu(functions)28 b(m)n(ust)e(b)r(e)j(iden)n(tical)d(for)h(the)i(t)n(w)n(o)e(sets.)515 4436 y Fv(1.15.14)95 b Fm(set)p 1024 4436 30 4 v 36 w(di\013)722 4589 y Ft(set)p 827 4589 V 35 w(Set)52 b(set)p 1126 4589 V 34 w(di\013)19 b Fl(\()44 b Ft(set)p 1473 4589 V 34 w(Set)52 b(set1)p Fl(,)43 b Ft(set)p 1980 4589 V 34 w(Set)52 b(set2)j Fl(\))515 4760 y Ft(set)p 620 4760 26 4 v 30 w(di\013)46 b Fu(returns)32 b(a)27 b(new)i(set)h(whic)n(h)e(is)g(the)h (di\013erence)j(resulting)c(from)d(remo)n(ving)f(ev)n(ery)30 b(elemen)n(t)d(in)515 4860 y Ft(set2)38 b Fu(from)23 b(the)28 b(elemen)n(ts)e(in)g Ft(set1)p Fu(.)35 b(Only)27 b(p)r(oin)n(ters)g(to)g(elemen)n(ts)f(are)h(copied,)g Ft(not)35 b Fu(the)28 b(data)e(p)r(oin)n(ted)2115 5255 y(26)p eop %%Page: 27 27 27 26 bop 515 523 a Fu(\(this)36 b(has)f(memory)c(managemen)n(t)f (implications\).)54 b(The)36 b Ft(hash)43 b Fu(and)35 b Ft(c)l(omp)l(ar)l(e)42 b Fu(functions)35 b(m)n(ust)f(b)r(e)515 623 y(iden)n(tical)26 b(for)h(the)i(t)n(w)n(o)e(sets.)515 838 y Fv(1.15.15)95 b Fm(set)p 1024 838 30 4 v 36 w(e)-5 b(qual)722 992 y Fv(in)m(t)41 b Ft(set)p 985 992 V 34 w(e)l(qual)9 b Fl(\()44 b Ft(set)p 1384 992 V 35 w(Set)52 b(set1)p Fl(,)42 b Ft(set)p 1891 992 V 35 w(Set)52 b(set2)j Fl(\))515 1163 y Ft(set)p 620 1163 26 4 v 30 w(e)l(qual)41 b Fu(returns)35 b(non-zero)e(if)e Ft(set1)43 b Fu(and)32 b Ft(set2)43 b Fu(con)n(tain)32 b(the)h(same)d(n)n(um)n(b)r(er)h(of)g (elemen)n(ts,)h(and)f(all)515 1262 y(of)25 b(the)k(elemen)n(ts)d(in)g Ft(set1)38 b Fu(are)28 b(also)e(in)g Ft(set2)p Fu(.)36 b(The)27 b Ft(hash)35 b Fu(and)26 b Ft(c)l(omp)l(ar)l(e)33 b Fu(functions)27 b(m)n(ust)e(b)r(e)j(iden)n(tical)515 1362 y(for)f(the)i(t)n(w)n(o)e(sets.)515 1578 y Fv(1.15.16)95 b Fm(set)p 1024 1578 30 4 v 36 w(get)p 1180 1578 V 36 w(stats)722 1731 y Ft(set)p 827 1731 V 35 w(Stats)50 b(set)p 1190 1731 V 35 w(get)p 1329 1731 V 35 w(stats)7 b Fl(\()43 b Ft(set)p 1712 1731 V 34 w(Set)52 b(set)f Fl(\))515 1902 y Ft(set)p 620 1902 26 4 v 30 w(get)p 754 1902 V 31 w(stats)33 b Fu(returns)e(statistics)f(ab)r(out)d(the)i Ft(set)p Fu(.)36 b(The)29 b Ft(set)p 2430 1902 V 30 w(Stats)35 b Fu(structure)d(is)27 b(sho)n(wn)h(in)f(Figure)h(5.)722 2118 y Fv(t)m(yp)s(edef)49 b(struct)41 b Ft(set)p 1481 2118 30 4 v 34 w(Stats)7 b Fk(f)853 2217 y Fv(unsigned)37 b(long)42 b Ft(size)6 b Fl(;)515 b Fc(=)p Fk(\003)26 b Fu(Size)j(of)e(table)g Fk(\003)p Fc(=)853 2317 y Fv(unsigned)37 b(long)42 b Ft(r)l(esizings)7 b Fl(;)338 b Fc(=)p Fk(\003)26 b Fu(Num)n(b)r(er)h(of)g(resizings)i Fk(\003)p Fc(=)853 2417 y Fv(unsigned)37 b(long)42 b Ft(entries)7 b Fl(;)400 b Fc(=)p Fk(\003)26 b Fu(T)-7 b(otal)26 b(en)n(tries)k(in)d(table)h Fk(\003)p Fc(=)853 2516 y Fv(unsigned)37 b(long)42 b Ft(buckets)p 1747 2516 V 36 w(use)l(d)9 b Fl(;)196 b Fc(=)p Fk(\003)26 b Fu(Num)n(b)r(er)h(of)g(hash)h(buc)n(k)n(ets)i(in)d (use)i Fk(\003)p Fc(=)853 2616 y Fv(unsigned)37 b(long)42 b Ft(singletons)7 b Fl(;)292 b Fc(=)p Fk(\003)26 b Fu(Num)n(b)r(er)h (of)g(length)g(one)i(lists)e Fk(\003)p Fc(=)853 2715 y Fv(unsigned)37 b(long)42 b Ft(maximum)p 1843 2715 V 36 w(length)6 b Fl(;)43 b Fc(=)p Fk(\003)27 b Fu(Maxim)n(um)20 b(list)27 b(length)h Fk(\003)p Fc(=)853 2915 y Fv(unsigned)37 b(long)42 b Ft(r)l(etrievals)7 b Fl(;)312 b Fc(=)p Fk(\003)26 b Fu(T)-7 b(otal)26 b(n)n(um)n(b)r(er)h(of)f(retriev)-5 b(als)30 b Fk(\003)p Fc(=)853 3014 y Fv(unsigned)37 b(long)42 b Ft(hits)7 b Fl(;)516 b Fc(=)p Fk(\003)26 b Fu(Num)n(b)r(er)h(of)g (retriev)-5 b(als)29 b(from)24 b(top)k(of)e(a)i(list)e Fk(\003)p Fc(=)55 b Fd(1)r(0)853 3114 y Fv(unsigned)37 b(long)42 b Ft(misses)7 b Fl(;)412 b Fc(=)p Fk(\003)26 b Fu(Num)n(b)r(er)h(of)g(unsuccessful)k(retriev)-5 b(als)30 b Fk(\003)p Fc(=)722 3214 y Fk(g)43 b(\003)p Ft(set)p 954 3214 V 34 w(Stats)7 b Fl(;)1817 3396 y Fu(Figure)28 b(5:)36 b Ft(set)p 2286 3396 26 4 v 30 w(Stats)515 3795 y Fv(1.15.17)95 b Fm(set)p 1024 3795 30 4 v 36 w(print)p 1268 3795 V 33 w(stats)722 3948 y Fv(v)m(oid)42 b Ft(set)p 1046 3948 V 34 w(print)p 1258 3948 V 34 w(stats)7 b Fl(\()44 b Ft(set)p 1641 3948 V 34 w(Set)52 b(set)p Fl(,)42 b Ft(FILE)55 b Fk(\003)p Ft(str)l(e)l(am)48 b Fl(\))515 4119 y Ft(set)p 620 4119 26 4 v 30 w(print)p 828 4119 V 30 w(stats)30 b Fu(prin)n(ts)25 b(the)g(statistics)h(for)e Ft(set)32 b Fu(on)23 b(the)j(sp)r(eci\014ed)h Ft(str)l(e)l(am)p Fu(.)34 b(If)23 b Ft(str)l(e)l(am)29 b Fu(is)24 b Fv(NULL)p Fu(,)f(then)515 4219 y Fv(stdout)g Fu(will)i(b)r(e)k(used.)515 4451 y Fn(1.16)111 b(Skip)36 b(List)g(Routines)515 4604 y Fu(Skip)25 b(list)h(supp)r(ort)i(is)e(pro)n(vided)g(as)g(an)g (alternativ)n(e)g(to)g(balanced)h(trees.)39 b(Skip)25 b(lists)h(ha)n(v)n(e)g(the)i(adv)-5 b(an-)515 4704 y(tage)27 b(that)h(an)f(inorder)h(w)n(alk)d(through)j(the)g(list)f(is)g(p)r (ossible)h(in)e(the)j(face)f(of)e(additions)g(and)h(deletions)515 4804 y(from)c(the)29 b(list.)35 b(Balanced)28 b(tree,)h(algorithms,)22 b(in)k(con)n(trast,)i(mak)n(e)c(this)k(sort)g(of)e(tra)n(v)n(ersal)h (imp)r(ossible)515 4903 y(b)r(ecause)k(of)26 b(the)j(rotations)f(that)g (are)g(necessary)k(for)27 b(the)i(balancing.)2115 5255 y(27)p eop %%Page: 28 28 28 27 bop 639 523 a Fu(F)-7 b(or)24 b(these)j(lists,)d(the)h Ft(key)32 b Fu(is)24 b(deriv)-5 b(able)24 b(from)c(the)25 b Ft(datum)32 b Fu(that)24 b(is)f(stored)j(in)d(the)j(list.)33 b(This)24 b(mak)n(es)515 623 y(it)f(p)r(ossible)i(for)f(the)i(actualy)d (k)n(eys)j(to)e(c)n(hange,)h(as)f(long)f(as)i(the)g(ordering)g(of)e (the)j(data)e(sta)n(y)g(the)i(same.)515 722 y(This)h(is)h(essen)n(tial) g(for)g(the)h(use)g(of)e(skip)g(lists)h(for)f Fj(Khepera)j Fu(trees.)639 822 y(This)24 b(co)r(de)h(is)e(deriv)n(ed)i(from)20 b([Pugh90)n(])j(and)g(from)d(a)j(skip)h(list)e(implemen)n(tatio)o(n)c (b)n(y)23 b(Lars)h(Nyland.)515 1038 y Fv(1.16.1)95 b Fm(sl)p 924 1038 30 4 v 37 w(cr)-5 b(e)g(ate)722 1191 y Ft(sl)p 783 1191 V 34 w(List)51 b(sl)p 1064 1191 V 34 w(cr)l(e)l(ate)6 b Fl(\()43 b Fv(in)m(t)e Fl(\()p Fk(\003)p Ft(c)l(omp)l(ar)l(e)6 b Fl(\)\()44 b Fv(const)d(v)m(oid)h Fk(\003)p Ft(key1)p Fl(,)h Fv(const)f(v)m(oid)f Fk(\003)p Ft(key2)56 b Fl(\),)1550 1291 y Fv(const)42 b(v)m(oid)g Fk(\003)p Fl(\()p Fk(\003)p Ft(key)7 b Fl(\)\()44 b Fv(const)e(v)m(oid) f Fk(\003)p Ft(datum)51 b Fl(\),)1550 1390 y Fv(const)42 b(c)m(har)h Fk(\003)p Fl(\()p Fk(\003)p Ft(print)8 b Fl(\)\()43 b Fv(const)e(v)m(oid)h Fk(\003)p Ft(datum)50 b Fl(\))44 b(\))515 1561 y Ft(sl)p 576 1561 26 4 v 29 w(cr)l(e)l(ate)h Fu(initializes)37 b(a)i(skip)g(list.)69 b(The)41 b Ft(c)l(omp)l(ar)l(e)k Fu(function)39 b(returns)j(-1,)e(0,)h (or)e(1)g(dep)r(ending)h(on)515 1661 y(the)33 b(ordering)e(of)g Ft(key1)44 b Fu(and)31 b Ft(key2)p Fu(.)48 b(The)33 b Ft(key)39 b Fu(function)31 b(con)n(v)n(erts)j(a)d Ft(datum)39 b Fu(in)n(to)30 b(a)h Ft(key)p Fu(.)48 b(The)33 b Ft(print)515 1761 y Fu(function)24 b(returns)29 b(a)24 b(string)i(represen)n(tation) i(of)c Ft(datum)p Fu(,)i(and)f(is)g(allo)n(w)n(ed)d(to)j(alw)n(a)n(ys)e (return)28 b(a)c(p)r(oin)n(ter)515 1860 y(to)j(the)i(same)d(static)j (bu\013er.)639 1960 y Ft(c)l(omp)l(ar)l(e)35 b Fu(m)n(ust)27 b(b)r(e)j(pro)n(vided.)39 b(If)28 b Ft(key)36 b Fu(is)29 b(not)f(pro)n(vided,)g(then)i Ft(datum)36 b Fu(will)26 b(b)r(e)k(used)h(as)e(the)h(k)n(ey)-7 b(.)515 2059 y(If)27 b Ft(print)34 b Fu(is)28 b(not)g(pro)n(vided,)e(then)j(the)g Ft(datum)35 b Fu(p)r(oin)n(ter)28 b(will)d(b)r(e)k(prin)n(ted)g(when)f (necessary)-7 b(.)515 2275 y Fv(1.16.2)95 b Fm(sl)p 924 2275 30 4 v 37 w(destr)-5 b(oy)722 2429 y Fv(v)m(oid)42 b Ft(sl)p 1002 2429 V 34 w(destr)l(oy)7 b Fl(\()44 b Ft(sl)p 1431 2429 V 34 w(List)50 b(list)g Fl(\))515 2600 y Ft(sl)p 576 2600 26 4 v 29 w(destr)l(oy)34 b Fu(remo)n(v)n(es)26 b(all)f(of)h(the)i(memory)22 b(asso)r(ciated)28 b(with)f(the)h(main)n (tenance)d(of)h(the)i(sp)r(eci\014ed)i(skip)515 2699 y Ft(list)p Fu(.)44 b(The)32 b(p)r(oin)n(ter)g(to)f(the)h (user-de\014ned)j Ft(datum)k Fu(is)31 b Fv(not)e Fu(freed)j({)f(this)g (is)g(the)i(resp)r(onsibilit)n(y)d(of)g(the)515 2799 y(user.)515 3015 y Fv(1.16.3)p 860 3015 30 4 v 131 w Fm(sl)p 960 3015 V 36 w(shutdown)722 3168 y Fv(v)m(oid)p 946 3168 V 77 w Ft(sl)p 1037 3168 V 34 w(shutdown)6 b Fl(\()45 b Fv(v)m(oid)d Fl(\))p 520 3339 26 4 v 545 3339 a Ft(sl)p 606 3339 V 30 w(shutdown)32 b Fu(is)23 b(used)j(to)e(free)h (the)h(in)n(ternal)d(data)g(structures)29 b(used)d(b)n(y)e(the)h(skip)f (list)f(pac)n(k)-5 b(age.)35 b(Since)515 3439 y(it)27 b(is)g(called)g(automatically)22 b(b)n(y)28 b Fj(libmaa)p Fu(,)h(it)e(should)g(not)h(b)r(e)h(called)e(explicitly)f(b)n(y)h(the)i (user.)515 3654 y Fv(1.16.4)95 b Fm(sl)p 924 3654 30 4 v 37 w(insert)722 3808 y Fv(v)m(oid)42 b Ft(sl)p 1002 3808 V 34 w(insert)8 b Fl(\()42 b Ft(sl)p 1382 3808 V 34 w(List)51 b(list)p Fl(,)41 b Fv(const)g(v)m(oid)h Fk(\003)p Ft(datum)50 b Fl(\))515 3979 y Fu(Insert)30 b Ft(datum)35 b Fu(in)n(to)26 b Ft(list)p Fu(.)515 4195 y Fv(1.16.5)95 b Fm(sl)p 924 4195 V 37 w(delete)722 4348 y Fv(v)m(oid)42 b Ft(sl)p 1002 4348 V 34 w(delete)6 b Fl(\()44 b Ft(sl)p 1380 4348 V 34 w(List)50 b(list)p Fl(,)41 b Fv(const)h(v)m(oid)f Fk(\003)p Ft(datum)51 b Fl(\))515 4519 y Fu(Delete)29 b Ft(datum)35 b Fu(from)24 b Ft(list)p Fu(.)2115 5255 y(28)p eop %%Page: 29 29 29 28 bop 515 523 a Fv(1.16.6)95 b Fm(sl)p 924 523 30 4 v 37 w(\014nd)722 676 y Fv(const)42 b(v)m(oid)g Fk(\003)p Ft(sl)p 1306 676 V 33 w(\014nd)9 b Fl(\()45 b Ft(sl)p 1615 676 V 34 w(List)51 b(list)p Fl(,)41 b Fv(const)g(v)m(oid)h Fk(\003)p Ft(key)51 b Fl(\))515 847 y Fu(Find)25 b(the)j(datum)23 b(in)i Ft(list)32 b Fu(that)27 b(has)f(an)g(asso)r(ciated)i(v)-5 b(alue)25 b(of)g Ft(key)p Fu(.)37 b(Return)27 b(that)f(datum)d(\(a)j(p) r(oin)n(ter\),)515 947 y(or)h Fv(NULL)g Fu(if)f(the)j Ft(key)36 b Fu(is)27 b(not)h(found.)515 1159 y Fv(1.16.7)95 b Fm(sl)p 924 1159 V 37 w(iter)-5 b(ate)722 1312 y Fv(in)m(t)41 b Ft(sl)p 941 1312 V 34 w(iter)l(ate)6 b Fl(\()42 b Ft(sl)p 1343 1312 V 34 w(List)51 b(list)p Fl(,)41 b Ft(sl)p 1799 1312 V 33 w(Iter)l(ator)51 b(f)61 b Fl(\))515 1483 y Fu(Iterate)42 b Ft(f)56 b Fu(o)n(v)n(er)40 b(ev)n(ery)h(datum)36 b(in)j Ft(list)p Fu(.)69 b(If)39 b Ft(f)56 b Fu(returns)43 b(non-zero,)g(then)d(ab)r(ort)g(the)h(remainder)d(of)515 1583 y(the)31 b(iteration.)41 b(Iterations)30 b(are)h(designed)g(to)e (do)h(something)d(appropriate)j(in)e(the)j(face)g(of)d(arbitrary)515 1683 y(insertions)g(and)g(deletions)g(p)r(erformed)f(b)n(y)h Ft(f)p Fu(.)515 1894 y Fv(1.16.8)95 b Fm(sl)p 924 1894 V 37 w(iter)-5 b(ate)p 1230 1894 V 34 w(ar)g(g)722 2048 y Fv(in)m(t)41 b Ft(sl)p 941 2048 V 34 w(iter)l(ate)p 1207 2048 V 33 w(ar)l(g)7 b Fl(\()43 b Ft(sl)p 1490 2048 V 34 w(List)51 b(list)p Fl(,)41 b Ft(sl)p 1946 2048 V 34 w(Iter)l(atorA)n(r)l(g)47 b(f)p Fl(,)42 b Fv(v)m(oid)g Fk(\003)p Ft(ar)l(g)50 b Fl(\))515 2219 y Fu(Iterate)42 b Ft(f)56 b Fu(o)n(v)n(er)40 b(ev)n(ery)h(datum)36 b(in)j Ft(list)p Fu(.)69 b(If)39 b Ft(f)56 b Fu(returns)43 b(non-zero,)g(then) d(ab)r(ort)g(the)h(remainder)d(of)515 2318 y(the)31 b(iteration.)41 b(Iterations)30 b(are)h(designed)g(to)e(do)h(something)d(appropriate)j (in)e(the)j(face)g(of)d(arbitrary)515 2418 y(insertions)g(and)g (deletions)g(p)r(erformed)f(b)n(y)h Ft(f)p Fu(.)515 2630 y Fv(1.16.9)p 860 2630 V 131 w Fm(sl)p 960 2630 V 36 w(dump)722 2783 y Fv(v)m(oid)p 946 2783 V 77 w Ft(sl)p 1037 2783 V 34 w(dump)5 b Fl(\()45 b Ft(sl)p 1405 2783 V 34 w(List)51 b(list)e Fl(\))515 2954 y Fu(Dump)24 b(the)29 b(in)n(ternal)e(data)g(structures)33 b(asso)r(ciated)c(with)f Ft(list)p Fu(.)34 b(This)27 b(is)h(purely)g(for)f(debugging.)515 3183 y Fn(1.17)111 b(Source)37 b(Co)s(de)h(Managemen)m(t)515 3336 y Fu(Most)22 b(of)e(the)j(source)h(co)r(de)g(managem)o(en)n(t)17 b(routines)23 b(are)f(designed)h(to)f(b)r(e)g(called)f(from)e(within)h (a)h(lexical)515 3436 y(analyzer.)54 b(The)35 b(routines)g(supp)r(ort)g (the)g(storage)g(and)e(retriev)-5 b(al)35 b(of)d(source)37 b(co)r(de)e(lines)f(and)f(source)515 3535 y(co)r(de)c(tok)n(en)f (information.)i(A)e(single,)e(global,)e(source)30 b(co)r(de)g (managemen)n(t)22 b(ob)5 b(ject)29 b(is)e(supp)r(orted.)639 3635 y Fv(This)j(do)s(cumen)m(tatio)o(n)25 b(is)30 b(incomplete.)639 3734 y(These)h(routines)26 b(ha)m(v)m(e)32 b(not)e(b)s(een)f(fully)e (implemen)m(t)o(ed)o(.)515 3946 y(1.17.1)95 b Fm(sr)-5 b(c)p 981 3946 V 36 w(cr)g(e)g(ate)722 4100 y Fv(v)m(oid)42 b Ft(sr)l(c)p 1050 4100 V 34 w(cr)l(e)l(ate)6 b Fl(\()43 b Fv(v)m(oid)e Fl(\))515 4271 y Fu(The)24 b Ft(sr)l(c)p 790 4271 26 4 v 30 w(cr)l(e)l(ate)k Fu(functions)c(initializes)d(the)k (global)20 b(source)26 b(co)r(de)g(managem)o(en)n(t)19 b(ob)5 b(ject.)35 b(This)23 b(routine)515 4370 y(should)30 b(only)e(b)r(e)k(called)e(once,)h(if)e(at)h(all.)41 b(If)30 b(the)h(other)h(routines)f(are)h(used)g(as)e(exp)r(ected,)k Ft(sr)l(c)p 3563 4370 V 30 w(cr)l(e)l(ate)515 4470 y Fu(will)25 b(b)r(e)k(called)e(automatically)21 b(when)29 b(it)e(is)h(needed.)515 4682 y Fv(1.17.2)95 b Fm(sr)-5 b(c)p 981 4682 30 4 v 36 w(destr)g(oy)722 4835 y Fv(v)m(oid)42 b Ft(sr)l(c)p 1050 4835 V 34 w(destr)l(oy)7 b Fl(\()43 b Fv(v)m(oid)f Fl(\))515 5006 y Ft(sr)l(c)p 624 5006 26 4 v 29 w(destr)l(oy)35 b Fu(frees)30 b(all)25 b(memory)e(asso)r (ciated)29 b(with)e(the)i(global)c(source)30 b(co)r(de)g(managemen)n(t) 22 b(ob)5 b(ject.)2115 5255 y(29)p eop %%Page: 30 30 30 29 bop 515 523 a Fv(1.17.3)95 b Fm(sr)-5 b(c)p 981 523 30 4 v 36 w(line)722 676 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(sr)l(c)p 1357 676 V 33 w(line)6 b Fl(\()44 b Fv(const)d(c)m(har)j Fk(\003)p Ft(line)p Fl(,)d Fv(in)m(t)g Ft(len)50 b Fl(\))515 847 y Ft(sr)l(c)p 624 847 26 4 v 29 w(line)34 b Fu(stores)c(a)d Ft(line)34 b Fu(of)26 b(length)i Ft(len)p Fu(.)515 1063 y Fv(1.17.4)95 b Fm(sr)-5 b(c)p 981 1063 30 4 v 36 w(new)p 1179 1063 V 35 w(\014le)722 1216 y Fv(v)m(oid)42 b Ft(sr)l(c)p 1050 1216 V 34 w(new)p 1224 1216 V 34 w(\014le)6 b Fl(\()45 b Fv(const)c(c)m(har)i Fk(\003)p Ft(\014lename)51 b Fl(\))515 1388 y Ft(sr)l(c)p 624 1388 26 4 v 29 w(new)p 793 1388 V 31 w(\014le)34 b Fu(sp)r(eci\014es)d(that)d Ft(\014lename)35 b Fu(is)28 b(the)h(name)c(of)i(the)i(curren)n(t)h(\014le)e(b)r(eing)g(read)h(b)n (y)e(the)i(lexer.)515 1603 y Fv(1.17.5)95 b Fm(sr)-5 b(c)p 981 1603 30 4 v 36 w(new)p 1179 1603 V 35 w(line)722 1757 y Fv(v)m(oid)42 b Ft(sr)l(c)p 1050 1757 V 34 w(new)p 1224 1757 V 34 w(line)6 b Fl(\()44 b Fv(in)m(t)d Ft(line)49 b Fl(\))515 1928 y Ft(sr)l(c)p 624 1928 26 4 v 29 w(new)p 793 1928 V 31 w(line)38 b Fu(sp)r(eci\014es)e(that)d Ft(line)39 b Fu(is)32 b(the)i(n)n(um)n(b)r(er)d(of)g(the)j(curren)n(t)i (line)c(b)r(eing)g(read)i(b)n(y)e(the)i(lexer.)515 2027 y(Line)27 b(n)n(um)n(b)r(ers)g(start)i(at)f(1.)515 2243 y Fv(1.17.6)95 b Fm(sr)-5 b(c)p 981 2243 30 4 v 36 w(advanc)g(e)722 2396 y Fv(v)m(oid)42 b Ft(sr)l(c)p 1050 2396 V 34 w(advanc)l(e)6 b Fl(\()46 b Fv(in)m(t)41 b Ft(length)50 b Fl(\))515 2568 y Ft(sr)l(c)p 624 2568 26 4 v 29 w(advanc)l(e)36 b Fu(is)28 b(used)h(to)f(adv)-5 b(ance)29 b(the)g(tok)n(en)f(o\013set)h (p)r(oin)n(ter)g Ft(length)34 b Fu(b)n(ytes.)515 2783 y Fv(1.17.7)95 b Fm(sr)-5 b(c)p 981 2783 30 4 v 36 w(get)722 2937 y Ft(sr)l(c)p 831 2937 V 34 w(T)f(yp)l(e)50 b(sr)l(c)p 1189 2937 V 33 w(get)8 b Fl(\()44 b Fv(in)m(t)d Ft(length)50 b Fl(\))515 3108 y Ft(sr)l(c)p 624 3108 26 4 v 29 w(get)32 b Fu(is)24 b(used)i(to)e(get)h(a)f Ft(sr)l(c)p 1458 3108 V 30 w(T)-6 b(yp)l(e)30 b Fu(ob)5 b(ject)25 b(for)e(the)j(curren)n(t)h (tok)n(en.)35 b(This)25 b(ob)5 b(ject)25 b(con)n(tains)f(\014le,)g (line,)515 3207 y(o\013set,)j(and)f(length)f(information)c(whic)n(h)k (can)i(b)r(e)g(used)h(to)d(prin)n(t)h(parse)i(error)f(messages)g(and)e (pro)n(vide)515 3307 y(detailed)i(tok)n(en)h(trac)n(king.)515 3523 y Fv(1.17.8)95 b Fm(sr)-5 b(c)p 981 3523 30 4 v 36 w(\014lename)722 3676 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(sr)l(c)p 1357 3676 V 33 w(\014lename)6 b Fl(\()46 b Ft(sr)l(c)p 1878 3676 V 33 w(T)-6 b(yp)l(e)50 b(sour)l(c)l(e)g Fl(\))515 3847 y Ft(sr)l(c)p 624 3847 26 4 v 29 w(\014lename)35 b Fu(returns)c(the)e Ft(\014le)34 b Fu(asso)r(ciated)c(with)d(the)i(sp) r(eci\014ed)h Ft(sour)l(c)l(e)k Fu(information.)515 4063 y Fv(1.17.9)95 b Fm(sr)-5 b(c)p 981 4063 30 4 v 36 w(linenumb)g(er)722 4216 y Fv(in)m(t)41 b Ft(sr)l(c)p 989 4216 V 34 w(linenumb)l(er)9 b Fl(\()43 b Ft(sr)l(c)p 1609 4216 V 34 w(T)-6 b(yp)l(e)49 b(sour)l(c)l(e)h Fl(\))515 4387 y Ft(sr)l(c)p 624 4387 26 4 v 29 w(linenumb)l(er)37 b Fu(returns)30 b(the)f Ft(line)34 b Fu(asso)r(ciated)29 b(with)e(the)i(sp)r(eci\014ed)i Ft(sour)l(c)l(e)j Fu(information.)515 4603 y Fv(1.17.10)95 b Fm(sr)-5 b(c)p 1029 4603 30 4 v 36 w(o\013set)722 4756 y Fv(in)m(t)41 b Ft(sr)l(c)p 989 4756 V 34 w(o\013set)8 b Fl(\()44 b Ft(sr)l(c)p 1403 4756 V 34 w(T)-6 b(yp)l(e)50 b(sour)l(c)l(e)f Fl(\))515 4927 y Ft(sr)l(c)p 624 4927 26 4 v 29 w(o\013set)37 b Fu(returns)31 b(the)e(tok)n(en)f Ft(o\013set)36 b Fu(asso)r(ciated)30 b(with)d(the)i(sp)r(eci\014ed)i Ft(sour)l(c)l(e)i Fu(information.)2115 5255 y(30)p eop %%Page: 31 31 31 30 bop 515 523 a Fv(1.17.11)95 b Fm(sr)-5 b(c)p 1029 523 30 4 v 36 w(length)722 676 y Fv(in)m(t)41 b Ft(sr)l(c)p 989 676 V 34 w(length)6 b Fl(\()44 b Ft(sr)l(c)p 1423 676 V 34 w(T)-6 b(yp)l(e)49 b(sour)l(c)l(e)h Fl(\))515 847 y Ft(sr)l(c)p 624 847 26 4 v 29 w(length)35 b Fu(returns)30 b(the)f(tok)n(en)f Ft(length)35 b Fu(asso)r(ciated)29 b(with)e(the)i(sp)r(eci\014ed)i Ft(sour)l(c)l(e)j Fu(information.)515 1063 y Fv(1.17.12)95 b Fm(sr)-5 b(c)p 1029 1063 30 4 v 36 w(sour)g(c)g(e)p 1327 1063 V 34 w(line)722 1216 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(sr)l(c)p 1357 1216 V 33 w(sour)l(c)l(e)p 1614 1216 V 35 w(line)6 b Fl(\()44 b Ft(sr)l(c)p 1967 1216 V 33 w(T)-6 b(yp)l(e)50 b(sour)l(c)l(e)f Fl(\))515 1388 y Ft(sr)l(c)p 624 1388 26 4 v 29 w(sour)l(c)l(e)p 877 1388 V 31 w(line)31 b Fu(returns)e(the)e(full)d(source)k(line)d(asso)r(ciated)i(with)f(the)h (sp)r(eci\014ed)i Ft(sour)l(c)l(e)j Fu(information.)515 1603 y Fv(1.17.13)95 b Fm(sr)-5 b(c)p 1029 1603 30 4 v 36 w(get)p 1185 1603 V 35 w(stats)722 1757 y Ft(sr)l(c)p 831 1757 V 34 w(Stats)51 b(sr)l(c)p 1198 1757 V 33 w(get)p 1335 1757 V 35 w(stats)7 b Fl(\()43 b Fv(v)m(oid)f Fl(\))515 1928 y Ft(sr)l(c)p 624 1928 26 4 v 29 w(get)p 757 1928 V 31 w(stats)35 b Fu(returns)d(the)e(statistics)g(asso)r(ciated)h(with) d(the)i(source)h(co)r(de)g(manager.)37 b(The)29 b Ft(sr)l(c)p 3596 1928 V 30 w(Stats)515 2027 y Fu(structure)j(is)27 b(sho)n(wn)h(in)f(Figure)h(6.)722 2243 y Fv(t)m(yp)s(edef)49 b(struct)41 b Ft(sr)l(c)p 1485 2243 30 4 v 33 w(Stats)51 b Fk(f)853 2342 y Fv(in)m(t)41 b Ft(lines)p 1182 2342 V 34 w(use)l(d)9 b Fl(;)719 b Fc(=)p Fk(\003)27 b Fu(Lines)h(used)i Fk(\003)p Fc(=)853 2442 y Fv(in)m(t)41 b Ft(lines)p 1182 2442 V 34 w(al)t(lo)l(c)l(ate)l(d)9 b Fl(;)565 b Fc(=)p Fk(\003)27 b Fu(Lines)h(allo)r(cated)f Fk(\003)p Fc(=)853 2542 y Fv(in)m(t)41 b Ft(lines)p 1182 2542 V 34 w(bytes)7 b Fl(;)697 b Fc(=)p Fk(\003)27 b Fu(Bytes)j(required)g(to)d(store)j (lines)d Fk(\003)p Fc(=)853 2641 y Fv(in)m(t)41 b Ft(tokens)p 1242 2641 V 35 w(total)9 b Fl(;)650 b Fc(=)p Fk(\003)27 b Fu(T)-7 b(ok)n(ens)28 b(used)i Fk(\003)p Fc(=)853 2741 y Fv(in)m(t)41 b Ft(tokens)p 1242 2741 V 35 w(r)l(euse)l(d)9 b Fl(;)588 b Fc(=)p Fk(\003)27 b Fu(T)-7 b(ok)n(ens)28 b(reused)j Fk(\003)p Fc(=)853 2841 y Fv(in)m(t)41 b Ft(tokens)p 1242 2841 V 35 w(size)6 b Fl(;)683 b Fc(=)p Fk(\003)27 b Fu(Size)h(of)f(a)g(tok)n(en)h(information)22 b(ob)5 b(ject)28 b Fk(\003)p Fc(=)722 2940 y Fk(g)43 b(\003)p Ft(sr)l(c)p 958 2940 V 34 w(Stats)7 b Fl(;)1816 3123 y Fu(Figure)28 b(6:)35 b Ft(sr)l(c)p 2288 3123 26 4 v 30 w(Stats)515 3521 y Fv(1.17.14)95 b Fm(sr)-5 b(c)p 1029 3521 30 4 v 36 w(print)p 1273 3521 V 33 w(stats)722 3674 y Fv(v)m(oid)42 b Ft(sr)l(c)p 1050 3674 V 34 w(print)p 1262 3674 V 34 w(stats)7 b Fl(\()43 b Ft(FILE)54 b Fk(\003)p Ft(str)l(e)l(am)48 b Fl(\))515 3846 y Ft(sr)l(c)p 624 3846 26 4 v 29 w(print)p 831 3846 V 30 w(stats)35 b Fu(prin)n(ts)29 b(the)h(statistics)h(ab)r(out)d(the)i(source)i(co)r(de)e(manager)c(to)i (the)i(sp)r(eci\014ed)i Ft(str)l(e)l(am)p Fu(.)515 3945 y(If)27 b Ft(str)l(e)l(am)32 b Fu(is)c Fv(NULL)p Fu(,)e(then)j Fv(stdout)23 b Fu(will)i(b)r(e)k(used.)515 4161 y Fv(1.17.15)95 b Fm(sr)-5 b(c)p 1029 4161 30 4 v 36 w(print)p 1273 4161 V 33 w(line)722 4314 y Fv(v)m(oid)42 b Ft(sr)l(c)p 1050 4314 V 34 w(print)p 1262 4314 V 34 w(line)6 b Fl(\()43 b Ft(FILE)54 b Fk(\003)p Ft(str)l(e)l(am)p Fl(,)41 b Ft(sr)l(c)p 2206 4314 V 34 w(T)-6 b(yp)l(e)49 b(sour)l(c)l(e)h Fl(\))515 4485 y Ft(sr)l(c)p 624 4485 26 4 v 29 w(print)p 831 4485 V 30 w(line)32 b Fu(prin)n(ts)26 b(a)g(line)f(of)g(source)k (co)r(de,)e(as)f(describ)r(ed)k(b)n(y)25 b Ft(sour)l(c)l(e)32 b Fu(to)26 b(the)h(sp)r(eci\014ed)j Ft(str)l(e)l(am)p Fu(.)k(If)515 4585 y Ft(str)l(e)l(am)e Fu(is)c Fv(NULL)p Fu(,)e(then)j Fv(stdout)23 b Fu(will)i(b)r(e)k(used.)2115 5255 y(31)p eop %%Page: 32 32 32 31 bop 515 523 a Fv(1.17.16)95 b Fm(sr)-5 b(c)p 1029 523 30 4 v 36 w(p)g(arse)p 1286 523 V 34 w(err)g(or)722 676 y Fv(v)m(oid)42 b Ft(sr)l(c)p 1050 676 V 34 w(p)l(arse)p 1272 676 V 34 w(err)l(or)9 b Fl(\()41 b Ft(FILE)55 b Fk(\003)p Ft(str)l(e)l(am)p Fl(,)40 b Ft(sr)l(c)p 2269 676 V 34 w(T)-6 b(yp)l(e)50 b(sour)l(c)l(e)p Fl(,)42 b Fv(const)g(c)m(har)h Fk(\003)p Ft(message)50 b Fl(\))515 847 y Ft(sr)l(c)p 624 847 26 4 v 29 w(p)l(arse)p 841 847 V 31 w(err)l(or)26 b Fu(will)17 b(prin)n(t)j(the)i(error)g Ft(message)27 b Fu(to)20 b(the)h(sp)r(eci\014ed)j Ft(str)l(e)l(am)p Fu(,)19 b(follo)n(w)n(ed)e(b)n(y)j(the)h(o\013ending)515 947 y(line)27 b(of)f(source)k(co)r(de,)f(as)f(sp)r(eci\014ed)j(b)n(y)c Ft(sour)l(c)l(e)p Fu(.)36 b(If)27 b Ft(str)l(e)l(am)32 b Fu(is)c Fv(NULL)p Fu(,)e(then)j Fv(stdout)23 b Fu(will)i(b)r(e)k (used.)639 1047 y(It)23 b(is)f(assumed)g(that)g Ft(message)30 b Fu(has)22 b(the)i(format)19 b(of)i Ft(yyerr)l(or)29 b Fu(so)23 b(that)g(massaging)18 b(of)j(the)j(string)e(can)515 1146 y(b)r(e)30 b(p)r(erformed)f(to)g(mak)n(e)e(it)h(more)g(readable)i (\(tok)n(en)g(names)e(are)i(assumed)e(to)i(start)g(with)f(\\T)p 3570 1146 25 4 v 29 w(")g(and)515 1246 y(will)21 b(b)r(e)26 b(c)n(hanged)f(to)e(more)g(readable)i(names\).)33 b(This)24 b(massaging)c(should)k(b)r(e)h(done)g(b)n(y)f(a)g(user-de\014ned)515 1346 y(function,)i(since)j(it)e(is)h(relativ)n(ely)e(sp)r(eci\014c)31 b(to)c(this)h(author's)g(co)r(ding)f(con)n(v)n(en)n(tions.)515 1561 y Fv(1.17.17)95 b Fm(sr)-5 b(c)p 1029 1561 30 4 v 36 w(print)p 1273 1561 V 33 w(err)g(or)722 1715 y Fv(v)m(oid)42 b Ft(sr)l(c)p 1050 1715 V 34 w(print)p 1262 1715 V 34 w(err)l(or)9 b Fl(\()41 b Ft(FILE)54 b Fk(\003)p Ft(str)p Fl(,)41 b Ft(sr)l(c)p 2119 1715 V 33 w(T)-6 b(yp)l(e)50 b(sour)l(c)l(e)p Fl(,)42 b Fv(const)g(c)m(har)h Fk(\003)p Ft(format)p Fl(,)e(.)13 b(.)g(.)43 b(\))515 1886 y Ft(sr)l(c)p 624 1886 26 4 v 29 w(print)p 831 1886 V 30 w(err)l(or)35 b Fu(will)26 b(prin)n(t)i(an)h(arbitrary)f(error,)i(sp)r(eci\014ed)i (as)d(for)f Ft(printf)45 b Fu(b)n(y)29 b(the)h Ft(format)35 b Fu(v)-5 b(ariable,)515 1985 y(to)27 b(the)i(sp)r(eci\014ed)i Ft(str)l(e)l(am)p Fu(,)25 b(follo)n(w)n(ed)f(b)n(y)k(the)g(line)f(of)g (source)j(co)r(de)f(sp)r(eci\014ed)i(b)n(y)c Ft(sour)l(c)l(e)p Fu(.)36 b(If)27 b Ft(str)l(e)l(am)32 b Fu(is)515 2085 y Fv(NULL)p Fu(,)25 b(then)30 b Fv(stdout)23 b Fu(will)i(b)r(e)k(used.) 515 2301 y Fv(1.17.18)95 b Fm(sr)-5 b(c)p 1029 2301 30 4 v 36 w(print)p 1273 2301 V 33 w(message)722 2454 y Fv(v)m(oid)42 b Ft(sr)l(c)p 1050 2454 V 34 w(print)p 1262 2454 V 34 w(message)6 b Fl(\()44 b Ft(FILE)55 b Fk(\003)p Ft(str)p Fl(,)40 b Ft(sr)l(c)p 2227 2454 V 34 w(T)-6 b(yp)l(e)50 b(sour)l(c)l(e)p Fl(,)42 b Fv(const)g(c)m(har)h Fk(\003)p Ft(format)p Fl(,)e(.)13 b(.)g(.)42 b(\))515 2625 y Ft(sr)l(c)p 624 2625 26 4 v 29 w(print)p 831 2625 V 30 w(message)35 b Fu(will)24 b(just)29 b(prin)n(t)e(a)g(message)g (lab)r(eled)h(with)f(a)g(line.)515 2858 y Fn(1.18)111 b(Stac)m(k)37 b(Routines)515 3011 y Fu(The)29 b(stac)n(k)g(routines)g (pro)n(vide)f(supp)r(ort)i(for)d(a)h(general)g(stac)n(k)h(of)e(p)r(oin) n(ters)j(to)e Fv(v)m(oid)p Fu(.)35 b(Because)d(of)27 b(the)515 3110 y(simplicit)n(y)19 b(of)24 b(the)i(stac)n(k)f(ob)5 b(ject,)25 b(no)f(statistics)i(are)g(main)n(tained.)k(\(Although)n(t)24 b(the)i(list)e(routines)h(can)515 3210 y(also)h(b)r(e)j(used)h(as)e(a)f (stac)n(k,)h(the)h(stac)n(k)f(implemen)n(ted)23 b(here)31 b(is)c(more)f(e\016cien)n(t.\))515 3426 y Fv(1.18.1)95 b Fm(stk)p 976 3426 30 4 v 36 w(cr)-5 b(e)g(ate)722 3579 y Ft(stk)p 827 3579 V 35 w(Stack)53 b(stk)p 1207 3579 V 35 w(cr)l(e)l(ate)6 b Fl(\()43 b Fv(v)m(oid)f Fl(\))515 3750 y Ft(stk)p 620 3750 26 4 v 30 w(cr)l(e)l(ate)33 b Fu(initializes)25 b(a)j(stac)n(k)g(ob)5 b(ject.)515 3966 y Fv(1.18.2)95 b Fm(stk)p 976 3966 30 4 v 36 w(destr)-5 b(oy)722 4119 y Fv(v)m(oid)42 b Ft(stk)p 1046 4119 V 34 w(destr)l(oy)7 b Fl(\()44 b Ft(stk)p 1519 4119 V 35 w(Stack)53 b(stack)g Fl(\))515 4290 y Ft(stk)p 620 4290 26 4 v 30 w(destr)l(oy)31 b Fu(destro)n(ys)26 b(all)c(memory)d(asso)r (ciated)25 b(with)f(the)h Ft(stack)p Fu(.)35 b(The)25 b(memory)19 b(used)26 b(b)n(y)d(data)h(is)f Ft(not)515 4390 y Fu(freed|this)28 b(memory)23 b(is)28 b(the)h(resp)r(onsibilit)n (y)e(of)f(the)j(user.)515 4606 y Fv(1.18.3)95 b Fm(stk)p 976 4606 30 4 v 36 w(push)722 4759 y Fv(v)m(oid)42 b Ft(stk)p 1046 4759 V 34 w(push)6 b Fl(\()46 b Ft(stk)p 1426 4759 V 35 w(Stack)53 b(stack)p Fl(,)43 b Fv(v)m(oid)f Fk(\003)p Ft(datum)50 b Fl(\))515 4930 y Ft(stk)p 620 4930 26 4 v 30 w(push)35 b Fu(places)29 b Ft(datum)35 b Fu(on)28 b(the)h(top)e(of)g(the)i Ft(stack)p Fu(.)2115 5255 y(32)p eop %%Page: 33 33 33 32 bop 515 523 a Fv(1.18.4)95 b Fm(stk)p 976 523 30 4 v 36 w(p)-5 b(op)722 676 y Fv(v)m(oid)42 b Fk(\003)p Ft(stk)p 1088 676 V 34 w(p)l(op)5 b Fl(\()45 b Ft(stk)p 1426 676 V 35 w(Stack)53 b(stack)g Fl(\))515 847 y Ft(stk)p 620 847 26 4 v 30 w(p)l(op)32 b Fu(remo)n(v)n(es)26 b(the)h(top)f(of)f (the)j Ft(stack)35 b Fu(and)26 b(returns)j(the)f(p)r(oin)n(ter.)36 b(If)25 b(the)j Ft(stack)35 b Fu(is)26 b(empt)n(y)-7 b(,)24 b Ft(stk)p 3651 847 V 30 w(p)l(op)515 947 y Fu(returns)31 b Fv(NULL)p Fu(.)515 1163 y Fv(1.18.5)95 b Fm(stk)p 976 1163 30 4 v 36 w(top)722 1316 y Fv(v)m(oid)42 b Fk(\003)p Ft(stk)p 1088 1316 V 34 w(top)5 b Fl(\()45 b Ft(stk)p 1416 1316 V 34 w(Stack)54 b(stack)e Fl(\))515 1487 y Ft(stk)p 620 1487 26 4 v 30 w(top)38 b Fu(returns)d(a)c(p)r(oin)n(ter)i (to)f(the)h(datum)c(on)j(the)h(top)f(of)f(the)i Ft(stack)p Fu(,)g(but)f(do)r(es)i Ft(not)41 b Fu(remo)n(v)n(e)30 b(this)515 1587 y(datum)25 b(from)f(the)29 b Ft(stack)p Fu(.)36 b(If)27 b(the)i Ft(stack)37 b Fu(is)28 b(empt)n(y)-7 b(,)24 b Ft(stk)p 2258 1587 V 31 w(p)l(op)34 b Fu(returns)d Fv(NULL)p Fu(.)515 1819 y Fn(1.19)111 b(String)36 b(P)m(o)s(ol)i (Routines)515 1972 y Fu(These)e(routines)e(pro)n(vide)g(supp)r(ort)h (for)d(string)i(p)r(o)r(ol)e(ob)5 b(jects.)55 b(In)33 b(general,)i(only)d(the)i Ft(str)p 3463 1972 V 29 w(\014nd)44 b Fu(and)515 2072 y Ft(str)p 618 2072 V 29 w(\014ndn)27 b Fu(functions)19 b(will)d(b)r(e)k(used.)35 b(This)18 b(function)h(tak)n(es)g(a)f(p)r(oin)n(ter)h(to)g(a)f(n)n (ull-terminated)d(string)k(and)515 2172 y(returns)35 b(a)d(p)r(oin)n(ter)h(to)f(another)i(n)n(ull-terminated)29 b(string)k(whic)n(h)f(con)n(tains)g(the)i(same)d(information.)515 2271 y(The)c(p)r(oin)n(ter)f(returned)j(will)23 b(b)r(e)k(iden)n(tical) e(for)g(all)e(iden)n(tical)i(strings.)36 b(Memory)24 b(for)h(string)h(storage)h(is)515 2371 y(automatically)19 b(reclaimed)25 b(at)g(program)e(termination)f(on)k(systems)g(that)g (supp)r(ort)i Ft(atexit)34 b Fu(or)26 b Ft(on)p 3620 2371 V 31 w(exit)p Fu(.)515 2587 y Fv(1.19.1)95 b Fm(str)p 974 2587 30 4 v 36 w(p)-5 b(o)g(ol)p 1174 2587 V 33 w(cr)g(e)g(ate)722 2740 y Ft(str)p 825 2740 V 34 w(Po)l(ol)52 b(str)p 1167 2740 V 33 w(p)l(o)l(ol)p 1340 2740 V 35 w(cr)l(e)l(ate)6 b Fl(\()43 b Fv(v)m(oid)f Fl(\))515 2911 y Ft(str)p 618 2911 26 4 v 29 w(p)l(o)l(ol)p 787 2911 V 30 w(cr)l(e)l(ate)33 b Fu(initialized)25 b(a)i(string)h(p)r(o)r(ol)f(ob)5 b(ject.)515 3127 y Fv(1.19.2)95 b Fm(str)p 974 3127 30 4 v 36 w(p)-5 b(o)g(ol)p 1174 3127 V 33 w(destr)g(oy)722 3280 y Fv(v)m(oid)42 b Ft(str)p 1044 3280 V 33 w(p)l(o)l(ol)p 1217 3280 V 35 w(destr)l(oy)7 b Fl(\()44 b Ft(str)p 1689 3280 V 33 w(Po)l(ol)53 b(p)l(o)l(ol)f Fl(\))515 3451 y Ft(str)p 618 3451 26 4 v 29 w(p)l(o)l(ol)p 787 3451 V 30 w(destr)l(oy)35 b Fu(destro)n(ys)30 b(the)f(string)f(p)r(o)r(ol)e (ob)5 b(ject,)28 b Ft(p)l(o)l(ol)p Fu(,)f(and)g(all)e(memory)e(asso)r (ciated)30 b(with)d(it.)515 3667 y Fv(1.19.3)95 b Fm(str)p 974 3667 30 4 v 36 w(p)-5 b(o)g(ol)p 1174 3667 V 33 w(exists)722 3820 y Fv(in)m(t)41 b Ft(str)p 983 3820 V 33 w(p)l(o)l(ol)p 1156 3820 V 35 w(exists)7 b Fl(\()43 b Ft(str)p 1569 3820 V 34 w(Po)l(ol)52 b(p)l(o)l(ol)p Fl(,)43 b Fv(const)e(c)m(har)i Fk(\003)p Ft(s)50 b Fl(\))515 3991 y Ft(str)p 618 3991 26 4 v 29 w(p)l(o)l(ol)p 787 3991 V 30 w(exists)35 b Fu(returns)30 b(non-zero)f(if)d(the)j(string,)e Ft(s)p Fu(,)g(is)h(already)f(in)g(the)i(string)e(p)r(o)r(ol,)f Ft(p)l(o)l(ol)p Fu(.)515 4207 y Fv(1.19.4)95 b Fm(str)p 974 4207 30 4 v 36 w(p)-5 b(o)g(ol)p 1174 4207 V 33 w(\014nd)722 4360 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(str)p 1351 4360 V 33 w(p)l(o)l(ol)p 1524 4360 V 35 w(\014nd)9 b Fl(\()45 b Ft(str)p 1877 4360 V 33 w(Po)l(ol)53 b(p)l(o)l(ol)p Fl(,)42 b Fv(const)g(c)m(har)h Fk(\003)p Ft(s)50 b Fl(\))515 4532 y Ft(str)p 618 4532 26 4 v 29 w(p)l(o)l(ol)p 787 4532 V 30 w(\014nd)41 b Fu(lo)r(oks)30 b(up)g(the)i(string,)f Ft(s)p Fu(,)f(in)f(the)j(memory)26 b(asso)r(ciated)32 b(with)e(the)h(string)g(p)r(o)r(ol)e(ob)5 b(ject,)515 4631 y Ft(p)l(o)l(ol)p Fu(.)35 b(If)24 b(the)i(string)e(is)h(found,)e (a)i(p)r(oin)n(ter)g(to)f(the)i(previously)e(stored)j(string)e(is)f (returned.)39 b(Otherwise,)515 4731 y(the)28 b(string)g(is)f(copied)h (in)n(to)d(string)j(p)r(o)r(ol)e(memory)-7 b(,)21 b(and)27 b(a)g(p)r(oin)n(ter)h(to)f(the)h(newly)g(allo)r(cated)e(memory)515 4830 y(is)h(returned.)2115 5255 y(33)p eop %%Page: 34 34 34 33 bop 515 523 a Fv(1.19.5)95 b Fm(str)p 974 523 30 4 v 36 w(p)-5 b(o)g(ol)p 1174 523 V 33 w(c)g(opy)722 676 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(str)p 1351 676 V 33 w(p)l(o)l(ol)p 1524 676 V 35 w(c)l(opy)7 b Fl(\()45 b Ft(str)p 1899 676 V 33 w(Po)l(ol)53 b(p)l(o)l(ol)p Fl(,)42 b Fv(const)g(c)m(har)h Fk(\003)p Ft(s)50 b Fl(\))515 847 y Ft(str)p 618 847 26 4 v 29 w(p)l(o)l(ol)p 787 847 V 30 w(c)l(opy)31 b Fu(returns)26 b(a)c(cop)n(y)h(of)e(the)j(string,)f Ft(s)p Fu(,)g(using)f(memory)17 b(from)j(the)j(string)g(p)r(o)r(ol)f (ob)5 b(ject,)23 b Ft(p)l(o)l(ol)p Fu(.)515 947 y(This)k(can)h(b)r(e)g (used)h(for)e(data)f(that)i(is)f(kno)n(wn)f(to)h(b)r(e)i(unique.)36 b(No)27 b(c)n(hec)n(ks)j(are)e(made)d(for)h(uniqueness,)515 1047 y(ho)n(w)n(ev)n(er;)h(and)h(a)f(p)r(oin)n(ter)h(to)g(the)h(string) e(is)h(not)g(placed)g(in)f(the)i(hash)f(table.)515 1262 y Fv(1.19.6)95 b Fm(str)p 974 1262 30 4 v 36 w(p)-5 b(o)g(ol)p 1174 1262 V 33 w(c)g(opyn)722 1416 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(str)p 1351 1416 V 33 w(p)l(o)l(ol)p 1524 1416 V 35 w(c)l(opyn)6 b Fl(\()46 b Ft(str)p 1945 1416 V 33 w(Po)l(ol)52 b(p)l(o)l(ol)p Fl(,)43 b Fv(const)f(c)m(har)h Fk(\003)p Ft(s)p Fl(,)f Fv(in)m(t)f Ft(length)50 b Fl(\))515 1587 y Ft(str)p 618 1587 26 4 v 29 w(p)l(o)l(ol)p 787 1587 V 30 w(c)l(opyn)41 b Fu(returns)36 b(a)c(cop)n(y)h(of)e(the)j (string,)f Ft(s)p Fu(,)g(using)f(memory)c(from)h(the)34 b(string)f(p)r(o)r(ol)e(ob)5 b(ject,)515 1686 y Ft(p)l(o)l(ol)p Fu(.)34 b(The)25 b(string)f(will)d(b)r(e)k Ft(length)31 b Fu(b)n(ytes)25 b(long,)d(and)i(will)c(b)r(e)26 b Fv(NULL)c Fu(terminated.)34 b(This)24 b(can)g(b)r(e)h(used)515 1786 y(for)30 b(data)h(that)g(is)g(kno)n(wn)f(to)h(b)r(e)i(unique.)46 b(No)31 b(c)n(hec)n(ks)j(are)e(made)d(for)h(uniqueness,)k(ho)n(w)n(ev)n (er;)f(and)d(a)515 1886 y(p)r(oin)n(ter)e(to)f(the)i(string)f(is)g(not) f(placed)i(in)e(the)i(hash)f(table.)515 2101 y Fv(1.19.7)95 b Fm(str)p 974 2101 30 4 v 36 w(p)-5 b(o)g(ol)p 1174 2101 V 33 w(gr)g(ow)722 2255 y Fv(v)m(oid)42 b Ft(str)p 1044 2255 V 33 w(p)l(o)l(ol)p 1217 2255 V 35 w(gr)l(ow)9 b Fl(\()42 b Ft(str)p 1601 2255 V 34 w(Po)l(ol)52 b(p)l(o)l(ol)p Fl(,)43 b Fv(const)e(c)m(har)i Fk(\003)p Ft(s)p Fl(,)g Fv(in)m(t)d Ft(length)50 b Fl(\))515 2426 y Ft(str)p 618 2426 26 4 v 29 w(p)l(o)l(ol)p 787 2426 V 30 w(gr)l(ow)41 b Fu(will)30 b(gro)n(w)j(a)g(string)g(in)g(the)h(sp)r(eci\014ed)i Ft(p)l(o)l(ol)42 b Fu(un)n(til)32 b Ft(str)p 2784 2426 V 29 w(p)l(o)l(ol)p 2953 2426 V 31 w(\014nish)40 b Fu(is)33 b(called.)53 b(There)515 2525 y(m)n(ust)33 b(not)j(b)r(e)h(an)n(y)e (other)i(calls)e(to)g(mo)r(dify)c(the)37 b(sp)r(eci\014ed)i(string)d Ft(p)l(o)l(ol)44 b Fu(b)r(et)n(w)n(een)39 b(the)e(\014rst)g(call)d(to) 515 2625 y Ft(str)p 618 2625 V 29 w(p)l(o)l(ol)p 787 2625 V 30 w(gr)l(ow)i Fu(and)27 b(the)i(call)d(to)i Ft(str)p 1677 2625 V 29 w(p)l(o)l(ol)p 1846 2625 V 30 w(\014nish)p Fu(.)515 2841 y Fv(1.19.8)95 b Fm(str)p 974 2841 30 4 v 36 w(p)-5 b(o)g(ol)p 1174 2841 V 33 w(\014nish)722 2994 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(str)p 1351 2994 V 33 w(p)l(o)l(ol)p 1524 2994 V 35 w(\014nish)6 b Fl(\()45 b Ft(str)p 1934 2994 V 33 w(Po)l(ol)53 b(p)l(o)l(ol)f Fl(\))515 3165 y Ft(str)p 618 3165 26 4 v 29 w(p)l(o)l(ol)p 787 3165 V 30 w(\014nish)31 b Fu(will)21 b(\014nish)j(the)h(gro)n(wth)e (of)f(a)h(string)h(p)r(erformed)f(b)n(y)g(m)n(ultiple)c(calls)j(to)i Ft(str)p 3415 3165 V 29 w(p)l(o)l(ol)p 3584 3165 V 30 w(gr)l(ow)p Fu(.)515 3265 y(The)g(string)f(will)e(b)r(e)j(n)n(ull)d (terminated)i(and)f(will)f(b)r(e)j(en)n(tered)j(in)n(to)22 b(the)i(sp)r(eci\014ed)j(string)c Ft(p)l(o)l(ol)p Fu(.)35 b(Calls)21 b(to)515 3365 y Ft(str)p 618 3365 V 29 w(p)l(o)l(ol)p 787 3365 V 30 w(gr)l(ow)32 b Fu(follo)n(ws)22 b(b)n(y)i(a)g(call)f(to)h Ft(str)p 1810 3365 V 30 w(p)l(o)l(ol)p 1980 3365 V 30 w(\014nish)32 b Fu(is)25 b(equiv)-5 b(alen)n(t)24 b(to)g(a)g(single)g (call)f(to)h Ft(str)p 3445 3365 V 30 w(p)l(o)l(ol)p 3615 3365 V 30 w(\014nd)p Fu(.)515 3580 y Fv(1.19.9)95 b Fm(str)p 974 3580 30 4 v 36 w(p)-5 b(o)g(ol)p 1174 3580 V 33 w(get)p 1327 3580 V 36 w(stats)722 3734 y Ft(str)p 825 3734 V 34 w(Stats)50 b(str)p 1185 3734 V 34 w(p)l(o)l(ol)p 1359 3734 V 34 w(get)p 1497 3734 V 35 w(stats)7 b Fl(\()43 b Ft(str)p 1878 3734 V 34 w(Po)l(ol)52 b(p)l(o)l(ol)g Fl(\))515 3905 y Ft(str)p 618 3905 26 4 v 29 w(p)l(o)l(ol)p 787 3905 V 30 w(get)p 921 3905 V 31 w(stats)36 b Fu(returns)d (statistics)f(ab)r(out)e(the)h(sp)r(eci\014ed)i(string)e Ft(p)l(o)l(ol)p Fu(.)43 b(The)30 b Ft(str)p 3231 3905 V 30 w(Stats)37 b Fu(structure)515 4004 y(is)27 b(sho)n(wn)h(in)f (Figure)h(7.)515 4220 y Fv(1.19.10)95 b Fm(str)p 1022 4220 30 4 v 35 w(p)-5 b(o)g(ol)p 1221 4220 V 34 w(print)p 1463 4220 V 33 w(stats)722 4373 y Fv(v)m(oid)42 b Ft(str)p 1044 4373 V 33 w(p)l(o)l(ol)p 1217 4373 V 35 w(print)p 1430 4373 V 34 w(stats)7 b Fl(\()43 b Ft(str)p 1810 4373 V 34 w(Po)l(ol)52 b(p)l(o)l(ol)p Fl(,)43 b Ft(FILE)54 b Fk(\003)p Ft(str)l(e)l(am)48 b Fl(\))515 4544 y Ft(str)p 618 4544 26 4 v 29 w(p)l(o)l(ol)p 787 4544 V 30 w(print)p 995 4544 V 30 w(stats)32 b Fu(prin)n(ts)27 b(the)g(statistics)h(for)e (the)h(sp)r(eci\014ed)i(string)d Ft(p)l(o)l(ol)35 b Fu(on)26 b(the)h(sp)r(eci\014ed)i Ft(str)l(e)l(am)p Fu(.)515 4644 y(If)e Ft(str)l(e)l(am)32 b Fu(is)c Fv(NULL)p Fu(,)e(then)j Fv(stdout)23 b Fu(will)i(b)r(e)k(used.)2115 5255 y(34)p eop %%Page: 35 35 35 34 bop 722 540 a Fv(t)m(yp)s(edef)49 b(struct)41 b Ft(str)p 1479 540 30 4 v 33 w(Stats)50 b Fk(f)853 639 y Fv(in)m(t)41 b Ft(c)l(ount)8 b Fl(;)880 b Fc(=)p Fk(\003)27 b Fu(Num)n(b)r(er)g(of)f(strings)j(created)i Fk(\003)p Fc(=)853 739 y Fv(in)m(t)41 b Ft(bytes)7 b Fl(;)897 b Fc(=)p Fk(\003)27 b Fu(Num)n(b)r(er)g(of)f(b)n(ytes)j(allo)r(cated)e Fk(\003)p Fc(=)853 839 y Fv(in)m(t)41 b Ft(r)l(etrievals)7 b Fl(;)741 b Fc(=)p Fk(\003)27 b Fu(T)-7 b(otal)26 b(n)n(um)n(b)r(er)g (of)h(retriev)-5 b(als)29 b Fk(\003)p Fc(=)853 938 y Fv(in)m(t)41 b Ft(hits)7 b Fl(;)945 b Fc(=)p Fk(\003)27 b Fu(Num)n(b)r(er)g(of)f(retriev)-5 b(als)29 b(from)c(top)i(of)g(a)g (list)g Fk(\003)p Fc(=)853 1038 y Fv(in)m(t)41 b Ft(misses)7 b Fl(;)841 b Fc(=)p Fk(\003)27 b Fu(Num)n(b)r(er)g(of)f(unsuccessful)32 b(retriev)-5 b(als)29 b Fk(\003)p Fc(=)722 1137 y Fk(g)43 b(\003)p Ft(str)p 952 1137 V 33 w(Stats)7 b Fl(;)1819 1320 y Fu(Figure)28 b(7:)36 b Ft(str)p 2286 1320 26 4 v 29 w(Stats)515 1668 y Fv(1.19.11)95 b Fm(str)p 1022 1668 30 4 v 35 w(exists)722 1822 y Fv(in)m(t)41 b Ft(str)p 983 1822 V 33 w(exists)7 b Fl(\()44 b Fv(const)d(c)m(har)i Fk(\003)p Ft(s)50 b Fl(\))515 1993 y Ft(str)p 618 1993 26 4 v 29 w(exists)34 b Fu(acts)29 b(lik)n(e)d Ft(str)p 1300 1993 V 29 w(p)l(o)l(ol)p 1469 1993 V 31 w(exists)p Fu(,)g(except)31 b(the)e(global)24 b(string)k(p)r(o)r(ol)f(is)g(used.) 515 2208 y Fv(1.19.12)95 b Fm(str)p 1022 2208 30 4 v 35 w(\014nd)722 2362 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(str)p 1351 2362 V 33 w(\014nd)9 b Fl(\()45 b Fv(const)d(c)m(har)h Fk(\003)p Ft(s)50 b Fl(\))515 2533 y Ft(str)p 618 2533 26 4 v 29 w(\014nd)c Fu(acts)36 b(lik)n(e)e Ft(str)p 1263 2533 V 29 w(p)l(o)l(ol)p 1432 2533 V 31 w(\014nd)p Fu(,)k(except)g(the)f(global)32 b(string)k(p)r(o)r(ol)e(is)h(used.)61 b(If)35 b(the)i(global)32 b(string)515 2632 y(p)r(o)r(ol)27 b(has)j(not)e(b)r(een)j(initialized,)26 b(it)i(will)e(b)r(e)k (initialized)c(automatically)-7 b(.)33 b(F)-7 b(urther,)31 b(on)e(systems)g(that)515 2732 y(supp)r(ort)g Ft(atexit)35 b Fu(or)28 b Ft(on)p 1252 2732 V 32 w(exit)p Fu(,)e Ft(str)p 1562 2732 V 29 w(destr)l(oy)35 b Fu(will)25 b(b)r(e)k(called)e (automatically)22 b(at)27 b(program)e(termination.)515 2948 y Fv(1.19.13)95 b Fm(str)p 1022 2948 30 4 v 35 w(\014ndn)722 3101 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(str)p 1351 3101 V 33 w(\014ndn)6 b Fl(\()47 b Fv(const)41 b(c)m(har)i Fk(\003)p Ft(s)p Fl(,)f Fv(in)m(t)f Ft(length)50 b Fl(\))515 3272 y Ft(str)p 618 3272 26 4 v 29 w(\014ndn)39 b Fu(acts)31 b(lik)n(e)e Ft(str)p 1292 3272 V 29 w(\014nd)p Fu(,)j(except)h(that)d (the)i(length)e(of)f(the)j(string)e(is)g(sp)r(eci\014ed,)j(and)d(the)i (string)515 3372 y(do)r(es)d(not)f(ha)n(v)n(e)f(to)g(b)r(e)i Fv(NULL)e Fu(terminated.)515 3588 y Fv(1.19.14)95 b Fm(str)p 1022 3588 30 4 v 35 w(c)-5 b(opy)722 3741 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(str)p 1351 3741 V 33 w(c)l(opy)7 b Fl(\()45 b Fv(const)d(c)m(har)h Fk(\003)p Ft(s)50 b Fl(\))515 3912 y Ft(str)p 618 3912 26 4 v 29 w(c)l(opy)41 b Fu(acts)34 b(lik)n(e)d Ft(str)p 1277 3912 V 29 w(p)l(o)l(ol)p 1446 3912 V 31 w(c)l(opy)p Fu(,)j(except)h(the)f(global)29 b(string)k(p)r(o)r(ol)f(is)g(used.)53 b(If)32 b(the)h(global)d(string) 515 4012 y(p)r(o)r(ol)d(has)j(not)e(b)r(een)j(initialized,)26 b(it)i(will)e(b)r(e)k(initialized)c(automatically)-7 b(.)33 b(F)-7 b(urther,)31 b(on)e(systems)g(that)515 4111 y(supp)r(ort)g Ft(atexit)35 b Fu(or)28 b Ft(on)p 1252 4111 V 32 w(exit)p Fu(,)e Ft(str)p 1562 4111 V 29 w(destr)l(oy)35 b Fu(will)25 b(b)r(e)k(called)e(automatically)22 b(at)27 b(program)e(termination.)515 4327 y Fv(1.19.15)95 b Fm(str)p 1022 4327 30 4 v 35 w(c)-5 b(opyn)722 4480 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(str)p 1351 4480 V 33 w(c)l(opyn)6 b Fl(\()46 b Fv(const)41 b(c)m(har)j Fk(\003)p Ft(s)p Fl(,)e Fv(in)m(t)e Ft(length)51 b Fl(\))515 4651 y Ft(str)p 618 4651 26 4 v 29 w(c)l(opyn)35 b Fu(acts)29 b(lik)n(e)c Ft(str)p 1306 4651 V 30 w(c)l(opy)p Fu(,)i(except)j(that)d (the)i(length)e(of)f(the)j(string)e(is)g(sp)r(eci\014ed,)i(and)e(the)i (string)515 4751 y(do)r(es)g(not)f(ha)n(v)n(e)f(to)g(b)r(e)i Fv(NULL)e Fu(terminated.)2115 5255 y(35)p eop %%Page: 36 36 36 35 bop 515 523 a Fv(1.19.16)95 b Fm(str)p 1022 523 30 4 v 35 w(gr)-5 b(ow)722 676 y Fv(v)m(oid)42 b Ft(str)p 1044 676 V 33 w(gr)l(ow)9 b Fl(\()43 b Fv(const)e(c)m(har)i Fk(\003)p Ft(s)p Fl(,)f Fv(in)m(t)f Ft(length)50 b Fl(\))515 847 y Ft(str)p 618 847 26 4 v 29 w(gr)l(ow)38 b Fu(will)27 b(gro)n(w)j(a)g(string)g(un)n(til)f Ft(str)p 1823 847 V 29 w(\014nish)38 b Fu(is)30 b(called.)44 b(There)33 b(m)n(ust)28 b(not)j(b)r(e)g(an)n(y)f(other)i(calls)d(to)515 947 y(mo)r(dify)23 b(the)29 b(global)24 b(string)k(p)r(o)r(ol)f(b)r(et) n(w)n(een)j(the)f(\014rst)h(call)c(to)h Ft(str)p 2593 947 V 29 w(gr)l(ow)35 b Fu(and)28 b(the)h(call)d(to)i Ft(str)p 3482 947 V 29 w(\014nish)p Fu(.)515 1163 y Fv(1.19.17)95 b Fm(str)p 1022 1163 30 4 v 35 w(\014nish)722 1316 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(str)p 1351 1316 V 33 w(\014nish)6 b Fl(\()45 b Fv(v)m(oid)d Fl(\))515 1487 y Ft(str)p 618 1487 26 4 v 29 w(\014nish)g Fu(will)31 b(\014nish)k(the)g(gro)n(wth)f(of)g(a)f(string)i(p)r(erformed)f(b)n(y)g (m)n(ultiple)c(calls)j(to)h Ft(str)p 3385 1487 V 29 w(gr)l(ow)p Fu(.)55 b(The)515 1587 y(string)30 b(will)d(b)r(e)k(n)n(ull)d (terminated)h(and)g(will)e(b)r(e)k(en)n(tered)j(in)n(to)28 b(the)j(global)c(string)j(p)r(o)r(ol)f(tables.)43 b(Calls)515 1686 y(to)27 b Ft(str)p 719 1686 V 29 w(gr)l(ow)35 b Fu(follo)n(ws)25 b(b)n(y)i(a)h(call)e(to)h Ft(str)p 1760 1686 V 29 w(\014nish)36 b Fu(is)27 b(equiv)-5 b(alen)n(t)27 b(to)h(a)f(single)g(call)f(to)i Ft(str)p 3250 1686 V 29 w(\014ndn)p Fu(.)515 1902 y Fv(1.19.18)95 b Fm(str)p 1022 1902 30 4 v 35 w(unique)722 2055 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(str)p 1351 2055 V 33 w(unique)6 b Fl(\()46 b Fv(const)41 b(c)m(har)i Fk(\003)p Ft(pr)l(e\014x)54 b Fl(\))515 2227 y Ft(str)p 618 2227 26 4 v 29 w(unique)38 b Fu(returns)c(a)d(unique)g(string)g(with)f(the)i(giv)n(en)e(pre\014x.) 46 b(This)31 b(is)g(not)f(the)i(most)d(prett)n(y)j(w)n(a)n(y)515 2326 y(to)25 b(generate)k(unique)d(strings,)h(and)e(should)h(b)r(e)h (impro)n(v)n(ed.)32 b(The)27 b(string)f(is)g(placed)h(in)e(the)i (string)f(p)r(o)r(ol)515 2426 y(and)h(do)r(es)i(not)f(need)i(to)d(b)r (e)i(freed.)515 2642 y Fv(1.19.19)95 b Fm(str)p 1022 2642 30 4 v 35 w(destr)-5 b(oy)722 2795 y Fv(v)m(oid)42 b Ft(str)p 1044 2795 V 33 w(destr)l(oy)7 b Fl(\()44 b Fv(v)m(oid)e Fl(\))515 2966 y Ft(str)p 618 2966 26 4 v 29 w(destr)l(oy)27 b Fu(frees)c(all)17 b(of)i(the)j(memory)15 b(asso)r(ciated)22 b(with)e(the)h(global)c(string)k(p)r(o)r(ol.)32 b(Since)21 b(this)f(function)515 3066 y(is)30 b(called)g(automatically) 25 b(at)30 b(program)e(termination)f(on)j(systems)h(that)g(supp)r(ort)i Ft(atexit)38 b Fu(or)31 b Ft(on)p 3620 3066 V 31 w(exit)p Fu(,)515 3165 y(there)f(should)d(b)r(e)j(no)d(need)j(to)d(call)f(this)i (function)f(explicitly)-7 b(.)639 3265 y(If)32 b(this)g(function)f(is)h (called)g(explicitly)-7 b(,)30 b(the)k(next)f(call)d(to)i Ft(str)p 2635 3265 V 29 w(\014nd)43 b Fu(will)29 b(re-initialize)h(the) j(global)515 3365 y(string)28 b(p)r(o)r(ol.)515 3580 y Fv(1.19.20)95 b Fm(str)p 1022 3580 30 4 v 35 w(get)p 1177 3580 V 36 w(stats)722 3734 y Ft(str)p 825 3734 V 34 w(Stats)50 b(str)p 1185 3734 V 34 w(get)p 1323 3734 V 34 w(stats)7 b Fl(\()44 b Fv(v)m(oid)d Fl(\))515 3905 y Ft(str)p 618 3905 26 4 v 29 w(get)p 751 3905 V 30 w(stats)29 b Fu(returns)c(statistics)f(ab)r(out)e(the)h(global)c(string)j(p)r(o)r (ol.)33 b(The)23 b Ft(str)p 2915 3905 V 29 w(Stats)29 b Fu(structure)e(is)22 b(sho)n(wn)515 4004 y(in)27 b(Figure)h(7.)515 4220 y Fv(1.19.21)95 b Fm(str)p 1022 4220 30 4 v 35 w(print)p 1265 4220 V 34 w(stats)722 4373 y Fv(v)m(oid)42 b Ft(str)p 1044 4373 V 33 w(print)p 1255 4373 V 34 w(stats)7 b Fl(\()43 b Ft(FILE)55 b Fk(\003)p Ft(str)l(e)l(am)48 b Fl(\))515 4544 y Ft(str)p 618 4544 26 4 v 29 w(print)p 825 4544 V 30 w(stats)43 b Fu(prin)n(ts)38 b(the)g(statistics)h(for)d(the)i (global)c(string)k(p)r(o)r(ol)e(on)g(the)j(sp)r(eci\014ed)h Ft(str)l(e)l(am)p Fu(.)63 b(If)515 4644 y Ft(str)l(e)l(am)32 b Fu(is)c Fv(NULL)p Fu(,)e(then)j Fv(stdout)23 b Fu(will)i(b)r(e)k (used.)2115 5255 y(36)p eop %%Page: 37 37 37 36 bop 515 523 a Fv(1.19.22)95 b Fm(txt)p 1018 523 30 4 v 36 w(soundex)722 676 y Fv(const)42 b(c)m(har)h Fk(\003)p Ft(txt)p 1347 676 V 34 w(soundex)10 b Fl(\()47 b Fv(const)41 b(c)m(har)i Fk(\003)p Ft(string)50 b Fl(\))515 847 y Fu(Giv)n(en)26 b(a)h(string,)g(return)j(\(in)e(a)f Ft(static)k Fu(bu\013er\),)e(the)g(Soundex)g(v)-5 b(alue)27 b(for)g(the)i(string.)639 947 y(The)40 b(basic)g(algorithm)34 b(for)39 b(the)h(soundex)h(routine)e(is)g(from)d(Donald)h(E.)i(Kn)n (uth's)h(THE)g(AR)-7 b(T)515 1047 y(OF)33 b(COMPUTER)h(PR)n(OGRAMMING,) c(V)-7 b(olume)29 b(3:)46 b(Sorting)32 b(and)g(Searc)n(hing)h (\(Addison-W)-7 b(esley)515 1146 y(Publishing)34 b(Co.,)h(1973,)f (pages)j(391)d(and)h(392\).)58 b(Kn)n(uth)37 b(notes)g(that)f(the)g (metho)r(d)e(w)n(as)i(originally)515 1246 y(describ)r(ed)i(b)n(y)d (Margaret)h(K.)f(Odell)f(and)h(Rob)r(ert)h(C.)e(Russell)h([US)f(P)n (aten)n(ts)j(1261167)32 b(\(1918\))h(and)515 1346 y(1435663)24 b(\(1922\)].)515 1578 y Fn(1.20)111 b(Timer)33 b(Supp)s(ort)515 1731 y Fu(These)21 b(routines)f(pro)n(vide)f(access)j(to)d(a)f (microsecond-resolution)g(time)e(that)j(can)h(b)r(e)g(used)h(for)d (pro\014ling.)515 1947 y Fv(1.20.1)95 b Fm(tim)p 1000 1947 V 35 w(start)722 2100 y Fv(v)m(oid)42 b Ft(tim)p 1068 2100 V 34 w(start)8 b Fl(\()42 b Fv(const)g(c)m(har)h Fk(\003)p Ft(name)50 b Fl(\))515 2271 y Fu(Start)28 b(the)h(named)d (timer.)515 2487 y Fv(1.20.2)95 b Fm(tim)p 1000 2487 V 35 w(stop)722 2640 y Fv(v)m(oid)42 b Ft(tim)p 1068 2640 V 34 w(stop)5 b Fl(\()44 b Fv(const)e(c)m(har)h Fk(\003)p Ft(name)50 b Fl(\))515 2812 y Fu(Stop)27 b(the)i(named)d (timer.)515 3027 y Fv(1.20.3)95 b Fm(tim)p 1000 3027 V 35 w(r)-5 b(eset)722 3181 y Fv(v)m(oid)42 b Ft(tim)p 1068 3181 V 34 w(r)l(eset)8 b Fl(\()42 b Fv(const)g(c)m(har)h Fk(\003)p Ft(name)50 b Fl(\))515 3352 y Fu(Reset)29 b(the)g(named)d (timer)f(to)j(zero)h(elapsed)g(time.)34 b(Use)29 b Ft(tim)p 2450 3352 26 4 v 30 w(start)34 b Fu(to)28 b(reset)j(the)e(start)g (time.)515 3567 y Fv(1.20.4)95 b Fm(tim)p 1000 3567 30 4 v 35 w(get)p 1155 3567 V 36 w(r)-5 b(e)g(al)722 3721 y Fv(double)39 b Ft(tim)p 1170 3721 V 34 w(get)p 1308 3721 V 35 w(r)l(e)l(al)9 b Fl(\()41 b Fv(const)h(c)m(har)h Fk(\003)p Ft(name)51 b Fl(\))515 3892 y Fu(Get)29 b(the)h(w)n(all)d (time)f(in)i(seconds)k(from)26 b(the)k(named)d(timer.)37 b(The)30 b(return)i(v)-5 b(alue)28 b(is)h(a)g Ft(double)36 b Fu(and)29 b(has)515 3991 y(microsecond)e(resolution)g(if)g(the)h (curren)n(t)j(system)d(pro)n(vides)g(that)g(accuracy)h(\(most)d (don't\).)515 4207 y Fv(1.20.5)95 b Fm(tim)p 1000 4207 V 35 w(get)p 1155 4207 V 36 w(user)722 4360 y Fv(double)39 b Ft(tim)p 1170 4360 V 34 w(get)p 1308 4360 V 35 w(user)9 b Fl(\()43 b Fv(const)f(c)m(har)h Fk(\003)p Ft(name)50 b Fl(\))515 4532 y Fu(Get)28 b(the)h(n)n(um)n(b)r(er)d(of)h(seconds)j (of)d(user)j(CPU)e(time.)2115 5255 y(37)p eop %%Page: 38 38 38 37 bop 515 523 a Fv(1.20.6)95 b Fm(tim)p 1000 523 30 4 v 35 w(get)p 1155 523 V 36 w(system)722 676 y Fv(double)39 b Ft(tim)p 1170 676 V 34 w(get)p 1308 676 V 35 w(system)6 b Fl(\()44 b Fv(const)d(c)m(har)i Fk(\003)p Ft(name)51 b Fl(\))515 847 y Fu(Get)28 b(the)h(n)n(um)n(b)r(er)d(of)h(seconds)j (of)d(system)g(CPU)i(time.)515 1063 y Fv(1.20.7)95 b Fm(tim)p 1000 1063 V 35 w(print)p 1243 1063 V 34 w(timer)722 1216 y Fv(v)m(oid)42 b Ft(tim)p 1068 1216 V 34 w(print)p 1280 1216 V 34 w(timer)9 b Fl(\()42 b Ft(FILE)54 b Fk(\003)p Ft(str)p Fl(,)40 b Fv(const)i(c)m(har)h Fk(\003)p Ft(name)51 b Fl(\))515 1388 y Fu(Prin)n(t)28 b(the)h(named)c(timer)h(v)-5 b(alues)28 b(to)f Ft(str)p Fu(.)35 b(The)29 b(format)24 b(is)j(similar)c(to)k Fv(time\(1\))p Fu(.)515 1603 y Fv(1.20.8)95 b Fm(tim)p 1000 1603 V 35 w(print)p 1243 1603 V 34 w(timers)722 1757 y Fv(v)m(oid)42 b Ft(tim)p 1068 1757 V 34 w(print)p 1280 1757 V 34 w(timers)7 b Fl(\()41 b Ft(FILE)55 b Fk(\003)p Ft(str)50 b Fl(\))515 1928 y Fu(Prin)n(t)28 b(all)d(the)k(timers)d(to)i Ft(str)p Fu(.)34 b(The)29 b(order)g(is)f(arbitary)-7 b(.)515 2144 y Fv(1.20.9)p 860 2144 V 131 w Fm(tim)p 1036 2144 V 35 w(shutdown)722 2297 y Fv(v)m(oid)p 946 2297 V 77 w Ft(tim)p 1103 2297 V 33 w(shutdown)6 b Fl(\()46 b Fv(v)m(oid)c Fl(\))515 2468 y Fu(F)-7 b(ree)21 b(all)16 b(memory)e(asso)r(ciated)21 b(with)d(the)i(timers.)31 b(This)19 b(function)f(is)h(called)f (automatically)13 b(at)18 b(program)515 2568 y(termination.)32 b(There)e(should)e(nev)n(er)h(b)r(e)g(a)f(need)h(to)f(call)e(this)i (function)f(in)g(user-lev)n(el)i(co)r(de.)2115 5255 y(38)p eop %%Page: 39 39 39 38 bop 515 523 a Fw(A)135 b(Maa)515 705 y Fu(When)23 b(Khep)r(er)9 b(_)-32 b(a)25 b(rose)g(up)f(out)f(of)f(the)i(w)n(atery)g (ab)n(yss)g(of)e(Nu,)h(he)h(created)j(Maa)22 b(as)h(a)g(foundation)e (up)r(on)515 805 y(whic)n(h)27 b(to)h(create)i(ev)n(erything)f(else)g ([Budge04,)d(pp.)h(295{8].)515 1079 y Fw(References)515 1261 y Fu([Aho88])38 b(Alfred)32 b(V.)e(Aho,)h(Ra)n(vi)e(Sethi,)j(and)e (Je\013rey)35 b(D.)30 b(Ullman.)41 b Ft(Compilers:)i(Principles,)32 b(T)-6 b(e)l(ch-)685 1361 y(niques,)31 b(and)g(T)-6 b(o)l(ols)p Fu(.)35 b(Addison-W)-7 b(esley)g(,)27 b(Reading,)e(MA,)i(1988.)515 1527 y([Budge04])40 b(E.)22 b(A.)h(W)-7 b(allis)19 b(Budge.)30 b Ft(The)25 b(go)l(ds)h(of)g(the)f(Egyptians)i(or)e(studies)g(in)h (Egyptian)g(mytholo)l(gy)p Fu(,)685 1626 y(v)n(olume)e(2.)36 b(Do)n(v)n(er)27 b(Publications,)f(1969.)515 1792 y([Kn)n(uth73])39 b(Donald)33 b(E.)i(Kn)n(uth.)60 b Ft(Sorting)37 b(and)h(Se)l(ar)l (ching)p Fu(,)f(v)n(olume)32 b(3)j(of)f(The)j(Art)f(of)e(Computer)685 1892 y(Programming.)29 b(Addison-W)-7 b(esley)g(,)28 b(Reading,)d(MA,)i(1973.)515 2058 y([Pugh90])39 b(William)21 b(Pugh.)39 b(Skip)28 b(lists:)38 b(a)28 b(probabilistic)f(alternativ)n (e)h(to)h(balanced)g(trees.)42 b Ft(Commu-)685 2158 y(nic)l(ations)31 b(of)e(the)h(A)n(CM)p Fu(,)c Fv(33)p Fu(\(6\):668{76,)d(June)29 b(1990.)2115 5255 y(39)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF libmaa-1.3.2/doc/libmaa.bib010064400017500000000000000023160611415633000147410ustar cheusovwheel@BOOK{faith:Aho88, AUTHOR = "Alfred V. {Aho} and Ravi {Sethi} and Jeffrey D. {Ullman}", TITLE = "Compilers: Principles, Techniques, and Tools", DATE = "1988", PUBLISHER = "Addison-Wesley, Reading, MA", SUBMITTER = "faith@proteus (Sun Jan 8 20:39:54 1995)", KEY = "Aho88"} @BOOK{faith:Budge04b, AUTHOR = "E. A. Wallis {Budge}", TITLE = "The gods of the Egyptians or studies in Egyptian mythology", VOLUME = "2", DATE = "1969", PUBLISHER = "Dover Publications", SUBMITTER = "faith@proteus (Sun Nov 19 11:03:09 1995)", KEY = "Budge04"} @BOOK{faith:Knuth73c, AUTHOR = "Donald E. {Knuth}", TITLE = "Sorting and Searching", DATE = "1973", PUBLISHER = "Addison-Wesley, Reading, MA", SERIES = "The Art of Computer Programming", VOLUME = "3", SUBMITTER = "faith@proteus (Sun Jan 8 20:30:28 1995)", KEY = "Knuth73"} @ARTICLE{faith:Pugh90, AUTHOR = "William {Pugh}", TITLE = "Skip lists: a probabilistic alternative to balanced trees", JOURNAL = "Communications of the ACM", VOLUME = "33", NUMBER = "6", DATE = "June 1990", PAGES = "668--76", SUBMITTER = "faith@proteus (Sun Feb 25 15:26:48 1996)", KEY = "Pugh90"} libmaa-1.3.2/doc/libmaa.tex010064400017500000000000000121710634050065500150110ustar cheusovwheel% user.tex -- User Manual for Libmaa % Created: Tue Jan 3 11:07:54 1995 by faith@cs.unc.edu % Revised: Wed May 21 00:49:39 1997 by faith@acm.org % Copyright 1995, 1997 Rickard E. Faith (faith@acm.org) % % 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., % 675 Mass Ave, Cambridge, MA 02139, USA. % % $Id: libmaa.tex,v 1.3 1997/05/21 05:01:33 faith Exp $ % \def\FileCreated{Tue Jan 3 11:07:54 1995} \def\FileRevised{Wed May 21 00:49:39 1997} \documentclass[draft]{article} \usepackage{xspace} %\usepackage{program} \usepackage{verbatim} \usepackage{lgrind} \usepackage{epic} \usepackage{eepicemu} \usepackage{outline} \usepackage{ifthen} \addtolength{\textwidth}{0.7in} \addtolength{\evensidemargin}{-0.7in} \DeclareFontShape{OT1}{cmtt}{bx}{n}{ <5><6><7><8>cmbtt8 <9>cmbtt9 <10><10.95><12><14.4><17.28><20.74><24.88>cmbtt10 }{} \DeclareFontShape{OT1}{cmr}{bx}{sc}{ <5><6><7><8><9><10><10.95><12> <14.4><17.28><20.74><24.88> cmbcsc10 }{} \newcommand{\prog}[1]{\texttt{#1}\xspace} \newcommand{\system}[1]{\textsc{#1}\xspace} %\newcommand{\keyword}[1]{\texttt{#1}\xspace} \newcommand{\figref}[1]{Fig.~\ref{#1}\xspace} \newcommand{\libmaa}{\textsc{libmaa}\xspace} \newcommand{\khepera}{\textsc{Khepera}\xspace} \newcommand{\kheperalong}{\textsc{Khepera} Transformation System\xspace} \newcommand{\Khepera}{Kheper\.a\xspace} \newcommand{\Ra}{R\=a\xspace} \newcommand{\Maa}{Maa\xspace} % systems \newcommand{\refine}{\system{Refine}} \newcommand{\dtre}{\system{dtre3}} \newcommand{\eli}{\system{Eli}} \newcommand{\cocktail}{\system{Cocktail}} \newcommand{\txl}{\system{txl}} \newcommand{\ZAP}{\system{zap}} \newcommand{\dialect}{\system{Dialect}} \newcommand{\pccts}{\system{pccts}} \newcommand{\sorcerer}{\system{Sorcerer}} \newcommand{\trans}{\system{Trans}} \newcommand{\sagepp}{\system{Sage}$++$} % programs \newcommand{\texinfo}{\TeX{}Info} \newcommand{\info}{\prog{info}} \newcommand{\yacc}{\prog{yacc}} \newcommand{\byacc}{\prog{byacc}} \newcommand{\bison}{\prog{bison}} \newcommand{\make}{\prog{make}} \newcommand{\lex}{\prog{lex}} \newcommand{\mpl}{\prog{mpl}} \newcommand{\pvm}{\prog{pmv}} \newcommand{\mpi}{\prog{mpi}} \newcommand{\pthreads}{\prog{pthreads}} % Misc \newcommand{\LISP}{\textsc{Lisp}\xspace} \newcommand{\proteus}{\textsc{Proteus}\xspace} \newcommand{\unix}{\textsc{Unix}\xspace} \newcommand{\AST}{\textsc{ast}\xspace} \newcommand{\cse}{\textsc{cse}\xspace} \newcommand{\postscript}{\textsc{PostScript}\xspace} \newcommand{\nesl}{\textsc{Nesl}\xspace} \newcommand{\fortran}{\textsc{Fortran}\xspace} \newcommand{\hpf}{\textsc{HPF}\xspace} \newcommand{\maspar}{\textsc{MasPar}\xspace} \newcommand{\keyword}[1]{\mbox{\normalshape\bf #1}} \newcommand{\INT}{\keyword{int}\ } \newcommand{\FLOAT}{\keyword{float}\ } \newcommand{\DOUBLE}{\keyword{double}\ } \newcommand{\CHAR}{\keyword{char}\ } \newcommand{\CONST}{\keyword{const}\ } \newcommand{\UNSIGNED}{\keyword{unsigned}\ } \newcommand{\VOID}{\keyword{void}\ } \newcommand{\RETURN}{\keyword{return}\ } \newcommand{\CBEGIN}{\{\ \qtab} \newcommand{\CEND}{\untab\}} \usepackage{fancybox} \newenvironment{Module}% {\rule{0pt}{5.25ex}% \begin{Sbox}\rule[-2ex]{0pt}{5ex}\begin{minipage}{6.75em}\begin{center}}% {\end{center}\end{minipage}\end{Sbox}\fbox{\TheSbox}} \newenvironment{Comment}{\begin{minipage}{4.4em}\begin{center}}% {\end{center}\end{minipage}} \begin{document} \bibliographystyle{refalpha} \title{Libmaa User's Manual} \author{Rickard E. Faith\thanks{Cray Fellow; supported by ARPA via ONR contract N00014-92-C-0182, by Rome Labs contract F30602-94-C-0037, and by a Cray Fellowship from Cray Research, Inc. and NCSC (North Carolina Supercomputing Center)..} \\ Department of Computer Science \\ University of North Carolina at Chapel Hill} \date{TR96-009 \\ DRAFT: \FileRevised \\ $Revision: 1.3 $} \maketitle\tableofcontents \clearpage \begin{abstract} The \libmaa library provides many low-level data structures which are helpful for writing compilers, including hash tables, sets, lists, debugging support, and memory management. Although \libmaa was designed and implemented as a foundation for the \kheperalong, the data structures are generally applicable to a wide range of programming problems. The memory management routines are especially helpful for improving the performance of memory-intensive applications. \end{abstract} \clearpage \section{Functions} \input general.tex \clearpage \appendix \section{\Maa} When \Khepera rose up out of the watery abyss of Nu, he created \Maa as a foundation upon which to create everything else \cite[pp.~295--8]{faith:Budge04b}. \bibliography{libmaa} \end{document} libmaa-1.3.2/doc/refalpha.bst010064400017500000000000000413760611415633200153450ustar cheusovwheel % BibTeX refdbms family % THIS FILE WAS AUTOMATICALLY GENERATED FROM: % $Header: /cvsroot/dict/dictd1/libmaa/doc/refalpha.bst,v 1.1 1996/02/25 22:04:10 faith Exp $ % Modifications copyright (C) 1989 John Wilkes, % Hewlett-Packard Company. % For BibTeX versions 0.99a or later, LaTeX version 2.09. % alpha style (sorted alphabetics) ENTRY { author booktitle conference conflocation edition editor journal key note number pages publisher reportnumber series title volume date } {} { label extra.label sort.label } INTEGERS { output.state before.all mid.sentence after.sentence after.block } INTEGERS {editor.used} FUNCTION {init.state.consts} { #0 'before.all := #1 'mid.sentence := #2 'after.sentence := #3 'after.block := } STRINGS { s t } FUNCTION {output.nonnull} { 's := output.state mid.sentence = { ", " * write$ } { output.state after.block = { add.period$ write$ newline$ "\newblock " write$ } { output.state before.all = 'write$ { add.period$ " " * write$ } if$ } if$ mid.sentence 'output.state := } if$ s } FUNCTION {output} { duplicate$ empty$ 'pop$ 'output.nonnull if$ } FUNCTION {output.check} { 't := duplicate$ empty$ { pop$ "empty " t * " in " * cite$ * warning$ } 'output.nonnull if$ } FUNCTION {output.bibitem} { newline$ "\bibitem[" write$ label write$ "]{" write$ cite$ write$ "}" write$ newline$ "" before.all 'output.state := #0 'editor.used := } FUNCTION {fin.entry} { add.period$ write$ newline$ } FUNCTION {new.block} { output.state before.all = 'skip$ { after.block 'output.state := } if$ } FUNCTION {new.sentence} { output.state after.block = 'skip$ { output.state before.all = 'skip$ { after.sentence 'output.state := } if$ } if$ } FUNCTION {not} { { #0 } { #1 } if$ } FUNCTION {and} { 'skip$ { pop$ #0 } if$ } FUNCTION {or} { { pop$ #1 } 'skip$ if$ } FUNCTION {new.block.checka} { empty$ 'skip$ 'new.block if$ } FUNCTION {new.block.checkb} { empty$ swap$ empty$ and 'skip$ 'new.block if$ } FUNCTION {new.sentence.checka} { empty$ 'skip$ 'new.sentence if$ } FUNCTION {new.sentence.checkb} { empty$ swap$ empty$ and 'skip$ 'new.sentence if$ } FUNCTION {either.or.check} { empty$ 'pop$ { "can't use both " swap$ * " fields in " * cite$ * warning$ } if$ } FUNCTION {empty.misc.check} { author empty$ title empty$ date empty$ note empty$ and and and key empty$ not and { "all relevant fields are empty in " cite$ * warning$ } 'skip$ if$ } FUNCTION {ignoring} { empty$ 'pop$ { "ignoring " swap$ * " in " * cite$ * warning$ } if$ } FUNCTION {field.or.null} { duplicate$ empty$ { pop$ "" } 'skip$ if$ } FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } { "{\em " swap$ * "}" * } if$ } FUNCTION {embolden} { duplicate$ empty$ { pop$ "" } { "{\bf " swap$ * "}" * } if$ } FUNCTION {tie.or.space.connect} { duplicate$ text.length$ #3 < { "~" } { " " } if$ swap$ * * } INTEGERS { nameptr namesleft numnames } FUNCTION {format.names} { 's := #1 'nameptr := s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't := nameptr #1 > { namesleft #1 > { ", " * t * } { numnames #2 > { "," * } 'skip$ if$ t "others" = { " et~al." * } { " and " * t * } if$ } if$ } 't if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {format.authors} { author empty$ { "" } { author format.names } if$ } FUNCTION {format.editors} { editor empty$ editor.used or { "" } { editor format.names editor #-1 #1 substring$ ")" = 'skip$ { editor num.names$ #1 > { ", editors" * } { ", editor" * } if$ } if$ #1 'editor.used := } if$ } FUNCTION {format.date} { date empty$ { "" } { date } if$ } FUNCTION {format.title} { title empty$ { "" } 'title if$ } FUNCTION {format.btitle} { title emphasize } FUNCTION {format.bvolume} { volume empty$ { "" } { "volume" volume tie.or.space.connect number empty$ 'skip$ { ", number" number tie.or.space.connect * "volume+number and series+number" series either.or.check } if$ series empty$ 'skip$ { " of " * series * } if$ } if$ } FUNCTION {format.number.series} { volume empty$ { number empty$ { series field.or.null } { output.state mid.sentence = { "number" } { "Number" } if$ number tie.or.space.connect series empty$ { "there's a number but no series in " cite$ * warning$ } { " in " * series * } if$ } if$ } { "" } if$ } FUNCTION {format.edition} { edition empty$ { "" } { output.state mid.sentence = { edition #1 #1 substring$ "l" change.case$ edition #2 global.max$ substring$ * } 'skip$ if$ } if$ } INTEGERS { multiresult } FUNCTION {multi.page.check} { 't := #0 'multiresult := { multiresult not t empty$ not and } { t #1 #1 substring$ duplicate$ "-" = swap$ duplicate$ "," = swap$ "+" = or or { #1 'multiresult := } { t #2 global.max$ substring$ 't := } if$ } while$ multiresult } FUNCTION {format.pages} { pages empty$ { "" } { output.state mid.sentence = { "p" } { "P" } if$ pages multi.page.check { "ages" * pages tie.or.space.connect } { "age" * pages tie.or.space.connect } if$ } if$ } FUNCTION {format.vol.num.pages} { volume field.or.null embolden number empty$ 'skip$ { volume empty$ { number * } { "(" number * ")" * * } if$ } if$ pages empty$ 'skip$ { duplicate$ empty$ { pop$ format.pages } { ":" * pages * } if$ } if$ } FUNCTION {format.in.ed.title} { field.or.null editor empty$ { "In " } { duplicate$ empty$ { "In " format.editors * } { "In " format.editors * ", " * } if$ } if$ swap$ * } FUNCTION {format.conference} { conference field.or.null emphasize conflocation empty$ 'skip$ { " (" conflocation * ")" * * } if$ } FUNCTION {format.journal} { journal empty$ { "empty journal in " cite$ * warning$ } 'skip$ if$ format.editors output journal emphasize output format.vol.num.pages } FUNCTION {article} { output.bibitem format.authors "author" output.check new.block format.title "title" output.check new.block format.journal output publisher conference new.block.checkb format.conference output publisher output format.date "date" output.check new.block note output fin.entry "booktitle" booktitle ignoring "edition" edition ignoring "reportnumber" reportnumber ignoring "series" series ignoring } FUNCTION {book} { output.bibitem author empty$ { format.editors "author and editor" output.check } { format.authors output.nonnull series empty$ { "author and editor" editor either.or.check } 'skip$ if$ } if$ new.block format.btitle "title" output.check format.bvolume output format.number.series output format.editors output format.edition output publisher reportnumber new.block.checkb publisher "publisher" output.check reportnumber output format.date "date" output.check new.block note output fin.entry "booktitle" booktitle ignoring "conference" conference ignoring "conflocation" conflocation ignoring "journal" journal ignoring "pages" pages ignoring } FUNCTION {inbook} { output.bibitem format.authors "author" output.check new.block format.title "title" output.check new.block booktitle emphasize format.in.ed.title "booktitle" output.check format.bvolume output format.number.series output format.pages "pages" output.check format.edition output publisher reportnumber new.block.checkb publisher "publisher" output.check reportnumber output format.date "date" output.check new.block note output fin.entry "conference" conference ignoring "conflocation" conflocation ignoring "journal" journal ignoring } FUNCTION {inproceedings} { output.bibitem format.authors "author" output.check new.block format.title "title" output.check new.block format.conference "conference and location" output.check journal empty$ { format.bvolume output format.number.series output format.pages output format.editors output format.edition output } { new.block "Published as " output before.all 'output.state := format.journal output "series" series ignoring "edition" edition ignoring } if$ publisher reportnumber new.block.checkb publisher output reportnumber output format.date "date" output.check new.block note output fin.entry "booktitle" booktitle ignoring } FUNCTION {manual} { output.bibitem author empty$ editor empty$ and { publisher empty$ { "no author, editor or publisher in " cite$ * warning$ } { publisher output.nonnull } if$ } { author empty$ { format.editors output.nonnull } { format.authors output.nonnull } if$ } if$ new.block format.btitle "title" output.check reportnumber output format.edition output author empty$ editor empty$ and 'skip$ { publisher new.block.checka publisher output } if$ format.date "date" output.check new.block note output fin.entry "booktitle" booktitle ignoring "conference" conference ignoring "conflocation" conflocation ignoring "journal" journal ignoring "number" number ignoring "pages" pages ignoring "series" series ignoring } FUNCTION {misc} { output.bibitem format.authors output title new.block.checka format.title "title" output.check format.editors output format.edition output publisher reportnumber new.block.checkb publisher output reportnumber output format.date "date" output.check new.block note "public note" output.check fin.entry empty.misc.check "booktitle" booktitle ignoring "conference" conference ignoring "conflocation" conflocation ignoring "journal" journal ignoring "number" number ignoring "pages" pages ignoring "reportnumber" reportnumber ignoring "series" series ignoring "volume" volume ignoring } FUNCTION {phdthesis} { output.bibitem format.authors "author" output.check new.block format.btitle "title" output.check new.block reportnumber empty$ { "PhD thesis" output.nonnull } { "PhD thesis, published as " reportnumber * output.nonnull } if$ new.block publisher "publisher" output.check format.date "date" output.check new.block note output fin.entry "booktitle" booktitle ignoring "conference" conference ignoring "conflocation" conflocation ignoring "edition" edition ignoring "editor" editor ignoring "journal" journal ignoring "number" number ignoring "pages" pages ignoring "series" series ignoring "volume" volume ignoring } FUNCTION {proceedings} { output.bibitem author empty$ { format.editors "author and editor" output.check } { "author and editor" editor either.or.check format.authors output.nonnull } if$ format.btitle "title" output.check format.conference output journal empty$ { format.bvolume output format.number.series output "pages" pages ignoring } { new.block "Published as " output.nonnull before.all 'output.state := format.journal output "series" series ignoring } if$ publisher reportnumber new.block.checkb publisher output reportnumber output format.date "date" output.check new.block note output fin.entry "booktitle" booktitle ignoring "edition" edition ignoring } FUNCTION {techreport} { output.bibitem author empty$ { format.editors "author and editor" output.check } { format.authors output.nonnull "author and editor" editor either.or.check } if$ new.block format.title "title" output.check new.block reportnumber empty$ { "Technical report" } { reportnumber } if$ output.nonnull format.edition output new.block publisher "publisher" output.check format.date "date" output.check new.block note output fin.entry "booktitle" booktitle ignoring "conference" conference ignoring "conflocation" conflocation ignoring "journal" journal ignoring "number" number ignoring "pages" pages ignoring "series" series ignoring "volume" volume ignoring } FUNCTION {unpublished} { output.bibitem format.authors "author" output.check new.block format.title "title" output.check publisher reportnumber new.block.checkb publisher output reportnumber output format.date "date" output.check new.block note "note" output.check fin.entry "booktitle" booktitle ignoring "conference" conference ignoring "conflocation" conflocation ignoring "edition" edition ignoring "editor" editor ignoring "journal" journal ignoring "number" number ignoring "pages" pages ignoring "series" series ignoring "volume" volume ignoring } FUNCTION {default.type} { misc } READ FUNCTION {sortify} { purify$ "l" change.case$ } INTEGERS { len } FUNCTION {chop.word} { 's := 'len := s #1 len substring$ = { s len #1 + global.max$ substring$ } 's if$ } FUNCTION {calc.label} { key 'label := key sortify 'sort.label := } FUNCTION {sort.format.names} { 's := #1 'nameptr := "" s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { nameptr #1 > { " " * } 'skip$ if$ s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := nameptr numnames = t "others" = and { "et al" * } { t sortify * } if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {sort.format.title} { 't := "A " #2 "An " #3 "The " #4 t chop.word chop.word chop.word sortify #1 global.max$ substring$ } FUNCTION {author.sort} { author empty$ { key empty$ { "to sort, need author or key in " cite$ * warning$ "" } { key sortify } if$ } { author sort.format.names } if$ } FUNCTION {author.editor.sort} { author empty$ { editor empty$ { key empty$ { "to sort, need author, editor, or key in " cite$ * warning$ "" } { key sortify } if$ } { editor sort.format.names } if$ } { author sort.format.names } if$ } FUNCTION {author.publisher.sort} { author empty$ { publisher empty$ { key empty$ { "to sort, need author, publisher, or key in " cite$ * warning$ "" } { key sortify } if$ } { "The " #4 publisher chop.word sortify } if$ } { author sort.format.names } if$ } FUNCTION {editor.publisher.sort} { editor empty$ { publisher empty$ { key empty$ { "to sort, need editor, publisher, or key in " cite$ * warning$ "" } { key sortify } if$ } { "The " #4 publisher chop.word sortify } if$ } { editor sort.format.names } if$ } FUNCTION {presort} { calc.label sort.label " " * type$ "book" = type$ "inbook" = or 'author.editor.sort { type$ "proceedings" = 'editor.publisher.sort { type$ "manual" = 'author.publisher.sort 'author.sort if$ } if$ } if$ * " " * date field.or.null sortify * " " * title field.or.null sort.format.title * #1 entry.max$ substring$ 'sort.key$ := } ITERATE {presort} SORT STRINGS { longest.label last.sort.label next.extra } INTEGERS { longest.label.width last.extra.num } FUNCTION {initialize.longest.label} { "" 'longest.label := #0 int.to.chr$ 'last.sort.label := "" 'next.extra := #0 'longest.label.width := #0 'last.extra.num := } FUNCTION {forward.pass} { last.sort.label sort.label = { last.extra.num #1 + 'last.extra.num := last.extra.num int.to.chr$ 'extra.label := } { "a" chr.to.int$ 'last.extra.num := "" 'extra.label := sort.label 'last.sort.label := } if$ } FUNCTION {reverse.pass} { next.extra "b" = { "a" 'extra.label := } 'skip$ if$ label extra.label * 'label := label width$ longest.label.width > { label 'longest.label := label width$ 'longest.label.width := } 'skip$ if$ extra.label 'next.extra := } EXECUTE {initialize.longest.label} ITERATE {forward.pass} REVERSE {reverse.pass} FUNCTION {begin.bib} { preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ longest.label width$ #0 > % Original had "9" for "0", { "12" 'longest.label := } % and used "123456789" here 'skip$ if$ "\begin{thebibliography}{" longest.label * "}" * write$ newline$ } EXECUTE {begin.bib} EXECUTE {init.state.consts} ITERATE {call.type$} FUNCTION {end.bib} { newline$ "\end{thebibliography}" write$ newline$ } EXECUTE {end.bib} libmaa-1.3.2/COPYING010064400017500000000000000430760622161547700133470ustar cheusovwheel GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. libmaa-1.3.2/COPYING.LIB010064400017500000000000000612610622161550000137330ustar cheusovwheel GNU LIBRARY GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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 Appendix: 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 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 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! libmaa-1.3.2/Makefile.in010064400017500000000000000170331155034355400143460ustar cheusovwheel# Makefile.in -- Makefile for libmaa # Created: Sun Nov 19 13:32:41 1995 by faith@dict.org # Copyright 1995-1998, 2002 Rickard E. Faith (faith@dict.org) # Copyright 2002-2010 Aleksey Cheusov (vle@gmx.net) # 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 1, or (at your option) any # later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 675 Mass Ave, Cambridge, MA 02139, USA. # MAA_MAJOR=@MAA_MAJOR@ MAA_MINOR=@MAA_MINOR@ MAA_TEENY=@MAA_TEENY@ VERSION=$(MAA_MAJOR).$(MAA_MINOR).$(MAA_TEENY) .SUFFIXES: .SUFFIXES: .c .o srcdir= @srcdir@ VPATH= @srcdir@ prefix= @prefix@ exec_prefix= @exec_prefix@ libdir= @libdir@ includedir= @includedir@ subdirs= doc CC= @CC@ CPP= @CPP@ LIBTOOL= @LIBTOOL@ INSTALL= @INSTALL@ INSTALL_PROGRAM=@INSTALL_PROGRAM@ INSTALL_DATA= @INSTALL_DATA@ AWK= @AWK@ VERCFLAGS= -DMAA_MAJOR=$(MAA_MAJOR) -DMAA_MINOR=$(MAA_MINOR) -DMAA_TEENY=$(MAA_TEENY) CFLAGS= @DEFS@ @CPPFLAGS@ @CFLAGS@ $(VERCFLAGS) -I. -I${srcdir} LDFLAGS= @LDFLAGS@ LIBS= @LIBS@ -lm TESTLIBS= -L.libs -lmaa HEADERS= config.h maa.h maaP.h obstack.h LIBOBJS= @LIBOBJS@ obstack.o xmalloc.o \ hash.o set.o stack.o list.o error.o memory.o string.o \ debug.o flags.o maa.o prime.o bit.o timer.o \ arg.o pr.o sl.o base64.o base26.o source.o parse-concrete.o \ text.o log.o TESTS= settest hashtest stringtest debugtest \ primetest listtest bittest argtest sltest prtest basetest TESTS_SH= logtest.sh EXES= memtest prtest MAALIB= libmaa.la lib: $(MAALIB) all: $(MAALIB) $(EXES) $(TESTS) logtest echo making $@ in doc; \ (cd doc && $(MAKE) $@) || exit 1; install: $(MAALIB) mkdir -p $(DESTDIR)$(libdir) && \ $(LIBTOOL) --mode=install $(INSTALL) -c libmaa.la $(DESTDIR)$(libdir) mkdir -p $(DESTDIR)$(includedir) && \ $(INSTALL_DATA) -c -m 644 ${srcdir}/maa.h $(DESTDIR)$(includedir) uninstall: rm -f $(DESTDIR)$(includedir)/maa.h $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/libmaa.la .PHONY: test test: $(TESTS) logtest @ex=0; \ if test "${srcdir}" != .; then \ cp ${srcdir}/argtest.in ${srcdir}/logtest.sh .; \ fi; \ for i in $(TESTS) $(TESTS_SH); do \ ./$$i | fgrep -v ' at ' > ./$$i.out.new; \ if cmp @srcdir@/$$i.out $$i.out.new; \ then \ echo PASSED $$i; rm -f $$i.out.new; \ else \ echo FAILED $$i; ex=1; \ fi; \ done; \ exit $$ex .PHONY: test-update test-update: $(TESTS) @for i in $(TESTS) $(TESTS_SH); do \ echo Writing $$i.out; \ ./$$i | fgrep -v ' at ' > $$i.out; \ done arg.o: arggram.c arggram.c: ${srcdir}/arggram.txt @AWK@ -f ./arggram2c < ${srcdir}/arggram.txt > $@ .c.o: $(LIBTOOL) --tag=CC --mode=compile $(CC) -o $@ -c $(CFLAGS) $< settest : settest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) hashtest : hashtest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) stringtest : stringtest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) debugtest : debugtest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) primetest : primetest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) listtest : listtest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) bittest : bittest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) argtest : argtest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) sltest : sltest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) prtest : prtest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) basetest : basetest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) logtest : logtest.o rnd.o $(MAALIB) $(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ $@.o rnd.o $(LDFLAGS) $(TESTLIBS) $(LIBS) $(MAALIB): $(LIBOBJS) $(LIBTOOL) --tag=CC --mode=link ${CC} -o libmaa.la ${LIBOBJS:.o=.lo} \ $(LDFLAGS) $(LIBS) \ -rpath "${libdir}" -export-symbols ${srcdir}/export.sym \ -version-info 3:0 $(LIBOBJS): $(HEADERS) # version.stamp # don't automatically bump version $(EXES): $(HEADERS) $(MAALIB) $(TESTS): $(HEADERS) $(MAALIB) rnd.o .PHONY: ChangeLog ChangeLog: (echo "***** Making new ChangeLog..."; \ rm -f ChangeLog; \ AWK=@AWK@ rcs2log -i 2 | \ sed -e 's,/cvsroot/dict/dictd1/,,g' \ -e 's,/cvs/dict/dictd1/,,g' \ -e 's,@[^>]*,@,g' \ -e 's,cheusov@[^>]*,vle@gmx.net,g' \ -e 's,faith@[^>]*,faith@dict.org,g' \ -e 's,hilliard...hilliard@.*,Bob Hilliard ,g' \ -e 's,tek...tek@.*,Julian Squires ,g' \ -e 's,\(.*\)<\([^@<>]\+\)@\([^@<>]\+\)>\(.*\),\1<\2 at \3}\4,g' \ > ChangeLog) .PHONY: cvsdist cvsdist: @( CVSROOT=`cat CVS/Root` && \ export CVSROOT && \ VERSION=$(VERSION) && \ VERSION_CVS=`echo $${VERSION} | tr . -` && \ export VERSION VERSION_CVS && \ $(MAKE) ChangeLog && \ cp ChangeLog /tmp/libmaa.ChangeLog.$${VERSION} && \ echo "***** Exporting files for libmaa-$${VERSION}..." && \ cd /tmp && \ rm -rf /tmp/libmaa-$${VERSION} && \ cvs export -fd libmaa-$${VERSION} \ -r libmaa-$${VERSION_CVS} dictd1/libmaa && \ cd libmaa-$${VERSION} && \ mv /tmp/libmaa.ChangeLog.$${VERSION} ChangeLog && \ autoheader && autoconf && \ rm -rf autom4te.cache libmaa/autom4te.cache && \ chmod -R a+rX,g-w . && \ cd .. && \ echo "***** Taring and zipping libmaa-$${VERSION}.tar.gz..." && \ tar cvvf libmaa-$${VERSION}.tar libmaa-$${VERSION} && \ gzip -9f libmaa-$${VERSION}.tar && \ echo "***** Done making /tmp/libmaa-$${VERSION}.tar.gz") .PHONY: clean cleandist tags clean: @for subdir in `echo $(subdirs)`; do \ echo making $@ in $$subdir; \ (cd $$subdir && $(MAKE) $@) || exit 1; \ done -rm -rf .libs -rm -f *~ *.la *.lo *.o core a.out config.log $(TESTS) $(EXES) -rm -f $(MAALIB) arggram.c -rm -f *.log *.aux *.toc *.dvi *.ps *.out.new -rm -f *.cfg *.dtk .inslog tca.map .pure -rm -f mkrnd distclean: clean @for subdir in `echo $(subdirs)`; do \ echo making $@ in $$subdir; \ (cd $$subdir && $(MAKE) $@) || exit 1; \ done -rm -f config.h config.h.in -rm -f config.cache config.status stamp-h.in stamp-h -rm -f Makefile arggram2c -rm -rf autom4te.cache cvsclean: distclean rm -rf configure config.h.in tags: etags: *.c # The following is based on the "Automatic Remaking" node in the GNU # Autoconf documentation: $(srcdir)/configure: configure.in cd $(srcdir) && autoconf # autoheader might not change config.h.in, so touch a stamp file. ${srcdir}/config.h.in: stamp-h.in ${srcdir}/stamp-h.in: configure.in cd ${srcdir} && autoheader touch ${srcdir}/stamp-h.in config.h: stamp-h stamp-h: config.h.in config.status ./config.status Makefile: Makefile.in config.status ./config.status config.status: configure ./config.status --recheck libmaa-1.3.2/NEWS010064400017500000000000000101141200301116600127520ustar cheusovwheel======================================================================== Version 1.3.2, by Aleksey Cheusov, Sun, 22 Jul 2012 17:44:37 +0300 Build failure on cygwin was fixed (sf.net bug #3398121) __inline__ directives were removed ======================================================================== Version 1.3.1, by Aleksey Cheusov, Sat, 22 Oct 2011 12:31:47 +0300 Build failure with gcc-4.6 was fixed. Thanks to Andrey N. Oktyabrski for the report. ======================================================================== Version 1.3.0, by Aleksey Cheusov, Sun, 10 Apr 2011 17:44:10 +0300 Only maa's symbols are exported from libmaa shared library (export.sym). 'libtool -export-symbols' is used for this to work. | DUE TO THIS IN ORDER TO AVOID POTENTIAL ABI INCOMPATIBILITIES, I'VE INCREASED MAJOR VERSION OF THE SHARED LIBRARY. FIXED: when both stream/file and syslog logging facilities are enabled, log_info() and other logging functions segfault on NetBSD-5.1/x86_64. va_copy magic was needed to fix this problem. It is assumed that strchr(3) is always available (no autoconf check). The same for unistd.h header file. CFLAGS set by user may override default -Wall -Werror set for GCC. Fix for warning messages produced by SunPro compiler (integer overflow detected: op "<<") -c flag was added to INSTALL_DATA invocation FIXED: compilation error on CentOS-5.4 FIXED: "make test" failed on OpenBSD-3.8. This system defines intptr_t in inttypes.h, not in stdint.h ======================================================================== Version 1.2.0, by Aleksey Cheusov, Wed, 18 Nov 2009 23:12:09 +0200 For better conformance with POSIX/SUS xmalloc, xrealloc and xcalloc functions take 'size_t' args, not 'unsigned int'. Due to change in API a major shared library number is bumped from 1 to 2 New trivial test for log.c fix for sltest.c: on OpenBSD intptr_t is defined in stdint.h Makefile.in: GNU make is not required anymore, bsd make is enough ======================================================================== Version 1.1.1, by Aleksey Cheusov, Sat, 31 Jan 2009 21:42:36 +0200 Makefile and configure fixes and clean-ups: LDFLAGS/LIBS passed to configure script are used to build library and test utilities Other minor clean-ups fixed: sf.net bug #2473314, test utility sltest.c failed under bigendian platforms. ======================================================================== Version 1.1.0, by Aleksey Cheusov, Sun, 7 Dec 2008 16:14:32 +0200 lots of code clean-ups MAA_TEENY constant added. Now libmaa has version 1.1.0, new maa_version_teeny function returns MAA_TEENY REMOVED: XTRAHEADERS, TARGETLIBS, RPATHFLAGS configure variables. Also removed are --with-purify, --with-insure, --with-efence, --with-checker, --with-local-dmalloc, --with-dmalloc, --with-gprof, --with-prof, --with-cflags and --with-cc options. Use standard CC, CFLAGS, CPPFLAGS, LDFLAGS and LIBS variables for configuring. compilation error on ALTlinux fixed: on latest glibc's write(2) is marked as WUR , i.e. return value MUST be checked, otherwise warnigns (errors with -Werror) are generated. target 'tests' renamed to 'test', target 'tests-update' renamed to 'test-update' Hash_table statistics is removed from settest.c and hashtest.c regression tests. This is because regression tests fail under 64-platforms. sltest.c (regression test): compilation failure on Linux/x86-64 fixed avoid using strdup(3), it is not portable (fails under Interix without -D_ALL_SOURCE). Another compilation fixes for Interix avoid using bcopy(3), use standard memcpy(3) instead -Werror is used instead of -pedantic (for gcc only) If at least one selftest fails (target 'test'), an exit status of 'make test' is 1. 'make test' now works correctly if it is run from external obj/ directory no '-g' hardcode for !gcc compilers no '-g -O' for gcc ======================================================================== Previous versions (1997-2008) were a part of dictd tarball libmaa-1.3.2/README010064400017500000000000000004220630336035100131450ustar cheusovwheelDevelopment of this software at the University of North Carolina, Chapel Hill was supported by ARPA via ONR contract N00014-92-C-0182, by Rome Labs contract F30602-94-C-0037, and by a Cray Fellowship from Cray Research, Inc. and NCSC (North Carolina Supercomputing Center). libmaa-1.3.2/alloca.c010064400017500000000000000334050574574774300137220ustar cheusovwheel/* alloca.c -- allocate automatically reclaimed memory (Mostly) portable public-domain implementation -- D A Gwyn This implementation of the PWB library alloca function, which is used to allocate space off the run-time stack so that it is automatically reclaimed upon procedure exit, was inspired by discussions with J. Q. Johnson of Cornell. J.Otto Tennant contributed the Cray support. There are some preprocessor constants that can be defined when compiling for your specific system, for improved efficiency; however, the defaults should be okay. The general concept of this implementation is to keep track of all alloca-allocated blocks, and reclaim any that are found to be deeper in the stack than the current invocation. This heuristic does not reclaim storage as soon as it becomes invalid, but it will do so eventually. As a special case, alloca(0) reclaims storage without allocating any. It is a good idea to use alloca(0) in your main control loop, etc. to force garbage collection. */ #ifdef HAVE_CONFIG_H #include #endif #ifdef emacs #include "blockinput.h" #endif /* If compiling with GCC 2, this file's not needed. */ #if !defined (__GNUC__) || __GNUC__ < 2 /* If someone has defined alloca as a macro, there must be some other way alloca is supposed to work. */ #ifndef alloca #ifdef emacs #ifdef static /* actually, only want this if static is defined as "" -- this is for usg, in which emacs must undefine static in order to make unexec workable */ #ifndef STACK_DIRECTION you lose -- must know STACK_DIRECTION at compile-time #endif /* STACK_DIRECTION undefined */ #endif /* static */ #endif /* emacs */ /* If your stack is a linked list of frames, you have to provide an "address metric" ADDRESS_FUNCTION macro. */ #if defined (CRAY) && defined (CRAY_STACKSEG_END) long i00afunc (); #define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) #else #define ADDRESS_FUNCTION(arg) &(arg) #endif #if __STDC__ typedef void *pointer; #else typedef char *pointer; #endif #define NULL 0 /* Different portions of Emacs need to call different versions of malloc. The Emacs executable needs alloca to call xmalloc, because ordinary malloc isn't protected from input signals. On the other hand, the utilities in lib-src need alloca to call malloc; some of them are very simple, and don't have an xmalloc routine. Non-Emacs programs expect this to call use xmalloc. Callers below should use malloc. */ #ifndef emacs #define malloc xmalloc #endif extern pointer malloc (); /* Define STACK_DIRECTION 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 */ #ifndef STACK_DIRECTION #define STACK_DIRECTION 0 /* Direction unknown. */ #endif #if STACK_DIRECTION != 0 #define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ #else /* STACK_DIRECTION == 0; need run-time code. */ static int stack_dir; /* 1 or -1 once known. */ #define STACK_DIR stack_dir static void find_stack_direction () { static char *addr = NULL; /* Address of first `dummy', once known. */ auto char dummy; /* To get stack address. */ if (addr == NULL) { /* Initial entry. */ addr = ADDRESS_FUNCTION (dummy); find_stack_direction (); /* Recurse once. */ } else { /* Second entry. */ if (ADDRESS_FUNCTION (dummy) > addr) stack_dir = 1; /* Stack grew upward. */ else stack_dir = -1; /* Stack grew downward. */ } } #endif /* STACK_DIRECTION == 0 */ /* An "alloca header" is used to: (a) chain together all alloca'ed blocks; (b) keep track of stack depth. It is very important that sizeof(header) agree with malloc alignment chunk size. The following default should work okay. */ #ifndef ALIGN_SIZE #define ALIGN_SIZE sizeof(double) #endif typedef union hdr { char align[ALIGN_SIZE]; /* To force sizeof(header). */ struct { union hdr *next; /* For chaining headers. */ char *deep; /* For stack depth measure. */ } h; } header; static header *last_alloca_header = NULL; /* -> last alloca header. */ /* Return a pointer to at least SIZE bytes of storage, which will be automatically reclaimed upon exit from the procedure that called alloca. Originally, this space was supposed to be taken from the current stack frame of the caller, but that method cannot be made to work for some implementations of C, for example under Gould's UTX/32. */ pointer alloca (size) unsigned size; { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe); #if STACK_DIRECTION == 0 if (STACK_DIR == 0) /* Unknown growth direction. */ find_stack_direction (); #endif /* Reclaim garbage, defined as all alloca'd storage that was allocated from deeper in the stack than currently. */ { register header *hp; /* Traverses linked list. */ #ifdef emacs BLOCK_INPUT; #endif for (hp = last_alloca_header; hp != NULL;) if ((STACK_DIR > 0 && hp->h.deep > depth) || (STACK_DIR < 0 && hp->h.deep < depth)) { register header *np = hp->h.next; free ((pointer) hp); /* Collect garbage. */ hp = np; /* -> next header. */ } else break; /* Rest are not deeper. */ last_alloca_header = hp; /* -> last valid storage. */ #ifdef emacs UNBLOCK_INPUT; #endif } if (size == 0) return NULL; /* No allocation required. */ /* Allocate combined header + user data storage. */ { register pointer new = malloc (sizeof (header) + size); /* Address of header. */ ((header *) new)->h.next = last_alloca_header; ((header *) new)->h.deep = depth; last_alloca_header = (header *) new; /* User storage begins just after header. */ return (pointer) ((char *) new + sizeof (header)); } } #if defined (CRAY) && defined (CRAY_STACKSEG_END) #ifdef DEBUG_I00AFUNC #include #endif #ifndef CRAY_STACK #define CRAY_STACK #ifndef CRAY2 /* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ struct stack_control_header { long shgrow:32; /* Number of times stack has grown. */ long shaseg:32; /* Size of increments to stack. */ long shhwm:32; /* High water mark of stack. */ long shsize:32; /* Current size of stack (all segments). */ }; /* The stack segment linkage control information occurs at the high-address end of a stack segment. (The stack grows from low addresses to high addresses.) The initial part of the stack segment linkage control information is 0200 (octal) words. This provides for register storage for the routine which overflows the stack. */ struct stack_segment_linkage { long ss[0200]; /* 0200 overflow words. */ long sssize:32; /* Number of words in this segment. */ long ssbase:32; /* Offset to stack base. */ long:32; long sspseg:32; /* Offset to linkage control of previous segment of stack. */ long:32; long sstcpt:32; /* Pointer to task common address block. */ long sscsnm; /* Private control structure number for microtasking. */ long ssusr1; /* Reserved for user. */ long ssusr2; /* Reserved for user. */ long sstpid; /* Process ID for pid based multi-tasking. */ long ssgvup; /* Pointer to multitasking thread giveup. */ long sscray[7]; /* Reserved for Cray Research. */ long ssa0; long ssa1; long ssa2; long ssa3; long ssa4; long ssa5; long ssa6; long ssa7; long sss0; long sss1; long sss2; long sss3; long sss4; long sss5; long sss6; long sss7; }; #else /* CRAY2 */ /* The following structure defines the vector of words returned by the STKSTAT library routine. */ struct stk_stat { long now; /* Current total stack size. */ long maxc; /* Amount of contiguous space which would be required to satisfy the maximum stack demand to date. */ long high_water; /* Stack high-water mark. */ long overflows; /* Number of stack overflow ($STKOFEN) calls. */ long hits; /* Number of internal buffer hits. */ long extends; /* Number of block extensions. */ long stko_mallocs; /* Block allocations by $STKOFEN. */ long underflows; /* Number of stack underflow calls ($STKRETN). */ long stko_free; /* Number of deallocations by $STKRETN. */ long stkm_free; /* Number of deallocations by $STKMRET. */ long segments; /* Current number of stack segments. */ long maxs; /* Maximum number of stack segments so far. */ long pad_size; /* Stack pad size. */ long current_address; /* Current stack segment address. */ long current_size; /* Current stack segment size. This number is actually corrupted by STKSTAT to include the fifteen word trailer area. */ long initial_address; /* Address of initial segment. */ long initial_size; /* Size of initial segment. */ }; /* The following structure describes the data structure which trails any stack segment. I think that the description in 'asdef' is out of date. I only describe the parts that I am sure about. */ struct stk_trailer { long this_address; /* Address of this block. */ long this_size; /* Size of this block (does not include this trailer). */ long unknown2; long unknown3; long link; /* Address of trailer block of previous segment. */ long unknown5; long unknown6; long unknown7; long unknown8; long unknown9; long unknown10; long unknown11; long unknown12; long unknown13; long unknown14; }; #endif /* CRAY2 */ #endif /* not CRAY_STACK */ #ifdef CRAY2 /* Determine a "stack measure" for an arbitrary ADDRESS. I doubt that "lint" will like this much. */ static long i00afunc (long *address) { struct stk_stat status; struct stk_trailer *trailer; long *block, size; long result = 0; /* We want to iterate through all of the segments. The first step is to get the stack status structure. We could do this more quickly and more directly, perhaps, by referencing the $LM00 common block, but I know that this works. */ STKSTAT (&status); /* Set up the iteration. */ trailer = (struct stk_trailer *) (status.current_address + status.current_size - 15); /* There must be at least one stack segment. Therefore it is a fatal error if "trailer" is null. */ if (trailer == 0) abort (); /* Discard segments that do not contain our argument address. */ while (trailer != 0) { block = (long *) trailer->this_address; size = trailer->this_size; if (block == 0 || size == 0) abort (); trailer = (struct stk_trailer *) trailer->link; if ((block <= address) && (address < (block + size))) break; } /* Set the result to the offset in this segment and add the sizes of all predecessor segments. */ result = address - block; if (trailer == 0) { return result; } do { if (trailer->this_size <= 0) abort (); result += trailer->this_size; trailer = (struct stk_trailer *) trailer->link; } while (trailer != 0); /* We are done. Note that if you present a bogus address (one not in any segment), you will get a different number back, formed from subtracting the address of the first block. This is probably not what you want. */ return (result); } #else /* not CRAY2 */ /* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. Determine the number of the cell within the stack, given the address of the cell. The purpose of this routine is to linearize, in some sense, stack addresses for alloca. */ static long i00afunc (long address) { long stkl = 0; long size, pseg, this_segment, stack; long result = 0; struct stack_segment_linkage *ssptr; /* Register B67 contains the address of the end of the current stack segment. If you (as a subprogram) store your registers on the stack and find that you are past the contents of B67, you have overflowed the segment. B67 also points to the stack segment linkage control area, which is what we are really interested in. */ stkl = CRAY_STACKSEG_END (); ssptr = (struct stack_segment_linkage *) stkl; /* If one subtracts 'size' from the end of the segment, one has the address of the first word of the segment. If this is not the first segment, 'pseg' will be nonzero. */ pseg = ssptr->sspseg; size = ssptr->sssize; this_segment = stkl - size; /* It is possible that calling this routine itself caused a stack overflow. Discard stack segments which do not contain the target address. */ while (!(this_segment <= address && address <= stkl)) { #ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); #endif if (pseg == 0) break; stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; this_segment = stkl - size; } result = address - this_segment; /* If you subtract pseg from the current end of the stack, you get the address of the previous stack segment's end. This seems a little convoluted to me, but I'll bet you save a cycle somewhere. */ while (pseg != 0) { #ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o\n", pseg, size); #endif stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; result += size; } return (result); } #endif /* not CRAY2 */ #endif /* CRAY */ #endif /* no alloca */ #endif /* not GCC version 2 */ libmaa-1.3.2/arg.c010064400017500000000000000162241111676220300132110ustar cheusovwheel/* arg.c -- Argument list support * Created: Sun Jan 7 13:39:29 1996 by faith@dict.org * Copyright 1996-1997, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Argument List Routines} * * \intro Argument lists are vectors of pointers to strings (e.g., the * standard |char **argv|). These routines manage the efficient creation, * manipulation, and deletion of these sorts of lists. * */ #include "maaP.h" typedef struct Arg { #if MAA_MAGIC unsigned magic; #endif int argc; /* Current count */ int argm; /* Maximum count */ char **argv; /* Vector */ mem_String object; } *Arg; static void _arg_check( arg_List arg, const char *function ) { Arg a = (Arg)arg; if (!a) err_internal( function, "arg is null\n" ); #if MAA_MAGIC if (a->magic != ARG_MAGIC) err_internal( function, "Magic match failed: 0x%08x (should be 0x%08x)\n", a->magic, ARG_MAGIC ); #endif } /* \doc Create an |arg_List| object. */ arg_List arg_create( void ) { Arg a = xmalloc( sizeof( struct Arg ) ); #if MAA_MAGIC a->magic = ARG_MAGIC; #endif a->argc = 0; a->argm = 2; a->argv = xmalloc( a->argm * sizeof( char ** ) ); a->argv[0] = NULL; a->object = mem_create_strings(); return a; } /* \doc Free all memory associated with |arg|, including the memory used for the strings. */ void arg_destroy( arg_List arg ) { Arg a = (Arg)arg; _arg_check( a, __func__ ); mem_destroy_strings( a->object ); xfree( a->argv ); #if MAA_MAGIC a->magic = ARG_MAGIC_FREED; #endif xfree( a ); } /* \doc Add |string| as the next item in |arg|. */ arg_List arg_add( arg_List arg, const char *string ) { Arg a = (Arg)arg; const char *new; _arg_check( a, __func__ ); new = mem_strcpy( a->object, string ); if (a->argm <= a->argc + 2 ) a->argv = xrealloc( a->argv, sizeof( char **) * (a->argm *= 2) ); a->argv[a->argc++] = (char *)new; /* discard const */ a->argv[a->argc] = NULL; return a; } /* \doc Add |length| characters of |string| as the next item in |arg|. A terminating "NULL" is added to the copied |string|. */ arg_List arg_addn( arg_List arg, const char *string, int length ) { Arg a = (Arg)arg; const char *new; _arg_check( a, __func__ ); new = mem_strncpy( a->object, string, length ); if (a->argm <= a->argc + 2 ) a->argv = xrealloc( a->argv, sizeof( char **) * (a->argm *= 2) ); a->argv[a->argc++] = (char *)new; /* discard const */ a->argv[a->argc] = NULL; return a; } /* \doc Grow the next item of |arg| with |length| characters of |string|. Several calls to |arg_grow| should be followed by a single call to |arg_finish| without any intervening calls to other functions which modify |arg|. */ void arg_grow( arg_List arg, const char *string, int length ) { Arg a = (Arg)arg; _arg_check( a, __func__ ); mem_grow( a->object, string, length ); } /* \doc Finish the growth of the next item in |arg| started by |arg_grow|. */ arg_List arg_finish( arg_List arg ) { Arg a = (Arg)arg; const char *new; _arg_check( a, __func__ ); new = mem_finish( a->object ); if (a->argm <= a->argc + 2 ) a->argv = xrealloc( a->argv, sizeof( char **) * (a->argm *= 2) ); a->argv[a->argc++] = (char *)new; /* discard const */ a->argv[a->argc] = NULL; return a; } /* \doc Return |item| from |arg|. |arg| is 0-based. */ const char *arg_get( arg_List arg, int item ) /* FIXME! inline? */ { Arg a = (Arg)arg; _arg_check( a, __func__ ); if (item < 0 || item >= a->argc) err_internal( __func__, "Request for item %d in list containing %d items\n", item, a->argc ); return a->argv[ item ]; } /* \doc Return the number of items in |arg|. */ int arg_count( arg_List arg ) /* FIXME! inline? */ { _arg_check( arg, __func__ ); return ((Arg)arg)->argc; } /* \doc Get an |argc| and |argv| from |arg|. These are suitable for use in calls to |exec|. The |argc|+1 item in |argv| is "NULL". */ void arg_get_vector( arg_List arg, int *argc, char ***argv ) { Arg a = (Arg)arg; _arg_check( a, __func__ ); *argc = a->argc; *argv = a->argv; } /* \doc Break up |string| into arguments, placing them as items in |arg|. Items within single or double quotes may contain spaces. The quotes are stripped as in shell argument processing. Backslash followed by outside quoted or double-quote subtokens is treated just as */ #include "arggram.c" #if ACTIONS_COUNT != 3 #error Modify arg_argify function or change arggram.txt #endif #if CHARTYPES_COUNT != 6 #error Modify char2char_type function or change arggram.txt #endif static int char2char_type (int quoteStyle, char ch) { switch (ch){ case '"': if (ARG_NO_QUOTE & quoteStyle) return CHARTYPE_OTHER; else return CHARTYPE_DQ; case '\'': if (ARG_NO_QUOTE & quoteStyle) return CHARTYPE_OTHER; else return CHARTYPE_SQ; case '\\': if (ARG_NO_ESCAPE & quoteStyle) return CHARTYPE_OTHER; else return CHARTYPE_BS; case ' ': case '\t': case '\r': case '\v': case '\n': return CHARTYPE_SPACE; case '\0': return CHARTYPE_NULL; default: return CHARTYPE_OTHER; } } arg_List arg_argify( const char *string, int quoteStyle ) { Arg a = arg_create(); const char *last = NULL; const char *pt = string; char ch; int ch_type; int state = 0; int curr_act = -1; do { ch = *pt; ch_type = char2char_type (quoteStyle, ch); curr_act = action [state] [ch_type]; /* fprintf (stderr, "%i -- %i(%c) / %i --> %i\n", state, ch_type, ch, curr_act, transition [state] [ch_type]);*/ state = transition [state] [ch_type]; switch (curr_act){ case ACTION_INCLUDE: if (!last) last = pt; break; case ACTION_SKIP: if (last){ arg_grow (a, last, pt - last); } last = pt + 1; break; case ACTION_FINISH: /* assert (last);*/ if (last){ arg_grow (a, last, pt - last); arg_finish (a); last = NULL; } break; default: abort (); } ++pt; }while (ch && state >= 0); switch (state){ case -1: /* Fine! Normal exit*/ break; case -2: /* Parsing error */ break; default: /* Oooops! */ err_internal( __func__, "arg.c:arg_argify is buggy!!!:\n"); } return a; } libmaa-1.3.2/arggram.txt010064400017500000000000000022421005120510200144330ustar cheusovwheel# STATE_SRC INPUT OUTPUT STATE_DEST ST_SPACES DQ SKIP ST_IN_DQ ST_SPACES SQ SKIP ST_IN_SQ ST_SPACES OTHER INCLUDE ST_IN_TOK ST_SPACES BS SKIP ST_IN_TOK_BS ST_SPACES NULL FINISH EXIT ST_SPACES SPACE FINISH ST_SPACES ST_IN_TOK DQ SKIP ST_IN_DQ ST_IN_TOK SQ SKIP ST_IN_SQ ST_IN_TOK OTHER INCLUDE ST_IN_TOK ST_IN_TOK BS SKIP ST_IN_TOK_BS ST_IN_TOK NULL FINISH EXIT ST_IN_TOK SPACE FINISH ST_SPACES ST_IN_TOK_BS DQ INCLUDE ST_IN_TOK ST_IN_TOK_BS SQ INCLUDE ST_IN_TOK ST_IN_TOK_BS OTHER INCLUDE ST_IN_TOK ST_IN_TOK_BS BS INCLUDE ST_IN_TOK ST_IN_TOK_BS NULL FINISH ERROR ST_IN_TOK_BS SPACE INCLUDE ST_IN_TOK ST_IN_DQ DQ SKIP ST_SPACES ST_IN_DQ SQ INCLUDE ST_IN_DQ ST_IN_DQ OTHER INCLUDE ST_IN_DQ ST_IN_DQ BS INCLUDE ST_IN_DQ ST_IN_DQ NULL FINISH ERROR ST_IN_DQ SPACE INCLUDE ST_IN_DQ ST_IN_SQ DQ INCLUDE ST_IN_SQ ST_IN_SQ SQ SKIP ST_SPACES ST_IN_SQ OTHER INCLUDE ST_IN_SQ ST_IN_SQ BS INCLUDE ST_IN_SQ ST_IN_SQ NULL FINISH ERROR ST_IN_SQ SPACE INCLUDE ST_IN_SQ libmaa-1.3.2/arggram2c.in010064400017500000000000000036511016261235500144730ustar cheusovwheel#!@AWK@ -f # # converts arggram.txt to arggram.c # usage: arggram2c < arggram.txt > arggram.c # BEGIN { current_state = 0 current_action = 0 current_chartype = 0 } { sub(/[#].*$/, "") } NF == 0 { next } { sub(/EXIT/, "-1", $4) sub(/ERROR/, "-2", $4) if ($1 in states){ $1 = states [$1] }else if ($1 >= 0){ states [$1] = current_state++ $1 = states [$1] } if ($2 in chartypes){ $2 = chartypes [$2] }else{ chartypes [$2] = current_chartype++ $2 = chartypes [$2] } if ($3 in actions){ $3 = actions [$3] }else{ actions [$3] = current_action++ $3 = actions [$3] } if ($4 in states){ $4 = states [$4] }else if ($4 >= 0){ states [$4] = current_state++ $4 = states [$4] } act [$1, $2] = $3 trans [$1, $2] = $4 } END { printf "#define STATE_EXIT (int) (-1)\n" printf "#define STATE_ERROR (int) (-2)\n" printf "\n" } END { for (i in chartypes){ print "#define CHARTYPE_" i " " chartypes [i] } printf "\n#define CHARTYPES_COUNT %i\n\n", current_chartype } END { for (i in actions){ print "#define ACTION_" i " " actions [i] } printf "\n#define ACTIONS_COUNT %i\n\n", current_action } END { print "static const int action [" current_state "] [" current_chartype "] = {" for (i=0; i < current_state; ++i){ if (i) printf ",\n" printf " " for (j=0; j < current_chartype; ++j){ if (j) printf ", " else printf "{ " printf "%i", act [i, j] } printf " }" } print "};\n" } END { print "static const int transition [" current_state "] [" current_chartype "] = {" for (i=0; i < current_state; ++i){ if (i) printf ",\n" printf " " for (j=0; j < current_chartype; ++j){ if (j) printf ", " else printf "{ " printf "%i", trans [i, j] } printf " }" } print "};\n" } libmaa-1.3.2/argtest.c010064400017500000000000000046561111676220300141170ustar cheusovwheel/* argtest.c -- * Created: Sun Jan 7 20:23:34 1996 by faith@dict.org * Copyright 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 1, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" int main( int argc, char **argv ) { arg_List a; int c; char **v; int i; FILE *f; char buffer [2000]; char *first_bq, *last_bq; maa_init( argv[0] ); --argc; ++argv; if (argc) f = fopen (argv [0], "r"); else f = fopen ("argtest.in", "r"); if (!f) exit (10); while (fgets (buffer, sizeof(buffer), f)){ first_bq = strchr (buffer, '`'); last_bq = strrchr (buffer, '`'); if (!first_bq || !last_bq) return 11; *first_bq++ = '\0'; *last_bq = '\0'; printf ("---------------------\nInput = \"%s\"\n\n", first_bq); /* 0 */ a = arg_argify (first_bq, 0); arg_get_vector (a, &c, &v); for (i = 0; i < c; i++){ printf ("Arg %d = \"%s\"\n", i, v[i]); } arg_destroy( a ); printf ("\n"); /* no escape */ a = arg_argify (first_bq, ARG_NO_ESCAPE); arg_get_vector (a, &c, &v); for (i = 0; i < c; i++){ printf ("Arg %d = \"%s\"\n", i, v[i]); } arg_destroy( a ); printf ("\n"); /* no quote */ a = arg_argify (first_bq, ARG_NO_QUOTE); arg_get_vector (a, &c, &v); for (i = 0; i < c; i++){ printf ("Arg %d = \"%s\"\n", i, v[i]); } arg_destroy( a ); printf ("\n"); /* no quote and no escape */ a = arg_argify (first_bq, ARG_NO_QUOTE | ARG_NO_ESCAPE); arg_get_vector (a, &c, &v); for (i = 0; i < c; i++){ printf ("Arg %d = \"%s\"\n", i, v[i]); } arg_destroy( a ); printf ("\n"); } return 0; } libmaa-1.3.2/argtest.in010064400017500000000000000005111005120510200142500ustar cheusovwheel`\\This is a "test of quotes" and ano'ther test' ` `"quotes"` `"quotesa" foo "" "quotes'b" '' 'foo'"'"'bar'` `noquotes` ` aaa1 foo ` ` aaa2 foo` `aaa3 foo ` ` ` `` `\\` `1''2''3''4` `' 1'' 2' `" 1"" 2" ` " 123"' 234' ` `1''""''""''""''""2` `''1""2''` `''1 ""2 '' ""` `'\''1` `1\ 2\ 3\ 4 \ 5` `\ \ \ \ ` `\ \'\"\ ` libmaa-1.3.2/argtest.out010064400017500000000000000072251005120510200144620ustar cheusovwheel--------------------- Input = "\\This is a "test of quotes" and ano'ther test' " Arg 0 = "\This" Arg 1 = "is" Arg 2 = "a" Arg 3 = "test of quotes" Arg 4 = "and" Arg 5 = "another test" Arg 0 = "\\This" Arg 1 = "is" Arg 2 = "a" Arg 3 = "test of quotes" Arg 4 = "and" Arg 5 = "another test" Arg 0 = "\This" Arg 1 = "is" Arg 2 = "a" Arg 3 = ""test" Arg 4 = "of" Arg 5 = "quotes"" Arg 6 = "and" Arg 7 = "ano'ther" Arg 8 = "test'" Arg 0 = "\\This" Arg 1 = "is" Arg 2 = "a" Arg 3 = ""test" Arg 4 = "of" Arg 5 = "quotes"" Arg 6 = "and" Arg 7 = "ano'ther" Arg 8 = "test'" --------------------- Input = ""quotes"" Arg 0 = "quotes" Arg 0 = "quotes" Arg 0 = ""quotes"" Arg 0 = ""quotes"" --------------------- Input = ""quotesa" foo "" "quotes'b" '' 'foo'"'"'bar'" Arg 0 = "quotesa" Arg 1 = "foo" Arg 2 = "" Arg 3 = "quotes'b" Arg 4 = "" Arg 5 = "foo'bar" Arg 0 = "quotesa" Arg 1 = "foo" Arg 2 = "" Arg 3 = "quotes'b" Arg 4 = "" Arg 5 = "foo'bar" Arg 0 = ""quotesa"" Arg 1 = "foo" Arg 2 = """" Arg 3 = ""quotes'b"" Arg 4 = "''" Arg 5 = "'foo'"'"'bar'" Arg 0 = ""quotesa"" Arg 1 = "foo" Arg 2 = """" Arg 3 = ""quotes'b"" Arg 4 = "''" Arg 5 = "'foo'"'"'bar'" --------------------- Input = "noquotes" Arg 0 = "noquotes" Arg 0 = "noquotes" Arg 0 = "noquotes" Arg 0 = "noquotes" --------------------- Input = " aaa1 foo " Arg 0 = "aaa1" Arg 1 = "foo" Arg 0 = "aaa1" Arg 1 = "foo" Arg 0 = "aaa1" Arg 1 = "foo" Arg 0 = "aaa1" Arg 1 = "foo" --------------------- Input = " aaa2 foo" Arg 0 = "aaa2" Arg 1 = "foo" Arg 0 = "aaa2" Arg 1 = "foo" Arg 0 = "aaa2" Arg 1 = "foo" Arg 0 = "aaa2" Arg 1 = "foo" --------------------- Input = "aaa3 foo " Arg 0 = "aaa3" Arg 1 = "foo" Arg 0 = "aaa3" Arg 1 = "foo" Arg 0 = "aaa3" Arg 1 = "foo" Arg 0 = "aaa3" Arg 1 = "foo" --------------------- Input = " " --------------------- Input = "" --------------------- Input = "\\" Arg 0 = "\" Arg 0 = "\\" Arg 0 = "\" Arg 0 = "\\" --------------------- Input = "1''2''3''4" Arg 0 = "1234" Arg 0 = "1234" Arg 0 = "1''2''3''4" Arg 0 = "1''2''3''4" --------------------- Input = "' 1'' 2' " Arg 0 = " 1 2" Arg 0 = " 1 2" Arg 0 = "'" Arg 1 = "1''" Arg 2 = "2'" Arg 0 = "'" Arg 1 = "1''" Arg 2 = "2'" --------------------- Input = "" 1"" 2" " Arg 0 = " 1 2" Arg 0 = " 1 2" Arg 0 = """ Arg 1 = "1""" Arg 2 = "2"" Arg 0 = """ Arg 1 = "1""" Arg 2 = "2"" --------------------- Input = " " 123"' 234' " Arg 0 = " 123 234" Arg 0 = " 123 234" Arg 0 = """ Arg 1 = "123"'" Arg 2 = "234'" Arg 0 = """ Arg 1 = "123"'" Arg 2 = "234'" --------------------- Input = "1''""''""''""''""2" Arg 0 = "12" Arg 0 = "12" Arg 0 = "1''""''""''""''""2" Arg 0 = "1''""''""''""''""2" --------------------- Input = "''1""2''" Arg 0 = "12" Arg 0 = "12" Arg 0 = "''1""2''" Arg 0 = "''1""2''" --------------------- Input = "''1 ""2 '' """ Arg 0 = "1" Arg 1 = "2" Arg 2 = "" Arg 3 = "" Arg 0 = "1" Arg 1 = "2" Arg 2 = "" Arg 3 = "" Arg 0 = "''1" Arg 1 = """2" Arg 2 = "''" Arg 3 = """" Arg 0 = "''1" Arg 1 = """2" Arg 2 = "''" Arg 3 = """" --------------------- Input = "'\''1" Arg 0 = "\1" Arg 0 = "\1" Arg 0 = "'''1" Arg 0 = "'\''1" --------------------- Input = "1\ 2\ 3\ 4 \ 5" Arg 0 = "1 2 3 4" Arg 1 = " 5" Arg 0 = "1\" Arg 1 = "2\" Arg 2 = "3\" Arg 3 = "4" Arg 4 = "\" Arg 5 = "5" Arg 0 = "1 2 3 4" Arg 1 = " 5" Arg 0 = "1\" Arg 1 = "2\" Arg 2 = "3\" Arg 3 = "4" Arg 4 = "\" Arg 5 = "5" --------------------- Input = "\ \ \ \ " Arg 0 = " " Arg 0 = "\" Arg 1 = "\" Arg 2 = "\" Arg 3 = "\" Arg 0 = " " Arg 0 = "\" Arg 1 = "\" Arg 2 = "\" Arg 3 = "\" --------------------- Input = "\ \'\"\ " Arg 0 = " '" " Arg 0 = "\" Arg 1 = "\\"\ " Arg 0 = " '" " Arg 0 = "\" Arg 1 = "\'\"\" libmaa-1.3.2/base26.c010064400017500000000000000062321111676220300135200ustar cheusovwheel/* base64.c -- Encode/decode integers in base64 format * Created: Mon Sep 23 16:55:12 1996 by faith@dict.org * Copyright 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Base-26 Routines} * * \intro These routines perform encoding and decodingusing the 26 * lowercase characters, a-z. This is sometimes useful for generating * unique identifiers that do not contain numbers. * */ #include "maaP.h" static unsigned char b26_list[] = "abcdefghijklmnopqrstuvwxyz"; #define XX 100 static int b26_index[256] = { XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX, 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,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, }; /* |b26_encode| encodes |val| in a printable base 26 format. A MSB-first encoding is generated. */ const char *b26_encode( unsigned long val ) { static char result[8] = { 'a', 'a', 'a', 'a', 'a', 'a', 'a', '\0'}; static unsigned long previous = 0; int i; if (previous != val) { previous = val; for (i = 6; i >= 0; i--) { result[i] = b26_list[ val % 26 ]; val = val / 26; } result[7] = 0; } for (i = 0; i < 6; i++) if (result[i] != b26_list[0]) return result + i; return result + 6; } unsigned long b26_decode( const char *val ) { unsigned long v = 0; int i; int offset = 1; int len = strlen( val ); for (i = len - 1; i >= 0; i--) { int tmp = b26_index[ (unsigned char)val[i] ]; if (tmp == XX) err_internal( __func__, "Illegal character in base26 value: `%c' (%d)\n", val[i], val[i] ); v += tmp * offset; offset *= 26; } return v; } libmaa-1.3.2/base64.c010064400017500000000000000104301111676220300135150ustar cheusovwheel/* base64.c -- Encode/decode integers in base64 format * Created: Mon Sep 23 16:55:12 1996 by faith@dict.org * Copyright 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * \section{Base-64 Routines} * * \intro These routines use the 64-character subset of International * Alphabet IA5 discussed in RFC 1421 (printeable encoding) and RFC 1522 * (base64 MIME). * Value Encoding Value Encoding Value Encoding Value Encoding 0 A 17 R 34 i 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y * */ #include "maaP.h" static unsigned char b64_list[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; #define XX 100 static int b64_index[256] = { XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,62, XX,XX,XX,63, 52,53,54,55, 56,57,58,59, 60,61,XX,XX, XX,XX,XX,XX, XX, 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,XX, XX,XX,XX,XX, XX,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,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, }; /* |b64_encode| encodes |val| in a printable base 64 format. A MSB-first encoding is generated. */ const char *b64_encode( unsigned long val ) { static char result[7]; int i; result[0] = b64_list[ (val & 0xc0000000) >> 30 ]; result[1] = b64_list[ (val & 0x3f000000) >> 24 ]; result[2] = b64_list[ (val & 0x00fc0000) >> 18 ]; result[3] = b64_list[ (val & 0x0003f000) >> 12 ]; result[4] = b64_list[ (val & 0x00000fc0) >> 6 ]; result[5] = b64_list[ (val & 0x0000003f) ]; result[6] = 0; for (i = 0; i < 5; i++) if (result[i] != b64_list[0]) return result + i; return result + 5; } unsigned long b64_decode_buf (const char *val, size_t len) { unsigned long v = 0; int i; int offset = 0; for (i = len - 1; i >= 0; i--) { int tmp = b64_index[ (unsigned char)val[i] ]; if (tmp == XX) err_internal( __func__, "Illegal character in base64 value: `%c'\n", val[i] ); v |= tmp << offset; offset += 6; } return v; } unsigned long b64_decode (const char *val) { return b64_decode_buf (val, strlen (val)); } libmaa-1.3.2/basetest.c010064400017500000000000000044521111676220300142520ustar cheusovwheel/* basetest.c -- Test base64 and base26 numbers * Created: Sun Nov 10 11:51:11 1996 by faith@dict.org * Copyright 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 1, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" int main( int argc, char **argv ) { long int i; const char *result; long int limit = 0xffff; if (argc == 2) limit = strtol( argv[1], NULL, 0 ); for (i = 0; i < limit; i++) { result = b26_encode( i ); if (i != b26_decode( result )) { printf( "%s => %ld != %ld\n", result, b26_decode( result ), i ); } if (i < 100) { result = b26_encode( 0 ); if (0 != b26_decode( result )) { printf( "%s => %ld != %ld (cache problem)\n", result, b26_decode( result ), 0L ); } result = b26_encode( i ); if (i != b26_decode( result )) { printf( "%s => %ld != %ld (cache problem)\n", result, b64_decode( result ), i ); } } if (i < 10 || !(i % (limit/10))) printf( "%ld = %s (base26)\n", i, result ); } for (i = 0; i < limit; i++) { result = b64_encode( i ); if (i != b64_decode( result )) { printf( "%s => %ld != %ld\n", result, b64_decode( result ), i ); } if (i < 100) { result = b64_encode( 0 ); if (0 != b64_decode( result )) { printf( "%s => %ld != %ld (cache problem)\n", result, b64_decode( result ), 0L ); } result = b64_encode( i ); if (i != b64_decode( result )) { printf( "%s => %ld != %ld (cache problem)\n", result, b64_decode( result ), i ); } } if (i < 10 || !(i % (limit/10))) printf( "%ld = %s (base64)\n", i, result ); } return 0; } libmaa-1.3.2/basetest.out010064400017500000000000000013260624143444000146360ustar cheusovwheel0 = a (base26) 1 = b (base26) 2 = c (base26) 3 = d (base26) 4 = e (base26) 5 = f (base26) 6 = g (base26) 7 = h (base26) 8 = i (base26) 9 = j (base26) 6553 = jsb (base26) 13106 = tkc (base26) 19659 = bdcd (base26) 26212 = bmue (base26) 32765 = bwmf (base26) 39318 = cgeg (base26) 45871 = cpwh (base26) 52424 = czoi (base26) 58977 = djgj (base26) 65530 = dsyk (base26) 0 = A (base64) 1 = B (base64) 2 = C (base64) 3 = D (base64) 4 = E (base64) 5 = F (base64) 6 = G (base64) 7 = H (base64) 8 = I (base64) 9 = J (base64) 6553 = BmZ (base64) 13106 = DMy (base64) 19659 = EzL (base64) 26212 = GZk (base64) 32765 = H/9 (base64) 39318 = JmW (base64) 45871 = LMv (base64) 52424 = MzI (base64) 58977 = OZh (base64) 65530 = P/6 (base64) libmaa-1.3.2/bit.c010064400017500000000000000043661200277615200132250ustar cheusovwheel/* bit.c -- * Created: Thu Sep 28 18:09:30 1995 by faith@dict.org * Copyright 1995-1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Bit manipulation routines} * * \intro These are a set of simple routine to manipulate bits in an * integer. * */ #include "maaP.h" /* \doc Set |bit| in |flags|. */ void bit_set( unsigned long *flags, int bit ) { *flags |= (1UL << bit); } /* \doc Clear |bit| in |flags|. */ void bit_clr( unsigned long *flags, int bit ) { *flags &= ~(1UL << bit); } /* \doc Test |bit| in |flags|, returning non-zero if the bit is set and zero if the bit is clear. */ int bit_tst( unsigned long *flags, int bit ) { return (*flags & (1UL << bit)); } /* \doc Return a count of the number of bits set in |flags|. */ int bit_cnt( unsigned long *flags ) { unsigned long x = *flags; #if SIZEOF_LONG == 4 x = (x >> 1 & 0x55555555) + (x & 0x55555555); x = ((x >> 2) & 0x33333333) + (x & 0x33333333); x = ((x >> 4) + x) & 0x0f0f0f0f; x = ((x >> 8) + x); return (x + (x >> 16)) & 0xff; #else #if SIZEOF_LONG == 8 x = (x >> 1 & 0x5555555555555555) + (x & 0x5555555555555555); x = ((x >> 2) & 0x3333333333333333) + (x & 0x3333333333333333); x = ((x >> 4) + x) & 0x0f0f0f0f0f0f0f0f; x = ((x >> 8) + x) & 0x00ff00ff00ff00ff; x = ((x >> 16) + x) & 0x0000ffff0000ffff; return (x + (x >> 32)) & 0xff; #else err_internal( __func__, "Implemented for 32-bit and 64-bit longs, not %d-bit longs\n", SIZEOF_LONG * 8 ); #endif #endif } libmaa-1.3.2/bittest.c010064400017500000000000000051571111676220300141210ustar cheusovwheel/* bittest.c -- Test the bit functions, especially the counter * Created: Mon Oct 2 10:10:57 1995 by faith@dict.org * Copyright 1995, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 1, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" int main( int argc, char **argv ) { unsigned long t = 0; printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 0 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 1 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 2 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 3 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 4 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 5 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 6 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 7 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 31 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 30 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 29 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 28 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_set( &t, 27 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); printf( "\n" ); bit_clr( &t, 0 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_clr( &t, 31 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_clr( &t, 1 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_clr( &t, 4 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); bit_clr( &t, 7 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); printf( "\n" ); bit_clr( &t, 16 ); printf( "0x%08lx has %d bits set\n", t, bit_cnt( &t ) ); return 0; } libmaa-1.3.2/bittest.out010064400017500000000000000010210607204154300144720ustar cheusovwheel0x00000000 has 0 bits set 0x00000001 has 1 bits set 0x00000003 has 2 bits set 0x00000007 has 3 bits set 0x0000000f has 4 bits set 0x0000001f has 5 bits set 0x0000003f has 6 bits set 0x0000007f has 7 bits set 0x000000ff has 8 bits set 0x800000ff has 9 bits set 0xc00000ff has 10 bits set 0xe00000ff has 11 bits set 0xf00000ff has 12 bits set 0xf80000ff has 13 bits set 0xf80000fe has 12 bits set 0x780000fe has 11 bits set 0x780000fc has 10 bits set 0x780000ec has 9 bits set 0x7800006c has 8 bits set 0x7800006c has 8 bits set libmaa-1.3.2/config.guess010075500017500000000000001247531034602417200146230ustar cheusovwheel#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-08-03' # 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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 . # Please send patches to . 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 ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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 ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # 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 ; set_cc_for_build= ;' # 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 ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; 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 ;; 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 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; 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 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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 ;; 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 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; 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 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # 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 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build 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 -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; 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 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????: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 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; 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 ;; *: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 main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi 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 ;; *: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 ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 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 #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 -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 eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build 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 -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; 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 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; 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 ;; 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 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 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 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *: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 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; 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; } ;; 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; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; 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 ;; 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 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; 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 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # 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 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #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 } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; 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 ;; 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 ;; 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 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; 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 ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. 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 ;; 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|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 ;; 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 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; 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 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 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 | S7501*:*: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; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *: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 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; 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 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *: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 ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *: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 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; 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 < # 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\n"); 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 -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # 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 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; 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: libmaa-1.3.2/config.sub010075500017500000000000000757771034602417200143010ustar cheusovwheel#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-07-08' # 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., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, 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 . 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 ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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 ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # 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 ;; * ) 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 | -knuth | -cray) 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 \ | bfin \ | 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 | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | ms1 \ | msp430 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m32c) 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-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | 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-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | ms1-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | 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-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; m32c-*) ;; # 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 ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; 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 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; 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 ;; 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 ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; 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 ;; xbox) basic_machine=i686-pc os=-mingw32 ;; 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 ;; mmix) basic_machine=mmix-knuth ;; 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 ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-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* \ | -skyos* | -haiku*) # 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* | -haiku* \ | -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 ;; -zvmoe) os=-zvmoe ;; -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 ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-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 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: libmaa-1.3.2/configure.in010064400017500000000000000056461200301116600146020ustar cheusovwheeldnl Process this file with autoconf to produce a configure script for libmaa. dnl dnl Created: Sun Nov 6 13:56:03 1994 by faith@dict.org dnl Copyright 1994-1998, 2001-2002 Rickard E. Faith (faith@dict.org) dnl Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) dnl dnl This program is free software; you can redistribute it and/or modify it dnl under the terms of the GNU General Public License as published by the dnl Free Software Foundation; either version 1, or (at your option) any dnl later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License along dnl with this program; if not, write to the Free Software Foundation, Inc., dnl 675 Mass Ave, Cambridge, MA 02139, USA. dnl dnl Flag conventions: dnl CFLAGS and LDFLAGS should be settable on the make commandline dnl for optimization and stripping. AC_PREREQ(2.53) AC_REVISION($Revision: 1.61 $) AC_INIT AC_CONFIG_SRCDIR([maa.h]) AC_CONFIG_HEADER(config.h) MAA_MAJOR=1 MAA_MINOR=3 MAA_TEENY=2 echo Configuring for libmaa $MAA_MAJOR.$MAA_MINOR.$MAA_TEENY echo . AC_CANONICAL_HOST AC_PROG_AWK AC_PROG_CC #AC_PROG_LIBTOOL AC_ISC_POSIX if test "$CC" = gcc; then CFLAGS="-Wall -Werror $CFLAGS" fi dnl Checks for programs. echo Checking for programs AC_PROG_INSTALL AC_CHECK_PROGS(PERL,perl4 perl) AC_CHECK_PROGS(LATEX,latex2e latex) AC_CHECK_PROGS(FIG2DEV,fig2dev) AC_CHECK_PROGS(DVIPS,dvips) AC_CHECK_PROGS(REFBIBTEX,refbibtex) AC_CHECK_PROGS(BIBTEX,bibtex) AC_CHECK_PROG(LIBTOOL,libtool,libtool) echo . echo Checking for header file support AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS(strings.h limits.h stdint.h inttypes.h) AC_CHECK_HEADERS(sys/resource.h sys/time.h sys/param.h sys/wait.h) AC_MSG_CHECKING(for SYSLOG_NAMES support in syslog.h) AC_TRY_COMPILE([ #define SYSLOG_NAMES #include #include ], [ if (facilitynames [0].c_name && facilitynames [0].c_val) return 0; ], AC_DEFINE([HAVE_SYSLOG_NAMES], [], 1. [Description]) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) echo . echo Checking for system constants AC_TYPE_SIZE_T AC_TYPE_SIGNAL AC_C_INLINE AC_C_BIGENDIAN AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(long long int) echo . echo Checking for library functions AC_FUNC_ALLOCA AC_FUNC_VPRINTF AC_CHECK_FUNCS(snprintf) AC_CHECK_FUNCS(gettimeofday strerror memcpy atexit on_exit sysconf) AC_CHECK_FUNCS(strtol strtoul) AC_CHECK_FUNCS(vsyslog) AC_REPLACE_FUNCS(strtol strtoul) AC_REPLACE_FUNCS(strlcpy) echo . echo Making output files AC_SUBST(MAA_TEENY) AC_SUBST(MAA_MINOR) AC_SUBST(MAA_MAJOR) AC_SUBST(AWK) AC_SUBST(LIBTOOL) AC_CONFIG_FILES([Makefile doc/Makefile arggram2c]) AC_OUTPUT touch stamp-h.in touch stamp-h echo . echo Done libmaa-1.3.2/debug.c010064400017500000000000000153571200277615200135370ustar cheusovwheel/* debug.c -- Debugging support for Khepera * Created: Fri Dec 23 10:53:10 1994 by faith@dict.org * Copyright 1994-1997, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Debugging Support} * * \intro These routines provide low-level support for run-time debugging * messages. A set of global flags are maintained using "#define" * statements. These flags are assumed to be 32-bit integers, the top two * bits of which are used to select one of four sets of debugging lags. * Each set, therefore, has 30 bits of flag information. The last set * (i.e., when the top two bits are both set) is reserved for internal use * by the \khepera library. For convenience, each flag can be given a * unique name, so that flags can be set easily with command-line options. * */ #include "maaP.h" #define TEST(flags,var) (((flags)>>31) \ ? (((flags)>>30) \ ? ((var[3] & (flags)) << 2) \ : ((var[2] & (flags)) << 2)) \ : (((flags)>>30) \ ? ((var[1] & (flags)) << 2) \ : ((var[0] & (flags)) << 2))) static hsh_HashTable hash; static dbg_Type setFlags[4]; static dbg_Type usedFlags[4]; /* |_dbg_exists| returns non-zero if |flag| has been associated with a name (using the |_dbg_register| function). */ static int _dbg_exists( dbg_Type flag ) { return TEST( flag, usedFlags ); } /* |_dbg_name| returns a pointer to the name that was associated with the |flag|. */ static const char *_dbg_name( dbg_Type flag ) { hsh_Position position; void *key; void *datum; if (!hash) err_fatal( __func__, "No debugging names registered\n" ); HSH_ITERATE( hash, position, key, datum ) { if (flag == (dbg_Type)datum) { HSH_ITERATE_END( hash ); return key; } } return "unknown flag"; } /* |_dbg_register| is documented in the |dbg_register| section. */ void _dbg_register( dbg_Type flag, const char *name ) { dbg_Type tmp; for (tmp = flag & 0x3fffffff; tmp && !(tmp & 1); tmp >>= 1); if (!tmp || tmp >> 1) err_fatal( __func__, "Malformed flag (%lx):" " a single low-order bit must be set\n", flag ); if (!hash) hash = hsh_create( NULL, NULL ); if (_dbg_exists( flag )) err_fatal( __func__, "The debug flag %lx has been used for \"%s\"" " and cannot be reused for \"%s\"\n", flag, _dbg_name( flag ), name ); hsh_insert( hash, name, (void *)flag ); } /* \doc |dbg_register| is used to set up an asociated between a |flag| and a |name|. After this association is made, calls to |dbg_set| can use |name| to set the global debugging flag. Both of the high bits cannot be set simultaneously---these flags are reserved for internal use by the \khepera library.\footnote{For internal \khepera library use, |_dbg_register| can be used to register flags which have both high bits set.} */ void dbg_register( dbg_Type flag, const char *name ) { /* These values are reserved for Khepera */ if ((flag & 0xc0000000) == 0xc0000000) err_fatal( __func__, "Flag (%lx) may not have both high-order bits set\n", flag ); _dbg_register( flag, name ); } /* \doc |dbg_set| sets the |name| flag. If |name| is ``none,'' then all flags are cleared. */ void dbg_set( const char *name ) { dbg_Type flag; if (!name) err_internal( __func__, "name is NULL\n" ); if (!hash) err_fatal( __func__, "No debugging names registered\n" ); if (!strcmp( name, "none" )) { setFlags[0] = setFlags[1] = setFlags[2] = setFlags[3] = 0; return; } if (!strcmp( name, "all" )) { setFlags[0] = setFlags[1] = setFlags[2] = setFlags[3] = ~0; return; } if (!(flag = (dbg_Type)hsh_retrieve( hash, name ))) { if (!(flag = (dbg_Type)hsh_retrieve( hash, name+1 )) && *name != '-' && *name != '+') { fprintf( stderr, "Valid debugging flags are:\n" ); dbg_list( stderr ); err_fatal( __func__, "\"%s\" is not a valid debugging flag\n", name ); } else { if (*name == '+') setFlags[ flag >> 30 ] |= flag; else setFlags[ flag >> 30 ] &= ~flag; /* - */ } } else { setFlags[ flag >> 30 ] |= flag; } } /* \doc Used to set the flag using the predefined macro instead of the string name. */ void dbg_set_flag( dbg_Type flag ) { setFlags[ flag >> 30 ] |= flag; } /* \doc Used to unset the flag using the predefined macro instead of the string name. */ void dbg_unset_flag( dbg_Type flag ) { setFlags[ flag >> 30 ] &= ~flag; } /* \doc This function tests the |flag|, returning non-zero if the |flag| is set, and zero otherwise. */ int dbg_test( dbg_Type flag ) { return TEST( flag, setFlags ); } /* \doc |dbg_destroy| destroys the memory associated with the debugging support routines. This routine should \emph{never} be called by the programmer: it is automatically called at program termination on systems that support the |atexit| or |on_exit| calls. */ void dbg_destroy( void ) { if (hash) hsh_destroy( hash ); hash = NULL; setFlags[0] = setFlags[1] = setFlags[2] = setFlags[3] = 0; usedFlags[0] = usedFlags[1] = usedFlags[2] = usedFlags[3] = 0; } static int _dbg_user( const void *key, const void *datum, void *arg ) { FILE *stream = (FILE *)arg; dbg_Type flag = (dbg_Type)datum; if ((flag & 0xc0000000) != 0xc0000000) fprintf( stream, " %s\n", (char *)key ); return 0; } static int _dbg_builtin( const void *key, const void *datum, void *arg ) { FILE *stream = (FILE *)arg; dbg_Type flag = (dbg_Type)datum; if ((flag & 0xc0000000) == 0xc0000000) fprintf( stream, " %s (builtin)\n", (char *)key ); return 0; } /* |dbg_list| lists all of the valid user-level debugging flags to the specified |stream|. */ void dbg_list( FILE *stream ) { hsh_iterate_arg( hash, _dbg_user, stream ); hsh_iterate_arg( hash, _dbg_builtin, stream ); } libmaa-1.3.2/configure010075500017500000000000005302151200301156100141720ustar cheusovwheel#! /bin/sh # From configure.in Revision: 1.61 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="maa.h" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS MAA_MAJOR MAA_MINOR MAA_TEENY LIBOBJS ALLOCA EGREP GREP CPP LIBTOOL BIBTEX REFBIBTEX DVIPS FIG2DEV LATEX PERL INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC AWK host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures 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 \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF 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 Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 &5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" MAA_MAJOR=1 MAA_MINOR=3 MAA_TEENY=2 echo Configuring for libmaa $MAA_MAJOR.$MAA_MINOR.$MAA_TEENY echo . ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #AC_PROG_LIBTOOL { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if ${ac_cv_search_strerror+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char strerror (); int main () { return strerror (); ; return 0; } _ACEOF for ac_lib in '' cposix; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_strerror=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_strerror+:} false; then : break fi done if ${ac_cv_search_strerror+:} false; then : else ac_cv_search_strerror=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5 $as_echo "$ac_cv_search_strerror" >&6; } ac_res=$ac_cv_search_strerror if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi if test "$CC" = gcc; then CFLAGS="-Wall -Werror $CFLAGS" fi echo Checking for programs # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' for ac_prog in perl4 perl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PERL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_PERL="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PERL" && break done for ac_prog in latex2e latex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LATEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LATEX"; then ac_cv_prog_LATEX="$LATEX" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LATEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LATEX=$ac_cv_prog_LATEX if test -n "$LATEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LATEX" >&5 $as_echo "$LATEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LATEX" && break done for ac_prog in fig2dev do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_FIG2DEV+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$FIG2DEV"; then ac_cv_prog_FIG2DEV="$FIG2DEV" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_FIG2DEV="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi FIG2DEV=$ac_cv_prog_FIG2DEV if test -n "$FIG2DEV"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIG2DEV" >&5 $as_echo "$FIG2DEV" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$FIG2DEV" && break done for ac_prog in dvips do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DVIPS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DVIPS"; then ac_cv_prog_DVIPS="$DVIPS" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DVIPS="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DVIPS=$ac_cv_prog_DVIPS if test -n "$DVIPS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DVIPS" >&5 $as_echo "$DVIPS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DVIPS" && break done for ac_prog in refbibtex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_REFBIBTEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$REFBIBTEX"; then ac_cv_prog_REFBIBTEX="$REFBIBTEX" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_REFBIBTEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi REFBIBTEX=$ac_cv_prog_REFBIBTEX if test -n "$REFBIBTEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $REFBIBTEX" >&5 $as_echo "$REFBIBTEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$REFBIBTEX" && break done for ac_prog in bibtex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_BIBTEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$BIBTEX"; then ac_cv_prog_BIBTEX="$BIBTEX" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_BIBTEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi BIBTEX=$ac_cv_prog_BIBTEX if test -n "$BIBTEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BIBTEX" >&5 $as_echo "$BIBTEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$BIBTEX" && break done # Extract the first word of "libtool", so it can be a program name with args. set dummy libtool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIBTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIBTOOL"; then ac_cv_prog_LIBTOOL="$LIBTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIBTOOL="libtool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIBTOOL=$ac_cv_prog_LIBTOOL if test -n "$LIBTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBTOOL" >&5 $as_echo "$LIBTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi echo . echo Checking for header file support ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in strings.h limits.h stdint.h inttypes.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/resource.h sys/time.h sys/param.h sys/wait.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSLOG_NAMES support in syslog.h" >&5 $as_echo_n "checking for SYSLOG_NAMES support in syslog.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define SYSLOG_NAMES #include #include int main () { if (facilitynames [0].c_name && facilitynames [0].c_val) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_SYSLOG_NAMES /**/" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext echo . echo Checking for system constants ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; 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 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # The cast to long int 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # The cast to long int 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if ${ac_cv_sizeof_long+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 $as_echo_n "checking size of void *... " >&6; } if ${ac_cv_sizeof_void_p+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : else if test "$ac_cv_type_void_p" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (void *) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_void_p=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 $as_echo "$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF # The cast to long int 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. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5 $as_echo_n "checking size of long long int... " >&6; } if ${ac_cv_sizeof_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default"; then : else if test "$ac_cv_type_long_long_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5 $as_echo "$ac_cv_sizeof_long_long_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int _ACEOF echo . echo Checking for library functions # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 $as_echo_n "checking for working alloca.h... " >&6; } if ${ac_cv_working_alloca_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_working_alloca_h=yes else ac_cv_working_alloca_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 $as_echo "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then $as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 $as_echo_n "checking for alloca... " >&6; } if ${ac_cv_func_alloca_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) # include # else # ifdef HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ void *alloca (size_t); # endif # endif # endif # endif #endif int main () { char *p = (char *) alloca (1); if (p) return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_func_alloca_works=yes else ac_cv_func_alloca_works=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 $as_echo "$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h 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=\${LIBOBJDIR}alloca.$ac_objext $as_echo "#define C_ALLOCA 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 $as_echo "$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 $as_echo_n "checking stack direction for C alloca... " >&6; } if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_c_stack_direction=0 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default 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 () { return find_stack_direction () < 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_stack_direction=1 else ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 $as_echo "$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_func in snprintf do : ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" if test "x$ac_cv_func_snprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SNPRINTF 1 _ACEOF fi done for ac_func in gettimeofday strerror memcpy atexit on_exit sysconf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in strtol strtoul do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in vsyslog do : ac_fn_c_check_func "$LINENO" "vsyslog" "ac_cv_func_vsyslog" if test "x$ac_cv_func_vsyslog" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VSYSLOG 1 _ACEOF fi done ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" if test "x$ac_cv_func_strtol" = xyes; then : $as_echo "#define HAVE_STRTOL 1" >>confdefs.h else case " $LIBOBJS " in *" strtol.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtol.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul" if test "x$ac_cv_func_strtoul" = xyes; then : $as_echo "#define HAVE_STRTOUL 1" >>confdefs.h else case " $LIBOBJS " in *" strtoul.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtoul.$ac_objext" ;; esac fi ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" if test "x$ac_cv_func_strlcpy" = xyes; then : $as_echo "#define HAVE_STRLCPY 1" >>confdefs.h else case " $LIBOBJS " in *" strlcpy.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strlcpy.$ac_objext" ;; esac fi echo . echo Making output files ac_config_files="$ac_config_files Makefile doc/Makefile arggram2c" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "arggram2c") CONFIG_FILES="$CONFIG_FILES arggram2c" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi touch stamp-h.in touch stamp-h echo . echo Done libmaa-1.3.2/debugtest.c010064400017500000000000000031061111676220300144210ustar cheusovwheel/* debugtest.c -- * Created: Sun Dec 25 18:57:38 1994 by faith@dict.org * Copyright 1994, 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 1, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" #include #define DBG_VERBOSE 0x00000001 #define DBG_TEST 0x00000002 int main( int argc, char **argv ) { int c; maa_init( argv[0] ); dbg_register( DBG_VERBOSE, "verbose" ); dbg_register( DBG_TEST, "test" ); while ((c = getopt( argc, argv, "d:" )) != -1) { switch (c) { case 'd': dbg_set( optarg ); break; default: fprintf( stderr, "Usage: debugtest [-dverbose] [-dtest]\n" ); break; } } if (dbg_test( DBG_VERBOSE )) printf( "Verbose set\n" ); else printf( "Verbose not set\n" ); if (dbg_test( DBG_TEST )) printf( "Test set\n" ); else printf( "Test not set\n" ); return 0; } libmaa-1.3.2/debugtest.out010064400017500000000000000000350607204154400150070ustar cheusovwheelVerbose not set Test not set libmaa-1.3.2/error.c010064400017500000000000000122621111676220300135670ustar cheusovwheel/* error.c -- Error reporting routines for Khepera * Created: Wed Dec 21 12:55:00 1994 by faith@dict.org * Copyright 1994-1997, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Error Reporting Routines} * * \intro Several error reporting routines are provided. These routines * are always used to print errors generated within the \khepera library, * and are available for the programmer as well. * */ #include "maaP.h" #include const char *_err_programName; /* \doc |err_set_program_name| records the value of |argv[0]| for the calling program. If this value is not "NULL", then it will be used when printing errors and warnings. */ void err_set_program_name( const char *programName ) { const char *pt =strrchr( programName, '/' ); if (pt) _err_programName = pt + 1; else _err_programName = programName; } /* \doc |err_program_name| returns the value of |programName| that was previously set with |err_set_program_name|. This value may be "NULL". */ const char *err_program_name( void ) { return _err_programName; } /* \doc |err_fatal| flushes "stdout", prints a fatal error report on "stderr", flushes "stderr" and "stdout", and calls |exit|. |routine| is the name of the routine in which the error took place. */ void err_fatal( const char *routine, const char *format, ... ) { va_list ap; fflush( stdout ); if (_err_programName) { if (routine) fprintf( stderr, "%s (%s): ", _err_programName, routine ); else fprintf( stderr, "%s: ", _err_programName ); } else { if (routine) fprintf( stderr, "%s: ", routine ); } va_start( ap, format ); vfprintf( stderr, format, ap ); log_error_va( routine, format, ap ); va_end( ap ); fflush( stderr ); fflush( stdout ); exit ( 1 ); } /* \doc |err_fatal_errno| flushes "stdout", prints a fatal error report on "stderr", prints the system error corresponding to |errno|, flushes "stderr" and "stdout", and calls |exit|. |routine| is the name of the routine in which the error took place. */ void err_fatal_errno( const char *routine, const char *format, ... ) { va_list ap; int errorno = errno; fflush( stdout ); if (_err_programName) { if (routine) fprintf( stderr, "%s (%s): ", _err_programName, routine ); else fprintf( stderr, "%s: ", _err_programName ); } else { if (routine) fprintf( stderr, "%s: ", routine ); } va_start( ap, format ); vfprintf( stderr, format, ap ); log_error_va( routine, format, ap ); va_end( ap ); #if HAVE_STRERROR fprintf( stderr, "%s: %s\n", routine, strerror( errorno ) ); log_error( routine, "%s: %s\n", routine, strerror( errorno ) ); #else errno = errorno; perror( routine ); log_error( routine, "%s: errno = %d\n", routine, errorno ); #endif fflush( stderr ); fflush( stdout ); exit( 1 ); } /* \doc |err_warning| flushes "stdout", prints a non-fatal warning on "stderr", and returns to the caller. |routine| is the name of the calling routine. */ void err_warning( const char *routine, const char *format, ... ) { va_list ap; fflush( stdout ); fflush( stderr ); if (_err_programName) { if (routine) fprintf( stderr, "%s (%s): ", _err_programName, routine ); else fprintf( stderr, "%s: ", _err_programName ); } else { if (routine) fprintf( stderr, "%s: ", routine ); } va_start( ap, format ); vfprintf( stderr, format, ap ); log_error_va( routine, format, ap ); va_end( ap ); } /* \doc |err_internal| flushes "stdout", prints the fatal error message, flushes "stderr" and "stdout", and calls |abort| so that a core dump is generated. */ void err_internal( const char *routine, const char *format, ... ) { va_list ap; fflush( stdout ); if (_err_programName) { if (routine) fprintf( stderr, "%s (%s): Internal error\n ", _err_programName, routine ); else fprintf( stderr, "%s: Internal error\n ", _err_programName ); } else { if (routine) fprintf( stderr, "%s: Internal error\n ", routine ); else fprintf( stderr, "Internal error\n " ); } va_start( ap, format ); vfprintf( stderr, format, ap ); log_error( routine, format, ap ); va_end( ap ); if (_err_programName) fprintf( stderr, "Aborting %s...\n", _err_programName ); else fprintf( stderr, "Aborting...\n" ); fflush( stderr ); fflush( stdout ); abort(); } libmaa-1.3.2/export.sym010064400017500000000000000055111144072771700143570ustar cheusovwheelmaa_init maa_shutdown maa_version_major maa_version_minor maa_version xmalloc xcalloc xrealloc xfree xstrdup bit_set bit_clr bit_tst bit_cnt prm_is_prime prm_next_prime hsh_create hsh_destroy hsh_insert hsh_delete hsh_retrieve hsh_iterate hsh_iterate_arg hsh_get_stats hsh_print_stats hsh_string_hash hsh_pointer_hash hsh_string_compare hsh_pointer_compare hsh_key_strings hsh_init_position hsh_next_position hsh_get_position hsh_readonly set_create set_get_hash set_get_compare set_destroy set_insert set_delete set_member set_iterate set_iterate_arg set_add set_del set_union set_inter set_diff set_equal set_get_stats set_print_stats set_count set_init_position set_next_position set_get_position set_readonly stk_create stk_destroy stk_push stk_pop stk_top lst_create lst_destroy lst_append lst_push lst_pop lst_top lst_nth_get lst_nth_set lst_member lst_length lst_iterate lst_iterate_arg lst_truncate lst_truncate_position lst_init_position lst_last_position lst_next_position lst_nth_position lst_get_position lst_set_position lst_dump _lst_shutdown lst_total_allocated err_set_program_name err_program_name err_fatal err_fatal_errno err_warning err_internal mem_create_strings mem_destroy_strings mem_strcpy mem_strncpy mem_grow mem_finish mem_get_string_stats mem_print_string_stats mem_create_objects mem_destroy_objects mem_get_object mem_get_empty_object mem_free_object mem_get_object_stats mem_print_object_stats str_pool_create str_pool_destroy str_pool_exists str_pool_find str_pool_copy str_pool_copyn str_pool_grow str_pool_finish str_pool_get_stats str_pool_print_stats str_pool_init_position str_pool_next_position str_pool_get_position str_pool_iterate str_pool_iterate_arg str_exists str_find str_findn str_copy str_copyn str_grow str_finish str_unique str_destroy str_get_stats str_print_stats dbg_register _dbg_register dbg_destroy dbg_set dbg_set_flag dbg_unset_flag dbg_test dbg_list flg_register flg_destroy flg_set flg_test flg_list flg_name tim_start tim_stop tim_reset tim_get_real tim_get_user tim_get_system tim_print_timer tim_print_timers _tim_shutdown arg_create arg_destroy arg_add arg_addn arg_grow arg_finish arg_get arg_count arg_get_vector arg_argify pr_open pr_close_nowait pr_close pr_wait _pr_shutdown pr_spawn pr_readwrite pr_filter sl_create sl_destroy _sl_shutdown sl_insert sl_delete sl_find sl_iterate sl_iterate_arg _sl_dump txt_soundex txt_soundex2 b64_encode b64_decode b64_decode_buf b26_encode b26_decode src_create src_destroy src_line src_new_file src_new_line src_advance src_cpp_line src_get src_filename src_linenumber src_offset src_length src_source_line src_parse_error src_print_error src_print_message src_print_line src_get_stats src_print_stats prs_register_concrete prs_concrete _prs_shutdown log_syslog log_set_facility log_get_facility log_option log_file log_stream log_close log_error_va log_error log_info_va log_info libmaa-1.3.2/flags.c010064400017500000000000000124141200277615200135340ustar cheusovwheel/* flags.c -- Flag support for Khepera * Created: Sat Mar 23 10:11:52 1996 by faith@dict.org * Copyright 1994-1997, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Flag Support} * * \intro These routines provide low-level support for run-time program * flow control. The mechanism used is similar to that used for debugging * messages. A set of global flags are maintained using "#define" * statements. These flags are assumed to be 32-bit integers, the top two * bits of which are used to select one of four sets of debugging lags. * Each set, therefore, has 30 bits of flag information. For convenience, * each flag can be given a unique name, so that flags can be set easily * with command-line options. * */ #include "maaP.h" #define TEST(flags,var) (((flags)>>31) \ ? (((flags)>>30) \ ? ((var[3] & (flags)) << 2) \ : ((var[2] & (flags)) << 2)) \ : (((flags)>>30) \ ? ((var[1] & (flags)) << 2) \ : ((var[0] & (flags)) << 2))) static hsh_HashTable hash; static flg_Type setFlags[4]; static flg_Type usedFlags[4]; /* |_flg_exists| returns non-zero if |flag| has been associated with a name (using the |flg_register| function). */ static int _flg_exists( flg_Type flag ) { return TEST( flag, usedFlags ); } /* |flg_name| returns a pointer to the name that was associated with the |flag|. */ const char *flg_name( flg_Type flag ) { hsh_Position position; void *key; void *datum; HSH_ITERATE( hash, position, key, datum ) { if (flag == (flg_Type)datum) { HSH_ITERATE_END( hash ); return key; } } return "unknown flag"; } /* \doc |flg_register| is used to set up an asociated between a |flag| and a |name|. After this association is made, calls to |flg_set| can use |name| to set the global flag. */ void flg_register( flg_Type flag, const char *name ) { flg_Type tmp; for (tmp = flag & 0x3fffffff; tmp && !(tmp & 1); tmp >>= 1); if (!tmp || tmp >> 1) err_fatal( __func__, "Malformed flag (%lx):" " a single low-order bit must be set\n", flag ); if (!hash) hash = hsh_create( NULL, NULL ); if (_flg_exists( flag )) err_fatal( __func__, "The flag %lx has been used for \"%s\"" " and cannot be reused for \"%s\"\n", flag, flg_name( flag ), name ); hsh_insert( hash, name, (void *)flag ); } /* \doc |flg_set| sets the |name| flag. If |name| is ``none,'' then all flags are cleared. */ void flg_set( const char *name ) { flg_Type flag; if (!name) err_internal( __func__, "name is NULL\n" ); if (!hash) err_fatal( __func__, "No flag names registered\n" ); if (!strcmp( name, "none" )) { setFlags[0] = setFlags[1] = setFlags[2] = setFlags[3] = 0; return; } if (!strcmp( name, "all" )) { setFlags[0] = setFlags[1] = setFlags[2] = setFlags[3] = ~0; return; } if (!(flag = (flg_Type)hsh_retrieve( hash, name ))) { flag = 0; if ( (*name != '-' && *name != '+') || !(flag = (flg_Type) hsh_retrieve( hash, name+1 ))) { fprintf( stderr, "Valid flags are:\n" ); flg_list( stderr ); err_fatal( __func__, "\"%s\" is not a valid flag\n", name ); } else { if (flag){ if (*name == '+') setFlags[ flag >> 30 ] |= flag; else setFlags[ flag >> 30 ] &= ~flag; /* - */ } } } else { setFlags[ flag >> 30 ] |= flag; } } /* \doc This function tests the |flag|, returning non-zero if the |flag| is set, and zero otherwise. */ int flg_test( flg_Type flag ) { return TEST( flag, setFlags ); } /* \doc |flg_destroy| destroys the memory associated with the flag support routines. This routine should \emph{never} be called by the programmer: it is automatically called at program termination on systems that support the |atexit| or |on_exit| calls. */ void flg_destroy( void ) { if (hash) hsh_destroy( hash ); hash = NULL; setFlags[0] = setFlags[1] = setFlags[2] = setFlags[3] = 0; usedFlags[0] = usedFlags[1] = usedFlags[2] = usedFlags[3] = 0; } static int _flg_user( const void *key, const void *datum, void *arg ) { FILE *stream = (FILE *)arg; fprintf( stream, " %s\n", (char *)key ); return 0; } /* |flg_list| lists all of the valid flags to the specified |stream|. */ void flg_list( FILE *stream ) { hsh_iterate_arg( hash, _flg_user, stream ); } libmaa-1.3.2/hash.c010064400017500000000000000417251111676220300133670ustar cheusovwheel/* hash.c -- Hash table routines for Khepera * Created: Thu Nov 3 20:07:29 1994 by faith@dict.org * Copyright 1994-1997, 1999, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Hash Table Routines} * * \intro Generic hash table support is provided for storing generic data * associated with keys. The hash table has prime length, with * self-organizing linked lists \cite[pp.~398--9]{faith:Knuth73c} used for * collision resolution. The hash table automatically grows as necessary to * preserve efficient access. * */ #include "maaP.h" typedef struct bucket { const void *key; unsigned long hash; const void *datum; struct bucket *next; } *bucketType; typedef struct table { #if MAA_MAGIC int magic; #endif unsigned long prime; unsigned long entries; bucketType *buckets; unsigned long resizings; unsigned long retrievals; unsigned long hits; unsigned long misses; unsigned long (*hash)( const void * ); int (*compare)( const void *, const void * ); int readonly; } *tableType; static void _hsh_check( tableType t, const char *function ) { if (!t) err_internal( function, "table is null\n" ); #if MAA_MAGIC if (t->magic != HSH_MAGIC) err_internal( function, "Magic match failed: 0x%08x (should be 0x%08x)\n", t->magic, HSH_MAGIC ); #endif if (!t->buckets) err_internal( function, "no buckets\n" ); } static hsh_HashTable _hsh_create( unsigned long seed, unsigned long (*hash)( const void * ), int (*compare)( const void *, const void * )) { tableType t; unsigned long i; unsigned long prime = prm_next_prime( seed ); t = xmalloc( sizeof( struct table ) ); #if MAA_MAGIC t->magic = HSH_MAGIC; #endif t->prime = prime; t->entries = 0; t->buckets = xmalloc( prime * sizeof( struct bucket ) ); t->resizings = 0; t->retrievals = 0; t->hits = 0; t->misses = 0; t->hash = hash ? hash : hsh_string_hash; t->compare = compare ? compare : hsh_string_compare; t->readonly = 0; for (i = 0; i < prime; i++) t->buckets[i] = NULL; return t; } /* \doc The |hsh_create| function initilizes a generic hash table. Keys and data are pointers to "void". The internal representation of the hash table will grow automatically when an insertion is performed and the table is more than half full. The |hash| function should take a pointer to a |key| and return an "unsigned long". If |hash| is "NULL", then the |key| is assumed to be a pointer to a null-terminated string, and the function shown in \grind{hsh_string_hash} will be used for |hash| (the algorithm for this function is from \cite[p.~435]{faith:Aho88}). The |compare| function should take a pair of pointers to keys and return zero if the keys are equal and non-zero if the keys are not equal. If |compare| is "NULL", then the keys are assumed to point to null-terminated strings, and the |strcmp| function will be used for |compare|. Additionally, the |hsh_pointer_hash| and |hsh_pointer_compare| functions are available and can be used to treat the \emph{value} of the "void" pointer as the key. These functions are often useful for maintaining sets of objects. */ hsh_HashTable hsh_create( unsigned long (*hash)( const void * ), int (*compare)( const void *, const void * ) ) { return _hsh_create( 0, hash, compare ); } static void _hsh_destroy_buckets( hsh_HashTable table ) { unsigned long i; tableType t = (tableType)table; _hsh_check( t, __func__ ); for (i = 0; i < t->prime; i++) { bucketType b = t->buckets[i]; while (b) { bucketType next = b->next; xfree( b ); /* terminal */ b = next; } } xfree( t->buckets ); /* terminal */ t->buckets = NULL; } static void _hsh_destroy_table( hsh_HashTable table ) { tableType t = (tableType)table; #if MAA_MAGIC t->magic = HSH_MAGIC_FREED; #endif xfree( t ); /* terminal */ } /* \doc |hsh_destroy| frees all of the memory associated with the hash table. The memory used by keys and data is \emph{not} freed---this memory is the responsibility of the user. However, a call to |hsh_iterate| can be used to free this memory \emph{immediately} before a call to |hsh_destroy|. */ void hsh_destroy( hsh_HashTable table ) { _hsh_check( table, __func__ ); if (((tableType)table)->readonly) err_internal( __func__, "Attempt to destroy readonly table\n" ); _hsh_destroy_buckets( table ); _hsh_destroy_table( table ); } static void _hsh_insert( hsh_HashTable table, unsigned long hash, const void *key, const void *datum ) { tableType t = (tableType)table; unsigned long h = hash % t->prime; bucketType b; _hsh_check( t, __func__ ); b = xmalloc( sizeof( struct bucket ) ); b->key = key; b->hash = hash; b->datum = datum; b->next = NULL; if (t->buckets[h]) b->next = t->buckets[h]; t->buckets[h] = b; ++t->entries; } /* \doc |hsh_insert| inserts a new |key| into the |table|. If the insertion is successful, zero is returned. If the |key| already exists, 1 is returned. Hence, the way to change the |datum| associated with a |key| is first to call |hsh_delete|. If the internal representation of the hash table becomes more than half full, its size is increased automatically. At present, this requires that all of the key pointers are copied into a new table. Rehashing is not required, however, since the hash values are stored for each key. */ int hsh_insert( hsh_HashTable table, const void *key, const void *datum ) { tableType t = (tableType)table; unsigned long hashValue = t->hash( key ); unsigned long h; _hsh_check( t, __func__ ); if (t->readonly) err_internal( __func__, "Attempt to insert into readonly table\n" ); /* Keep table less than half full */ if (t->entries * 2 > t->prime) { tableType new = _hsh_create( t->prime * 3, t->hash, t->compare ); unsigned long i; for (i = 0; i < t->prime; i++) { if (t->buckets[i]) { bucketType pt; for (pt = t->buckets[i]; pt; pt = pt->next) _hsh_insert( new, pt->hash, pt->key, pt->datum ); } } /* fixup values */ _hsh_destroy_buckets( t ); t->prime = new->prime; t->buckets = new->buckets; _hsh_destroy_table( new ); ++t->resizings; } h = hashValue % t->prime; if (t->buckets[h]) { /* Assert uniqueness */ bucketType pt; for (pt = t->buckets[h]; pt; pt = pt->next) if (!t->compare( pt->key, key )) return 1; } _hsh_insert( t, hashValue, key, datum ); return 0; } /* \doc |hsh_delete| removes a |key| and the associated datum from the |table|. Zero is returned if the |key| was present. Otherwise, 1 is returned. */ int hsh_delete( hsh_HashTable table, const void *key ) { tableType t = (tableType)table; unsigned long h = t->hash( key ) % t->prime; _hsh_check( t, __func__ ); if (t->readonly) err_internal( __func__, "Attempt to delete from readonly table\n" ); if (t->buckets[h]) { bucketType pt; bucketType prev; for (prev = NULL, pt = t->buckets[h]; pt; prev = pt, pt = pt->next) if (!t->compare( pt->key, key )) { --t->entries; if (!prev) t->buckets[h] = pt->next; else prev->next = pt->next; xfree( pt ); return 0; } } return 1; } /* \doc |hsh_retrieve| retrieves the datum associated with a |key|. If the |key| is not present in the |table|, then "NULL" is returned. */ const void *hsh_retrieve( hsh_HashTable table, const void *key ) { tableType t = (tableType)table; unsigned long h = t->hash( key ) % t->prime; _hsh_check( t, __func__ ); ++t->retrievals; if (t->buckets[h]) { bucketType pt; bucketType prev; for (prev = NULL, pt = t->buckets[h]; pt; prev = pt, pt = pt->next) if (!t->compare( pt->key, key )) { if (!prev) { ++t->hits; } else if (!t->readonly) { /* Self organize */ prev->next = pt->next; pt->next = t->buckets[h]; t->buckets[h] = pt; } return pt->datum; } } ++t->misses; return NULL; } /* \doc |hsh_iterate| is used to iterate a function over every value in the |table|. The function, |iterator|, is passed the |key| and |datum| pair for each entry in the table. If |iterator| returns a non-zero value, the iterations stop, and |hsh_iterate| returns non-zero. Note that the keys are in some arbitrary order, and that this order may change between two successive calls to |hsh_iterate|. */ int hsh_iterate( hsh_HashTable table, int (*iterator)( const void *key, const void *datum ) ) { tableType t = (tableType)table; unsigned long i; bucketType pt; bucketType next; /* Save, because pt might vanish. */ _hsh_check( t, __func__ ); for (i = 0; i < t->prime; i++) { if (t->buckets[i]) { for (pt = t->buckets[i]; pt; pt = next) { next = pt->next; if (iterator( pt->key, pt->datum )) return 1; } } } return 0; } /* \doc |hsh_iterate_arg| is used to iterate a function over every value in the |table|. The function, |iterator|, is passed the |key| and |datum| pair for each entry in the table. If |iterator| returns a non-zero value, the iterations stop, and |hsh_iterate| returns non-zero. Note that the keys are in some arbitrary order, and that this order may change between two successive calls to |hsh_iterate|. */ int hsh_iterate_arg( hsh_HashTable table, int (*iterator)( const void *key, const void *datum, void *arg ), void *arg ) { tableType t = (tableType)table; unsigned long i; bucketType pt; bucketType next; /* Save, because pt might vanish. */ _hsh_check( t, __func__ ); for (i = 0; i < t->prime; i++) { if (t->buckets[i]) { for (pt = t->buckets[i]; pt; pt = next) { next = pt->next; if (iterator( pt->key, pt->datum, arg )) return 1; } } } return 0; } /* a function callable from hsh_iterate() to print key values */ static int _hsh_key_strings( const void *k, const void *d ) { const char *s; static int i = 0; if (k == NULL) { i=0; return 0; } s = k; printf("%s ",s); if ((i += strlen(s)+2) >= 60) { i=0; printf("\n"); } return 0; } /* print all keys in table t as strings */ void hsh_key_strings(hsh_HashTable t) { _hsh_key_strings(NULL,NULL); hsh_iterate(t,_hsh_key_strings); printf("\n"); } /* \doc |hsh_get_stats| returns statistics about the |table|. The |hsh_Stats| structure is shown in \grind{hsh_Stats}. */ hsh_Stats hsh_get_stats( hsh_HashTable table ) { tableType t = (tableType)table; hsh_Stats s = xmalloc( sizeof( struct hsh_Stats ) ); unsigned long i; unsigned count; _hsh_check( t, __func__ ); s->size = t->prime; s->resizings = t->resizings; s->entries = 0; s->buckets_used = 0; s->singletons = 0; s->maximum_length = 0; s->retrievals = t->retrievals; s->hits = t->hits; s->misses = t->misses; for (i = 0; i < t->prime; i++) { if (t->buckets[i]) { bucketType pt; ++s->buckets_used; for (count = 0, pt = t->buckets[i]; pt; ++count, pt = pt->next); if (count == 1) ++s->singletons; s->maximum_length = max( s->maximum_length, count ); s->entries += count; } } if (t->entries != s->entries ) err_internal( __func__, "Incorrect count for entries: %lu vs. %lu\n", t->entries, s->entries ); return s; } /* \doc |hsh_print_stats| prints the statistics for |table| on the specified |stream|. If |stream| is "NULL", then "stdout" will be used. */ void hsh_print_stats( hsh_HashTable table, FILE *stream ) { FILE *str = stream ? stream : stdout; hsh_Stats s = hsh_get_stats( table ); _hsh_check( table, __func__ ); fprintf( str, "Statistics for hash table at %p:\n", table ); fprintf( str, " %lu resizings to %lu total\n", s->resizings, s->size ); fprintf( str, " %lu entries (%lu buckets used, %lu without overflow)\n", s->entries, s->buckets_used, s->singletons ); fprintf( str, " maximum list length is %lu", s->maximum_length ); if (s->buckets_used) fprintf( str, " (optimal is %.1f)\n", (double)s->entries / (double)s->buckets_used ); else fprintf( str, "\n" ); fprintf( str, " %lu retrievals (%lu from top, %lu failed)\n", s->retrievals, s->hits, s->misses ); xfree( s ); /* rare */ } unsigned long hsh_string_hash( const void *key ) { const char *pt = (const char *)key; unsigned long h = 0; if (!pt) err_internal( __func__, "String-valued keys may not be NULL\n" ); while (*pt) { h += *pt++; #if 0 h *= 65599L; /* prime near %$2^{16}$% */ #else h *= 2654435789U; /* prime near %$\frac{\sqrt{5}-1}{2}2^{32}$% */ #endif } return h & 0xffffffff; } unsigned long hsh_pointer_hash( const void *key ) { const char *pt; unsigned long h = 0; int i; #ifdef WORDS_BIGENDIAN pt = ((const char *)&key) + SIZEOF_VOID_P - 1; #else pt = (const char *)&key; #endif for (i = 0; i < SIZEOF_VOID_P; i++) { #ifdef WORDS_BIGENDIAN h += *pt--; #else h += *pt++; #endif #if 0 h *= 65599L; /* prime near %$2^{16}$% */ #else h *= 2654435789U; /* prime near %$\frac{\sqrt{5}-1}{2}2^{32}$% */ #endif } return h & 0xffffffff; } int hsh_string_compare( const void *key1, const void *key2 ) { if (!key1 || !key2) err_internal( __func__, "String-valued keys may not be NULL: key1=%p, key2=%p\n", key1, key2 ); return strcmp( (const char *)key1, (const char *)key2 ); } int hsh_pointer_compare( const void *key1, const void *key2 ) { const char *p1 = (const char *)&key1; const char *p2 = (const char *)&key2; int i; for (i = 0; i < SIZEOF_VOID_P; i++) if (*p1++ != *p2++) return 1; return 0; } /* \doc |hsh_init_position| returns a position marker for some arbitary first element in the table. This marker can be used with |hsh_next_position| and |hsh_get_position|. */ hsh_Position hsh_init_position( hsh_HashTable table ) { tableType t = (tableType)table; unsigned long i; _hsh_check( t, __func__ ); for (i = 0; i < t->prime; i++) if (t->buckets[i]) { t->readonly = 1; return t->buckets[i]; } return NULL; } /* \doc |hsh_next_position| returns a position marker for the next element in the table. Elements are in arbitrary order based on their positions in the hash table. */ hsh_Position hsh_next_position( hsh_HashTable table, hsh_Position position ) { tableType t = (tableType)table; bucketType b = (bucketType)position; unsigned long i; unsigned long h; _hsh_check( t, __func__ ); if (!b) { t->readonly = 0; return NULL; } if (b->next) return b->next; for (h = b->hash % t->prime, i = h + 1; i < t->prime; i++) if (t->buckets[i]) return t->buckets[i]; t->readonly = 0; return NULL; } /* \doc |hsh_get_position| returns the datum associated with the |position| marker, or "NULL" if there is no such datum. |key| is set to the key associated with this datum, or "NULL" is there is no such datum. */ void *hsh_get_position( hsh_Position position, void **key ) { bucketType b = (bucketType)position; *key = NULL; if (!b) return NULL; *key = (void *)b->key; /* Discard const */ return (void *)b->datum; /* Discard const */ } /* \doc |hsh_readonly| sets the |readonly| flag for the |table| to |flag|. |flag| should be 0 or 1. The value of the previous flag is returned. When a hash table is marked as readonly, self-organization of the bucket-overflow lists will not take place, and any attempt to modify the list (e.g., insertion or deletion) will result in an error. */ int hsh_readonly( hsh_HashTable table, int flag ) { tableType t = (tableType)table; int current; _hsh_check( t, __func__ ); current = t->readonly; t->readonly = flag; return current; } libmaa-1.3.2/hashtest.c010064400017500000000000000103051111676220300142550ustar cheusovwheel/* hashtest.c -- Test program for Khepera hash table routines * Created: Sun Nov 6 18:55:23 1994 by faith@dict.org * Copyright 1994, 1995, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 1, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" extern void init_rand( void ); extern int get_rand( int ll, int ul ); static int iterator( const void *key, const void *datum ) { printf( "%s: %s\n", (const char *)key, (const char *)datum ); return 0; } static int freer( const void *key, const void *datum ) { xfree( (void *)datum ); xfree( (void *)key ); return 0; } static int free_data( const void *key, const void *datum ) { xfree( (void *)datum ); return 0; } int main( int argc, char **argv ) { hsh_HashTable t; int i; int j; int count; if (argc == 1) { count = 100; } else if (argc != 2 ) { fprintf( stderr, "usage: hashtest count\n" ); return 1; } else { count = atoi( argv[1] ); } printf( "Running test for count of %d\n", count ); /* Test sequential keys */ t = hsh_create( NULL, NULL ); for (i = 0; i < count; i++) { char *key = xmalloc( 20 ); char *datum = xmalloc( 20 ); sprintf( key, "key%d", i ); sprintf( datum, "datum%d", i ); hsh_insert( t, key, datum ); } for (i = count; i >= 0; i--) { char key[100]; char datum[100]; const char *pt; sprintf( key, "key%d", i ); sprintf( datum, "datum%d", i ); pt = hsh_retrieve( t, key ); if (!pt || strcmp( pt, datum )) { printf( "Expected \"%s\", got \"%s\"\n", datum, pt ? pt : "(null)" ); } } if (count <= 200) hsh_iterate( t, iterator ); /* hsh_print_stats( t, stdout );*/ hsh_iterate( t, freer ); hsh_destroy( t ); /* Test random keys */ t = hsh_create( NULL, NULL ); init_rand(); for (i = 0; i < count; i++) { int len = get_rand( 2, 32 ); char *key = xmalloc( len + 1 ); char *datum = xmalloc( 20 ); for (j = 0; j < len; j++) key[j] = get_rand( 32, 128 ); key[ len ] = '\0'; sprintf( datum, "datum%d", i ); hsh_insert( t, key, datum ); } init_rand(); for (i = 0; i < count; i++) { int len = get_rand( 2, 32 ); char *key = xmalloc( len + 1 ); char datum[100]; const char *pt; for (j = 0; j < len; j++) key[j] = get_rand( 32, 128 ); key[ len ] = '\0'; sprintf( datum, "datum%d", i ); pt = hsh_retrieve( t, key ); if (!pt || strcmp( pt, datum )) printf( "Expected \"%s\", got \"%s\" for key \"%s\"\n", datum, pt, key ); xfree( key ); } /* hsh_print_stats( t, stdout );*/ hsh_iterate( t, freer ); hsh_destroy( t ); /* Test (random) integer keys */ t = hsh_create( hsh_pointer_hash, hsh_pointer_compare ); init_rand(); for (i = 0; i < count; i++) { long key = get_rand( 1, 16777216 ); char *datum = xmalloc( 20 ); sprintf( datum, "datum%d", i ); hsh_insert( t, (void *)key, datum ); } init_rand(); for (i = 0; i < count; i++) { long key = get_rand( 1, 16777216 ); char datum[100]; const char *pt; sprintf( datum, "datum%d", i ); pt = hsh_retrieve( t, (void *)key ); if (!pt || strcmp( pt, datum )) printf( "Expected \"%s\", got \"%s\" for key %ld\n", datum, pt, key ); } /* hsh_print_stats( t, stdout );*/ hsh_iterate( t, free_data ); hsh_destroy( t ); return 0; } libmaa-1.3.2/hashtest.out010064400017500000000000000030101111404247000146300ustar cheusovwheelRunning test for count of 100 Expected "datum100", got "(null)" key80: datum80 key71: datum71 key62: datum62 key53: datum53 key44: datum44 key9: datum9 key35: datum35 key26: datum26 key97: datum97 key17: datum17 key88: datum88 key79: datum79 key0: datum0 key50: datum50 key8: datum8 key41: datum41 key6: datum6 key32: datum32 key23: datum23 key94: datum94 key14: datum14 key85: datum85 key76: datum76 key67: datum67 key58: datum58 key49: datum49 key5: datum5 key31: datum31 key3: datum3 key22: datum22 key13: datum13 key20: datum20 key91: datum91 key11: datum11 key82: datum82 key73: datum73 key64: datum64 key55: datum55 key46: datum46 key37: datum37 key28: datum28 key99: datum99 key19: datum19 key2: datum2 key90: datum90 key10: datum10 key81: datum81 key72: datum72 key63: datum63 key70: datum70 key54: datum54 key61: datum61 key45: datum45 key52: datum52 key36: datum36 key43: datum43 key27: datum27 key34: datum34 key18: datum18 key25: datum25 key96: datum96 key16: datum16 key87: datum87 key78: datum78 key69: datum69 key60: datum60 key51: datum51 key42: datum42 key7: datum7 key33: datum33 key40: datum40 key24: datum24 key95: datum95 key15: datum15 key86: datum86 key93: datum93 key77: datum77 key84: datum84 key68: datum68 key75: datum75 key59: datum59 key66: datum66 key57: datum57 key48: datum48 key39: datum39 key4: datum4 key30: datum30 key21: datum21 key92: datum92 key12: datum12 key83: datum83 key74: datum74 key65: datum65 key56: datum56 key47: datum47 key38: datum38 key29: datum29 key98: datum98 key89: datum89 key1: datum1 libmaa-1.3.2/install-sh010075500017500000000000000112450613746357700143210ustar cheusovwheel#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # 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. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 libmaa-1.3.2/list.c010064400017500000000000000270241111676220300134130ustar cheusovwheel/* list.c -- List routines for Khepera * Created: Wed Nov 9 19:40:00 1994 by faith@dict.org as stack.c * Copyright 1994-1997, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{List Routines} * * \intro The list routines provide support for a general linked list * containting objects that are pointers to "void". The list can be viewed * as a stack or queue -- data can be added to the head or the tail, but * can only be removed from the head (this data structure is sometimes * called a ``qstack''). (If only a stack is needed, the stack routines are * more efficient.) * */ #include "maaP.h" typedef struct data { const void *datum; struct data *next; } *dataType; typedef struct list { #if MAA_MAGIC int magic; #endif struct data *head; struct data *tail; unsigned int count; } *listType; static mem_Object mem; static long int _lst_allocated; static void _lst_check( listType l, const char *function ) { if (!l) err_internal( function, "list is null\n" ); #if MAA_MAGIC if (l->magic != LST_MAGIC) err_internal( function, "Incorrect magic: 0x%08x (should be 0x%08x)\n", l->magic, LST_MAGIC ); #endif } long int lst_total_allocated( void ) { return _lst_allocated; } /* \doc |lst_create| initializes a list object. */ lst_List lst_create( void ) { listType l = xmalloc( sizeof( struct list ) ); _lst_allocated += sizeof(struct list); #if MAA_MAGIC l->magic = LST_MAGIC; #endif l->head = NULL; l->tail = NULL; l->count = 0; if (!mem) mem = mem_create_objects( sizeof( struct data ) ); return l; } void _lst_shutdown( void ) { if (mem) mem_destroy_objects( mem ); mem = NULL; } /* \doc |lst_destroy| destroys all memory associated with the |list|. The memory used by data is \emph{not} freed---this memory is the responsibility of the user. */ void lst_destroy( lst_List list ) { listType l = (listType)list; dataType d; _lst_check( l, __func__ ); for (d = l->head; d;) { dataType next = d->next; mem_free_object( mem, d ); d = next; } #if MAA_MAGIC l->magic = LST_MAGIC_FREED; #endif xfree( list ); } /* \doc |lst_append| appends |datum| on the |list|. */ void lst_append( lst_List list, const void *datum ) { listType l; dataType d; if (!list) return; l = (listType)list; d = mem_get_object( mem ); _lst_allocated += sizeof(struct data); _lst_check( l, __func__ ); d->datum = datum; d->next = NULL; if (l->tail) { assert( l->tail->next == NULL ); l->tail->next = d; } l->tail = d; if (!l->head) l->head = d; ++l->count; } /* \doc |lst_push| prepends |datum| on the |list|. */ void lst_push( lst_List list, const void *datum ) { listType l = (listType)list; dataType d = mem_get_object( mem ); _lst_allocated += sizeof(struct data); _lst_check( l, __func__ ); d->datum = datum; d->next = l->head; l->head = d; if (!l->tail) l->tail = d; ++l->count; } /* \doc |lst_pop| removes the first datum on the |list| and returns the pointer. If the |list| is empty, |lst_pop| returns "NULL". */ void *lst_pop( lst_List list ) { listType l = (listType)list; void *datum = NULL; _lst_check( l, __func__ ); if (l->head) { dataType old = l->head; datum = (void *)old->datum; /* Discard const */ l->head = l->head->next; if (!l->head) l->tail = NULL; --l->count; mem_free_object( mem, old ); } return datum; } /* \doc |lst_top| returns a pointer to the datum that is the first element of the |list|, but does \emph{not} remove this datum from the |list|. If the |list| is empty, |lst_top| returns "NULL". */ void *lst_top( lst_List list ) { listType l = (listType)list; _lst_check( l, __func__ ); if (l->head) return (void *)l->head->datum; /* Discard const */ return NULL; } /* \doc |lst_nth_get| returns a pointer to the $n$-th datum in the |list|, or "NULL" if the $n$th element does not exist. */ void *lst_nth_get( lst_List list, unsigned int n ) { listType l = (listType)list; dataType d; unsigned int i; _lst_check( l, __func__ ); if (n < 1 || n > l->count) return NULL; for (i = 1, d = l->head; i < n && d; i++, d = d->next); if (i != n) err_internal( __func__, "Can't find element %d of %d\n", n, l->count ); return (void *)d->datum; /* Discard const. */ } /* \doc |lst_nth_set| locates the $n$-th datum in the |list| and replaces that datum with |datum|. If the $n$th element does not exist, the program will halt with an error. (I.e., it is the programmer's responsibility to check |lst_length| and only pass valid values of |n|.) */ void lst_nth_set( lst_List list, unsigned int n, const void *datum ) { listType l = (listType)list; dataType d; unsigned int i; _lst_check( l, __func__ ); if (n < 1 || n > l->count) err_fatal( __func__, "Attempt to change element %d of %d elements\n", n, l->count ); for (i = 1, d = l->head; i < n && d; i++, d = d->next); if (i != n) err_internal( __func__, "Can't find element %d of %d\n", n, l->count ); d->datum = datum; } /* \doc |lst_member| returns non-zero if the pointer to |datum| is also a pointer on the list, and zero otherwise. Note that only pointers are compared, so identical copies of data structures will be viewed as non-equal. */ int lst_member( lst_List list, const void *datum ) { listType l = (listType)list; dataType d; _lst_check( l, __func__ ); for (d = l->head; d; d = d->next) if (d->datum == datum) return 1; return 0; } /* \doc |lst_length| returns the number of elements in the list. */ unsigned int lst_length( lst_List list ) { listType l = (listType)list; _lst_check( l, __func__ ); return l->count; } /* \doc |lst_truncate| truncates a list to |length| elements. If the list is not longer than |length|, nothing it done. */ void lst_truncate( lst_List list, unsigned int length ) { listType l = (listType)list; dataType d; dataType next; unsigned int i; _lst_check( l, __func__ ); if (l->count <= length) return; if (!length) { next = l->head; l->head = l->tail = NULL; } else { /* Find new end of list */ for (i = 1, d = l->head; i < length && d; d = d->next); /* Remember start of remainder of list */ next = d->next; /* Truncate list */ d->next = NULL; l->tail = d; } /* Free truncated portion of list */ while (next) { dataType tmp = next->next; mem_free_object( mem, next ); next = tmp; --l->count; } assert( l->count == length ); } /* \doc |lst_truncate_position| truncates a list beyond |position| (i.e., |position| is always left in the list. If |postition| is "NULL", then the list is emptied. This convention is useful when using |lst_last_postition| to get a marker allowing an older state of a list to be restored. */ void lst_truncate_position( lst_List list, lst_Position position ) { listType l = (listType)list; dataType d; dataType next; _lst_check( l, __func__ ); if (!position) { next = l->head; l->head = l->tail = NULL; } else { d = position; /* New end of list */ next = d->next; /* Start of remainder of list */ /* Truncate */ d->next = NULL; l->tail = d; } /* Free truncated portion of list */ while (next) { dataType tmp = next->next; mem_free_object( mem, next ); next = tmp; --l->count; } } /* \doc |lst_iterate| is used to iterate a function over every element in the |list|. The function, |iterator|, is passed a pointer to each element. If |iterator| returns a non-zero value, the iterations stop, and |lst_iterate| returns. */ int lst_iterate( lst_List list, int (*iterator)( const void *datum ) ) { listType l = (listType)list; dataType d; _lst_check( l, __func__ ); for (d = l->head; d; d = d->next) if (iterator( d->datum )) return 1; return 0; } /* \doc |lst_iterate_arg| is used to iterate a function over every element in the |list|. The function, |iterator|, is passed a pointer to each element. If |iterator| returns a non-zero value, the iterations stop, and |lst_iterate| returns. */ int lst_iterate_arg( lst_List list, int (*iterator)( const void *datum, void *arg ), void *arg ) { listType l = (listType)list; dataType d; _lst_check( l, __func__ ); for (d = l->head; d; d = d->next) if (iterator( d->datum, arg )) return 1; return 0; } /* \doc |lst_init_position| returns a position marker for the head of the list. This marker can be used with |lst_next_position| and |lst_get_position|. */ lst_Position lst_init_position( lst_List list ) { listType l = (listType)list; _lst_check( l, __func__ ); return l->head; } /* \doc |lst_last_position| returns a position marker for the tail of the list. This marker can be used with |lst_truncate_position| to restore a previous state of the list. */ lst_Position lst_last_position( lst_List list ) { listType l = (listType)list; _lst_check( l, __func__ ); return l->tail; } /* \doc |lst_next_position| returns a position marker for the element after the element marked by |position|, or "NULL" if |position| is the last element in the list. */ lst_Position lst_next_position( lst_Position position ) { dataType d = (dataType)position; if (!d) return NULL; return d->next; } /* \doc |lst_nth_position| returns a position marker for the $n$th element in the list, or "NULL" if the $n$th element does not exist. */ lst_Position lst_nth_position( lst_List list, unsigned int n ) { listType l = (listType)list; dataType d; unsigned int i; _lst_check( l, __func__ ); if (n < 1 || n > l->count) return NULL; for (i = 1, d = l->head; i < n && d; i++, d = d->next); if (i != n) err_internal( __func__, "Can't find element %d of %d\n", n, l->count ); return d; } /* \doc |lst_get_position| returns the datum associated with the |position| marker, or "NULL" if there is no such element. */ void *lst_get_position( lst_Position position ) { dataType d = (dataType)position; if (!d) return NULL; return (void *)d->datum; /* Discard const */ } /* \doc |lst_set_position| sets the |datum| associated with the |position| marker. */ void lst_set_position( lst_Position position, const void *datum ) { dataType d = (dataType)position; if (d) d->datum = datum; } /* \doc |lst_dump| prints each |datum| on the list in hex */ static int _lst_dump_node( const void *datum ) { printf(" 0x%p\n", datum); return 0; } void lst_dump( lst_List l ) { lst_iterate(l,_lst_dump_node); } libmaa-1.3.2/listtest.c010064400017500000000000000035741111676220300143170ustar cheusovwheel/* listtest.c -- * Created: Wed Aug 9 11:36:09 1995 by faith@dict.org * Copyright 1995, 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 1, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" static int print( const void *datum ) { printf( "%s ", (char *)datum ); return 0; } int main( int argc, char **argv ) { lst_List list = lst_create(); lst_Position p; char *e; long i; maa_init( argv[0] ); lst_append( list, "1" ); lst_iterate( list, print ); printf( "\n" ); lst_append( list, "2" ); lst_append( list, "3" ); lst_iterate( list, print ); printf( "\n" ); lst_push( list, "0" ); lst_iterate( list, print ); printf( "\n" ); printf( "Length = %d (expect 4)\n", lst_length( list ) ); LST_ITERATE(list,p,e) { printf( "%s ", e ); } printf( "\n" ); lst_pop( list ); lst_iterate( list, print ); printf( "\n" ); printf( "Length = %d (expect 3)\n", lst_length( list ) ); lst_truncate( list, 1 ); lst_iterate( list, print ); printf( "\n" ); printf( "Length = %d (expect 1)\n", lst_length( list ) ); for (i = 0; i < 10000; i++) lst_push( list, (void *)i ); lst_destroy( list ); return 0; } libmaa-1.3.2/listtest.out010064400017500000000000000001500607204154500146730ustar cheusovwheel1 1 2 3 0 1 2 3 Length = 4 (expect 4) 0 1 2 3 1 2 3 Length = 3 (expect 3) 1 Length = 1 (expect 1) libmaa-1.3.2/log.c010064400017500000000000000207021151216241700132160ustar cheusovwheel/* log.c -- Logging routines, for a single, program-wide logging facility * Created: Mon Mar 10 09:37:21 1997 by faith@dict.org * Copyright 1997-1999, 2001-2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * */ #include "maaP.h" #ifdef HAVE_SYSLOG_NAMES #define SYSLOG_NAMES #endif #include #include #include #include #if HAVE_SYS_PARAM_H # include #endif #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 64 #endif static int logFd = -1; static FILE *logUserStream; static int logSyslog; static int inhibitFull = 0; static int logOpen; static int logFacility = LOG_USER; static const char *logIdent; static const char *logFilenameOrig; static char *logFilename; static char *logFilenameTmp; static int logFilenameLen; static char logHostname[MAXHOSTNAMELEN]; #ifndef HAVE_SYSLOG_NAMES typedef struct _code { const char *c_name; int c_val; } CODE; CODE facilitynames[] = { #if LOG_AUTH { "auth", LOG_AUTH }, #endif #if LOG_AUTHPRIV { "authpriv", LOG_AUTHPRIV }, #endif #if LOG_CRON { "cron", LOG_CRON }, #endif #if LOG_DAEMON { "daemon", LOG_DAEMON }, #endif #if LOG_FTP { "ftp", LOG_FTP }, #endif #if LOG_KERN { "kern", LOG_KERN }, #endif #if LOG_LPR { "lpr", LOG_LPR }, #endif #if LOG_MAIL { "mail", LOG_MAIL }, #endif #if LOG_NEWS { "news", LOG_NEWS }, #endif #if LOG_SYSLOG { "syslog", LOG_SYSLOG }, #endif #if LOG_USER { "user", LOG_USER }, #endif #if LOG_UUCP { "uucp", LOG_UUCP }, #endif #if LOG_LOCAL0 { "local0", LOG_LOCAL0 }, #endif #if LOG_LOCAL1 { "local1", LOG_LOCAL1 }, #endif #if LOG_LOCAL2 { "local2", LOG_LOCAL2 }, #endif #if LOG_LOCAL3 { "local3", LOG_LOCAL3 }, #endif #if LOG_LOCAL4 { "local4", LOG_LOCAL4 }, #endif #if LOG_LOCAL5 { "local5", LOG_LOCAL5 }, #endif #if LOG_LOCAL6 { "local6", LOG_LOCAL6 }, #endif #if LOG_LOCAL7 { "local7", LOG_LOCAL7 }, #endif { NULL, -1 }, }; #endif static void _log_set_hostname( void ) { static int hostnameSet = 0; char *pt; if (!hostnameSet) { memset( logHostname, 0, sizeof(logHostname) ); gethostname( logHostname, sizeof(logHostname)-1 ); if ((pt = strchr(logHostname, '.'))) *pt = '\0'; ++hostnameSet; } } void log_set_facility(const char *facility) { CODE *pt; for (pt = facilitynames; pt->c_name; pt++) { if (!strcmp(pt->c_name, facility)) { logFacility = pt->c_val; return; } } err_fatal(__func__, "%s is not a valid facility name\n", facility); } const char *log_get_facility(void) { CODE *pt; for (pt = facilitynames; pt->c_name; pt++) if (pt->c_val == logFacility) return pt->c_name; return NULL; } void log_option( int option ) { if (option == LOG_OPTION_NO_FULL) inhibitFull = 1; else inhibitFull = 0; } void log_syslog( const char *ident ) { if (ident){ if (logSyslog) err_internal( __func__, "Syslog facility already open\n" ); openlog( ident, LOG_PID|LOG_NOWAIT, logFacility ); ++logOpen; ++logSyslog; }else{ if (!logSyslog) return; closelog (); --logOpen; --logSyslog; } } static void log_mkpath(const char *filename) { char *tmp = alloca(strlen(filename) + 1); char *pt; strcpy(tmp, filename); for (pt = tmp; *pt; pt++) { if (*pt == '/' && pt != tmp) { *pt = '\0'; mkdir(tmp, 0755); *pt = '/'; } } } static void _log_check_filename(void) { time_t t; struct tm *tm; if (!logFilename || !logFilenameTmp || !logFilenameLen) return; time(&t); tm = localtime(&t); strftime(logFilenameTmp, logFilenameLen, logFilenameOrig, tm); if (strcmp(logFilenameTmp, logFilename)) { strcpy(logFilename, logFilenameTmp); if (logFd >= 0) close(logFd); log_mkpath(logFilename); if ((logFd = open( logFilename, O_WRONLY|O_CREAT|O_APPEND, 0644 )) < 0) err_fatal_errno( __func__, "Cannot open \"%s\" for append\n", logFilename ); } } void log_file( const char *ident, const char *filename ) { if (ident && filename){ if (logFd >= 0) err_internal( __func__, "Log file \"%s\" open when trying to open \"%s\"\n", logFilename, filename ); logIdent = str_find( ident ); logFilenameOrig = str_find(filename); logFilenameLen = strlen(filename)*3+1024; logFilename = xmalloc(logFilenameLen + 1); logFilenameTmp = xmalloc(logFilenameLen + 1); logFilename[0] = '\0'; _log_check_filename(); _log_set_hostname(); ++logOpen; }else{ if (logFd < 0) return; close (logFd); logFd = -1; if (logFilename) xfree (logFilename); logFilename = NULL; if (logFilenameTmp) xfree (logFilenameTmp); logFilenameTmp = NULL; logFilenameLen = 0; --logOpen; } } void log_stream( const char *ident, FILE *stream ) { if (ident && stream){ if (logUserStream) err_internal( __func__, "User stream already open\n" ); logUserStream = stream; logIdent = str_find( ident ); _log_set_hostname(); ++logOpen; }else{ if (!logUserStream) return; if (logUserStream != stdout && logUserStream != stderr) { fclose (logUserStream); } logUserStream = NULL; --logOpen; } } void log_close( void ) { log_file (NULL, NULL); log_stream (NULL, NULL); log_syslog (NULL); } static void _log_base_va( const char *routine, int log_facility, const char *format, va_list ap ) { va_list ap_copy; time_t t; static char buf [4096] = ""; static char buf_main [4096] = ""; static char buf_preamble [256] = ""; va_copy (ap_copy, ap); if (!logOpen) return; time(&t); if (logFd >= 0 || logUserStream) { /* preamble */ if (inhibitFull) { buf_preamble [0] = 0; } else { snprintf (buf_preamble, sizeof (buf_preamble), "%24.24s %s %s[%ld]: ", ctime(&t), logHostname, logIdent, (long int) getpid()); } /* main part of log message */ vsnprintf (buf_main, sizeof (buf_main), format, ap ); /* full log message */ if (routine){ snprintf (buf, sizeof (buf), "%s(%s) %s\n", buf_preamble, routine, buf_main); }else{ snprintf (buf, sizeof (buf), "%s%s\n", buf_preamble, buf_main); } /* writing */ if (logFd >= 0) { _log_check_filename(); while (-1 == write (logFd, buf, strlen (buf)) && errno == EINTR); } if (logUserStream) { fseek( logUserStream, 0L, SEEK_END ); /* might help if luser didn't open stream with "a" */ if (logUserStream == stdout || logUserStream == stderr) fprintf( logUserStream, "%s", buf_main ); else fprintf( logUserStream, "%s", buf ); fflush( logUserStream ); } } #if HAVE_VSYSLOG if (logSyslog) { vsyslog( log_facility, format, ap_copy ); } #endif } void log_error_va( const char *routine, const char *format, va_list ap ) { _log_base_va (routine, LOG_ERR, format, ap); } void log_error( const char *routine, const char *format, ... ) { va_list ap; va_start( ap, format ); log_error_va( routine, format, ap ); va_end( ap ); } void log_info_va( const char *format, va_list ap ) { _log_base_va (NULL, LOG_INFO, format, ap); } void log_info( const char *format, ... ) { va_list ap; va_start( ap, format ); log_info_va( format, ap ); va_end( ap ); } libmaa-1.3.2/logtest.c010064400017500000000000000021331115206163200141110ustar cheusovwheel/* sltest.c -- * Created: Fri, 27 Feb 2009 23:21:31 +0200 by vle@gmx.net * Copyright 2009 Aleksey Cheusov (vle@gmx.net) * * 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 1, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" int main( int argc, char **argv ) { const char *logfn; --argc, ++argv; if (!argc) return 1; logfn = argv [0]; maa_init (argv [0]); log_file ("logtest", logfn); log_error ("main", "Error??? No-o-o-o... :-)"); maa_shutdown (); return 0; } libmaa-1.3.2/logtest.sh010075500017500000000000000005201115247265200143120ustar cheusovwheel#!/bin/sh rm -f _log_file.txt env LC_ALL=C ./logtest _log_file.txt awk ' { sub(/Mon|Tue|Wed|Thu|Fri|Sat|Sun/, "Day") sub(/Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec/, "Mth") sub(/\[[0-9]+\]/, "[NNNNN]") gsub(/[0-9][0-9]/, "NN") gsub(/[0-9]/, "NN") $6 = "HOSTNAME" print }' _log_file.txt rm -f _log_file.txt libmaa-1.3.2/logtest.sh.out010064400017500000000000000001221115223424700151070ustar cheusovwheelDay Mth NN NN:NN:NN NNNN HOSTNAME logtest[NNNNN]: (main) Error??? No-o-o-o... :-) libmaa-1.3.2/maa.c010064400017500000000000000043541111676220300131770ustar cheusovwheel/* maa.c -- General Support for libmaa * Created: Sun Nov 19 13:24:35 1995 by faith@dict.org * Copyright 1995, 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{General Support} * */ #include "maaP.h" #include "maa.h" /* \doc |maa_init| should be called at the start of "main()", and serves to initialize debugging and other support for \libmaa. */ void maa_init( const char *programName ) { tim_start( "total" ); err_set_program_name( programName ); _dbg_register( MAA_MEMORY, ".memory" ); _dbg_register( MAA_TIME, ".time" ); _dbg_register( MAA_PR, ".pr" ); _dbg_register( MAA_SL, ".sl" ); _dbg_register( MAA_SRC, ".src" ); _dbg_register( MAA_PARSE, ".parse" ); } void maa_shutdown( void ) { if (dbg_test(MAA_MEMORY) || dbg_test(MAA_TIME)) fprintf( stderr, "%s\n", maa_version() ); if (dbg_test(MAA_MEMORY)) { str_print_stats( stderr ); } _pr_shutdown(); str_destroy(); _lst_shutdown(); _sl_shutdown(); tim_stop( "total" ); if (dbg_test(MAA_TIME)) { tim_print_timers( stderr ); } _tim_shutdown(); flg_destroy(); dbg_destroy(); } int maa_version_major( void ) { return MAA_MAJOR; } int maa_version_minor( void ) { return MAA_MINOR; } int maa_version_teeny( void ) { return MAA_MINOR; } const char *maa_version( void ) { static char buffer[80]; sprintf( buffer, "Libmaa %d.%d.%d", MAA_MAJOR, MAA_MINOR, MAA_TEENY ); return buffer; } libmaa-1.3.2/maa.h010064400017500000000000000600061200277615200132030ustar cheusovwheel/* maa.h -- Header file for visible libmaa functions * Created: Sun Nov 19 13:21:21 1995 by faith@dict.org * Copyright 1994-1998, 2002 Rickard E. Faith (faith@dict.org) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef _MAA_H_ #define _MAA_H_ #include #include #ifndef __GNUC__ #define __attribute__(x) #endif /* If MAA_MAGIC is non-zero, important structures will be tagged with a magic number which will be checked for integrity at each access. This uses up more memory, and is slightly slower, but helps debugging quite a bit. */ #ifndef MAA_MAGIC #define MAA_MAGIC 1 #endif #if MAA_MAGIC #define HSH_MAGIC 0x01020304 #define HSH_MAGIC_FREED 0x10203040 #define SET_MAGIC 0x02030405 #define SET_MAGIC_FREED 0x20304050 #define LST_MAGIC 0x03040506 #define LST_MAGIC_FREED 0x30405060 #define MEM_STRINGS_MAGIC 0x23232323 #define MEM_STRINGS_MAGIC_FREED 0x32323232 #define MEM_OBJECTS_MAGIC 0x42424242 #define MEM_OBJECTS_MAGIC_FREED 0x24242424 #define ARG_MAGIC 0xfeedbead #define ARG_MAGIC_FREED 0xefdeebda #define PR_MAGIC 0x0bad7734 #define PR_MAGIC_FREED 0xb0da7743 #define SL_LIST_MAGIC 0xabcdef01 #define SL_LIST_MAGIC_FREED 0xbadcfe10 #define SL_ENTRY_MAGIC 0xacadfeed #define SL_ENTRY_MAGIC_FREED 0xcadaefde #endif /* version.c */ extern const char *maa_revision_string; /* maa.c */ #define MAA_MEMORY (3U<<30|1<<29) /* Print memory usage statistics at exit */ #define MAA_TIME (3U<<30|1<<28) /* Print timer information at exit */ #define MAA_PR (3U<<30|1<<27) /* Debug process routines */ #define MAA_SL (3U<<30|1<<26) /* Debug skip list routines */ #define MAA_PARSE (3U<<30|1<<25) /* Debug parsing */ #define MAA_SRC (3U<<30|1<<24) /* Source library */ extern void maa_init( const char *programName ); extern void maa_shutdown( void ); extern int maa_version_major( void ); extern int maa_version_minor( void ); extern const char *maa_version( void ); /* xmalloc.c */ #ifndef DMALLOC_FUNC_CHECK extern void *xmalloc( size_t size ); extern void *xcalloc( size_t num, size_t size ); extern void *xrealloc( void *pt, size_t size ); extern void xfree( void *pt ); extern char *xstrdup( const char *s ); #endif /* bit.c */ extern void bit_set( unsigned long *flags, int bit ); extern void bit_clr( unsigned long *flags, int bit ); extern int bit_tst( unsigned long *flags, int bit ); extern int bit_cnt( unsigned long *flags ); /* prime.c */ extern int prm_is_prime( unsigned int value ); extern unsigned long prm_next_prime( unsigned int start ); /* hash.c */ typedef void *hsh_HashTable; typedef void *hsh_Position; typedef struct hsh_Stats { unsigned long size; /* Size of table */ unsigned long resizings; /* Number of resizings */ unsigned long entries; /* Total entries in table */ unsigned long buckets_used; /* Number of hash buckets in use */ unsigned long singletons; /* Number of length one lists */ unsigned long maximum_length; /* Maximum list length */ unsigned long retrievals; /* Total number of retrievals */ unsigned long hits; /* Number of retrievals from top of a list */ unsigned long misses; /* Number of unsuccessful retrievals */ } *hsh_Stats; extern hsh_HashTable hsh_create( unsigned long (*hash)( const void * ), int (*compare)( const void *, const void * ) ); extern void hsh_destroy( hsh_HashTable table ); extern int hsh_insert( hsh_HashTable table, const void *key, const void *datum ); extern int hsh_delete( hsh_HashTable table, const void *key ); extern const void *hsh_retrieve( hsh_HashTable table, const void *key ); extern int hsh_iterate( hsh_HashTable table, int (*iterator)( const void *key, const void *datum ) ); extern int hsh_iterate_arg( hsh_HashTable table, int (*iterator)( const void *key, const void *datum, void *arg ), void *arg ); extern hsh_Stats hsh_get_stats( hsh_HashTable table ); extern void hsh_print_stats( hsh_HashTable table, FILE *stream ); extern unsigned long hsh_string_hash( const void *key ); extern unsigned long hsh_pointer_hash( const void *key ); extern int hsh_string_compare( const void *key1, const void *key2 ); extern int hsh_pointer_compare( const void *key1, const void *key2 ); extern void hsh_key_strings(hsh_HashTable); extern hsh_Position hsh_init_position( hsh_HashTable table ); extern hsh_Position hsh_next_position( hsh_HashTable table, hsh_Position position ); extern void *hsh_get_position( hsh_Position position, void **key ); extern int hsh_readonly( hsh_HashTable table, int flag ); #define HSH_POSITION_INIT(P,T) ((P)=hsh_init_position(T)) #define HSH_POSITION_NEXT(P,T) ((P)=hsh_next_position(T,P)) #define HSH_POSITION_OK(P) (P) #define HSH_POSITION_GET(P,K,D) ((D)=hsh_get_position(P,&K)) #define HSH_POSITION_GETKEY(P,K) (hsh_get_position(P,&K)) /* iterate over all (key, datum) pairs, (K,D), in hash table T */ #define HSH_ITERATE(T,P,K,D) \ for (HSH_POSITION_INIT((P),(T)); \ HSH_POSITION_OK(P) && (HSH_POSITION_GET((P),(K),(D)),1); \ HSH_POSITION_NEXT((P),(T))) /* iterate over all keys K, in hash table T */ #define HSH_ITERATE_KEYS(T,P,K) \ for (HSH_POSITION_INIT((P),(T)); \ HSH_POSITION_OK(P) && (HSH_POSITION_GETKEY((P),(K)),1); \ HSH_POSITION_NEXT((P),(T))) /* If the HSH_ITERATE loop is exited before all elements in the table are seen, then HSH_ITERATE_END should be called. Calling this function after complete loops does no harm. */ #define HSH_ITERATE_END(T) hsh_readonly(T,0) /* set.c */ typedef void *set_Set; typedef void *set_Position; typedef struct set_Stats{ unsigned long size; /* Size of table */ unsigned long resizings; /* Number of resizings */ unsigned long entries; /* Total entries in table */ unsigned long buckets_used; /* Number of hash buckets in use */ unsigned long singletons; /* Number of length one lists */ unsigned long maximum_length; /* Maximum list length */ unsigned long retrievals; /* Total number of retrievals */ unsigned long hits; /* Number of retrievals from top of a list */ unsigned long misses; /* Number of unsuccessful retrievals */ } *set_Stats; typedef unsigned long (*set_HashFunction)( const void * ); typedef int (*set_CompareFunction)( const void *, const void * ); extern set_Set set_create( set_HashFunction hash, set_CompareFunction compare ); extern set_HashFunction set_get_hash( set_Set set ); extern set_CompareFunction set_get_compare( set_Set set ); extern void set_destroy( set_Set set ); extern int set_insert( set_Set set, const void *elem ); extern int set_delete( set_Set set, const void *elem ); extern int set_member( set_Set set, const void *elem ); extern int set_iterate( set_Set set, int (*iterator)( const void *key ) ); extern int set_iterate_arg( set_Set set, int (*iterator)( const void *elem, void *arg ), void *arg ); extern set_Set set_add( set_Set set1, set_Set set2 ); extern set_Set set_del( set_Set set1, set_Set set2 ); extern set_Set set_union( set_Set set1, set_Set set2 ); extern set_Set set_inter( set_Set set1, set_Set set2 ); extern set_Set set_diff( set_Set set1, set_Set set2 ); extern int set_equal( set_Set set1, set_Set set2 ); extern set_Stats set_get_stats( set_Set set ); extern void set_print_stats( set_Set set, FILE *stream ); extern int set_count( set_Set set ); extern set_Position set_init_position( set_Set set ); extern set_Position set_next_position( set_Set set, set_Position position ); extern void *set_get_position( set_Position position ); extern int set_readonly( set_Set set, int flag ); #define SET_POSITION_INIT(P,S) ((P)=set_init_position(S)) #define SET_POSITION_NEXT(P,S) ((P)=set_next_position(S,P)) #define SET_POSITION_OK(P) (P) #define SET_POSITION_GET(P,E) ((E)=set_get_position(P)) /* iterate over all entries E in set S */ #define SET_ITERATE(S,P,E) \ for (SET_POSITION_INIT((P),(S)); \ SET_POSITION_OK(P) && (SET_POSITION_GET((P),(E)),1); \ SET_POSITION_NEXT((P),(S))) /* If the SET_ITERATE loop is exited before all elements in the set are seen, then SET_ITERATE_END should be called. Calling this function after complete loops does no harm. */ #define SET_ITERATE_END(S) set_readonly(S,0) /* stack.c */ typedef void *stk_Stack; extern stk_Stack stk_create( void ); extern void stk_destroy( stk_Stack stack ); extern void stk_push( stk_Stack stack, void *datum ); extern void *stk_pop( stk_Stack stack ); extern void *stk_top( stk_Stack stack ); /* list.c */ typedef void *lst_List; typedef void *lst_Position; extern lst_List lst_create( void ); extern void lst_destroy( lst_List list ); extern void lst_append( lst_List list, const void *datum ); extern void lst_push( lst_List list, const void *datum ); extern void *lst_pop( lst_List list ); extern void *lst_top( lst_List list ); extern void *lst_nth_get( lst_List list, unsigned int n ); extern void lst_nth_set( lst_List list, unsigned int n, const void *datum ); extern int lst_member( lst_List list, const void *datum ); extern unsigned int lst_length( lst_List list ); extern int lst_iterate( lst_List list, int (*iterator)( const void *datum ) ); extern int lst_iterate_arg( lst_List list, int (*iterator)( const void *datum, void *arg ), void *arg ); extern void lst_truncate( lst_List list, unsigned int length ); extern void lst_truncate_position( lst_List list, lst_Position position ); extern lst_Position lst_init_position( lst_List list ); extern lst_Position lst_last_position( lst_List list ); extern lst_Position lst_next_position( lst_Position position ); extern lst_Position lst_nth_position( lst_List list, unsigned int n ); extern void *lst_get_position( lst_Position position ); extern void lst_set_position( lst_Position position, const void *datum ); extern void lst_dump( lst_List list ); extern void _lst_shutdown( void ); extern long int lst_total_allocated( void ); #define LST_POSITION_INIT(P,L) ((P)=lst_init_position(L)) #define LST_POSITION_NEXT(P) ((P)=lst_next_position(P)) #define LST_POSITION_OK(P) (P) #define LST_POSITION_GET(P,E) ((E)=lst_get_position(P)) /* iterate over all entries E in list L */ #define LST_ITERATE(L,P,E) \ for (LST_POSITION_INIT((P),(L)); \ LST_POSITION_OK(P) && (LST_POSITION_GET((P),(E)),1); \ LST_POSITION_NEXT(P)) /* iterate over all entries in lists L1 and L2 */ #define LST_ITERATE2(L1,L2,P1,P2,E1,E2) \ for (LST_POSITION_INIT((P1),(L1)), LST_POSITION_INIT((P2),(L2)); \ LST_POSITION_OK(P1) && LST_POSITION_OK(P2) \ && (LST_POSITION_GET((P1),(E1)),LST_POSITION_GET((P2),(E2)),1); \ LST_POSITION_NEXT(P1), LST_POSITION_NEXT(P2)) /* error.c */ extern void err_set_program_name( const char *programName ); extern const char *err_program_name( void ); extern void err_fatal( const char *routine, const char *format, ... ) __attribute__((noreturn,format(printf, 2, 3))); extern void err_fatal_errno( const char *routine, const char *format, ... ) __attribute__((noreturn,format(printf, 2, 3))); extern void err_warning( const char *routine, const char *format, ... ) __attribute__((format(printf, 2, 3))); extern void err_internal( const char *routine, const char *format, ... ) __attribute__((noreturn,format(printf, 2, 3))); /* memory.c */ typedef void *mem_String; typedef void *mem_Object; typedef struct mem_StringStats { int count; /* Number of strings or objects */ int bytes; /* Number of bytes allocated */ } *mem_StringStats; typedef struct mem_ObjectStats { int total; /* Total objects requested */ int used; /* Total currently in use */ int reused; /* Total reused */ int size; /* Size of each object */ } *mem_ObjectStats; extern mem_String mem_create_strings( void ); extern void mem_destroy_strings( mem_String info ); extern const char *mem_strcpy( mem_String info, const char *string ); extern const char *mem_strncpy( mem_String info, const char *string, int len ); extern void mem_grow( mem_String info, const char *string, int len ); extern const char *mem_finish( mem_String info ); extern mem_StringStats mem_get_string_stats( mem_String info ); extern void mem_print_string_stats( mem_String info, FILE *stream ); extern mem_Object mem_create_objects( int size ); extern void mem_destroy_objects( mem_Object info ); extern void *mem_get_object( mem_Object info ); extern void *mem_get_empty_object( mem_Object info ); extern void mem_free_object( mem_Object info, void *obj ); extern mem_ObjectStats mem_get_object_stats( mem_Object info ); extern void mem_print_object_stats( mem_Object info, FILE *stream ); /* string.c */ typedef void *str_Pool; typedef hsh_Position str_Position; typedef struct str_Stats { int count; /* Number of strings created */ int bytes; /* Number of bytes allocated */ int retrievals; /* Total number of retrievals */ int hits; /* Number of retrievals from top of a list */ int misses; /* Number of unsuccessful retrievals */ } *str_Stats; extern str_Pool str_pool_create( void ); extern void str_pool_destroy( str_Pool pool ); extern int str_pool_exists( str_Pool pool, const char *s ); extern const char *str_pool_find( str_Pool pool, const char *s ); extern const char *str_pool_copy( str_Pool pool, const char *s ); extern const char *str_pool_copyn( str_Pool pool, const char *s, int length ); extern void str_pool_grow( str_Pool pool, const char *s, int length ); extern const char *str_pool_finish( str_Pool pool ); extern str_Stats str_pool_get_stats( str_Pool pool ); extern void str_pool_print_stats( str_Pool pool, FILE *stream ); extern str_Position str_pool_init_position( str_Pool table ); extern str_Position str_pool_next_position( str_Pool table, str_Position position ); extern void str_pool_get_position( str_Position position, char const *const *key ); #define str_pool_readonly(pool, flag) hsh_readonly ((pool), (flag)) extern int str_pool_iterate( str_Pool pool, int (*iterator)( const char *s ) ); extern int str_pool_iterate_arg( str_Pool pool, int (*iterator)( const char *s, void *arg ), void *arg ); #define STR_POSITION_INIT(P,T) ((P)=str_pool_init_position(T)) #define STR_POSITION_NEXT(P,T) ((P)=str_pool_next_position(T,P)) #define STR_POSITION_OK(P) (P) #define STR_POSITION_GET(P,K) (str_pool_get_position(P,&K), K) /* iterate over all keys (K) in string pool T */ #define STR_ITERATE(T,P,K) \ for (STR_POSITION_INIT((P),(T)); \ STR_POSITION_OK(P) && (STR_POSITION_GET((P),(K)),1); \ STR_POSITION_NEXT((P),(T))) /* If the STR_ITERATE loop is exited before all elements in the table are seen, then STR_ITERATE_END should be called. Calling this function after complete loops does no harm. */ #define STR_ITERATE_END(T) str_readonly(T,0) extern int str_exists( const char *s ); extern const char *str_find( const char *s ); extern const char *str_findn( const char *s, int length ); extern const char *str_copy( const char *s ); extern const char *str_copyn( const char *s, int length ); extern void str_grow( const char *s, int length ); extern const char *str_finish( void ); extern const char *str_unique( const char *prefix ); extern void str_destroy( void ); extern str_Stats str_get_stats( void ); extern void str_print_stats( FILE *stream ); /* debug.c */ typedef unsigned long int dbg_Type; extern void dbg_register( dbg_Type flag, const char *name ); extern void _dbg_register( dbg_Type flag, const char *name ); extern void dbg_destroy( void ); extern void dbg_set( const char *name ); extern void dbg_set_flag( dbg_Type flag ); extern void dbg_unset_flag( dbg_Type flag ); extern int dbg_test( dbg_Type flag ); extern void dbg_list( FILE *stream ); #define PRINTF(flag,arg) if (dbg_test(flag)) { log_info arg; } /* flags.c */ typedef unsigned long int flg_Type; extern void flg_register( flg_Type flag, const char *name ); extern void flg_destroy( void ); extern void flg_set( const char *name ); extern int flg_test( flg_Type flag ); extern void flg_list( FILE *stream ); extern const char *flg_name( flg_Type flag ); /* timer.c */ extern void tim_start( const char *name ); extern void tim_stop( const char *name ); extern void tim_reset( const char *name ); extern double tim_get_real( const char *name ); extern double tim_get_user( const char *name ); extern double tim_get_system( const char *name ); extern void tim_print_timer( FILE *str, const char *name ); extern void tim_print_timers( FILE *str ); extern void _tim_shutdown( void ); /* arg.c */ #define ARG_NO_ESCAPE 0x0001 /* Backslashed are not escape characters */ #define ARG_NO_QUOTE 0x0002 /* Don't use quote marks for quoting */ typedef void *arg_List; extern arg_List arg_create( void ); extern void arg_destroy( arg_List arg ); extern arg_List arg_add( arg_List arg, const char *string ); extern arg_List arg_addn( arg_List arg, const char *string, int length ); extern void arg_grow( arg_List arg, const char *string, int length ); extern arg_List arg_finish( arg_List arg ); extern const char *arg_get( arg_List arg, int item ); extern int arg_count( arg_List arg ); extern void arg_get_vector( arg_List arg, int *argc, char ***argv ); extern arg_List arg_argify( const char *string, int quoteStyle ); /* pr.c */ #define PR_USE_STDIN 0x00000001 #define PR_USE_STDOUT 0x00000002 #define PR_USE_STDERR 0x00000004 #define PR_CREATE_STDIN 0x00000010 #define PR_CREATE_STDOUT 0x00000020 #define PR_CREATE_STDERR 0x00000040 #define PR_STDERR_TO_STDOUT 0x00000100 extern int pr_open( const char *command, int flags, int *infd, int *outfd, int *errfd ); extern int pr_close_nowait( int fd ); extern int pr_close( int fd ); extern int pr_wait( int pid ); extern void _pr_shutdown( void ); extern int pr_spawn( const char *command ); int pr_readwrite( int in, int out, const char *inBuffer, int inLen, char *outBuffer, int outMaxLen ); int pr_filter( const char *command, const char *inBuffer, int inLen, char *outBuffer, int outMaxLen ); /* sl.c */ typedef void *sl_List; typedef int (*sl_Iterator)( const void *datum ); typedef int (*sl_IteratorArg)( const void *datum, void *arg ); extern sl_List sl_create( int (*compare)( const void *key1, const void *key2 ), const void *(*key)( const void *datum ), const char *(*print)( const void *datum ) ); extern void sl_destroy( sl_List list ); extern void _sl_shutdown( void ); extern void sl_insert( sl_List list, const void *datum ); extern void sl_delete( sl_List list, const void *datum ); extern const void *sl_find( sl_List list, const void *key ); extern int sl_iterate( sl_List list, sl_Iterator f ); extern int sl_iterate_arg( sl_List list, sl_IteratorArg f, void *arg ); extern void _sl_dump( sl_List list ); /* text.c */ extern const char * txt_soundex( const char *string ); extern void txt_soundex2( const char *string, char *result /* five chars */ ); /* base64.c */ extern const char *b64_encode( unsigned long val ); extern unsigned long b64_decode( const char *val ); extern unsigned long b64_decode_buf (const char *val, size_t len); /* base26.c */ extern const char *b26_encode( unsigned long val ); extern unsigned long b26_decode( const char *val ); /* source.c */ typedef void *src_Type; typedef struct src_Stats { int lines_used; /* Lines used */ int lines_allocated; /* Lines allocated */ int lines_bytes; /* Bytes required to store lines */ int tokens_total; /* Tokens used */ int tokens_reused; /* Tokens reused */ int tokens_size; /* Size of a token information object */ } *src_Stats; extern void src_create( void ); extern void src_destroy( void ); extern const char *src_line( const char *line, int len ); extern void src_new_file( const char *filename ); extern void src_new_line( int line ); extern void src_advance( int length ); extern void src_cpp_line( const char *line, int length ); extern src_Type src_get( int length ); extern const char *src_filename( src_Type source ); extern int src_linenumber( src_Type source ); extern int src_offset( src_Type source ); extern int src_length( src_Type source ); extern const char *src_source_line( src_Type source ); extern void src_parse_error( FILE *stream, src_Type source, const char *message ); extern void src_print_error( FILE *stream, src_Type source, const char *format, ... ); extern void src_print_message( FILE *str, src_Type source, const char *format, ... ); extern void src_print_line( FILE *stream, src_Type source ); extern src_Stats src_get_stats( void ); extern void src_print_stats( FILE *stream ); /* parse-concrete.c */ extern void prs_register_concrete( const char *symbol, const char *concrete ); extern const char *prs_concrete( const char *symbol ); extern void _prs_shutdown( void ); /* log.c */ #define LOG_OPTION_FULL 1 #define LOG_OPTION_NO_FULL 2 extern void log_syslog( const char *ident ); extern void log_set_facility( const char *facility ); extern const char *log_get_facility( void ); extern void log_option( int option ); extern void log_file( const char *ident, const char *filename ); extern void log_stream( const char *ident, FILE *stream ); extern void log_close( void ); extern void log_error_va( const char *routine, const char *format, va_list ap ); extern void log_error( const char *routine, const char *format, ... ); extern void log_info_va( const char *format, va_list ap ); extern void log_info( const char *format, ... ); #endif libmaa-1.3.2/maaP.h010064400017500000000000000064541200301016100133100ustar cheusovwheel/* maaP.h -- Internal header file for libmaa * Created: Sun Nov 19 13:19:44 1995 by faith@dict.org * Copyright 1994-1998, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef _MAAP_H_ #define _MAAP_H_ #include #include #include #include #include #include #if defined(__INTERIX) && !defined(_ALL_SOURCE) /* bug in Interix-3.5 header files? */ long random (void); int isascii (int c); int gethostname(char *, size_t); void vsyslog (int priority, const char *message, va_list args); int getopt (int argc, char * const *argv, const char *optstring); #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif #if HAVE_STDINT_H #include #endif #if HAVE_INTTYPES_H #include #endif #if HAVE_ALLOCA_H # include #endif #ifndef HAVE_ALLOCA # ifndef alloca /* predefined by HP cc +Olibcalls */ # ifdef _AIX # pragma alloca # else void *alloca(size_t size); # endif # endif #endif /* Get string functions */ #if STDC_HEADERS # include #else # if HAVE_STRINGS_H # include # endif # if !defined(HAVE_MEMCPY) # define memcpy(d, s, n) bcopy ((s), (d), (n)) # define memmove(d, s, n) bcopy ((s), (d), (n)) # endif #endif #if !defined(HAVE_STRLCPY) extern size_t strlcpy_libmaa (char *s, const char * wc, size_t size); #define strlcpy strlcpy_libmaa #endif #if !defined(HAVE_STRTOL) extern long strtol( const char *, char **, int ); #endif #if !defined(HAVE_STRTOUL) extern unsigned long int strtoul( const char *, char **, int ); #endif #if !defined(SIZEOF_VOID_P) # define SIZEOF_VOID_P sizeof (void *) #endif /* Get time functions */ #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif /* Handle getopt correctly */ #if HAVE_GETOPT_H # include #endif #if !defined(HAVE_GETOPT) extern int getopt( int, char * const *, const char * ); extern int optind; extern char *optarg; #endif /* We actually need a few non-ANSI C things... */ #if defined(__STRICT_ANSI__) extern char *strdup( const char * ); extern FILE *fdopen( int fildes, const char *mode ); extern long int random( void ); #endif #if HAVE_SYS_RESOURCE_H # include #endif /* Provide assert() */ #include #if HAVE_LIMITS_H #include #endif /* Local stuff */ #ifndef max #define max(a,b) ((a)>(b)?(a):(b)) #endif #include "maa.h" /* dmalloc must be last */ #ifdef DMALLOC_FUNC_CHECK # include "dmalloc.h" #endif #endif libmaa-1.3.2/memory.c010064400017500000000000000240631111676220300137500ustar cheusovwheel/* memory.c -- Memory management for Khepera * Created: Thu Dec 22 09:58:38 1994 by faith@dict.org * Copyright 1994-1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Memory Management Routines} * * \intro The memory management routines provide simple support for string * object storage. These routines are generally used as building blocks by * other parts of the \khepera library (e.g., string pools and abstract * syntax trees). * */ #include "maaP.h" #include "obstack.h" #ifdef DMALLOC_FUNC_CHECK /* Must be true functions */ #define obstack_chunk_alloc malloc #define obstack_chunk_free free #else #define obstack_chunk_alloc xmalloc #define obstack_chunk_free xfree #endif typedef struct stringInfo { #if MAA_MAGIC int magic; #endif int count; int bytes; struct obstack *obstack; } *stringInfo; typedef struct objectInfo { #if MAA_MAGIC int magic; #endif int total; int used; int reused; int size; stk_Stack stack; /* for free list */ struct obstack *obstack; } *objectInfo; #if !MAA_MAGIC #define _mem_magic_strings(i,function) \ do { \ if (!i) err_internal( function, "mem_String is null\n" ); \ } while (0); #else static void _mem_magic_strings( stringInfo i, const char *function ) { if (!i) err_internal( function, "mem_String is null\n" ); if (i->magic != MEM_STRINGS_MAGIC) err_internal( function, "Incorrect magic: 0x%08x (should be 0x%08x)\n", i->magic, MEM_STRINGS_MAGIC ); } #endif /* \doc |mem_create_strings| creates a memory object for storing strings. */ mem_String mem_create_strings( void ) { stringInfo info = xmalloc( sizeof( struct stringInfo ) ); #if MAA_MAGIC info->magic = MEM_STRINGS_MAGIC; #endif info->count = 0; info->bytes = 0; info->obstack = xmalloc( sizeof( struct obstack ) ); obstack_init( info->obstack ); obstack_alignment_mask( info->obstack ) = 0; /* no alignment for chars */ return info; } /* \doc |mem_destroy_strings| destroys the memory object returned from |mem_create_strings|. All memory if freed, including that used for the strings. Therefore, any pointers to strings in the table will be left dangling. */ void mem_destroy_strings( mem_String info ) { stringInfo i = (stringInfo)info; _mem_magic_strings( i, __func__ ); #if MAA_MAGIC i->magic = MEM_STRINGS_MAGIC_FREED; #endif obstack_free( i->obstack, NULL ); xfree( i->obstack ); /* terminal */ xfree( i ); /* terminal */ } /* \doc |mem_strcpy| copies a |string| into the memory object pointed to by |info|. */ const char *mem_strcpy( mem_String info, const char *string ) { stringInfo i = (stringInfo)info; int len = strlen( string ); _mem_magic_strings( i, __func__ ); ++i->count; i->bytes += len + 1; return obstack_copy0( i->obstack, string, len ); } /* \doc |mem_strncpy| copies |len| bytes of |string| into the memory object pointed to by |info|. A null is added to the end of the copied sequence. */ const char *mem_strncpy( mem_String info, const char *string, int len ) { stringInfo i = (stringInfo)info; _mem_magic_strings( i, __func__ ); ++i->count; i->bytes += len + 1; return obstack_copy0( i->obstack, string, len ); } /* \doc |mem_grow| copies |len| of |string| onto the top of the memory object pointed to by |info|. Several calls to |mem_grow| should be followed by a single call to |mem_finish| without any intervening calls to other functions which modify |info|. */ void mem_grow( mem_String info, const char *string, int len ) { stringInfo i = (stringInfo)info; _mem_magic_strings( i, __func__ ); i->bytes += len; obstack_grow( i->obstack, string, len ); } /* \doc |mem_finish| finishes the growth of the object performed by |mem_grow|. */ const char *mem_finish( mem_String info ) { stringInfo i = (stringInfo)info; _mem_magic_strings( i, __func__ ); ++i->count; i->bytes += 1; obstack_grow0( i->obstack, "", 0 ); return obstack_finish( i->obstack ); } /* \doc |mem_get_string_stats| returns statistics about the memory object pointed to by |info|. The |mem_StringStats| structure is shown in \grind{mem_StringStats}. */ mem_StringStats mem_get_string_stats( mem_String info ) { stringInfo i = (stringInfo)info; mem_StringStats s = xmalloc( sizeof( struct mem_StringStats ) ); _mem_magic_strings( i, __func__ ); s->count = i->count; s->bytes = i->bytes; return s; } /* \doc |mem_print_string_stats| prints the statistics for the memory object pointed to by |info| on the specified |stream|. If |stream| is "NULL", then "stdout" will be used. */ void mem_print_string_stats( mem_String info, FILE *stream ) { FILE *str = stream ? stream : stdout; mem_StringStats s = mem_get_string_stats( info ); _mem_magic_strings( info, __func__ ); fprintf( str, "Statistics for string memory manager at %p:\n", info ); fprintf( str, " %d strings, using %d bytes\n", s->count, s->bytes ); xfree( s ); /* rare */ } #if !MAA_MAGIC #define _mem_magic_objects(i,function) /* */ #else static void _mem_magic_objects( objectInfo i, const char *function ) { if (!i) err_internal( function, "mem_Object is null\n" ); if (i->magic != MEM_OBJECTS_MAGIC) err_internal( function, "Incorrect magic: 0x%08x (should be 0x%08x)\n", i->magic, MEM_OBJECTS_MAGIC ); } #endif /* \doc |mem_create_objects| creates a memory storage object for object of |size| bytes. */ mem_Object mem_create_objects( int size ) { objectInfo info = xmalloc( sizeof ( struct objectInfo ) ); #if MAA_MAGIC info->magic = MEM_OBJECTS_MAGIC; #endif info->total = 0; info->used = 0; info->reused = 0; info->size = size; info->stack = stk_create(); info->obstack = xmalloc( sizeof( struct obstack ) ); obstack_init( info->obstack ); return info; } /* \doc |mem_destroy_objects| destroys the memory object returned from |mem_create_objects|. All memory if freed, including that used for the object. Therefore, any pointers to objects stored by |info| will be left dangling. */ void mem_destroy_objects( mem_Object info ) { objectInfo i = (objectInfo)info; _mem_magic_objects( i, __func__ ); #if MAA_MAGIC i->magic = MEM_OBJECTS_MAGIC_FREED; #endif stk_destroy( i->stack ); obstack_free( i->obstack, NULL ); xfree( i->obstack ); /* terminal */ xfree( i ); /* terminal */ } /* \doc |mem_get_object| returns a pointer to a block of memory which is |size| bytes long (as specified in the call to |mem_create_objects|). This block is either newly allocated memory, or is memory which was previously allocated by |mem_get_object| and subsequently freed by |mem_free_object|. */ void *mem_get_object( mem_Object info ) { objectInfo i = (objectInfo)info; void *obj = stk_pop( i->stack ); _mem_magic_objects( i, __func__ ); if (!obj) { obj = obstack_alloc( i->obstack, i->size ); ++i->total; } else ++i->reused; ++i->used; return obj; } /* \doc |mem_get_empty_object| is exactly like |mem_get_object|, except the memory associated with the object is set to all zeros. */ void *mem_get_empty_object( mem_Object info ) { objectInfo i = (objectInfo)info; void *obj = mem_get_object( info ); memset( obj, 0, i->size ); return obj; } /* \doc |mem_free_object| ``frees'' the object, |obj|, which was previously obtained from |mem_get_object|. The memory associated with the object is not actually freed, but the object pointer is stored on a stack, and is available for subsequent calls to |mem_get_object|. */ void mem_free_object( mem_Object info, void *obj ) { objectInfo i = (objectInfo)info; _mem_magic_objects( i, __func__ ); stk_push( i->stack, obj ); --i->used; } /* \doc |mem_get_object_stats| returns statistics about the memory object pointed to by |info|. The |mem_ObjectStats| structure is shown in \grind{mem_ObjectStats}. */ mem_ObjectStats mem_get_object_stats( mem_Object info ) { objectInfo i = (objectInfo)info; mem_ObjectStats s = xmalloc( sizeof( struct mem_ObjectStats ) ); _mem_magic_objects( i, __func__ ); if (info) { s->total = i->total; s->used = i->used; s->reused = i->reused; s->size = i->size; } else { s->total = 0; s->used = 0; s->reused = 0; s->size = 0; } return s; } /* \doc |mem_print_object_stats| prints the statistics for the memory object pointed to by |info| on the specified |stream|. If |stream| is "NULL", then "stdout" will be used. */ void mem_print_object_stats( mem_Object info, FILE *stream ) { FILE *str = stream ? stream : stdout; mem_ObjectStats s = mem_get_object_stats( info ); _mem_magic_objects( info, __func__ ); fprintf( str, "Statistics for object memory manager at %p:\n", info ); fprintf( str, " %d objects allocated, of which %d are in use\n", s->total, s->used ); fprintf( str, " %d objects have been reused\n", s->reused ); xfree( s ); /* rare */ } libmaa-1.3.2/memtest.c010064400017500000000000000022751111676220300141170ustar cheusovwheel/* memtest.c -- * Created: Sat Jul 1 22:42:09 1995 by faith@dict.org * Copyright 1995, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include #include int main( void ) { char *buf; int i; #ifdef KH_GNU_MALLOC mcheck(0); #endif buf = malloc( 6 ); for (i = 0; i < 7; i++) { printf( "i = %d\n", i ); buf[i] = i; } for (i = -1; i < 7; i++) printf( "buf[%d] = %d\n", i, buf[i] ); free( buf ); return 0; } libmaa-1.3.2/mkrnd.c010064400017500000000000000022741111676220300135530ustar cheusovwheel/* mkrnd.c -- * Created: Wed Sep 25 09:55:23 1996 by faith@dict.org * Copyright 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 1, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" int main( int argc, char **argv ) { int count; int i; if (argc != 2) { fprintf( stderr, "Usage: mkrnd \n" ); exit( 1 ); } count = atoi( argv[1] ); for (i = 0; i < count; i++) { printf( "%f, ", (double)random()/(double)INT_MAX); } printf( "\n" ); return 0; } libmaa-1.3.2/obstack.c010064400017500000000000000350411074545147100140750ustar cheusovwheel/* obstack.c - subroutines used implicitly by object stack macros Copyright (C) 1988, 89, 90, 91, 92, 93, 94 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "obstack.h" /* This is just to get __GNU_LIBRARY__ defined. */ #include #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #if defined (_LIBC) || !defined (__GNU_LIBRARY__) #ifdef __STDC__ #define POINTER void * #else #define POINTER char * #endif /* Determine default alignment. */ struct fooalign {char x; double d;}; #define DEFAULT_ALIGNMENT \ ((PTR_INT_TYPE) ((char *)&((struct fooalign *) 0)->d - (char *)0)) /* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT. But in fact it might be less smart and round addresses to as much as DEFAULT_ROUNDING. So we prepare for it to do that. */ union fooround {long x; double d;}; #define DEFAULT_ROUNDING (sizeof (union fooround)) /* When we copy a long block of data, this is the unit to do it with. On some machines, copying successive ints does not work; in such a case, redefine COPYING_UNIT to `long' (if that works) or `char' as a last resort. */ #ifndef COPYING_UNIT #define COPYING_UNIT int #endif /* The non-GNU-C macros copy the obstack into this global variable to avoid multiple evaluation. */ struct obstack *_obstack; /* Define a macro that either calls functions with the traditional malloc/free calling interface, or calls functions with the mmalloc/mfree interface (that adds an extra first argument), based on the state of use_extra_arg. For free, do not use ?:, since some compilers, like the MIPS compilers, do not allow (expr) ? void : void. */ #define CALL_CHUNKFUN(h, size) \ (((h) -> use_extra_arg) \ ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ : (*(h)->chunkfun) ((size))) #define CALL_FREEFUN(h, old_chunk) \ do { \ if ((h) -> use_extra_arg) \ (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ else \ (*(h)->freefun) ((old_chunk)); \ } while (0) /* Initialize an obstack H for use. Specify chunk size SIZE (0 means default). Objects start on multiples of ALIGNMENT (0 means use default). CHUNKFUN is the function to use to allocate chunks, and FREEFUN the function to free them. Return nonzero if successful, zero if out of memory. To recover from an out of memory error, free up some memory, then call this again. */ int _obstack_begin (h, size, alignment, chunkfun, freefun) struct obstack *h; int size; int alignment; POINTER (*chunkfun) (); void (*freefun) (); { register struct _obstack_chunk* chunk; /* points to new chunk */ if (alignment == 0) alignment = DEFAULT_ALIGNMENT; if (size == 0) /* Default size is what GNU malloc can fit in a 4096-byte block. */ { /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. Use the values for range checking, because if range checking is off, the extra bytes won't be missed terribly, but if range checking is on and we used a larger request, a whole extra 4096 bytes would be allocated. These number are irrelevant to the new GNU malloc. I suspect it is less sensitive to the size of the request. */ int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) + 4 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)); size = 4096 - extra; } h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; h->freefun = freefun; h->chunk_size = size; h->alignment_mask = alignment - 1; h->use_extra_arg = 0; chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); if (!chunk) { h->alloc_failed = 1; return 0; } h->alloc_failed = 0; h->next_free = h->object_base = chunk->contents; h->chunk_limit = chunk->limit = (char *) chunk + h->chunk_size; chunk->prev = 0; /* The initial chunk now contains no empty object. */ h->maybe_empty_object = 0; return 1; } int _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg) struct obstack *h; int size; int alignment; POINTER (*chunkfun) (); void (*freefun) (); POINTER arg; { register struct _obstack_chunk* chunk; /* points to new chunk */ if (alignment == 0) alignment = DEFAULT_ALIGNMENT; if (size == 0) /* Default size is what GNU malloc can fit in a 4096-byte block. */ { /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc. Use the values for range checking, because if range checking is off, the extra bytes won't be missed terribly, but if range checking is on and we used a larger request, a whole extra 4096 bytes would be allocated. These number are irrelevant to the new GNU malloc. I suspect it is less sensitive to the size of the request. */ int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)) + 4 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1)); size = 4096 - extra; } h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun; h->freefun = freefun; h->chunk_size = size; h->alignment_mask = alignment - 1; h->extra_arg = arg; h->use_extra_arg = 1; chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); if (!chunk) { h->alloc_failed = 1; return 0; } h->alloc_failed = 0; h->next_free = h->object_base = chunk->contents; h->chunk_limit = chunk->limit = (char *) chunk + h->chunk_size; chunk->prev = 0; /* The initial chunk now contains no empty object. */ h->maybe_empty_object = 0; return 1; } /* Allocate a new current chunk for the obstack *H on the assumption that LENGTH bytes need to be added to the current object, or a new object of length LENGTH allocated. Copies any partial object from the end of the old chunk to the beginning of the new one. */ void _obstack_newchunk (h, length) struct obstack *h; int length; { register struct _obstack_chunk* old_chunk = h->chunk; register struct _obstack_chunk* new_chunk; register long new_size; register int obj_size = h->next_free - h->object_base; register int i; int already; /* Compute size for new chunk. */ new_size = (obj_size + length) + (obj_size >> 3) + 100; if (new_size < h->chunk_size) new_size = h->chunk_size; /* Allocate and initialize the new chunk. */ new_chunk = CALL_CHUNKFUN (h, new_size); if (!new_chunk) { h->alloc_failed = 1; return; } h->alloc_failed = 0; h->chunk = new_chunk; new_chunk->prev = old_chunk; new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size; /* Move the existing object to the new chunk. Word at a time is fast and is safe if the object is sufficiently aligned. */ if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT) { for (i = obj_size / sizeof (COPYING_UNIT) - 1; i >= 0; i--) ((COPYING_UNIT *)new_chunk->contents)[i] = ((COPYING_UNIT *)h->object_base)[i]; /* We used to copy the odd few remaining bytes as one extra COPYING_UNIT, but that can cross a page boundary on a machine which does not do strict alignment for COPYING_UNITS. */ already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT); } else already = 0; /* Copy remaining bytes one by one. */ for (i = already; i < obj_size; i++) new_chunk->contents[i] = h->object_base[i]; /* If the object just copied was the only data in OLD_CHUNK, free that chunk and remove it from the chain. But not if that chunk might contain an empty object. */ if (h->object_base == old_chunk->contents && ! h->maybe_empty_object) { new_chunk->prev = old_chunk->prev; CALL_FREEFUN (h, old_chunk); } h->object_base = new_chunk->contents; h->next_free = h->object_base + obj_size; /* The new chunk certainly contains no empty object yet. */ h->maybe_empty_object = 0; } /* Return nonzero if object OBJ has been allocated from obstack H. This is here for debugging. If you use it in a program, you are probably losing. */ #ifdef __STDC__ /* Suppress -Wmissing-prototypes warning. We don't want to declare this in obstack.h because it is just for debugging. */ int _obstack_allocated_p (struct obstack *h, POINTER obj); #endif int _obstack_allocated_p (h, obj) struct obstack *h; POINTER obj; { register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */ register struct _obstack_chunk* plp; /* point to previous chunk if any */ lp = (h)->chunk; /* We use >= rather than > since the object cannot be exactly at the beginning of the chunk but might be an empty object exactly at the end of an adjacent chunk. */ while (lp != 0 && ((POINTER)lp >= obj || (POINTER)(lp)->limit < obj)) { plp = lp->prev; lp = plp; } return lp != 0; } /* Free objects in obstack H, including OBJ and everything allocate more recently than OBJ. If OBJ is zero, free everything in H. */ #undef obstack_free /* This function has two names with identical definitions. This is the first one, called from non-ANSI code. */ void _obstack_free (h, obj) struct obstack *h; POINTER obj; { register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */ register struct _obstack_chunk* plp; /* point to previous chunk if any */ lp = h->chunk; /* We use >= because there cannot be an object at the beginning of a chunk. But there can be an empty object at that address at the end of another chunk. */ while (lp != 0 && ((POINTER)lp >= obj || (POINTER)(lp)->limit < obj)) { plp = lp->prev; CALL_FREEFUN (h, lp); lp = plp; /* If we switch chunks, we can't tell whether the new current chunk contains an empty object, so assume that it may. */ h->maybe_empty_object = 1; } if (lp) { h->object_base = h->next_free = (char *)(obj); h->chunk_limit = lp->limit; h->chunk = lp; } else if (obj != 0) /* obj is not in any of the chunks! */ abort (); } /* This function is used from ANSI code. */ void obstack_free (h, obj) struct obstack *h; POINTER obj; { register struct _obstack_chunk* lp; /* below addr of any objects in this chunk */ register struct _obstack_chunk* plp; /* point to previous chunk if any */ lp = h->chunk; /* We use >= because there cannot be an object at the beginning of a chunk. But there can be an empty object at that address at the end of another chunk. */ while (lp != 0 && ((POINTER)lp >= obj || (POINTER)(lp)->limit < obj)) { plp = lp->prev; CALL_FREEFUN (h, lp); lp = plp; /* If we switch chunks, we can't tell whether the new current chunk contains an empty object, so assume that it may. */ h->maybe_empty_object = 1; } if (lp) { h->object_base = h->next_free = (char *)(obj); h->chunk_limit = lp->limit; h->chunk = lp; } else if (obj != 0) /* obj is not in any of the chunks! */ abort (); } #if 0 /* These are now turned off because the applications do not use it and it uses bcopy via obstack_grow, which causes trouble on sysV. */ /* Now define the functional versions of the obstack macros. Define them to simply use the corresponding macros to do the job. */ #ifdef __STDC__ /* These function definitions do not work with non-ANSI preprocessors; they won't pass through the macro names in parentheses. */ /* The function names appear in parentheses in order to prevent the macro-definitions of the names from being expanded there. */ POINTER (obstack_base) (obstack) struct obstack *obstack; { return obstack_base (obstack); } POINTER (obstack_next_free) (obstack) struct obstack *obstack; { return obstack_next_free (obstack); } int (obstack_object_size) (obstack) struct obstack *obstack; { return obstack_object_size (obstack); } int (obstack_room) (obstack) struct obstack *obstack; { return obstack_room (obstack); } void (obstack_grow) (obstack, pointer, length) struct obstack *obstack; POINTER pointer; int length; { obstack_grow (obstack, pointer, length); } void (obstack_grow0) (obstack, pointer, length) struct obstack *obstack; POINTER pointer; int length; { obstack_grow0 (obstack, pointer, length); } void (obstack_1grow) (obstack, character) struct obstack *obstack; int character; { obstack_1grow (obstack, character); } void (obstack_blank) (obstack, length) struct obstack *obstack; int length; { obstack_blank (obstack, length); } void (obstack_1grow_fast) (obstack, character) struct obstack *obstack; int character; { obstack_1grow_fast (obstack, character); } void (obstack_blank_fast) (obstack, length) struct obstack *obstack; int length; { obstack_blank_fast (obstack, length); } POINTER (obstack_finish) (obstack) struct obstack *obstack; { return obstack_finish (obstack); } POINTER (obstack_alloc) (obstack, length) struct obstack *obstack; int length; { return obstack_alloc (obstack, length); } POINTER (obstack_copy) (obstack, pointer, length) struct obstack *obstack; POINTER pointer; int length; { return obstack_copy (obstack, pointer, length); } POINTER (obstack_copy0) (obstack, pointer, length) struct obstack *obstack; POINTER pointer; int length; { return obstack_copy0 (obstack, pointer, length); } #endif /* __STDC__ */ #endif /* 0 */ #endif /* _LIBC or not __GNU_LIBRARY__. */ libmaa-1.3.2/obstack.h010064400017500000000000000464741107162146700141130ustar cheusovwheel/* obstack.h - object stack macros Copyright (C) 1988, 89, 90, 91, 92, 93, 94 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Summary: All the apparent functions defined here are macros. The idea is that you would use these pre-tested macros to solve a very specific set of problems, and they would run fast. Caution: no side-effects in arguments please!! They may be evaluated MANY times!! These macros operate a stack of objects. Each object starts life small, and may grow to maturity. (Consider building a word syllable by syllable.) An object can move while it is growing. Once it has been "finished" it never changes address again. So the "top of the stack" is typically an immature growing object, while the rest of the stack is of mature, fixed size and fixed address objects. These routines grab large chunks of memory, using a function you supply, called `obstack_chunk_alloc'. On occasion, they free chunks, by calling `obstack_chunk_free'. You must define them and declare them before using any obstack macros. Each independent stack is represented by a `struct obstack'. Each of the obstack macros expects a pointer to such a structure as the first argument. One motivation for this package is the problem of growing char strings in symbol tables. Unless you are "fascist pig with a read-only mind" --Gosper's immortal quote from HAKMEM item 154, out of context--you would not like to put any arbitrary upper limit on the length of your symbols. In practice this often means you will build many short symbols and a few long symbols. At the time you are reading a symbol you don't know how long it is. One traditional method is to read a symbol into a buffer, realloc()ating the buffer every time you try to read a symbol that is longer than the buffer. This is beaut, but you still will want to copy the symbol from the buffer to a more permanent symbol-table entry say about half the time. With obstacks, you can work differently. Use one obstack for all symbol names. As you read a symbol, grow the name in the obstack gradually. When the name is complete, finalize it. Then, if the symbol exists already, free the newly read name. The way we do this is to take a large chunk, allocating memory from low addresses. When you want to build a symbol in the chunk you just add chars above the current "high water mark" in the chunk. When you have finished adding chars, because you got to the end of the symbol, you know how long the chars are, and you can create a new object. Mostly the chars will not burst over the highest address of the chunk, because you would typically expect a chunk to be (say) 100 times as long as an average object. In case that isn't clear, when we have enough chars to make up the object, THEY ARE ALREADY CONTIGUOUS IN THE CHUNK (guaranteed) so we just point to it where it lies. No moving of chars is needed and this is the second win: potentially long strings need never be explicitly shuffled. Once an object is formed, it does not change its address during its lifetime. When the chars burst over a chunk boundary, we allocate a larger chunk, and then copy the partly formed object from the end of the old chunk to the beginning of the new larger chunk. We then carry on accreting characters to the end of the object as we normally would. A special macro is provided to add a single char at a time to a growing object. This allows the use of register variables, which break the ordinary 'growth' macro. Summary: We allocate large chunks. We carve out one object at a time from the current chunk. Once carved, an object never moves. We are free to append data of any size to the currently growing object. Exactly one object is growing in an obstack at any one time. You can run one obstack per control block. You may have as many control blocks as you dare. Because of the way we do it, you can `unwind' an obstack back to a previous state. (You may remove objects much as you would with a stack.) */ /* Don't do the contents of this file more than once. */ #ifndef __OBSTACK_H__ #define __OBSTACK_H__ /* We use subtraction of (char *)0 instead of casting to int because on word-addressable machines a simple cast to int may ignore the byte-within-word field of the pointer. */ #ifndef __PTR_TO_INT #define __PTR_TO_INT(P) ((P) - (char *)0) #endif #ifndef __INT_TO_PTR #define __INT_TO_PTR(P) ((P) + (char *)0) #endif /* We need the type of the resulting object. In ANSI C it is ptrdiff_t but in traditional C it is usually long. If we are in ANSI C and don't already have ptrdiff_t get it. */ #if defined (__STDC__) && ! defined (offsetof) #if defined (__GNUC__) && defined (IN_GCC) /* On Next machine, the system's stddef.h screws up if included after we have defined just ptrdiff_t, so include all of stddef.h. Otherwise, define just ptrdiff_t, which is all we need. */ #ifndef __NeXT__ #define __need_ptrdiff_t #endif #endif #include #endif #ifdef __STDC__ #define PTR_INT_TYPE ptrdiff_t #else #define PTR_INT_TYPE long #endif struct _obstack_chunk /* Lives at front of each chunk. */ { char *limit; /* 1 past end of this chunk */ struct _obstack_chunk *prev; /* address of prior chunk or NULL */ char contents[4]; /* objects begin here */ }; struct obstack /* control current object in current chunk */ { long chunk_size; /* preferred size to allocate chunks in */ struct _obstack_chunk* chunk; /* address of current struct obstack_chunk */ char *object_base; /* address of object we are building */ char *next_free; /* where to add next char to current object */ char *chunk_limit; /* address of char after current chunk */ PTR_INT_TYPE temp; /* Temporary for some macros. */ int alignment_mask; /* Mask of alignment for each object. */ struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk. */ void (*freefun) (); /* User's function to free a chunk. */ char *extra_arg; /* first arg for chunk alloc/dealloc funcs */ unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */ unsigned maybe_empty_object:1;/* There is a possibility that the current chunk contains a zero-length object. This prevents freeing the chunk if we allocate a bigger chunk to replace it. */ unsigned alloc_failed:1; /* chunk alloc func returned 0 */ }; /* Declare the external functions we use; they are in obstack.c. */ #ifdef __STDC__ extern void _obstack_newchunk (struct obstack *, int); extern void _obstack_free (struct obstack *, void *); extern int _obstack_begin (struct obstack *, int, int, void *(*) (), void (*) ()); extern int _obstack_begin_1 (struct obstack *, int, int, void *(*) (), void (*) (), void *); #else extern void _obstack_newchunk (); extern void _obstack_free (); extern int _obstack_begin (); extern int _obstack_begin_1 (); #endif #ifdef __STDC__ /* Do the function-declarations after the structs but before defining the macros. */ void obstack_init (struct obstack *obstack); void * obstack_alloc (struct obstack *obstack, int size); void * obstack_copy (struct obstack *obstack, void *address, int size); void * obstack_copy0 (struct obstack *obstack, void *address, int size); void obstack_free (struct obstack *obstack, void *block); void obstack_blank (struct obstack *obstack, int size); void obstack_grow (struct obstack *obstack, void *data, int size); void obstack_grow0 (struct obstack *obstack, void *data, int size); void obstack_1grow (struct obstack *obstack, int data_char); void obstack_ptr_grow (struct obstack *obstack, void *data); void obstack_int_grow (struct obstack *obstack, int data); void * obstack_finish (struct obstack *obstack); int obstack_object_size (struct obstack *obstack); int obstack_room (struct obstack *obstack); void obstack_1grow_fast (struct obstack *obstack, int data_char); void obstack_ptr_grow_fast (struct obstack *obstack, void *data); void obstack_int_grow_fast (struct obstack *obstack, int data); void obstack_blank_fast (struct obstack *obstack, int size); void * obstack_base (struct obstack *obstack); void * obstack_next_free (struct obstack *obstack); int obstack_alignment_mask (struct obstack *obstack); int obstack_chunk_size (struct obstack *obstack); #endif /* __STDC__ */ /* Non-ANSI C cannot really support alternative functions for these macros, so we do not declare them. */ /* Pointer to beginning of object being allocated or to be allocated next. Note that this might not be the final address of the object because a new chunk might be needed to hold the final size. */ #define obstack_base(h) ((h)->alloc_failed ? 0 : (h)->object_base) /* Size for allocating ordinary chunks. */ #define obstack_chunk_size(h) ((h)->chunk_size) /* Pointer to next byte not yet allocated in current chunk. */ #define obstack_next_free(h) ((h)->alloc_failed ? 0 : (h)->next_free) /* Mask specifying low bits that should be clear in address of an object. */ #define obstack_alignment_mask(h) ((h)->alignment_mask) #define obstack_init(h) \ _obstack_begin ((h), 0, 0, \ (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free) #define obstack_begin(h, size) \ _obstack_begin ((h), (size), 0, \ (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free) #define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \ _obstack_begin ((h), (size), (alignment), \ (void *(*) ()) (chunkfun), (void (*) ()) (freefun)) #define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \ _obstack_begin_1 ((h), (size), (alignment), \ (void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg)) #define obstack_chunkfun(h, newchunkfun) \ ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun)) #define obstack_freefun(h, newfreefun) \ ((h) -> freefun = (void (*)()) (newfreefun)) #define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = achar) #define obstack_blank_fast(h,n) ((h)->next_free += (n)) #if defined (__GNUC__) && defined (__STDC__) #if __GNUC__ < 2 #define __extension__ #endif /* For GNU C, if not -traditional, we can define these macros to compute all args only once without using a global variable. Also, we can avoid using the `temp' slot, to make faster code. */ #define obstack_object_size(OBSTACK) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ __o->alloc_failed ? 0 : \ (unsigned) (__o->next_free - __o->object_base); }) #define obstack_room(OBSTACK) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ (unsigned) (__o->chunk_limit - __o->next_free); }) #define obstack_grow(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->next_free + __len > __o->chunk_limit) \ _obstack_newchunk (__o, __len); \ if (!__o->alloc_failed) \ { \ memcpy (__o->next_free, (char *) (where), __len); \ __o->next_free += __len; \ } \ (void) 0; }) #define obstack_grow0(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->next_free + __len + 1 > __o->chunk_limit) \ _obstack_newchunk (__o, __len + 1); \ if (!__o->alloc_failed) \ { \ memcpy (__o->next_free, (char *) (where), __len); \ __o->next_free += __len; \ *(__o->next_free)++ = 0; \ } \ (void) 0; }) #define obstack_1grow(OBSTACK,datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + 1 > __o->chunk_limit) \ _obstack_newchunk (__o, 1); \ if (!__o->alloc_failed) \ *(__o->next_free)++ = (datum); \ (void) 0; }) /* These assume that the obstack alignment is good enough for pointers or ints, and that the data added so far to the current object shares that much alignment. */ #define obstack_ptr_grow(OBSTACK,datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (void *)); \ if (!__o->alloc_failed) \ *((void **)__o->next_free)++ = ((void *)datum); \ (void) 0; }) #define obstack_int_grow(OBSTACK,datum) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (int) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (int)); \ if (!__o->alloc_failed) \ *((int *)__o->next_free)++ = ((int)datum); \ (void) 0; }) #define obstack_ptr_grow_fast(h,aptr) (*((void **)(h)->next_free)++ = (void *)aptr) #define obstack_int_grow_fast(h,aint) (*((int *)(h)->next_free)++ = (int)aint) #define obstack_blank(OBSTACK,length) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ int __len = (length); \ if (__o->chunk_limit - __o->next_free < __len) \ _obstack_newchunk (__o, __len); \ if (!__o->alloc_failed) \ __o->next_free += __len; \ (void) 0; }) #define obstack_alloc(OBSTACK,length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_blank (__h, (length)); \ obstack_finish (__h); }) #define obstack_copy(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_grow (__h, (where), (length)); \ obstack_finish (__h); }) #define obstack_copy0(OBSTACK,where,length) \ __extension__ \ ({ struct obstack *__h = (OBSTACK); \ obstack_grow0 (__h, (where), (length)); \ obstack_finish (__h); }) /* The local variable is named __o1 to avoid a name conflict when obstack_blank is called. */ #define obstack_finish(OBSTACK) \ __extension__ \ ({ struct obstack *__o1 = (OBSTACK); \ void *value; \ if (__o1->alloc_failed) \ value = 0; \ else \ { \ value = (void *) __o1->object_base; \ if (__o1->next_free == value) \ __o1->maybe_empty_object = 1; \ __o1->next_free \ = __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\ & ~ (__o1->alignment_mask)); \ if (__o1->next_free - (char *)__o1->chunk \ > __o1->chunk_limit - (char *)__o1->chunk) \ __o1->next_free = __o1->chunk_limit; \ __o1->object_base = __o1->next_free; \ } \ value; }) #define obstack_free(OBSTACK, OBJ) \ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ void *__obj = (OBJ); \ if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \ __o->next_free = __o->object_base = __obj; \ else (obstack_free) (__o, __obj); }) #else /* not __GNUC__ or not __STDC__ */ #define obstack_object_size(h) \ (unsigned) ((h)->alloc_failed ? 0 : (h)->next_free - (h)->object_base) #define obstack_room(h) \ (unsigned) ((h)->chunk_limit - (h)->next_free) /* Note that the call to _obstack_newchunk is enclosed in (..., 0) so that we can avoid having void expressions in the arms of the conditional expression. Casting the third operand to void was tried before, but some compilers won't accept it. */ #define obstack_grow(h,where,length) \ ( (h)->temp = (length), \ (((h)->next_free + (h)->temp > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \ ((h)->alloc_failed ? 0 : \ (memcpy ((h)->next_free, (char *) (where), (h)->temp), \ (h)->next_free += (h)->temp))) #define obstack_grow0(h,where,length) \ ( (h)->temp = (length), \ (((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \ ((h)->alloc_failed ? 0 : \ (memcpy ((h)->next_free, (char *) (where), (h)->temp), \ (h)->next_free += (h)->temp, \ *((h)->next_free)++ = 0))) #define obstack_1grow(h,datum) \ ( (((h)->next_free + 1 > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), 1), 0) : 0), \ ((h)->alloc_failed ? 0 : \ (*((h)->next_free)++ = (datum)))) #define obstack_ptr_grow(h,datum) \ ( (((h)->next_free + sizeof (char *) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (char *)), 0) : 0), \ ((h)->alloc_failed ? 0 : \ (*((char **)(((h)->next_free+=sizeof(char *))-sizeof(char *))) = ((char *)datum)))) #define obstack_int_grow(h,datum) \ ( (((h)->next_free + sizeof (int) > (h)->chunk_limit) \ ? (_obstack_newchunk ((h), sizeof (int)), 0) : 0), \ ((h)->alloc_failed ? 0 : \ (*((int *)(((h)->next_free+=sizeof(int))-sizeof(int))) = ((int)datum)))) #define obstack_ptr_grow_fast(h,aptr) (*((char **)(h)->next_free)++ = (char *)aptr) #define obstack_int_grow_fast(h,aint) (*((int *)(h)->next_free)++ = (int)aint) #define obstack_blank(h,length) \ ( (h)->temp = (length), \ (((h)->chunk_limit - (h)->next_free < (h)->temp) \ ? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \ ((h)->alloc_failed ? 0 : \ ((h)->next_free += (h)->temp))) #define obstack_alloc(h,length) \ (obstack_blank ((h), (length)), obstack_finish ((h))) #define obstack_copy(h,where,length) \ (obstack_grow ((h), (where), (length)), obstack_finish ((h))) #define obstack_copy0(h,where,length) \ (obstack_grow0 ((h), (where), (length)), obstack_finish ((h))) #define obstack_finish(h) \ ( (h)->alloc_failed ? 0 : \ (((h)->next_free == (h)->object_base \ ? (((h)->maybe_empty_object = 1), 0) \ : 0), \ (h)->temp = __PTR_TO_INT ((h)->object_base), \ (h)->next_free \ = __INT_TO_PTR ((__PTR_TO_INT ((h)->next_free)+(h)->alignment_mask) \ & ~ ((h)->alignment_mask)), \ (((h)->next_free - (char *)(h)->chunk \ > (h)->chunk_limit - (char *)(h)->chunk) \ ? ((h)->next_free = (h)->chunk_limit) : 0), \ (h)->object_base = (h)->next_free, \ __INT_TO_PTR ((h)->temp))) #ifdef __STDC__ #define obstack_free(h,obj) \ ( (h)->temp = (char *)(obj) - (char *) (h)->chunk, \ (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ ? (int) ((h)->next_free = (h)->object_base \ = (h)->temp + (char *) (h)->chunk) \ : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0))) #else #define obstack_free(h,obj) \ ( (h)->temp = (char *)(obj) - (char *) (h)->chunk, \ (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\ ? (int) ((h)->next_free = (h)->object_base \ = (h)->temp + (char *) (h)->chunk) \ : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0))) #endif #endif /* not __GNUC__ or not __STDC__ */ #endif /* not __OBSTACK_H__ */ libmaa-1.3.2/parse-concrete.c010064400017500000000000000026421111676220300153510ustar cheusovwheel/* parse-concrete.c -- Support for calling parsers from Libmaa, continued * Created: Mon Apr 24 17:40:51 1995 by faith@dict.org * Copyright 1995, 1997, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" static hsh_HashTable _prs_hash; void prs_register_concrete( const char *symbol, const char *concrete ) { if (!_prs_hash) _prs_hash = hsh_create( NULL, NULL ); hsh_insert( _prs_hash, str_find( symbol ), str_find( concrete ) ); } const char *prs_concrete( const char *symbol ) { if (!_prs_hash) return NULL; return hsh_retrieve( _prs_hash, symbol ); } void _prs_shutdown( void ) { if (_prs_hash) hsh_destroy( _prs_hash ); } libmaa-1.3.2/pr.c010064400017500000000000000317721165050332400130660ustar cheusovwheel/* pr.c -- Process creation and tracking support * Created: Sun Jan 7 13:34:08 1996 by faith@dict.org * Copyright 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Process Management Routines} * * \intro The process management routines are designed to facilitate the * creation and management of child processes, coprocesses, and associated * pipelines and I/O. Some support for daemons and socket connections is * also provided. * */ #include "maaP.h" #include #include #include #if HAVE_SYS_PARAM_H # include #endif #if HAVE_SYS_WAIT_H # include #endif #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif typedef struct _pr_Obj { int pid; } *_pr_Obj; static _pr_Obj _pr_objects = NULL; #if 0 static void _pr_check( pr_Object object, const char *function ) { Obj o = (Obj)object; if (!o) err_internal( function, "object is null\n" ); #if MAA_MAGIC if (o->magic != PR_MAGIC) err_internal( function, "Magic match failed: 0x%08x (should be 0x%08x)\n", o->magic, PR_MAGIC ); #endif } #endif /* The idea for the max_fd call is from W. Richard Stevens; Advanced Programming in the UNIX Environment (Addison-Wesley Publishing Co., 1992); page 43. The implementation here, however, is different from that provided by Stevens for his open_max routine. */ static int max_fd( void ) { static int maxFd = 0; if (maxFd) return maxFd; #if HAVE_SYSCONF if ((maxFd = sysconf( _SC_OPEN_MAX )) > 0) return maxFd; #endif #ifdef NOFILE return maxFd = NOFILE; /* Usually in sys/params.h */ #else # ifdef _NFILE return maxFd = _NFILE; # else return maxFd = 256; /* best guess */ # endif #endif } static void _pr_init( void ) { if (!_pr_objects) _pr_objects = xcalloc( max_fd(), sizeof( struct _pr_Obj ) ); } void _pr_shutdown( void ) { int i; if (_pr_objects) { for (i = 0; i < max_fd(); i++) { /* FIXME: blah */; if (_pr_objects[i].pid) { kill( _pr_objects[i].pid, SIGKILL ); /* FIXME! be gentler. */ pr_wait( _pr_objects[i].pid ); _pr_objects[i].pid = 0; } } xfree( _pr_objects ); _pr_objects = NULL; } } int pr_open( const char *command, int flags, int *infd, int *outfd, int *errfd) { int pid; int fdin[2]; int fdout[2]; int fderr[2]; arg_List list; int argc; char **argv; int null; _pr_init(); if (flags & ~(PR_USE_STDIN | PR_USE_STDOUT | PR_USE_STDERR | PR_CREATE_STDIN | PR_CREATE_STDOUT | PR_CREATE_STDERR | PR_STDERR_TO_STDOUT)) err_internal( __func__, "Illegal flags: 0x%08x\n", flags ); if ((flags & PR_USE_STDIN) && (flags & PR_CREATE_STDIN)) err_internal( __func__, "Cannot both use and create stdin\n" ); if ((flags & PR_USE_STDOUT) && (flags & PR_CREATE_STDOUT)) err_internal( __func__, "Cannot both use and create stdout\n" ); if ((flags & PR_USE_STDERR) && (flags & PR_CREATE_STDERR)) err_internal( __func__, "Cannot both use and create stderr\n" ); if ((flags & PR_STDERR_TO_STDOUT) && ((flags & PR_USE_STDERR) || (flags & PR_CREATE_STDERR))) err_internal( __func__, "Cannot use/create stderr when duping to stdout\n" ); list = arg_argify( command, 0 ); arg_get_vector( list, &argc, &argv ); PRINTF(MAA_PR,("Execing %s with \"%s\"\n", argv[0], command )); if ((flags & PR_CREATE_STDIN) && pipe( fdin ) < 0) err_fatal_errno( __func__, "Cannot create pipe for stdin\n" ); if ((flags & PR_CREATE_STDOUT) && pipe( fdout ) < 0) err_fatal_errno( __func__, "Cannot create pipe for stdout\n" ); if ((flags & PR_CREATE_STDERR) && pipe( fderr ) < 0) err_fatal_errno( __func__, "Cannot create pipe for stderr\n" ); if ((pid = fork()) < 0) err_fatal_errno( __func__, "Cannot fork\n" ); if (pid == 0) { /* child */ int i; #define CHILD(CREATE,USE,fds,writefd,readfd,fd,FILENO,flag) \ if (flags & CREATE) { \ close( fds[writefd] ); \ dup2( fds[readfd], FILENO ); \ close( fds[readfd] ); \ } else if (flags & USE) { \ if (fd && *fd) { \ dup2( *fd, FILENO ); \ close( *fd ); \ } else { \ if ((null = open( "/dev/null", flag )) >= 0) { \ dup2( null, FILENO ); \ close( null ); \ } \ } \ } CHILD( PR_CREATE_STDIN, PR_USE_STDIN, fdin, 1, 0, infd, STDIN_FILENO, O_RDONLY ); CHILD( PR_CREATE_STDOUT, PR_USE_STDOUT, fdout, 0, 1, outfd, STDOUT_FILENO, O_WRONLY ); CHILD( PR_CREATE_STDERR, PR_USE_STDERR, fderr, 0, 1, errfd, STDERR_FILENO, O_WRONLY ); #undef CHILD if (flags & PR_STDERR_TO_STDOUT) dup2( STDOUT_FILENO, STDERR_FILENO ); for (i = 0; i < max_fd(); i++) if (_pr_objects[i].pid > 0) close( i ); execvp( argv[0], argv ); _exit(127); } /* parent */ #define PARENT(CREATE,USE,fds,readfd,writefd,fd,flag,name) \ if (flags & CREATE) { \ close( fds[ readfd ] ); \ *fd = fds[ writefd ]; \ _pr_objects[ *fd ].pid = pid; \ PRINTF(MAA_PR,(name " = %d; ",*fd)); \ } else if (flags & USE) { \ if (fd && *fd) { \ PRINTF(MAA_PR,(name " = %d*; ",*fd)); \ _pr_objects[ *fd ].pid =0; \ close( *fd ); \ } \ } PARENT( PR_CREATE_STDIN, PR_USE_STDIN, fdin, 0, 1, infd, "w", "stdin" ); PARENT( PR_CREATE_STDOUT, PR_USE_STDOUT, fdout, 1, 0, outfd, "r", "stdout" ); PARENT( PR_CREATE_STDERR, PR_USE_STDERR, fderr, 1, 0, errfd, "r", "stderr" ); #undef PARENT PRINTF(MAA_PR,("child pid = %d\n",pid)); arg_destroy( list ); return pid; } int pr_wait( int pid ) { int exitStatus = 0; int status; PRINTF(MAA_PR,("waiting on pid %d\n",pid)); while (waitpid( pid, &status, 0 ) < 0) { if (errno != EINTR) { if (errno == ECHILD) return 0; /* We've already waited */ /* This is really bad... */ PRINTF(MAA_PR,("waitpid() < 0, errno = %d\n", errno )); perror( __func__ ); return -1; } } if (WIFEXITED( status )) exitStatus |= WEXITSTATUS( status ); /* SIGPIPE is ok here, since tar may shutdown early. Anything else is a problem. */ if (WIFSIGNALED( status ) && WTERMSIG( status ) != SIGPIPE) exitStatus |= 128 + WTERMSIG( status ); /* like bash :-) */ PRINTF(MAA_PR,("Child %d exited with status 0x%04x\n",pid,exitStatus)); return exitStatus; } int pr_close_nowait( int fd ) { int pid; if (!_pr_objects) err_internal( __func__, "No previous call to pr_open()\n" ); if (!(pid = _pr_objects[ fd ].pid)) err_internal( __func__, "File (%d) not created by pr_open()\n", fd ); _pr_objects[ fd ].pid = 0; close( fd ); return pid; } int pr_close( int fd ) { int pid = pr_close_nowait( fd ); return pr_wait( pid ); } int pr_readwrite( int in, int out, const char *inBuffer, int inLen, char *outBuffer, int outMaxLen ) { long flags; const char *inPt = inBuffer; char *outPt = outBuffer; int outLen = 0; fd_set rfds, wfds, efds; struct timeval tv; int n; int count; int retval; int status; if ((flags = fcntl( in, F_GETFL )) < 0) err_fatal_errno( __func__, "Can't get flags for output stream\n" ); #ifdef O_NONBLOCK flags |= O_NONBLOCK; #else flags |= FNDELAY; #endif fcntl( in, F_SETFL, flags ); if ((flags = fcntl( out, F_GETFL )) < 0) err_fatal_errno( __func__, "Can't get flags for input stream\n" ); #ifdef O_NONBLOCK flags |= O_NONBLOCK; #else flags |= FNDELAY; #endif fcntl( out, F_SETFL, flags ); n = max( in, out ) + 1; for (;;) { tv.tv_sec = 5; tv.tv_usec = 0; FD_ZERO( &rfds ); FD_ZERO( &wfds ); FD_ZERO( &efds ); FD_SET( out, &rfds ); FD_SET( out, &efds ); if (inLen) { FD_SET( in, &wfds ); FD_SET( in, &efds ); } switch ((retval = select( n, &rfds, &wfds, &efds, &tv ))) { case -1: err_fatal_errno( __func__, "Filter failed\n" ); break; /* case 0: err_fatal( __func__, "Filter hung\n" ); break; */ default: if (dbg_test(MAA_PR)) { printf( "select(2) returns %d," " inLen = %d, outLen = %d, outMaxLen = %d\n", retval, inLen, outLen, outMaxLen ); if (FD_ISSET( in, &rfds )) printf( " in/read\n" ); if (FD_ISSET( out, &rfds )) printf( " out/read\n" ); if (FD_ISSET( in, &wfds )) printf( " in/write\n" ); if (FD_ISSET( out, &wfds )) printf( " out/write\n" ); if (FD_ISSET( in, &efds )) printf( " in/error\n" ); if (FD_ISSET( out, &efds )) printf( " out/error\n" ); } if (inLen) { if ((count = write( in, inPt, inLen )) <= 0) { if (errno != EAGAIN) err_fatal_errno( __func__, "Error writing to filter\n" ); } else { PRINTF(MAA_PR,(" wrote %d\n",count)); inLen -= count; inPt += count; if (!inLen) { pr_close_nowait( in ); n = out + 1; } } } if ((count = read( out, outPt, outMaxLen )) <= 0) { if (!count) { if (inLen) err_fatal( __func__, "End of output, but input not flushed\n" ); if ((status = pr_close( out ))) err_warning( __func__, "Filter had non-zero exit status: 0x%x\n", status ); return outLen; } else if (errno != EAGAIN) err_fatal_errno( __func__, "Error reading from filter\n" ); } else { PRINTF(MAA_PR,(" read %d\n",count)); outLen += count; outPt += count; if ((outMaxLen -= count) < 0) err_fatal( __func__, "Output buffer overflow\n" ); } break; } } } int pr_filter( const char *command, const char *inBuffer, int inLen, char *outBuffer, int outMaxLen ) { int in, out; pr_open( command, PR_CREATE_STDIN | PR_CREATE_STDOUT, &in, &out, NULL ); return pr_readwrite( in, out, inBuffer, inLen, outBuffer, outMaxLen ); } int pr_spawn( const char *command ) { arg_List list; int argc; char **argv; int pid; int status; int exitStatus = 0; _pr_init(); list = arg_argify( command, 0 ); arg_get_vector( list, &argc, &argv ); PRINTF(MAA_PR,("Execing %s with \"%s\"\n", argv[0], command )); if ((pid = fork()) < 0) err_fatal_errno( __func__, "Cannot fork\n" ); if (pid == 0) { /* child */ execvp( argv[0], argv ); _exit(127); } /* parent */ PRINTF(MAA_PR,("child pid = %d\n",pid)); arg_destroy( list ); PRINTF(MAA_PR,("waiting on pid %d\n",pid)); while (waitpid( pid, &status, 0 ) < 0) { if (errno != EINTR) { if (errno == ECHILD) return 0; /* We've already waited */ /* This is really bad... */ PRINTF(MAA_PR,("waitpid() < 0, errno = %d\n", errno )); perror( __func__ ); return -1; } } if (WIFEXITED( status )) exitStatus |= WEXITSTATUS( status ); /* SIGPIPE is ok here, since tar may shutdown early. Anything else is a problem. */ if (WIFSIGNALED( status ) && WTERMSIG( status ) != SIGPIPE) exitStatus |= 128 + WTERMSIG( status ); /* like bash :-) */ PRINTF(MAA_PR,("Child %d exited with status 0x%04x\n",pid,exitStatus)); return exitStatus; } libmaa-1.3.2/prime.c010064400017500000000000000044131111676220300135510ustar cheusovwheel/* prime.c -- Find prime numbers * Created: Thu Jul 20 22:04:37 1995 by faith@dict.org * Copyright 1995, 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * \section{Prime Number Routines} * * \intro These routines are used to find the next larger prime number for * expansion of the hash tables used by the hash and set routines. These * routines are only useful for 32-bit unsigned values. * */ #include "maaP.h" /* \doc |prm_is_prime| returns 1 if |value| is prime; 0 otherwise. Primality is determined by testings all odd divisors less than the square root of |value|. For 32-bit integers, this may mean that we will test about $\frac{\sqrt{2^{32}-1}}{2} = 32768$ odd values instead of the 6542 primes that would actually need to be tested. (A table of pre-computed primes using less than 26kB of memory could be used to recover this factor of 5 performance loss.) */ int prm_is_prime( unsigned int value ) { unsigned int divisor = 3; unsigned int square = divisor * divisor; if (value == 2) return 1; if (value == 3) return 1; if (!(value & 1)) return 0; /* even */ while (square < value && value % divisor) { ++divisor; square += 4 * divisor; ++divisor; } return value % divisor != 0; } /* \doc |prm_next_prime| returns the smallest odd prime greater than or equal to |start|. */ unsigned long prm_next_prime( unsigned int start ) { unsigned int next; for (next = start | 1; !prm_is_prime( next ); next += 2); return next; } libmaa-1.3.2/primetest.c010064400017500000000000000021341111676220300144470ustar cheusovwheel/* primetest.c -- * Created: Thu Jul 20 22:15:54 1995 by faith@dict.org * Copyright 1995, 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" int main( int argc, char **argv ) { if (argc != 2) { printf( "%lu\n", prm_next_prime( 10000 ) ); } else { printf( "%lu\n", prm_next_prime( strtoul( argv[1], NULL, 0 ) ) ); } return 0; } libmaa-1.3.2/primetest.out010064400017500000000000000000060607204154600150350ustar cheusovwheel10007 libmaa-1.3.2/prtest.c010064400017500000000000000044441165050416300137640ustar cheusovwheel/* prtest.c -- * Created: Fri Jan 12 14:18:32 1996 by faith@dict.org * Copyright 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" int main( int argc, char **argv ) { int fdin = 0; int fdout; char buf[BUFSIZ]; int c; int i; ssize_t cnt = 0; maa_init( argv[0] ); while ((c = getopt( argc, argv, "D" )) != EOF) switch (c) { case 'D': dbg_set( ".pr" ); break; } if (argc-optind == 0) { pr_open( "echo foo", PR_USE_STDIN | PR_CREATE_STDOUT, &fdin, &fdout, NULL ); } else { for (i = optind; i < argc; i++) { pr_open( argv[i], PR_USE_STDIN | PR_CREATE_STDOUT, &fdin, &fdout, NULL ); fdin = fdout; } } printf ("Got:"); while (cnt = read (fdout, buf, BUFSIZ-1), cnt > 0){ buf [cnt] = 0; printf( " \"%s\"\n", buf ); } printf( "status = 0x%02x\n", pr_close (fdout) ); #if 0 printf( "%s\n", maa_version() ); pr_open( "echo foobar", PR_USE_STDIN | PR_CREATE_STDOUT, NULL, &instr, NULL ); pr_open( "cat", PR_USE_STDIN | PR_CREATE_STDOUT, &instr, &outstr, NULL ); fgets( buf, sizeof( buf ), outstr ); printf( "Got \"%s\"\n", buf ); printf( "status = 0x%02x\n", pr_close( outstr ) ); pr_open( "cat", PR_CREATE_STDIN | PR_CREATE_STDOUT, &instr, &outstr, NULL ); fprintf( instr, "this is a test\n" ); fflush( instr ); fgets( buf, sizeof( buf ), outstr ); printf( "Got \"%s\"\n", buf ); printf( "status = 0x%02x\n", pr_close( instr ) ); printf( "status = 0x%02x\n", pr_close( outstr ) ); #endif return 0; } libmaa-1.3.2/prtest.out010064400017500000000000000000320622461670400143440ustar cheusovwheelGot: "foo " status = 0x00 libmaa-1.3.2/rnd.c010064400017500000000000001451011111676220300132200ustar cheusovwheel/* rnd.c -- "Random" number generator for test programs * Created: Wed Sep 25 10:04:32 1996 by faith@dict.org * Copyright 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" #include #define MAXRND 5000 /* Random numbers are hard coded, since there is great variability in terms of what random(3) actually returns. */ static double rnd[MAXRND] = { 0.125341, 0.544604, 0.414346, 0.583974, 0.174296, 0.961711, 0.690130, 0.292579, 0.562515, 0.109384, 0.823356, 0.714925, 0.841857, 0.481093, 0.448740, 0.533222, 0.116015, 0.745627, 0.391775, 0.068052, 0.350539, 0.739208, 0.712224, 0.128878, 0.695183, 0.796589, 0.460657, 0.170030, 0.598239, 0.450458, 0.697441, 0.723580, 0.995062, 0.111787, 0.307554, 0.169358, 0.073498, 0.997683, 0.461937, 0.636013, 0.107068, 0.285293, 0.350938, 0.948924, 0.766386, 0.799678, 0.482146, 0.882401, 0.545306, 0.873921, 0.950452, 0.895845, 0.613129, 0.662676, 0.024722, 0.308312, 0.459265, 0.485379, 0.478342, 0.057504, 0.935837, 0.175782, 0.781084, 0.930899, 0.287569, 0.088638, 0.100257, 0.361067, 0.086321, 0.562194, 0.997080, 0.193389, 0.847487, 0.348018, 0.142314, 0.613873, 0.147696, 0.624459, 0.496274, 0.693002, 0.498380, 0.446726, 0.588847, 0.111509, 0.109403, 0.613569, 0.419821, 0.568668, 0.098948, 0.898162, 0.626172, 0.034785, 0.073945, 0.407257, 0.965684, 0.361514, 0.495895, 0.065940, 0.722581, 0.582216, 0.628134, 0.719660, 0.775606, 0.475621, 0.067678, 0.917919, 0.089494, 0.215375, 0.542379, 0.585768, 0.908377, 0.040759, 0.032494, 0.497224, 0.152267, 0.141897, 0.110793, 0.572088, 0.710564, 0.209741, 0.470251, 0.336737, 0.244526, 0.544195, 0.743994, 0.210210, 0.905709, 0.239889, 0.276150, 0.628290, 0.822105, 0.904284, 0.347950, 0.597711, 0.379905, 0.415628, 0.515630, 0.469399, 0.631003, 0.058008, 0.055166, 0.539380, 0.098767, 0.087660, 0.036604, 0.251035, 0.229557, 0.147397, 0.823123, 0.940121, 0.357138, 0.293373, 0.276858, 0.601664, 0.837569, 0.020852, 0.811873, 0.743278, 0.260741, 0.088024, 0.371568, 0.082846, 0.992308, 0.719518, 0.680556, 0.372213, 0.135147, 0.196186, 0.841612, 0.766150, 0.254195, 0.896778, 0.305530, 0.352962, 0.984438, 0.342134, 0.603997, 0.213995, 0.489531, 0.427119, 0.154117, 0.846668, 0.720493, 0.430975, 0.448332, 0.558062, 0.451827, 0.260206, 0.301340, 0.712567, 0.348229, 0.672908, 0.795413, 0.340537, 0.392427, 0.475970, 0.712750, 0.527573, 0.672156, 0.554361, 0.293723, 0.926351, 0.451140, 0.599253, 0.279313, 0.435578, 0.941387, 0.883309, 0.649573, 0.430918, 0.310429, 0.803690, 0.277586, 0.030922, 0.234665, 0.725918, 0.588984, 0.686492, 0.986124, 0.890324, 0.399059, 0.334353, 0.563232, 0.194472, 0.674890, 0.955659, 0.670442, 0.387640, 0.483232, 0.342598, 0.942001, 0.776955, 0.268949, 0.393141, 0.376209, 0.548261, 0.828719, 0.317596, 0.431571, 0.478292, 0.748514, 0.742000, 0.281982, 0.026100, 0.772922, 0.516647, 0.752018, 0.361905, 0.203138, 0.738142, 0.252229, 0.602197, 0.072494, 0.815461, 0.796669, 0.747384, 0.771120, 0.467111, 0.135024, 0.254352, 0.809709, 0.077025, 0.031307, 0.078658, 0.470166, 0.407516, 0.626919, 0.298884, 0.725112, 0.058490, 0.777176, 0.473626, 0.800490, 0.059158, 0.499725, 0.573411, 0.575805, 0.251743, 0.935317, 0.778943, 0.989885, 0.187546, 0.381140, 0.062380, 0.003007, 0.177810, 0.809764, 0.774127, 0.644921, 0.944788, 0.028479, 0.454630, 0.021813, 0.059786, 0.533287, 0.491978, 0.467302, 0.160206, 0.790862, 0.192414, 0.218696, 0.568039, 0.666039, 0.019186, 0.627197, 0.165765, 0.592598, 0.203001, 0.417508, 0.527914, 0.981944, 0.407393, 0.715460, 0.363084, 0.469773, 0.718467, 0.540894, 0.279537, 0.492594, 0.185815, 0.224324, 0.521073, 0.640444, 0.246137, 0.580859, 0.173731, 0.738115, 0.048161, 0.333938, 0.528978, 0.240575, 0.552634, 0.097016, 0.906614, 0.571820, 0.724213, 0.072379, 0.164418, 0.927214, 0.489887, 0.692332, 0.909158, 0.897280, 0.407792, 0.272242, 0.367053, 0.126260, 0.813136, 0.646590, 0.618854, 0.998951, 0.870914, 0.139927, 0.639395, 0.117051, 0.720786, 0.813126, 0.855166, 0.768946, 0.147064, 0.384144, 0.009521, 0.699698, 0.481161, 0.916135, 0.271518, 0.205374, 0.988514, 0.435936, 0.132588, 0.478401, 0.128268, 0.041746, 0.375681, 0.536060, 0.313988, 0.742733, 0.662320, 0.127124, 0.389323, 0.281173, 0.126074, 0.260237, 0.421100, 0.765469, 0.377288, 0.141885, 0.578596, 0.232455, 0.910832, 0.725659, 0.616599, 0.920353, 0.425357, 0.097760, 0.836488, 0.696876, 0.303133, 0.825002, 0.132811, 0.435721, 0.303403, 0.261079, 0.477466, 0.679083, 0.797139, 0.791454, 0.421817, 0.459459, 0.918578, 0.811140, 0.740632, 0.044653, 0.071377, 0.161732, 0.810122, 0.448665, 0.303618, 0.388718, 0.681120, 0.214450, 0.114377, 0.297719, 0.134803, 0.539735, 0.395478, 0.971291, 0.236610, 0.698611, 0.796293, 0.369421, 0.134332, 0.099696, 0.630500, 0.611798, 0.778779, 0.427640, 0.403253, 0.200596, 0.887099, 0.321831, 0.011736, 0.627731, 0.366484, 0.083113, 0.789464, 0.176606, 0.531778, 0.093081, 0.565323, 0.212898, 0.307531, 0.679701, 0.510617, 0.442334, 0.219435, 0.906095, 0.413625, 0.456045, 0.604706, 0.209919, 0.825466, 0.739038, 0.309614, 0.455967, 0.350836, 0.088394, 0.883607, 0.754089, 0.288990, 0.770706, 0.075920, 0.300725, 0.398437, 0.442404, 0.383838, 0.187901, 0.619010, 0.915616, 0.280982, 0.184334, 0.128514, 0.588513, 0.864034, 0.639130, 0.030847, 0.083469, 0.545225, 0.444473, 0.539514, 0.149931, 0.654391, 0.364981, 0.888969, 0.964006, 0.820948, 0.239806, 0.052399, 0.704554, 0.993895, 0.341389, 0.475260, 0.069815, 0.642114, 0.873697, 0.512219, 0.025952, 0.061597, 0.131229, 0.941568, 0.342579, 0.315563, 0.070082, 0.931093, 0.179597, 0.709212, 0.961940, 0.263066, 0.254437, 0.406413, 0.802581, 0.404368, 0.060804, 0.167561, 0.293338, 0.024810, 0.988509, 0.533143, 0.077209, 0.693063, 0.527038, 0.418598, 0.168323, 0.596853, 0.060712, 0.042020, 0.109073, 0.086664, 0.103617, 0.240302, 0.028233, 0.446197, 0.555865, 0.098315, 0.377289, 0.735462, 0.807527, 0.339229, 0.998528, 0.061964, 0.745642, 0.801109, 0.466333, 0.806446, 0.968670, 0.759670, 0.831256, 0.957179, 0.292814, 0.908465, 0.650242, 0.819852, 0.327063, 0.818565, 0.416705, 0.387775, 0.860585, 0.525778, 0.474440, 0.964203, 0.766080, 0.502672, 0.410399, 0.321945, 0.600987, 0.787689, 0.057407, 0.408514, 0.126918, 0.055936, 0.470478, 0.872560, 0.857044, 0.936811, 0.679006, 0.825714, 0.696482, 0.510262, 0.782893, 0.989295, 0.418728, 0.433136, 0.809147, 0.745791, 0.251701, 0.225853, 0.133566, 0.112287, 0.751631, 0.608006, 0.076489, 0.517711, 0.110679, 0.486889, 0.839656, 0.711666, 0.274578, 0.897063, 0.120180, 0.401496, 0.952999, 0.590658, 0.274056, 0.810043, 0.527469, 0.953062, 0.635758, 0.223951, 0.463325, 0.418651, 0.213246, 0.882052, 0.851787, 0.022393, 0.627843, 0.103488, 0.248246, 0.761409, 0.215774, 0.999877, 0.369416, 0.292264, 0.517587, 0.480094, 0.779153, 0.357243, 0.191760, 0.053730, 0.254307, 0.311939, 0.455226, 0.207305, 0.902597, 0.729282, 0.017348, 0.430066, 0.682344, 0.653106, 0.654017, 0.145668, 0.071757, 0.867263, 0.027721, 0.923544, 0.889656, 0.655564, 0.027032, 0.137902, 0.416973, 0.242806, 0.137778, 0.786389, 0.535070, 0.655366, 0.266483, 0.314223, 0.012609, 0.458243, 0.367953, 0.266916, 0.770182, 0.823179, 0.474221, 0.672779, 0.552460, 0.491569, 0.102845, 0.234804, 0.144675, 0.756862, 0.380473, 0.216432, 0.624124, 0.408194, 0.139976, 0.513780, 0.063757, 0.167008, 0.651682, 0.480731, 0.409814, 0.789461, 0.267120, 0.944884, 0.444827, 0.533603, 0.259106, 0.457436, 0.991845, 0.627059, 0.724351, 0.762027, 0.450238, 0.198572, 0.434806, 0.002698, 0.690141, 0.537651, 0.237503, 0.834817, 0.294513, 0.617976, 0.051249, 0.918637, 0.026169, 0.191226, 0.432417, 0.089927, 0.358234, 0.084100, 0.570657, 0.768047, 0.873560, 0.837777, 0.712931, 0.318387, 0.371379, 0.972038, 0.775823, 0.363225, 0.599097, 0.500174, 0.125252, 0.049335, 0.698746, 0.560058, 0.052033, 0.388887, 0.097709, 0.289536, 0.223704, 0.392221, 0.907512, 0.274954, 0.310858, 0.933681, 0.466179, 0.743275, 0.023608, 0.824413, 0.827375, 0.594265, 0.592460, 0.700935, 0.432042, 0.305392, 0.019322, 0.803421, 0.277429, 0.795145, 0.166646, 0.876526, 0.295319, 0.291897, 0.925861, 0.994065, 0.851955, 0.977895, 0.382952, 0.949663, 0.267431, 0.606657, 0.341884, 0.174943, 0.881610, 0.652742, 0.108624, 0.347790, 0.396018, 0.132231, 0.172202, 0.223393, 0.726496, 0.764663, 0.924328, 0.158538, 0.070054, 0.943650, 0.961959, 0.347483, 0.738795, 0.128604, 0.224010, 0.034114, 0.420502, 0.149871, 0.028179, 0.272457, 0.127766, 0.411132, 0.222120, 0.395197, 0.017788, 0.564005, 0.570139, 0.899399, 0.216747, 0.678763, 0.247188, 0.612765, 0.810995, 0.419391, 0.836157, 0.537491, 0.184053, 0.760485, 0.696029, 0.254107, 0.704135, 0.657987, 0.601591, 0.442931, 0.786592, 0.825600, 0.477045, 0.207093, 0.975471, 0.505224, 0.479550, 0.103237, 0.916356, 0.701670, 0.498434, 0.934144, 0.265675, 0.068573, 0.833543, 0.482421, 0.747336, 0.080731, 0.095186, 0.558331, 0.500122, 0.931343, 0.095822, 0.684175, 0.691828, 0.791850, 0.938282, 0.395964, 0.449837, 0.539873, 0.838894, 0.236429, 0.365474, 0.315939, 0.443523, 0.340945, 0.821163, 0.923073, 0.444182, 0.737519, 0.624743, 0.942616, 0.671663, 0.890417, 0.011189, 0.505206, 0.372839, 0.758526, 0.585937, 0.468025, 0.316856, 0.086058, 0.399368, 0.412678, 0.770234, 0.091196, 0.204528, 0.708516, 0.487160, 0.654366, 0.248389, 0.326054, 0.890795, 0.613863, 0.641993, 0.334317, 0.954808, 0.463156, 0.257390, 0.398990, 0.200675, 0.882132, 0.341606, 0.872337, 0.772549, 0.352795, 0.377543, 0.145388, 0.111321, 0.963479, 0.613413, 0.428177, 0.049538, 0.012781, 0.840856, 0.819771, 0.103977, 0.045384, 0.528287, 0.591137, 0.699749, 0.776677, 0.917191, 0.590544, 0.390539, 0.559184, 0.924861, 0.345347, 0.022340, 0.182251, 0.744338, 0.223014, 0.064384, 0.085944, 0.095352, 0.836933, 0.438739, 0.472894, 0.982321, 0.550060, 0.436374, 0.595734, 0.978237, 0.485912, 0.608514, 0.819093, 0.305683, 0.712491, 0.864477, 0.833971, 0.303628, 0.564226, 0.610647, 0.220819, 0.154770, 0.001187, 0.780003, 0.079632, 0.346534, 0.802343, 0.261883, 0.090872, 0.025357, 0.326267, 0.176815, 0.120709, 0.163200, 0.615554, 0.593603, 0.145521, 0.165614, 0.029977, 0.741255, 0.143852, 0.515888, 0.349769, 0.962945, 0.821571, 0.062261, 0.827421, 0.655542, 0.365889, 0.391647, 0.266189, 0.586708, 0.546417, 0.267376, 0.366711, 0.626049, 0.613910, 0.169054, 0.887932, 0.704782, 0.194411, 0.214199, 0.881597, 0.315120, 0.377398, 0.497151, 0.908723, 0.522919, 0.662765, 0.938700, 0.264174, 0.806617, 0.454588, 0.613943, 0.769562, 0.276160, 0.676204, 0.596983, 0.931702, 0.042092, 0.988631, 0.197891, 0.628800, 0.535048, 0.465267, 0.995512, 0.161097, 0.079177, 0.164566, 0.049029, 0.783958, 0.358977, 0.263227, 0.665555, 0.674097, 0.640626, 0.162706, 0.582820, 0.163545, 0.825472, 0.521520, 0.427719, 0.632089, 0.976108, 0.041662, 0.401651, 0.252268, 0.717865, 0.998634, 0.183970, 0.759958, 0.987265, 0.381861, 0.388758, 0.522313, 0.847128, 0.384270, 0.683410, 0.926305, 0.548835, 0.732439, 0.710263, 0.907812, 0.995666, 0.375818, 0.581909, 0.636292, 0.538525, 0.164729, 0.799837, 0.363996, 0.686248, 0.227555, 0.996085, 0.662356, 0.269217, 0.397736, 0.914624, 0.987083, 0.396371, 0.098594, 0.747041, 0.383635, 0.480455, 0.135799, 0.905948, 0.327583, 0.520069, 0.589358, 0.253888, 0.068904, 0.321796, 0.964151, 0.976716, 0.317462, 0.339969, 0.558625, 0.953754, 0.878494, 0.723354, 0.753591, 0.242490, 0.409602, 0.981146, 0.238576, 0.071959, 0.250363, 0.636312, 0.986583, 0.237446, 0.032682, 0.085177, 0.984486, 0.416318, 0.565633, 0.120285, 0.322266, 0.893216, 0.640354, 0.911623, 0.147104, 0.709258, 0.233420, 0.111255, 0.685975, 0.550882, 0.451224, 0.244600, 0.504636, 0.329718, 0.967954, 0.258227, 0.572208, 0.377557, 0.239373, 0.810783, 0.449515, 0.489736, 0.447095, 0.436099, 0.727182, 0.479778, 0.521276, 0.711668, 0.896095, 0.086909, 0.831953, 0.218361, 0.980125, 0.472307, 0.129984, 0.127228, 0.181566, 0.363404, 0.238483, 0.867541, 0.914286, 0.689707, 0.112141, 0.418922, 0.019424, 0.080095, 0.677149, 0.591632, 0.457652, 0.916522, 0.402415, 0.907167, 0.406257, 0.849510, 0.343266, 0.133439, 0.329288, 0.864542, 0.845107, 0.225383, 0.951450, 0.677060, 0.443744, 0.931575, 0.149367, 0.573728, 0.058803, 0.330933, 0.937132, 0.297286, 0.198474, 0.851418, 0.986993, 0.310615, 0.270341, 0.006417, 0.390710, 0.947489, 0.598049, 0.848362, 0.864011, 0.000464, 0.755529, 0.270268, 0.849975, 0.098795, 0.403707, 0.179263, 0.963337, 0.248814, 0.404646, 0.914787, 0.925874, 0.848390, 0.846363, 0.075241, 0.422118, 0.905166, 0.406174, 0.359250, 0.202452, 0.604648, 0.210669, 0.189444, 0.915263, 0.481009, 0.195861, 0.305974, 0.428499, 0.793910, 0.154336, 0.292509, 0.794374, 0.909866, 0.562778, 0.644349, 0.008661, 0.966485, 0.823611, 0.971998, 0.215299, 0.228257, 0.886785, 0.141173, 0.076647, 0.733148, 0.216414, 0.498765, 0.638314, 0.622588, 0.858015, 0.840765, 0.227237, 0.068684, 0.030210, 0.142500, 0.549693, 0.226071, 0.448474, 0.978191, 0.019981, 0.602810, 0.270701, 0.814355, 0.512676, 0.833479, 0.458704, 0.521337, 0.799963, 0.282315, 0.493334, 0.015262, 0.510572, 0.380120, 0.156435, 0.587219, 0.113268, 0.372849, 0.085984, 0.751581, 0.995437, 0.943999, 0.592346, 0.222673, 0.012682, 0.622556, 0.365173, 0.562375, 0.848627, 0.813647, 0.540566, 0.868608, 0.416457, 0.811267, 0.682963, 0.929133, 0.644746, 0.141667, 0.450470, 0.444709, 0.423982, 0.943804, 0.459972, 0.934554, 0.323924, 0.616407, 0.521773, 0.437191, 0.989255, 0.607757, 0.188772, 0.984692, 0.551755, 0.781119, 0.207365, 0.564438, 0.403675, 0.572539, 0.126813, 0.252302, 0.386186, 0.667379, 0.120910, 0.802643, 0.478647, 0.803873, 0.731776, 0.123393, 0.945540, 0.182246, 0.568102, 0.369523, 0.126050, 0.028074, 0.304077, 0.449973, 0.644480, 0.825851, 0.887165, 0.633736, 0.433607, 0.075937, 0.618428, 0.985363, 0.857056, 0.825793, 0.549801, 0.260731, 0.398332, 0.676614, 0.513033, 0.784518, 0.343993, 0.633943, 0.587161, 0.822640, 0.437816, 0.318937, 0.946032, 0.383356, 0.501183, 0.514134, 0.752879, 0.627232, 0.542208, 0.056956, 0.077206, 0.186689, 0.882807, 0.964370, 0.820424, 0.316414, 0.040307, 0.438852, 0.301777, 0.897363, 0.264645, 0.851578, 0.158094, 0.662977, 0.528191, 0.671126, 0.447495, 0.872184, 0.305069, 0.034656, 0.694824, 0.742885, 0.353593, 0.640856, 0.126242, 0.854776, 0.154990, 0.879121, 0.482008, 0.697199, 0.936077, 0.559214, 0.883887, 0.818884, 0.523584, 0.704312, 0.135298, 0.563891, 0.143163, 0.437075, 0.461254, 0.407809, 0.288653, 0.619347, 0.070786, 0.816845, 0.290474, 0.518281, 0.689029, 0.595543, 0.552937, 0.383853, 0.338428, 0.906530, 0.024709, 0.464670, 0.761305, 0.179699, 0.343791, 0.243313, 0.876898, 0.279868, 0.802527, 0.760785, 0.098752, 0.326110, 0.465097, 0.234050, 0.890001, 0.608260, 0.671126, 0.351255, 0.016069, 0.959779, 0.970602, 0.086854, 0.776623, 0.261076, 0.605135, 0.465652, 0.856619, 0.158072, 0.849505, 0.195047, 0.064601, 0.874213, 0.659717, 0.825906, 0.053913, 0.003508, 0.069219, 0.930810, 0.283376, 0.871746, 0.691595, 0.382127, 0.197857, 0.156692, 0.616177, 0.087858, 0.764952, 0.287303, 0.439113, 0.781021, 0.247082, 0.409715, 0.867875, 0.023705, 0.670791, 0.473010, 0.489358, 0.527410, 0.631082, 0.338862, 0.722458, 0.695683, 0.213076, 0.382175, 0.521589, 0.266988, 0.385683, 0.590809, 0.197799, 0.669058, 0.462555, 0.889394, 0.051185, 0.660412, 0.046086, 0.667363, 0.748269, 0.811038, 0.954666, 0.187382, 0.592059, 0.201748, 0.597097, 0.459935, 0.225453, 0.267888, 0.932945, 0.714811, 0.795298, 0.564027, 0.053674, 0.517756, 0.259710, 0.266750, 0.899930, 0.781300, 0.533738, 0.285613, 0.372108, 0.731537, 0.954671, 0.834663, 0.620931, 0.005857, 0.495075, 0.667017, 0.673220, 0.243344, 0.478056, 0.627886, 0.430726, 0.070115, 0.829634, 0.027823, 0.530049, 0.055087, 0.295710, 0.462995, 0.769898, 0.091009, 0.027022, 0.823572, 0.608764, 0.286732, 0.090321, 0.508695, 0.068031, 0.624059, 0.794308, 0.440140, 0.355596, 0.748979, 0.274803, 0.976527, 0.754836, 0.769878, 0.643544, 0.428055, 0.013222, 0.121600, 0.055941, 0.443948, 0.191715, 0.885574, 0.471771, 0.721764, 0.940661, 0.767481, 0.184759, 0.710559, 0.858490, 0.211780, 0.534131, 0.467254, 0.498512, 0.624453, 0.975948, 0.566543, 0.248512, 0.770256, 0.006683, 0.604109, 0.519235, 0.281486, 0.580636, 0.274071, 0.051363, 0.224180, 0.702126, 0.064585, 0.345780, 0.758066, 0.508533, 0.537494, 0.643640, 0.980304, 0.259258, 0.584302, 0.747785, 0.444017, 0.294861, 0.606274, 0.655797, 0.828992, 0.073528, 0.154309, 0.453445, 0.049477, 0.720852, 0.701958, 0.819733, 0.727535, 0.306066, 0.338968, 0.009020, 0.886702, 0.613039, 0.060383, 0.110881, 0.315164, 0.124969, 0.456661, 0.073231, 0.633502, 0.994155, 0.716871, 0.613806, 0.253413, 0.301173, 0.361590, 0.697430, 0.596034, 0.967865, 0.353227, 0.425026, 0.041393, 0.507536, 0.878472, 0.090870, 0.228388, 0.580429, 0.910603, 0.955923, 0.886495, 0.249571, 0.964943, 0.773197, 0.862609, 0.025326, 0.884078, 0.177774, 0.150295, 0.340740, 0.251004, 0.783797, 0.334895, 0.967875, 0.397603, 0.588308, 0.269048, 0.759193, 0.285738, 0.865082, 0.727058, 0.638966, 0.290108, 0.768451, 0.146502, 0.168580, 0.859321, 0.374890, 0.749009, 0.769923, 0.330813, 0.635504, 0.019494, 0.295756, 0.408701, 0.882103, 0.321082, 0.292780, 0.059877, 0.471377, 0.633519, 0.310881, 0.255174, 0.968414, 0.278756, 0.652777, 0.556722, 0.547804, 0.411970, 0.842460, 0.412886, 0.139028, 0.481426, 0.702994, 0.907479, 0.627928, 0.871574, 0.766799, 0.002819, 0.620583, 0.536723, 0.333632, 0.256087, 0.556216, 0.629388, 0.664788, 0.438320, 0.950471, 0.957568, 0.498196, 0.421848, 0.591087, 0.809077, 0.677022, 0.559500, 0.087833, 0.329799, 0.116222, 0.635638, 0.741768, 0.958683, 0.048524, 0.880796, 0.440109, 0.751519, 0.788275, 0.068037, 0.623093, 0.555074, 0.070856, 0.243676, 0.091797, 0.404488, 0.499763, 0.648013, 0.033876, 0.164551, 0.086333, 0.984347, 0.122118, 0.584529, 0.406195, 0.713205, 0.393606, 0.083217, 0.272705, 0.481440, 0.413015, 0.388927, 0.117077, 0.154784, 0.347610, 0.165601, 0.035580, 0.787718, 0.917120, 0.823855, 0.855756, 0.540213, 0.378929, 0.926612, 0.783888, 0.470725, 0.331100, 0.283651, 0.118739, 0.364976, 0.448202, 0.205071, 0.349322, 0.570320, 0.789601, 0.755517, 0.283525, 0.183207, 0.838734, 0.556230, 0.664646, 0.251749, 0.945157, 0.781723, 0.406532, 0.292767, 0.947325, 0.442112, 0.080485, 0.864445, 0.265967, 0.936241, 0.404658, 0.644895, 0.862852, 0.188546, 0.115621, 0.193952, 0.472197, 0.234360, 0.558928, 0.920399, 0.439431, 0.908250, 0.490719, 0.229032, 0.663767, 0.774244, 0.412238, 0.502501, 0.330474, 0.076884, 0.754249, 0.275631, 0.858608, 0.160782, 0.568397, 0.805933, 0.602894, 0.648883, 0.670378, 0.868861, 0.585123, 0.075036, 0.513756, 0.447976, 0.263582, 0.629377, 0.641927, 0.735779, 0.863737, 0.200855, 0.656178, 0.303168, 0.109105, 0.146898, 0.532200, 0.772872, 0.921142, 0.944438, 0.275373, 0.251615, 0.021322, 0.029622, 0.527246, 0.879930, 0.190404, 0.095643, 0.685863, 0.793299, 0.744526, 0.356241, 0.662160, 0.329649, 0.431276, 0.175916, 0.777625, 0.694858, 0.805293, 0.419552, 0.430638, 0.669030, 0.620407, 0.086816, 0.972198, 0.729513, 0.233714, 0.504398, 0.502385, 0.154855, 0.448836, 0.777758, 0.406470, 0.470158, 0.807380, 0.933716, 0.350088, 0.997784, 0.029360, 0.035951, 0.791083, 0.773886, 0.392192, 0.453243, 0.103535, 0.823468, 0.629159, 0.881160, 0.518327, 0.434452, 0.300712, 0.948964, 0.103482, 0.921119, 0.035781, 0.075680, 0.650632, 0.269494, 0.580078, 0.153017, 0.424350, 0.028914, 0.930775, 0.830820, 0.499072, 0.738155, 0.764536, 0.849160, 0.735939, 0.793896, 0.885111, 0.527022, 0.567782, 0.277303, 0.980265, 0.671316, 0.100771, 0.609423, 0.552476, 0.619098, 0.043875, 0.853188, 0.568062, 0.147357, 0.774307, 0.603843, 0.223038, 0.424939, 0.873337, 0.803116, 0.577956, 0.297687, 0.832030, 0.508731, 0.128507, 0.331102, 0.246885, 0.893044, 0.180262, 0.982825, 0.686940, 0.065374, 0.509847, 0.254721, 0.342677, 0.490112, 0.926038, 0.443448, 0.099535, 0.478513, 0.062546, 0.143410, 0.331701, 0.630608, 0.290767, 0.106008, 0.234451, 0.513805, 0.530948, 0.107789, 0.316921, 0.108903, 0.405476, 0.148951, 0.617634, 0.533983, 0.480053, 0.864519, 0.427026, 0.660316, 0.847344, 0.113966, 0.725689, 0.357191, 0.368687, 0.068366, 0.847302, 0.294725, 0.511814, 0.946837, 0.773238, 0.574359, 0.090247, 0.104940, 0.204968, 0.381014, 0.210948, 0.439419, 0.894819, 0.741896, 0.547208, 0.211740, 0.850799, 0.952683, 0.360691, 0.468433, 0.486666, 0.840744, 0.332952, 0.913692, 0.501060, 0.180296, 0.027658, 0.226749, 0.537487, 0.396346, 0.295115, 0.384789, 0.691070, 0.806928, 0.331626, 0.464309, 0.381287, 0.421873, 0.569248, 0.586255, 0.802887, 0.780196, 0.025674, 0.697706, 0.522092, 0.572882, 0.909446, 0.372891, 0.525566, 0.270137, 0.841324, 0.012232, 0.110881, 0.174276, 0.925924, 0.611941, 0.354573, 0.953582, 0.838690, 0.892059, 0.349928, 0.133805, 0.276848, 0.040998, 0.940733, 0.608474, 0.505307, 0.322020, 0.030346, 0.074556, 0.908275, 0.833233, 0.854752, 0.933950, 0.530939, 0.376844, 0.506832, 0.440385, 0.749735, 0.032398, 0.710522, 0.591059, 0.044629, 0.821403, 0.765336, 0.970554, 0.433345, 0.119908, 0.924136, 0.272035, 0.011968, 0.274064, 0.405840, 0.288815, 0.315063, 0.346572, 0.897289, 0.820370, 0.668593, 0.927635, 0.894925, 0.576868, 0.760868, 0.749677, 0.510818, 0.291807, 0.126521, 0.017650, 0.732192, 0.876256, 0.050048, 0.442714, 0.467315, 0.094677, 0.264117, 0.232651, 0.065231, 0.697462, 0.352560, 0.989367, 0.969497, 0.364527, 0.263431, 0.375337, 0.653342, 0.578493, 0.721909, 0.550631, 0.398863, 0.390502, 0.478267, 0.293788, 0.967370, 0.239135, 0.043465, 0.478188, 0.530942, 0.169986, 0.495838, 0.263134, 0.046243, 0.545885, 0.705848, 0.513558, 0.640563, 0.969965, 0.746209, 0.705793, 0.667428, 0.098769, 0.695160, 0.636925, 0.463296, 0.958590, 0.012262, 0.116638, 0.537083, 0.734171, 0.667270, 0.935946, 0.124673, 0.145536, 0.229734, 0.092043, 0.384671, 0.273200, 0.570231, 0.915613, 0.443186, 0.066068, 0.178747, 0.489429, 0.611954, 0.884595, 0.002987, 0.252516, 0.854560, 0.749196, 0.958310, 0.521987, 0.847965, 0.653469, 0.158912, 0.311261, 0.612059, 0.171174, 0.427899, 0.149143, 0.905345, 0.095169, 0.085089, 0.030018, 0.240705, 0.314824, 0.122060, 0.625377, 0.588023, 0.692291, 0.540990, 0.031209, 0.758360, 0.719736, 0.520638, 0.370313, 0.604331, 0.523624, 0.622830, 0.458891, 0.272820, 0.581140, 0.980878, 0.120785, 0.234609, 0.139790, 0.432046, 0.846668, 0.310964, 0.859945, 0.995811, 0.216309, 0.955114, 0.080900, 0.246326, 0.195819, 0.395724, 0.368387, 0.821196, 0.983747, 0.060678, 0.362186, 0.014956, 0.819037, 0.081922, 0.535594, 0.189351, 0.686253, 0.059218, 0.812181, 0.145144, 0.332039, 0.393320, 0.126022, 0.452824, 0.627929, 0.265812, 0.884870, 0.474597, 0.576776, 0.744815, 0.470408, 0.793085, 0.699929, 0.551308, 0.039411, 0.895748, 0.947032, 0.407798, 0.716944, 0.930778, 0.468475, 0.079130, 0.945734, 0.287513, 0.161052, 0.481328, 0.476863, 0.847305, 0.540546, 0.289044, 0.992449, 0.872585, 0.682364, 0.118471, 0.325408, 0.310293, 0.384283, 0.210278, 0.784889, 0.961059, 0.955093, 0.255297, 0.754144, 0.655021, 0.806605, 0.793556, 0.550769, 0.753637, 0.201353, 0.267713, 0.684415, 0.669829, 0.346843, 0.630150, 0.957341, 0.507894, 0.111478, 0.434204, 0.355199, 0.652024, 0.723248, 0.347647, 0.524609, 0.405612, 0.466118, 0.850017, 0.715904, 0.850401, 0.060295, 0.500794, 0.811461, 0.015388, 0.756091, 0.565605, 0.670409, 0.562696, 0.359161, 0.221178, 0.316333, 0.560514, 0.488891, 0.000748, 0.230343, 0.835734, 0.630898, 0.187684, 0.343628, 0.742376, 0.621888, 0.698827, 0.394400, 0.345137, 0.046474, 0.919008, 0.750748, 0.512592, 0.769025, 0.466653, 0.362994, 0.829321, 0.967447, 0.174454, 0.844709, 0.723538, 0.740059, 0.515118, 0.286234, 0.099220, 0.736296, 0.602567, 0.659734, 0.225187, 0.603316, 0.890076, 0.060921, 0.234214, 0.077761, 0.404549, 0.976590, 0.699649, 0.103376, 0.370989, 0.044785, 0.149850, 0.289997, 0.795534, 0.662443, 0.059023, 0.262187, 0.025436, 0.888343, 0.229633, 0.199891, 0.733052, 0.953171, 0.939950, 0.248170, 0.239405, 0.039170, 0.984466, 0.841972, 0.698903, 0.209653, 0.445288, 0.588980, 0.270575, 0.679502, 0.666740, 0.675124, 0.656091, 0.366389, 0.778500, 0.027081, 0.411175, 0.928350, 0.317078, 0.206709, 0.590793, 0.376101, 0.468895, 0.616229, 0.264444, 0.698528, 0.816119, 0.997496, 0.651699, 0.756069, 0.245666, 0.891104, 0.795239, 0.230132, 0.733076, 0.494142, 0.439786, 0.178364, 0.083122, 0.710360, 0.857866, 0.749863, 0.385484, 0.513957, 0.116252, 0.163984, 0.541038, 0.527427, 0.092334, 0.858116, 0.734136, 0.683126, 0.234217, 0.203031, 0.299355, 0.498661, 0.901559, 0.115474, 0.496157, 0.553258, 0.871544, 0.741823, 0.444362, 0.666783, 0.971956, 0.177438, 0.160925, 0.411741, 0.355802, 0.244047, 0.122101, 0.213668, 0.993910, 0.507585, 0.727626, 0.110162, 0.671569, 0.268664, 0.637589, 0.763903, 0.126780, 0.371725, 0.447029, 0.360996, 0.574755, 0.746384, 0.859657, 0.476314, 0.861858, 0.355814, 0.029572, 0.733402, 0.097637, 0.473934, 0.400185, 0.069593, 0.651372, 0.561110, 0.481334, 0.007175, 0.805157, 0.603435, 0.220843, 0.799067, 0.111021, 0.948469, 0.909229, 0.782590, 0.217133, 0.546818, 0.546493, 0.343913, 0.918543, 0.993522, 0.704909, 0.493299, 0.739905, 0.564566, 0.969613, 0.601764, 0.920380, 0.999185, 0.335166, 0.018017, 0.473119, 0.735351, 0.087610, 0.124492, 0.296460, 0.568944, 0.131666, 0.101617, 0.172380, 0.352509, 0.900685, 0.283401, 0.300978, 0.809914, 0.065991, 0.518111, 0.356732, 0.612483, 0.862024, 0.275276, 0.606005, 0.566933, 0.768574, 0.345910, 0.131499, 0.738187, 0.947674, 0.051879, 0.737372, 0.282840, 0.069896, 0.210491, 0.018191, 0.157507, 0.334983, 0.314651, 0.726451, 0.466649, 0.416269, 0.898831, 0.819159, 0.316953, 0.182232, 0.120137, 0.126867, 0.248222, 0.638248, 0.483600, 0.860706, 0.500272, 0.758875, 0.466711, 0.067205, 0.527449, 0.812621, 0.198704, 0.265636, 0.760296, 0.250583, 0.003008, 0.043136, 0.320479, 0.213500, 0.061327, 0.477986, 0.548483, 0.375978, 0.204437, 0.015132, 0.792247, 0.103268, 0.834291, 0.109200, 0.285500, 0.954428, 0.236067, 0.533722, 0.592677, 0.719667, 0.394428, 0.092949, 0.478543, 0.861139, 0.160154, 0.005992, 0.673760, 0.358858, 0.271628, 0.434056, 0.609441, 0.274637, 0.477192, 0.929920, 0.488137, 0.538519, 0.407906, 0.036620, 0.914497, 0.612343, 0.051752, 0.706743, 0.715611, 0.886043, 0.815944, 0.001111, 0.840471, 0.052011, 0.534833, 0.433147, 0.771678, 0.929261, 0.526096, 0.250221, 0.790400, 0.686250, 0.256213, 0.464161, 0.045108, 0.527841, 0.898216, 0.654549, 0.802478, 0.375408, 0.584469, 0.290615, 0.913927, 0.992375, 0.327234, 0.828423, 0.604718, 0.378986, 0.535167, 0.320329, 0.265029, 0.351110, 0.321440, 0.105500, 0.403121, 0.856274, 0.538647, 0.174800, 0.785535, 0.064743, 0.425020, 0.575935, 0.750994, 0.681233, 0.040096, 0.796102, 0.209074, 0.938312, 0.450650, 0.011552, 0.313720, 0.035119, 0.302167, 0.227647, 0.027494, 0.629402, 0.056071, 0.632213, 0.008388, 0.591237, 0.952542, 0.273417, 0.942348, 0.273983, 0.378916, 0.345469, 0.130256, 0.917563, 0.520269, 0.915791, 0.982307, 0.945289, 0.491726, 0.733300, 0.626522, 0.531822, 0.529402, 0.835597, 0.470134, 0.980052, 0.847149, 0.783855, 0.015172, 0.149316, 0.011502, 0.042666, 0.778718, 0.067573, 0.674879, 0.787106, 0.658810, 0.627421, 0.060522, 0.601158, 0.901404, 0.439439, 0.946627, 0.031660, 0.357002, 0.466896, 0.947451, 0.339309, 0.412185, 0.439178, 0.072609, 0.038707, 0.971000, 0.602011, 0.874304, 0.441134, 0.582063, 0.721453, 0.224989, 0.597235, 0.870769, 0.236491, 0.639901, 0.649487, 0.304063, 0.314780, 0.436593, 0.962873, 0.942202, 0.497115, 0.564031, 0.843605, 0.936554, 0.510658, 0.875266, 0.293556, 0.977554, 0.822717, 0.632864, 0.389739, 0.261895, 0.705474, 0.428446, 0.232894, 0.307485, 0.302750, 0.674029, 0.889548, 0.024203, 0.899017, 0.486783, 0.894972, 0.135508, 0.126685, 0.544459, 0.439571, 0.441465, 0.981052, 0.402445, 0.383666, 0.478168, 0.966476, 0.227272, 0.414722, 0.477134, 0.102537, 0.708277, 0.454688, 0.925254, 0.341142, 0.844427, 0.187149, 0.046615, 0.272873, 0.420043, 0.354100, 0.575623, 0.094072, 0.243648, 0.599826, 0.993089, 0.730431, 0.494798, 0.128598, 0.857116, 0.039258, 0.568169, 0.298580, 0.020310, 0.970614, 0.682247, 0.498478, 0.937089, 0.909519, 0.913199, 0.414224, 0.012056, 0.621477, 0.868912, 0.937310, 0.962618, 0.713339, 0.124459, 0.009234, 0.986212, 0.544503, 0.363334, 0.561835, 0.638575, 0.606982, 0.161661, 0.631664, 0.337413, 0.656459, 0.760261, 0.194528, 0.695717, 0.328430, 0.493109, 0.716027, 0.299044, 0.175356, 0.214505, 0.236133, 0.084874, 0.127705, 0.650357, 0.096931, 0.749181, 0.519269, 0.034241, 0.711800, 0.232607, 0.158700, 0.721034, 0.218819, 0.703203, 0.084367, 0.780655, 0.341777, 0.691349, 0.942316, 0.973441, 0.028762, 0.598775, 0.733702, 0.223290, 0.294492, 0.062133, 0.716399, 0.010520, 0.361177, 0.891754, 0.225025, 0.597310, 0.976629, 0.352730, 0.247667, 0.073559, 0.101911, 0.766936, 0.107800, 0.813711, 0.999543, 0.266500, 0.534744, 0.218363, 0.969703, 0.619112, 0.999017, 0.311480, 0.310461, 0.941333, 0.284921, 0.339222, 0.540109, 0.018624, 0.562513, 0.834601, 0.080756, 0.278911, 0.845121, 0.441933, 0.170666, 0.070146, 0.039243, 0.147295, 0.422875, 0.286910, 0.220854, 0.524786, 0.053846, 0.328654, 0.338497, 0.053389, 0.595155, 0.873241, 0.271752, 0.564858, 0.492352, 0.270769, 0.876338, 0.802813, 0.212102, 0.161259, 0.142036, 0.752211, 0.179882, 0.704548, 0.586812, 0.260639, 0.983460, 0.431933, 0.702572, 0.154125, 0.502078, 0.741815, 0.301420, 0.924953, 0.028725, 0.522274, 0.449739, 0.082571, 0.850929, 0.788236, 0.135960, 0.446083, 0.661477, 0.407712, 0.010941, 0.153829, 0.678481, 0.887279, 0.956642, 0.890583, 0.048538, 0.098678, 0.642794, 0.228420, 0.803226, 0.229606, 0.489059, 0.786685, 0.661539, 0.191631, 0.940811, 0.163617, 0.933446, 0.242231, 0.088571, 0.962171, 0.764505, 0.538310, 0.044742, 0.615433, 0.326546, 0.180702, 0.061517, 0.988022, 0.588413, 0.072458, 0.141851, 0.266894, 0.959737, 0.098494, 0.157478, 0.008274, 0.197171, 0.800272, 0.236694, 0.000397, 0.029879, 0.725753, 0.787083, 0.691418, 0.917384, 0.727894, 0.855035, 0.850830, 0.970124, 0.943606, 0.813001, 0.734629, 0.481916, 0.857742, 0.350063, 0.808462, 0.038444, 0.411580, 0.796484, 0.626857, 0.484037, 0.938336, 0.893751, 0.443774, 0.036829, 0.051229, 0.452048, 0.234000, 0.851501, 0.688742, 0.234398, 0.881380, 0.414496, 0.021480, 0.572798, 0.331880, 0.749374, 0.427833, 0.182710, 0.719498, 0.371438, 0.995710, 0.454128, 0.853354, 0.853452, 0.804191, 0.661816, 0.891896, 0.215770, 0.458300, 0.518753, 0.699808, 0.396635, 0.412505, 0.143582, 0.433465, 0.463734, 0.595630, 0.667465, 0.315235, 0.284372, 0.901863, 0.196615, 0.698868, 0.923343, 0.769413, 0.030748, 0.672717, 0.197246, 0.213457, 0.392216, 0.568684, 0.209168, 0.846343, 0.422038, 0.062620, 0.650534, 0.083854, 0.954516, 0.866304, 0.542154, 0.473269, 0.566112, 0.938789, 0.885774, 0.709694, 0.372254, 0.349508, 0.305323, 0.039719, 0.664743, 0.589695, 0.941582, 0.861358, 0.288563, 0.864925, 0.630771, 0.319311, 0.537642, 0.828017, 0.532768, 0.929857, 0.396701, 0.741936, 0.776201, 0.818739, 0.804556, 0.426735, 0.902593, 0.759072, 0.293039, 0.444747, 0.232341, 0.859151, 0.383536, 0.118115, 0.568845, 0.755790, 0.467623, 0.874168, 0.795509, 0.132366, 0.463863, 0.737091, 0.993724, 0.752426, 0.602015, 0.624496, 0.071737, 0.139657, 0.452512, 0.604505, 0.069515, 0.849213, 0.346441, 0.845716, 0.667952, 0.150997, 0.272451, 0.570546, 0.910069, 0.565490, 0.015293, 0.142410, 0.424641, 0.398829, 0.260526, 0.993486, 0.154620, 0.728149, 0.867654, 0.950129, 0.860515, 0.331517, 0.687219, 0.854239, 0.083943, 0.289235, 0.478735, 0.155680, 0.428892, 0.931247, 0.760185, 0.498407, 0.780461, 0.106625, 0.344122, 0.448413, 0.257622, 0.616573, 0.018959, 0.167690, 0.182063, 0.034252, 0.310101, 0.606704, 0.433081, 0.570626, 0.600190, 0.587700, 0.298775, 0.467844, 0.537829, 0.159290, 0.799362, 0.225049, 0.013529, 0.883305, 0.514283, 0.492263, 0.038985, 0.943175, 0.423511, 0.799169, 0.441582, 0.203971, 0.905794, 0.785704, 0.652384, 0.163416, 0.402276, 0.671343, 0.331106, 0.584339, 0.705594, 0.641207, 0.191043, 0.138675, 0.211833, 0.791233, 0.726376, 0.510608, 0.259077, 0.264205, 0.669897, 0.058439, 0.489253, 0.683426, 0.941744, 0.003537, 0.175689, 0.980728, 0.946712, 0.599200, 0.779898, 0.388294, 0.803171, 0.685692, 0.173997, 0.455555, 0.849108, 0.576274, 0.126898, 0.180215, 0.160613, 0.832492, 0.821422, 0.351656, 0.971168, 0.033255, 0.142889, 0.697543, 0.543863, 0.401966, 0.961748, 0.213760, 0.460405, 0.451002, 0.897186, 0.402148, 0.454538, 0.072875, 0.382877, 0.401250, 0.672075, 0.162774, 0.789544, 0.475246, 0.848467, 0.963541, 0.930801, 0.697575, 0.539815, 0.057699, 0.877790, 0.700428, 0.890192, 0.699212, 0.052083, 0.861359, 0.732467, 0.194972, 0.558902, 0.276329, 0.596938, 0.520651, 0.490089, 0.057343, 0.971652, 0.387275, 0.459491, 0.426190, 0.460150, 0.842368, 0.827441, 0.132226, 0.005142, 0.616984, 0.607472, 0.853609, 0.580525, 0.538273, 0.551184, 0.120340, 0.595973, 0.428973, 0.820768, 0.486165, 0.128185, 0.872851, 0.347524, 0.860652, 0.067823, 0.906426, 0.136981, 0.664761, 0.427077, 0.627070, 0.722104, 0.398729, 0.014346, 0.181595, 0.824919, 0.474496, 0.023963, 0.652360, 0.606722, 0.029105, 0.269344, 0.214194, 0.882713, 0.849869, 0.752467, 0.433897, 0.970210, 0.348440, 0.862870, 0.790977, 0.834605, 0.991055, 0.663829, 0.182128, 0.851707, 0.731652, 0.088555, 0.988688, 0.396413, 0.515631, 0.615758, 0.118517, 0.914360, 0.630104, 0.300112, 0.739279, 0.104600, 0.324075, 0.391639, 0.711322, 0.353179, 0.660983, 0.925516, 0.235892, 0.510853, 0.677983, 0.669789, 0.481062, 0.026423, 0.532659, 0.272040, 0.861027, 0.523715, 0.935868, 0.043156, 0.375422, 0.667520, 0.131710, 0.364110, 0.063933, 0.647341, 0.979868, 0.182451, 0.561701, 0.609972, 0.482563, 0.300981, 0.714572, 0.806637, 0.692620, 0.425894, 0.159817, 0.353603, 0.351410, 0.395709, 0.864456, 0.029393, 0.065498, 0.345518, 0.055815, 0.598158, 0.617558, 0.916843, 0.121872, 0.553426, 0.959998, 0.497294, 0.220946, 0.091708, 0.861404, 0.284879, 0.739050, 0.841273, 0.467330, 0.300751, 0.451245, 0.949893, 0.601732, 0.165818, 0.756530, 0.294352, 0.591712, 0.916347, 0.647955, 0.943122, 0.312056, 0.512410, 0.972514, 0.377554, 0.857928, 0.028330, 0.975712, 0.475486, 0.945172, 0.097584, 0.028912, 0.905171, 0.594879, 0.249858, 0.996879, 0.456283, 0.534737, 0.735928, 0.297556, 0.002067, 0.036680, 0.748801, 0.951960, 0.638411, 0.914619, 0.708490, 0.932763, 0.506331, 0.624837, 0.580718, 0.449453, 0.936893, 0.093128, 0.421967, 0.314447, 0.951056, 0.450297, 0.290159, 0.426542, 0.395469, 0.387744, 0.455454, 0.300640, 0.982623, 0.705311, 0.297519, 0.438906, 0.240048, 0.033447, 0.736462, 0.242115, 0.070127, 0.485263, 0.194075, 0.708538, 0.399881, 0.902565, 0.641301, 0.906212, 0.527402, 0.222019, 0.355665, 0.464296, 0.315147, 0.777632, 0.778743, 0.266203, 0.227929, 0.068902, 0.692745, 0.623398, 0.456646, 0.148199, 0.924038, 0.439269, 0.853510, 0.221557, 0.878175, 0.093558, 0.255004, 0.614636, 0.335674, 0.325131, 0.099899, 0.529749, 0.033669, 0.499780, 0.432314, 0.674970, 0.405993, 0.959717, 0.896989, 0.761657, 0.424012, 0.212136, 0.539289, 0.202755, 0.478340, 0.767218, 0.271658, 0.171085, 0.390616, 0.728304, 0.319284, 0.314654, 0.167573, 0.172795, 0.536211, 0.045748, 0.266353, 0.791214, 0.660384, 0.602027, 0.116345, 0.760283, 0.131775, 0.150014, 0.260064, 0.564089, 0.824984, 0.666056, 0.523806, 0.721974, 0.427713, 0.947818, 0.934110, 0.967003, 0.150573, 0.412450, 0.734220, 0.422231, 0.583535, 0.124836, 0.150535, 0.902819, 0.439490, 0.318108, 0.075614, 0.975701, 0.363855, 0.341967, 0.766915, 0.024239, 0.943993, 0.883260, 0.784523, 0.075769, 0.033274, 0.044586, 0.639858, 0.858259, 0.710642, 0.163664, 0.580232, 0.138356, 0.111482, 0.514342, 0.105358, 0.262055, 0.926792, 0.839579, 0.684286, 0.510327, 0.964415, 0.834821, 0.413146, 0.403905, 0.152928, 0.488760, 0.379606, 0.516784, 0.830726, 0.146521, 0.541023, 0.774720, 0.029781, 0.325546, 0.850488, 0.063056, 0.370132, 0.490346, 0.921314, 0.080774, 0.654010, 0.501547, 0.219130, 0.765492, 0.015889, 0.324488, 0.027547, 0.942681, 0.164067, 0.711834, 0.453007, 0.128481, 0.546654, 0.866153, 0.532386, 0.699583, 0.354913, 0.911992, 0.216367, 0.185640, 0.058513, 0.757390, 0.960359, 0.088294, 0.082935, 0.810847, 0.151350, 0.453067, 0.301194, 0.072664, 0.533841, 0.955204, 0.574211, 0.752971, 0.720696, 0.590099, 0.077459, 0.748244, 0.532780, 0.241525, 0.460077, 0.985787, 0.370007, 0.006731, 0.851940, 0.902393, 0.706314, 0.206853, 0.814386, 0.922681, 0.392493, 0.872898, 0.680071, 0.352852, 0.961193, 0.763006, 0.163700, 0.112542, 0.216073, 0.464893, 0.185206, 0.749915, 0.420097, 0.759417, 0.502886, 0.140793, 0.349516, 0.580345, 0.889037, 0.882296, 0.821870, 0.349114, 0.868083, 0.191877, 0.355845, 0.720023, 0.094270, 0.062160, 0.926876, 0.908656, 0.984840, 0.319369, 0.781554, 0.664911, 0.672221, 0.742747, 0.427917, 0.835921, 0.855289, 0.643991, 0.300814, 0.040495, 0.393905, 0.720911, 0.799912, 0.896791, 0.861705, 0.149428, 0.477136, 0.750741, 0.031724, 0.299006, 0.099855, 0.899807, 0.490882, 0.455700, 0.619830, 0.585153, 0.517860, 0.546706, 0.493809, 0.502700, 0.866075, 0.275363, 0.167612, 0.538297, 0.018110, 0.595529, 0.374218, 0.873399, 0.239520, 0.675032, 0.913894, 0.633425, 0.395943, 0.713806, 0.530216, 0.257648, 0.863234, 0.007352, 0.008389, 0.894958, 0.306358, 0.108245, 0.794765, 0.797240, 0.563945, 0.414594, 0.382393, 0.081805, 0.961301, 0.876201, 0.584505, 0.827376, 0.151564, 0.752117, 0.365673, 0.169674, 0.347646, 0.739890, 0.043073, 0.587166, 0.414922, 0.956967, 0.220591, 0.810866, 0.670773, 0.750808, 0.068514, 0.534007, 0.758159, 0.076903, 0.428965, 0.064517, 0.185148, 0.223730, 0.861757, 0.749093, 0.638325, 0.244150, 0.830898, 0.599625, 0.120351, 0.415403, 0.427001, 0.271915, 0.167520, 0.792674, 0.441589, 0.515167, 0.532564, 0.484662, 0.102332, 0.947487, 0.441628, 0.322924, 0.758353, 0.112401, 0.073731, 0.826866, 0.646408, 0.831891, 0.903770, 0.075373, 0.896408, 0.088918, 0.299104, 0.758165, 0.838011, 0.937428, 0.002315, 0.668909, 0.537053, 0.122666, 0.084312, 0.964054, 0.394581, 0.251833, 0.756728, 0.836170, 0.766999, 0.289292, 0.320831, 0.869332, 0.236779, 0.762460, 0.192256, 0.995132, 0.874861, 0.265987, 0.821998, 0.521269, 0.097878, 0.725768, 0.596642, 0.994285, 0.814686, 0.895746, 0.752450, 0.652697, 0.833174, 0.754765, 0.321606, 0.370227, 0.877430, 0.405918, 0.334281, 0.272011, 0.657751, 0.091009, 0.108181, 0.424750, 0.380302, 0.429013, 0.294082, 0.617081, 0.191472, 0.486338, 0.612212, 0.066333, 0.752325, 0.434210, 0.587601, 0.850202, 0.159978, 0.184244, 0.844487, 0.974664, 0.079989, 0.596938, 0.627361, 0.913163, 0.351702, 0.948966, 0.283390, 0.229133, 0.354884, 0.617671, 0.501144, 0.012635, 0.708680, 0.609325, 0.437385, 0.088982, 0.038337, 0.731468, 0.706062, 0.229810, 0.217805, 0.318274, 0.296142, 0.970130, 0.752485, 0.883744, 0.820332, 0.912463, 0.067987, 0.664820, 0.887127, 0.147976, 0.261757, 0.514487, 0.061139, 0.613459, 0.463453, 0.344529, 0.842592, 0.818338, 0.962200, 0.343736, 0.830973, 0.670880, 0.953061, 0.268358, 0.759862, 0.991398, 0.999826, 0.465925, 0.221208, 0.217631, 0.784199, 0.517350, 0.187761, 0.536684, 0.401094, 0.008093, 0.449146, 0.469081, 0.672913, 0.336273, 0.617057, 0.934670, 0.850760, 0.678196, 0.548130, 0.314213, 0.022726, 0.390722, 0.132551, 0.984926, 0.734457, 0.963524, 0.655806, 0.687518, 0.231882, 0.415668, 0.678917, 0.231707, 0.881593, 0.900125, 0.449338, 0.665792, 0.417475, 0.637100, 0.202476, 0.818568, 0.645193, 0.651622, 0.287649, 0.318106, 0.987895, 0.904706, 0.252776, 0.838655, 0.582902, 0.800905, 0.152868, 0.605628, 0.191627, 0.285419, 0.590554, 0.926084, 0.248943, 0.246360, 0.613603, 0.480824, 0.662028, 0.292519, 0.712532, 0.543621, 0.192644, 0.161870, 0.209414, 0.610118, 0.798970, 0.411889, 0.428686, 0.444163, 0.063512, 0.716335, 0.762269, 0.051407, 0.621041, 0.015045, 0.890061, 0.203944, 0.815950, 0.042930, 0.809571, 0.007577, 0.328349, 0.400125, 0.933661, 0.577292, 0.646485, 0.547264, 0.058116, 0.308513, 0.839783, 0.770648, 0.852134, 0.032427, 0.932518, 0.061548, 0.642545, 0.731488, 0.473437, 0.071232, 0.175651, 0.536949, 0.787567, 0.937920, 0.588355, 0.408608, 0.952965, 0.478417, 0.612552, 0.768915, 0.521346, 0.422123, 0.776492, 0.849695, 0.822248, 0.710154, 0.426987, 0.468732, 0.257418, 0.485103, 0.777245, 0.097201, 0.255751, 0.629379, 0.129628, 0.188270, 0.690927, 0.772173, 0.919758, 0.164364, 0.843404, 0.095410, 0.701313, 0.630971, 0.033330, 0.289668, 0.039579, 0.986295, 0.768084, 0.652131, 0.755210, 0.289431, 0.074254, 0.531702, 0.139126, 0.896502, 0.241856, 0.566113, 0.365234, 0.499273, 0.051216, 0.142480, 0.596474, 0.306967, 0.771859, 0.726102, 0.495237, 0.462786, 0.498274, 0.414995, 0.627150, 0.341679, 0.510404, 0.328463, 0.972650, 0.543734, 0.618131, 0.012229, 0.530029, 0.386215, 0.664360, 0.285238, 0.675645, 0.738614, 0.816940, 0.814771, 0.635116, 0.058796, 0.380884, 0.000351, 0.558069, 0.432100, 0.142830, 0.154543, 0.739067, 0.914690, 0.880644, 0.234303, 0.377476, 0.378919, 0.649298, 0.004626, 0.720598, 0.159702, 0.333089, 0.693247, 0.703436, 0.951220, 0.705477, 0.233464, 0.337435, 0.369837, 0.518703, 0.013080, 0.108452, 0.335643, 0.827851, 0.743568, 0.394438, 0.208735, 0.743919, 0.952507, 0.640835, 0.886749, 0.107050, 0.379901, 0.801439, 0.987694, 0.614205, 0.178915, 0.366613, 0.263502, 0.183541, 0.087211, 0.423204, 0.516630, 0.780458, 0.126640, 0.467849, 0.485935, 0.360105, 0.805284, 0.855772, 0.878807, 0.818364, 0.964224, 0.214450, 0.646215, 0.707791, 0.608888, 0.854950, 0.451710, 0.561395, 0.495785, 0.338459, 0.668445, 0.875686, 0.139898, 0.656139, 0.489891, 0.318813, 0.022753, 0.753393, 0.502353, 0.109963, 0.176598, 0.018983, 0.890421, 0.303238, 0.486832, 0.376356, 0.663342, 0.292116, 0.232128, 0.542150, 0.110480, 0.196352, 0.756599, 0.756695, 0.904143, 0.365488, 0.611645, 0.355854, 0.926883, 0.107430, 0.694313, 0.595328, 0.983117, 0.834211, 0.251467, 0.473008, 0.153024, 0.274220, 0.226401, 0.655377, 0.384183, 0.402999, 0.674360, 0.274605, 0.706237, 0.161192, 0.650961, 0.369579, 0.453308, 0.883089, 0.911729, 0.563788, 0.079441, 0.668328, 0.320483, 0.983585, 0.033816, 0.932129, 0.339438, 0.960698, 0.039559, 0.033751, 0.556026, 0.022676, 0.867962, 0.807494, 0.495684, 0.020986, 0.081713, 0.722085, 0.676363, 0.465896, 0.125084, 0.350723, 0.740501, 0.831320, 0.511915, 0.391462, 0.200899, 0.965224, 0.274551, 0.112628, 0.529012, 0.353993, 0.780956, 0.849495, 0.337577, 0.814772, 0.781624, 0.677016, 0.775470, 0.821183, 0.710767, 0.331496, 0.843859, 0.578729, 0.138990, 0.339543, 0.599715, 0.220703, 0.061628, 0.276079, 0.686600, 0.186712, 0.626802, 0.427101, 0.018032, 0.138717, 0.818563, 0.218931, 0.103940, 0.093114, 0.331559, 0.632952, 0.447107, 0.112515, 0.482448, 0.784684, 0.927287, 0.264072, 0.461700, 0.702757, 0.085255, 0.172467, 0.034253, 0.929114, 0.751196, 0.173243, 0.268657, 0.350912, 0.393946, 0.330285, 0.626990, 0.080546, 0.516996, 0.253792, 0.507647, 0.535028, 0.392508, 0.326210, 0.753959, 0.496449, 0.419324, 0.085519, 0.129401, 0.866431, 0.198034, 0.611848, 0.651115, 0.125320, 0.875920, 0.112814, 0.828077, 0.961175, 0.285281, 0.862330, 0.890289, 0.036478, 0.035573, 0.158945, 0.387389, 0.429519, 0.489230, 0.014379, 0.510065, 0.006226, 0.268171, 0.017712, 0.541254, 0.660680, 0.343922, 0.295214, 0.157128, 0.763246, 0.380732, 0.286529, 0.629677, 0.578766, 0.898378, 0.280791, 0.704086, 0.774298, 0.393606, 0.532164, 0.735473, 0.678887, 0.394494, 0.625761, 0.715365, 0.430067, 0.784707, 0.102754, 0.859586, 0.273937, 0.117133, 0.369652, 0.280163, 0.385305, 0.387364, 0.821417, 0.045984, 0.731286, 0.116631, 0.203113, 0.494532, 0.497363, 0.489642, 0.124209, 0.076129, 0.388020, 0.405000, 0.780216, 0.162318, 0.798606, 0.312379, 0.897791, 0.477493, 0.706873, 0.523552, 0.192858, 0.136940, 0.308259, 0.295612, 0.996526, 0.582195, 0.412745, 0.366178, 0.862358, 0.798050, 0.753542, 0.683776, 0.844034, 0.484828, 0.800406, 0.047146, 0.979361, 0.297770, 0.536789, 0.103570, 0.373899, 0.924808, 0.508570, 0.154114, 0.087126, 0.307176, 0.466493, 0.984917, 0.784670, 0.173366, 0.508469, 0.977528, 0.310306, 0.816728, 0.273139, 0.306832, 0.398923, 0.685884, 0.673010, 0.261281, 0.483934, 0.426552, 0.945057, 0.327968, 0.911380, 0.745463, 0.375114, 0.890740, 0.043233, 0.911902, 0.994310, 0.417132, 0.836711, 0.502880, 0.571246, 0.923837, 0.810057, 0.037739, 0.908754, 0.594726, 0.211106, 0.417223, 0.572254, 0.521412, 0.233951, 0.845393, 0.828244, 0.632874, 0.531277, 0.501254, 0.894155, 0.015211, 0.927805, 0.839212, 0.343179, 0.839185, 0.584676, 0.718293, 0.729925, 0.627909, 0.630195, 0.724235, 0.045041, 0.466906, 0.227116, 0.616287, 0.390743, 0.037172, 0.654026, 0.299498, 0.631898, 0.865132, 0.716721, 0.204152, 0.386543, 0.950672, 0.049545, 0.214787, 0.583546, 0.580822, 0.716041, 0.477701, 0.596034, 0.643846, 0.316914, 0.939212, 0.483031, 0.901590, 0.657505, 0.212956, 0.529499, 0.287700, 0.937191, 0.574539, 0.754606, 0.164307, 0.190826, 0.145349, 0.201479, 0.844852, 0.444847, 0.833377, 0.709983, 0.161568, 0.037529, 0.096526, 0.112240, 0.087075, 0.311314, 0.695785, 0.667897, 0.027354, 0.173487, 0.263931, 0.671200, 0.490400, 0.203143, 0.154230, 0.391990, 0.860648, 0.367186, 0.921488, 0.148347, 0.304377, 0.496028, 0.902953, 0.468684, 0.686853, 0.048303, 0.670163, 0.531705, 0.493150, 0.503540, 0.241688, 0.654718, 0.541069, 0.338214, 0.766957, 0.628144, 0.649528, 0.462743, 0.296041, 0.676882, 0.636229, 0.559972, 0.348082, 0.126630, 0.763114, 0.502312, 0.518620, 0.623762, 0.869499, 0.440108, 0.772109, 0.173876, 0.936136, 0.675063, 0.642560, 0.622989, 0.723365, 0.312722, 0.154694, 0.216515, 0.816262, 0.396382, 0.871233, 0.357332, 0.734596, 0.638190, 0.985476, 0.384124, 0.100933, 0.281517, 0.061006, 0.737162, 0.841489, 0.409088, 0.863792, 0.604603, 0.911401, 0.382412, 0.228365, 0.780899, 0.822520, 0.000474, 0.954775, 0.758655, 0.675537, 0.597335, 0.381645, 0.398902, 0.910057, 0.536338, 0.615417, 0.726320, 0.932720, 0.486650, 0.083651, 0.667316, 0.124839, 0.069127, 0.051441, 0.225772, 0.350644, 0.112447, 0.962934, 0.192133, 0.521535, 0.826726, 0.796736, 0.432936, 0.209137, 0.025101, 0.213835, 0.031657, 0.025575, 0.168610, 0.790313, 0.701112, 0.765945, 0.171957, 0.100014, 0.676002, 0.708296, 0.715431, 0.402322, 0.641016, 0.202080, 0.485973, 0.308332, 0.326920, 0.555101, 0.359773, 0.552692, 0.905745, 0.472220, 0.515626, 0.097878, 0.993755, 0.342351, 0.894614, 0.426691, 0.551489, 0.919714, 0.640526, 0.583146, 0.945289, 0.809136, 0.373458, 0.646401, 0.575081, 0.545416, 0.746415, 0.251083, 0.253711, 0.461845, 0.653405, 0.894727, 0.663926, 0.139379, 0.203059, 0.990845, 0.694479, 0.562832, 0.543537, 0.600224, 0.035051, 0.059162, 0.698102, 0.028806, 0.401514, 0.592716, 0.455497, 0.953003, 0.512430, 0.096022, 0.536149, 0.457719, 0.905158, 0.909607, 0.104120, 0.480239, 0.455023, 0.850534, 0.731323, 0.708734, 0.312380, 0.384728, 0.603461, 0.976305, 0.524107, 0.806520, 0.967151, 0.218586, 0.369351, 0.510688, 0.818811, 0.404402, 0.569850, 0.516913, 0.433208, 0.971364, 0.109629, 0.888705, 0.924367, 0.622059, 0.984727, 0.460515, 0.079778, 0.889886, 0.370123, 0.183898, 0.370125, 0.825145, 0.034432, 0.101448, 0.533879, 0.346812, 0.486176, 0.137340, 0.323118, 0.010283, 0.943859, 0.290268, 0.228869, 0.313210, 0.800956, 0.047679, 0.717613, 0.370806, 0.564592, 0.150821, 0.342170, 0.674221, 0.039526, 0.266537, 0.296280, 0.024253, 0.727052, 0.376058, 0.914139, 0.097175, 0.559956, 0.284264, 0.922320, 0.594388, 0.385711, 0.456199, 0.941200, 0.871887, 0.593539, 0.264318, 0.882170, 0.537398, 0.554586, 0.111038, 0.850608, 0.355542, 0.158718, 0.568221, 0.726348, 0.723310, 0.719042, 0.068518, 0.397531, 0.758568, 0.335054, 0.693811, 0.782821, 0.062107, 0.069868, 0.696959, 0.159281, 0.629824, 0.981223, 0.081601, 0.224212, 0.366934, 0.537800, 0.165412, 0.238822, 0.131339, 0.429729, 0.120991, 0.668737, 0.984315, 0.232030, 0.519345, 0.339857, 0.390747, 0.087565, 0.066204, 0.114057, 0.806607, 0.134722, 0.511588, 0.565175, 0.469777, 0.205399, 0.347995, 0.531883, 0.275268, 0.044955, 0.691165, 0.905091, 0.026178, 0.772766, 0.129303, 0.393112, 0.310566, 0.294715, 0.631933, 0.441905, 0.724444, 0.752925, 0.110641, 0.708759, 0.984954, 0.629986, 0.048616, 0.375702, 0.717551, 0.114820, 0.489759, 0.524158, 0.249542, 0.001348, 0.089333, 0.719319, 0.206747, 0.437328, 0.251202, 0.482014, 0.482282, 0.942367, 0.387106, 0.508460, 0.715133, 0.516409, 0.901572, 0.025699, 0.811124, 0.533505, 0.467604, 0.535568, 0.286430, 0.578245, 0.244327, 0.271384, 0.208231, 0.292943, 0.647086, 0.925782, 0.407763, 0.136845, 0.449941, 0.657305, 0.138193, 0.539273, 0.376625, 0.344940, 0.976601, 0.627827, 0.826954, 0.458884, 0.570194, 0.214059, 0.967344, 0.285327, 0.730468, 0.868916, 0.311026, 0.541592, 0.402421, 0.778630, 0.077160, 0.688851, 0.356875, 0.321487, 0.960236, 0.565106, 0.614429, 0.607322, 0.490889, 0.022192, 0.744167, 0.940829, 0.679498, 0.882360, 0.480103, 0.056123, 0.227300, 0.456704, 0.683950, 0.054254, 0.915587, 0.254144, 0.268313, 0.882931, 0.539471, 0.998782, 0.751847, 0.850497, 0.540374, 0.154268, 0.629126, 0.617534, 0.843119, 0.986001, 0.939020, 0.803355, 0.551107, 0.553450, 0.410677, 0.041996, 0.575642, 0.154845, 0.982825, 0.255140, 0.037205, 0.462928, 0.311263, 0.264505, 0.919631, 0.995212, 0.318759, 0.835219, 0.249356, 0.587072, 0.718150, 0.788827, 0.585853, 0.469996, 0.639323, 0.126227, 0.624264, 0.268449, 0.743761, 0.467384, 0.254451, 0.682781, 0.270739, 0.805558, 0.236231, 0.681416, 0.847554, 0.811873, 0.836260, 0.830379, 0.067013, 0.873465, 0.293307, 0.378276, 0.137970, 0.212939, 0.373489, 0.456729, 0.048158, 0.622845, 0.043801, 0.766307, 0.411671, 0.629654, 0.236304, 0.050995, 0.755881, 0.860568, 0.319444, 0.499642, 0.327952, 0.573895, 0.182423, 0.598690, 0.379453, 0.418653, 0.280106, 0.227007, 0.230526, 0.116366, 0.057386, 0.297540, 0.989831, 0.350694, 0.675816, 0.127801, 0.563633, 0.049304, 0.584530, 0.611790, 0.672149, 0.628331, 0.378097, 0.083820, 0.257985, 0.614401, 0.134815, 0.013866, 0.474969, 0.454259, 0.513507, 0.802921, 0.028154, 0.695930, 0.401611, 0.407607, 0.114583, 0.681717, 0.634614, 0.345109, 0.798083, 0.692000, 0.642649, 0.787915, 0.042694, 0.318465, 0.915716, 0.606327, 0.367769, 0.500246, 0.218117, 0.039918, 0.128577, 0.596214, 0.123738, 0.386561, 0.210616, 0.258553, 0.400427, 0.685585, 0.712813, 0.913934, 0.488506, 0.740967, 0.609864, 0.890117, 0.148574, 0.724447, 0.571834, 0.783188, 0.069556, 0.369918, 0.475188, 0.712205, 0.157832, 0.517882, 0.030670, 0.073549, 0.124209, 0.398439, 0.573795, 0.342326, 0.438356, 0.702371, 0.938540, 0.562095, 0.088933, 0.149156, 0.820648, 0.489360, 0.834741, 0.533461, 0.403294, 0.323247, 0.274427, 0.013158, 0.213364, 0.423001, 0.737604, 0.785198, 0.206189, 0.807160, 0.155116, 0.681377, 0.519365, 0.312949, 0.199259, 0.550035, 0.386497, 0.323467, 0.948473, 0.960292, 0.665793, 0.386830, 0.662663, 0.604333, 0.948924, 0.751596, }; static int randpt; extern void init_rand( void ); extern int get_rand( int ll, int ul ); void init_rand( void ) { randpt = 1; } int get_rand( int ll, int ul ) { double r = rnd[randpt++]; int val; if (randpt >= MAXRND) err_internal( __func__, "Ran out of random numbers (only %d available)\n", MAXRND ); val = floor( ll + r * (ul - ll) ); if (val > ul) err_internal( __func__, "%d > %d\n", val, ul ); if (val < ll) err_internal( __func__, "%d < %d\n", val, ll ); return val; } libmaa-1.3.2/set.c010064400017500000000000000525471111676220300132430ustar cheusovwheel/* set.c -- Set routines for Khepera * Created: Wed Nov 9 13:31:24 1994 by faith@dict.org * Copyright 1994-1997, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Set Routines} * * \intro The set implementation is similar to the hash table * implementation, except that the set object does not associate a |datum| * with a |key|. For sets, keys are called elements. All of the hash * table functions are supported, with the addition of a membership test * and several set operations. * * The underlying data structure is a hash table of prime length, with * self-organizing linked lists \cite[pp.~398--9]{faith:Knuth73c} used for * collision resolution. The hash table automatically grows as necessary * to preserve efficient access. * */ #include "maaP.h" typedef struct bucket { const void *elem; unsigned int hash; struct bucket *next; } *bucketType; typedef struct set { #if MAA_MAGIC int magic; #endif unsigned long prime; unsigned long entries; bucketType *buckets; unsigned long resizings; unsigned long retrievals; unsigned long hits; unsigned long misses; unsigned long (*hash)( const void * ); int (*compare)( const void *, const void * ); int readonly; } *setType; static void _set_check( setType t, const char *function ) { if (!t) err_internal( function, "set is null\n" ); #if MAA_MAGIC if (t->magic != SET_MAGIC) err_internal( function, "Bad magic: 0x%08x (should be 0x%08x)\n", t->magic, SET_MAGIC ); #endif } static set_Set _set_create( unsigned long seed, set_HashFunction hash, set_CompareFunction compare ) { setType t; unsigned long i; unsigned long prime = prm_next_prime( seed ); t = xmalloc( sizeof( struct set ) ); #if MAA_MAGIC t->magic = SET_MAGIC; #endif t->prime = prime; t->entries = 0; t->buckets = xmalloc( t->prime * sizeof( struct bucket ) ); t->resizings = 0; t->retrievals = 0; t->hits = 0; t->misses = 0; t->hash = hash ? hash : hsh_string_hash; t->compare = compare ? compare : hsh_string_compare; t->readonly = 0; for (i = 0; i < t->prime; i++) t->buckets[i] = NULL; return t; } /* \doc The |set_create| function initilizes a set object. Elements are pointers to "void". The internal representation of the set will grow automatically when an insertion is performed and the table is more than half full. The |hash| function should take a pointer to a |elem| and return an "unsigned int". If |hash| is "NULL", then the |elem| is assumed to be a pointer to a null-terminated string, and the function shown in \grindref{fig:hshstringhash} will be used for |hash|. The |compare| function should take a pair of pointers to elements and return zero if the elements are the same and non-zero if they are different. If |compare| is "NULL", then the elements are assumed to point to null-terminated strings, and the |strcmp| function will be used for |compare|. Additionally, the |hsh_pointer_hash| and |hsh_pointer_compare| functions are available and can be used to treat the \emph{value} of the "void" pointer as the element. These functions are often useful for maintaining sets of objects. */ set_Set set_create( set_HashFunction hash, set_CompareFunction compare ) { return _set_create( 0, hash, compare ); } set_HashFunction set_get_hash( set_Set set ) { setType t = (setType)set; _set_check( t, __func__ ); return t->hash; } set_CompareFunction set_get_compare( set_Set set ) { setType t = (setType)set; _set_check( t, __func__ ); return t->compare; } static void _set_destroy_buckets( set_Set set ) { unsigned long i; setType t = (setType)set; _set_check( t, __func__ ); for (i = 0; i < t->prime; i++) { bucketType b = t->buckets[i]; while (b) { bucketType next = b->next; xfree( b ); /* terminal */ b = next; } } xfree( t->buckets ); /* terminal */ t->buckets = NULL; } static void _set_destroy_table( set_Set set ) { setType t = (setType)set; _set_check( t, __func__ ); #if MAA_MAGIC t->magic = SET_MAGIC_FREED; #endif xfree( t ); /* terminal */ } /* \doc |set_destroy| frees all of the memory associated with the set object. The memory used by elements is \emph{not} freed---this memory is the responsibility of the user. However, a call to |set_iterate| can be used to free this memory \emph{immediately} before a call to |set_destroy|. */ void set_destroy( set_Set set ) { setType t = (setType)set; _set_check( t, __func__ ); if (t->readonly) err_internal( __func__, "Attempt to destroy readonly set\n" ); _set_destroy_buckets( set ); _set_destroy_table( set ); } static void _set_insert( set_Set set, unsigned int hash, const void *elem ) { setType t = (setType)set; unsigned long h = hash % t->prime; bucketType b; _set_check( t, __func__ ); b = xmalloc( sizeof( struct bucket ) ); b->hash = hash; b->elem = elem; b->next = NULL; if (t->buckets[h]) b->next = t->buckets[h]; t->buckets[h] = b; ++t->entries; } /* \doc |set_insert| inserts a new |elem| into the |set|. If the insertion is successful, zero is returned. If the |elem| already exists, 1 is returned. If the internal representation of the set becomes more than half full, its size is increased automatically. At present, this requires that all of the element pointers are copied into a new set. Rehashing is not required, however, since the hash values are stored for each element. */ int set_insert( set_Set set, const void *elem ) { setType t = (setType)set; unsigned long hashValue = t->hash( elem ); unsigned long h; _set_check( t, __func__ ); if (t->readonly) err_internal( __func__, "Attempt to insert into readonly set\n" ); /* Keep table less than half full */ if (t->entries * 2 > t->prime) { setType new = _set_create( t->prime * 3, t->hash, t->compare ); unsigned long i; for (i = 0; i < t->prime; i++) { if (t->buckets[i]) { bucketType pt; for (pt = t->buckets[i]; pt; pt = pt->next) _set_insert( new, pt->hash, pt->elem ); } } /* fixup values */ _set_destroy_buckets( t ); t->prime = new->prime; t->buckets = new->buckets; _set_destroy_table( new ); ++t->resizings; } h = hashValue % t->prime; if (t->buckets[h]) { /* Assert uniqueness */ bucketType pt; for (pt = t->buckets[h]; pt; pt = pt->next) if (!t->compare( pt->elem, elem )) return 1; } _set_insert( t, hashValue, elem ); return 0; } /* \doc |set_delete| removes an |elem| from the |set|. Zero is returned if the |elem| was present. Otherwise, 1 is returned. */ int set_delete( set_Set set, const void *elem ) { setType t = (setType)set; unsigned long h = t->hash( elem ) % t->prime; _set_check( t, __func__ ); if (t->readonly) err_internal( __func__, "Attempt to delete from readonly set\n" ); if (t->buckets[h]) { bucketType pt; bucketType prev; for (prev = NULL, pt = t->buckets[h]; pt; prev = pt, pt = pt->next) if (!t->compare( pt->elem, elem )) { --t->entries; if (!prev) t->buckets[h] = pt->next; else prev->next = pt->next; xfree( pt ); return 0; } } return 1; } /* \doc |set_member| returns 1 if |elem| is in |set|. Otherwise, zero is returned. */ int set_member( set_Set set, const void *elem ) { setType t = (setType)set; unsigned long h = t->hash( elem ) % t->prime; _set_check( t, __func__ ); ++t->retrievals; if (t->buckets[h]) { bucketType pt; bucketType prev; for (prev = NULL, pt = t->buckets[h]; pt; prev = pt, pt = pt->next) if (!t->compare( pt->elem, elem )) { if (!prev) { ++t->hits; } else if (!t->readonly) { /* Self organize */ prev->next = pt->next; pt->next = t->buckets[h]; t->buckets[h] = pt; } return 1; } } ++t->misses; return 0; } /* \doc |set_iterate| is used to iterate a function over every |elem| in the |set|. The function, |iterator|, is passed each |elem|. If |iterator| returns a non-zero value, the iterations stop, and |set_iterate| returns. Note that the elements are in some arbitrary order, and that this order may change between two successive calls to |set_iterate|. */ int set_iterate( set_Set set, int (*iterator)( const void *elem ) ) { setType t = (setType)set; unsigned long i; int savedReadonly; _set_check( t, __func__ ); savedReadonly = t->readonly; t->readonly = 1; for (i = 0; i < t->prime; i++) { if (t->buckets[i]) { bucketType pt; for (pt = t->buckets[i]; pt; pt = pt->next) if (iterator( pt->elem )) { t->readonly = savedReadonly; return 1; } } } t->readonly = savedReadonly; return 0; } /* \doc |set_iterate_arg| is used to iterate a function over every |elem| in the |set|. The function, |iterator|, is passed each |elem|. If |iterator| returns a non-zero value, the iterations stop, and |set_iterate| returns. Note that the elements are in some arbitrary order, and that this order may change between two successive calls to |set_iterate|. */ int set_iterate_arg( set_Set set, int (*iterator)( const void *elem, void *arg ), void *arg ) { setType t = (setType)set; unsigned long i; int savedReadonly; _set_check( t, __func__ ); savedReadonly = t->readonly; t->readonly = 1; for (i = 0; i < t->prime; i++) { if (t->buckets[i]) { bucketType pt; for (pt = t->buckets[i]; pt; pt = pt->next) if (iterator( pt->elem, arg )) { t->readonly = savedReadonly; return 1; } } } t->readonly = savedReadonly; return 0; } /* \doc |set_init_position| returns a position marker for some arbitary first element in the set. This marker can be used with |set_next_position| and |set_get_position|. */ set_Position set_init_position( set_Set set ) { setType t = (setType)set; unsigned long i; _set_check( t, __func__ ); for (i = 0; i < t->prime; i++) if (t->buckets[i]) { t->readonly = 1; return t->buckets[i]; } return NULL; } /* \doc |set_next_position| returns a position marker for the next element in the set. Elements are in arbitrary order based on their positions in the hash table. */ set_Position set_next_position( set_Set set, set_Position position ) { setType t = (setType)set; bucketType b = (bucketType)position; unsigned long i; unsigned long h; _set_check( t, __func__ ); if (!b) { t->readonly = 0; return NULL; } if (b->next) return b->next; for (h = b->hash % t->prime, i = h + 1; i < t->prime; i++) if (t->buckets[i]) return t->buckets[i]; t->readonly = 0; return NULL; } /* \doc |set_get_position| returns the element associated with the |position| marker, or "NULL" if there is no such element. */ void *set_get_position( set_Position position ) { bucketType b = (bucketType)position; if (!b) return NULL; return (void *)b->elem; /* Discard const */ } /* \doc |set_readonly| sets the |readonly| flag for the |set| to |flag|. |flag| should be 0 or 1. The value of the previous flag is returned. When a set is marked as readonly, self-organization of the bucket-overflow lists will not take place, and any attempt to modify the list (e.g., insertion or deletion) will result in an error. */ int set_readonly( set_Set set, int flag ) { setType t = (setType)set; int current; _set_check( t, __func__ ); current = t->readonly; t->readonly = flag; return current; } /* \doc |set_add| returns |set1|, which now contains all of the elements in |set1| and |set2|. Only pointers to elements are copied, \emph{not} the data pointed (this has memory management implications). The |hash| and |compare| functions must be identical for the two sets. |set2| is not changed. */ set_Set set_add( set_Set set1, set_Set set2 ) { setType t1 = (setType)set1; setType t2 = (setType)set2; unsigned long i; _set_check( t1, __func__ ); _set_check( t2, __func__ ); if (t1->hash != t2->hash) err_fatal( __func__, "Sets do not have identical hash functions\n" ); if ( t1->compare != t2->compare ) err_fatal( __func__, "Sets do not have identical comparison functions\n" ); for (i = 0; i < t2->prime; i++) { if (t2->buckets[i]) { bucketType pt; for (pt = t2->buckets[i]; pt; pt = pt->next) set_insert( set1, pt->elem ); } } return set1; } /* \doc |set_del| returns |set1|, which now contains all of the elements in |set1| other than those in |set2|. Only pointers to elements are copied, \emph{not} the data pointed (this has memory management implications). The |hash| and |compare| functions must be identical for the two sets. |set2| is not changed. */ set_Set set_del( set_Set set1, set_Set set2 ) { setType t1 = (setType)set1; setType t2 = (setType)set2; unsigned long i; _set_check( t1, __func__ ); _set_check( t2, __func__ ); if (t1->hash != t2->hash) err_fatal( __func__, "Sets do not have identical hash functions\n" ); if ( t1->compare != t2->compare ) err_fatal( __func__, "Sets do not have identical comparison functions\n" ); for (i = 0; i < t2->prime; i++) { if (t2->buckets[i]) { bucketType pt; for (pt = t2->buckets[i]; pt; pt = pt->next) set_delete( set1, pt->elem ); } } return set1; } /* \doc |set_union| returns a new set which is the union of |set1| and |set2|. Only pointers to elements are copied, \emph{not} the data pointed (this has memory management implications). The |hash| and |compare| functions must be identical for the two sets. */ set_Set set_union( set_Set set1, set_Set set2 ) { setType t1 = (setType)set1; setType t2 = (setType)set2; set_Set set; unsigned long i; _set_check( t1, __func__ ); _set_check( t2, __func__ ); if (t1->hash != t2->hash) err_fatal( __func__, "Sets do not have identical hash functions\n" ); if ( t1->compare != t2->compare ) err_fatal( __func__, "Sets do not have identical comparison functions\n" ); set = set_create( t1->hash, t1->compare ); for (i = 0; i < t1->prime; i++) { if (t1->buckets[i]) { bucketType pt; for (pt = t1->buckets[i]; pt; pt = pt->next) set_insert( set, pt->elem ); } } for (i = 0; i < t2->prime; i++) { if (t2->buckets[i]) { bucketType pt; for (pt = t2->buckets[i]; pt; pt = pt->next) set_insert( set, pt->elem ); } } return set; } /* \doc |set_inter| returns a new set which is the intersection of |set1| and |set2|. Only pointers to elements are copied, \emph{not} the data pointed (this has memory management implications). The |hash| and |compare| functions must be identical for the two sets. */ set_Set set_inter( set_Set set1, set_Set set2 ) { setType t1 = (setType)set1; setType t2 = (setType)set2; set_Set set; unsigned long i; int savedReadonly; _set_check( t1, __func__ ); _set_check( t2, __func__ ); if (t1->hash != t2->hash) err_fatal( __func__, "Sets do not have identical hash functions\n" ); if ( t1->compare != t2->compare ) err_fatal( __func__, "Sets do not have identical comparison functions\n" ); set = set_create( t1->hash, t1->compare ); savedReadonly = t2->readonly; t2->readonly = 1; /* save time on set_member */ for (i = 0; i < t1->prime; i++) { if (t1->buckets[i]) { bucketType pt; for (pt = t1->buckets[i]; pt; pt = pt->next) if (set_member( t2, pt->elem )) set_insert( set, pt->elem ); } } t2->readonly = savedReadonly; return set; } /* \doc |set_diff| returns a new set which is the difference resulting from removing every element in |set2| from the elements in |set1|. Only pointers to elements are copied, \emph{not} the data pointed (this has memory management implications). The |hash| and |compare| functions must be identical for the two sets. */ set_Set set_diff( set_Set set1, set_Set set2 ) { setType t1 = (setType)set1; setType t2 = (setType)set2; set_Set set; unsigned long i; int savedReadonly; _set_check( t1, __func__ ); _set_check( t2, __func__ ); if (t1->hash != t2->hash) err_fatal( __func__, "Sets do not have identical hash functions\n" ); if ( t1->compare != t2->compare ) err_fatal( __func__, "Sets do not have identical comparison functions\n" ); set = set_create( t1->hash, t1->compare ); savedReadonly = t2->readonly; t2->readonly = 1; /* save time on set_member */ for (i = 0; i < t1->prime; i++) { if (t1->buckets[i]) { bucketType pt; for (pt = t1->buckets[i]; pt; pt = pt->next) if (!set_member( t2, pt->elem )) set_insert( set, pt->elem ); } } t2->readonly = savedReadonly; return set; } /* \doc |set_equal| returns non-zero if |set1| and |set2| contain the same number of elements, and all of the elements in |set1| are also in |set2|. The |hash| and |compare| functions must be identical for the two sets. */ int set_equal( set_Set set1, set_Set set2 ) { setType t1 = (setType)set1; setType t2 = (setType)set2; unsigned long i; int savedReadonly; _set_check( t1, __func__ ); _set_check( t2, __func__ ); if (t1->hash != t2->hash) err_fatal( __func__, "Sets do not have identical hash functions\n" ); if ( t1->compare != t2->compare ) err_fatal( __func__, "Sets do not have identical comparison functions\n" ); if (t1->entries != t2->entries) return 0; /* not equal */ savedReadonly = t2->readonly; t2->readonly = 1; /* save time on set_member */ for (i = 0; i < t1->prime; i++) { if (t1->buckets[i]) { bucketType pt; for (pt = t1->buckets[i]; pt; pt = pt->next) if (!set_member( t2, pt->elem )) { t2->readonly = savedReadonly; return 0; /* not equal */ } } } t2->readonly = savedReadonly; return 1; /* equal */ } int set_count( set_Set set ) { setType t = (setType)set; _set_check( t, __func__ ); return t->entries; } /* \doc |set_get_stats| returns statistics about the |set|. The |set_Stats| structure is shown in \grind{set_Stats}. */ set_Stats set_get_stats( set_Set set ) { setType t = (setType)set; set_Stats s = xmalloc( sizeof( struct set_Stats ) ); unsigned long i; unsigned long count; _set_check( t, __func__ ); s->size = t->prime; s->resizings = t->resizings; s->entries = 0; s->buckets_used = 0; s->singletons = 0; s->maximum_length = 0; s->retrievals = t->retrievals; s->hits = t->hits; s->misses = t->misses; for (i = 0; i < t->prime; i++) { if (t->buckets[i]) { bucketType pt; ++s->buckets_used; for (count = 0, pt = t->buckets[i]; pt; ++count, pt = pt->next); if (count == 1) ++s->singletons; s->maximum_length = max( s->maximum_length, count ); s->entries += count; } } if ( t->entries != s->entries ) err_internal( __func__, "Incorrect count for entries: %lu vs. %lu\n", t->entries, s->entries ); return s; } /* \doc |set_print_stats| prints the statistics for |set| on the specified |stream|. If |stream| is "NULL", then "stdout" will be used. */ void set_print_stats( set_Set set, FILE *stream ) { setType t = (setType)set; FILE *str = stream ? stream : stdout; set_Stats s = set_get_stats( t ); _set_check( t, __func__ ); fprintf( str, "Statistics for set at %p:\n", set ); fprintf( str, " %lu resizings to %lu total\n", s->resizings, s->size ); fprintf( str, " %lu entries (%lu buckets used, %lu without overflow)\n", s->entries, s->buckets_used, s->singletons ); fprintf( str, " maximum list length is %lu", s->maximum_length ); if (s->buckets_used) fprintf( str, " (optimal is %.1f)\n", (double)s->entries / (double)s->buckets_used ); else fprintf( str, "\n" ); fprintf( str, " %lu retrievals (%lu from top, %lu failed)\n", s->retrievals, s->hits, s->misses ); xfree( s ); /* rare */ } libmaa-1.3.2/settest.c010064400017500000000000000106731111676220300141350ustar cheusovwheel/* settest.c -- Test program for Khepera set routines * Created: Wed Nov 9 15:04:25 1994 by faith@dict.org * Copyright 1994-1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 1, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" extern void init_rand( void ); extern int get_rand( int ll, int ul ); static int iterator( const void *key ) { printf( "%s\n", (const char *)key ); return 0; } static int freer( const void *key ) { xfree( (void *)key ); return 0; } int main( int argc, char **argv ) { set_Set t; set_Set t1; set_Set t2; int i; int j; int count; set_Position p; const void *k; if (argc == 1) { count = 100; } else if (argc != 2 ) { fprintf( stderr, "usage: settest count\n" ); return 1; } else { count = atoi( argv[1] ); } printf( "Running test for count of %d\n", count ); /* Test sequential keys */ t = set_create( NULL, NULL ); for (i = 0; i < count; i++) { char *key = xmalloc( 20 ); sprintf( key, "key%d", i ); set_insert( t, key ); } for (i = count; i >= 0; i--) { char key[100]; sprintf( key, "key%d", i ); if (!set_member( t, key )) printf( "\"%s\" is not a member of the set\n", key ); } if (count <= 200) set_iterate( t, iterator ); /* set_print_stats( t, stdout );*/ set_iterate( t, freer ); set_destroy( t ); /* Test random keys */ t = set_create( NULL, NULL ); init_rand(); for (i = 0; i < count; i++) { int len = get_rand( 2, 32 ); char *key = xmalloc( len + 1 ); for (j = 0; j < len; j++) key[j] = get_rand( 32, 128 ); key[ len ] = '\0'; set_insert( t, key ); printf( "item%d = %s\n", i, key ); } init_rand(); for (i = 0; i < count; i++) { int len = get_rand( 2, 32 ); char *key = xmalloc( len + 1 ); for (j = 0; j < len; j++) key[j] = get_rand( 32, 128 ); key[ len ] = '\0'; printf( "lookup%d = %s\n", i, key ); if (!set_member( t, key )) printf( "\"%s\" is not a member of the set", key ); xfree( key ); } /* set_print_stats( t, stdout );*/ set_iterate( t, freer ); set_destroy( t ); /* Test (random) integer keys */ t = set_create( hsh_pointer_hash, hsh_pointer_compare ); init_rand(); for (i = 0; i < count; i++) { long key = get_rand( 1, 16777216 ); set_insert( t, (void *)key ); printf( "int%d = %ld\n", i, key ); } init_rand(); for (i = 0; i < count; i++) { long key = get_rand( 1, 16777216 ); printf( "intlookup%d = %ld\n", i, key ); if (!set_member( t, (void *)key )) printf( "%ld is not a member of the set", key ); } /* set_print_stats( t, stdout );*/ set_destroy( t ); /* Test set operations */ t1 = set_create( NULL, NULL ); t2 = set_create( NULL, NULL ); set_insert( t1, "foo" ); set_insert( t1, "bar" ); set_insert( t2, "t2-foo" ); set_insert( t2, "bar" ); printf( "\nSet 1:\n" ); set_iterate( t1, iterator ); printf( "\nSet 1 (again):\n" ); SET_ITERATE(t1,p,k) printf( "%s\n", (const char *)k ); printf( "\nSet 2:\n" ); set_iterate( t2, iterator ); printf( "Set 1 == Set 2 ? ===> %d\n", set_equal( t1, t2 ) ); printf( "Set 1 == Set 1 ? ===> %d\n", set_equal( t1, t1 ) ); printf( "\nUnion:\n"); t = set_union( t1, t2 ); set_iterate( t, iterator ); set_destroy( t ); printf( "\nIntersection:\n"); t = set_inter( t1, t2 ); set_iterate( t, iterator ); set_destroy( t ); printf( "\nDifference:\n"); t = set_diff( t1, t2 ); set_iterate( t, iterator ); set_destroy( t ); set_destroy( t1 ); set_destroy( t2 ); return 0; } libmaa-1.3.2/settest.out010064400017500000000000000234061111404224100145070ustar cheusovwheelRunning test for count of 100 "key100" is not a member of the set key80 key71 key62 key53 key44 key9 key35 key26 key97 key17 key88 key79 key0 key50 key8 key41 key6 key32 key23 key94 key14 key85 key76 key67 key58 key49 key5 key31 key3 key22 key13 key20 key91 key11 key82 key73 key64 key55 key46 key37 key28 key99 key19 key2 key90 key10 key81 key72 key63 key70 key54 key61 key45 key52 key36 key43 key27 key34 key18 key25 key96 key16 key87 key78 key69 key60 key51 key42 key7 key33 key40 key24 key95 key15 key86 key93 key77 key84 key68 key75 key59 key66 key57 key48 key39 key4 key30 key21 key92 key12 key83 key74 key65 key56 key47 key38 key29 key98 key89 key1 item0 = GX0|b&y1d|98GmF%0<"~S'bRH0Y%$*()7 item33 = JU item34 = Dfm@ item35 = %glLm|ho{Yk%G,% item36 = sryaobPk~HImg85, item37 = hZ'Q* item38 = pd:v+F{X:mR{]5LH item39 = tq"\)7i4 item40 = C!KC9ioM`UO)6-hD4[G-Q& item42 = ^NGk9zJ item43 = 8K\eiK3I bS6p<[$x item44 = 2I item45 = B(Vi item46 = pd>C}jBYP,$cU$E);5Ew:=yLg"oo item47 = XcI=!m:l/t<J@nxJf[z`u!P item54 = hXL>(FGi(3dN^ item55 = ?uZ]@{L8F item56 = t@sjAD-* item57 = ZI$!pn)$RXcjxXEUxA"1g5&()pJM~T item58 = Y}NZn=drp=VZ5. item59 = 'Am9("?0+/[X-/"g-QA|n%o^C item60 = 9XT9C\Z0uc24t item61 = DOwR_z9mKZi item62 = `Yy$~2\SL item63 = '/$kB9 item64 = `]/W/oRI\}#F8d1h~DER item65 = DaxTfdwDW]S/lBa5_9Fw~F)gD item66 = -v?QX8&>|}>@U{te item67 = 7G~6&8]~6#(~GV+>u]w.d6*a item68 = K7P?|8VD6mKOJIeNRd item69 = (o4~M,,1B6swb*H!'aXKwFwGq@,? item70 = q5{`Jy.W%?y<3q~=9 EzYqr h9q item71 = F1|7 item72 = wxqq'HvFB3Z42w item73 = 2=Il.zDPQh\T%'1t|n> item81 = J+K'\ item98 = dZ8<%M\=8|: lookup0 = GX0|b&y1d|98GmF%0<"~S'bRH0Y%$*()7 lookup33 = JU lookup34 = Dfm@ lookup35 = %glLm|ho{Yk%G,% lookup36 = sryaobPk~HImg85, lookup37 = hZ'Q* lookup38 = pd:v+F{X:mR{]5LH lookup39 = tq"\)7i4 lookup40 = C!KC9ioM`UO)6-hD4[G-Q& lookup42 = ^NGk9zJ lookup43 = 8K\eiK3I bS6p<[$x lookup44 = 2I lookup45 = B(Vi lookup46 = pd>C}jBYP,$cU$E);5Ew:=yLg"oo lookup47 = XcI=!m:l/t<J@nxJf[z`u!P lookup54 = hXL>(FGi(3dN^ lookup55 = ?uZ]@{L8F lookup56 = t@sjAD-* lookup57 = ZI$!pn)$RXcjxXEUxA"1g5&()pJM~T lookup58 = Y}NZn=drp=VZ5. lookup59 = 'Am9("?0+/[X-/"g-QA|n%o^C lookup60 = 9XT9C\Z0uc24t lookup61 = DOwR_z9mKZi lookup62 = `Yy$~2\SL lookup63 = '/$kB9 lookup64 = `]/W/oRI\}#F8d1h~DER lookup65 = DaxTfdwDW]S/lBa5_9Fw~F)gD lookup66 = -v?QX8&>|}>@U{te lookup67 = 7G~6&8]~6#(~GV+>u]w.d6*a lookup68 = K7P?|8VD6mKOJIeNRd lookup69 = (o4~M,,1B6swb*H!'aXKwFwGq@,? lookup70 = q5{`Jy.W%?y<3q~=9 EzYqr h9q lookup71 = F1|7 lookup72 = wxqq'HvFB3Z42w lookup73 = 2=Il.zDPQh\T%'1t|n> lookup81 = J+K'\ lookup98 = dZ8<%M\=8|: int0 = 9136939 int1 = 6951572 int2 = 9797458 int3 = 2924202 int4 = 16134833 int5 = 11578460 int6 = 4908661 int7 = 9437436 int8 = 1835159 int9 = 13813621 int10 = 11994451 int11 = 14124016 int12 = 8071401 int13 = 7528608 int14 = 8945981 int15 = 1946409 int16 = 12509545 int17 = 6572894 int18 = 1141724 int19 = 5881069 int20 = 12401852 int21 = 11949136 int22 = 2162214 int23 = 11663235 int24 = 13364545 int25 = 7728542 int26 = 2852630 int27 = 10036785 int28 = 7557431 int29 = 11701118 int30 = 12139658 int31 = 16694370 int32 = 1875475 int33 = 5159900 int34 = 2841356 int35 = 1233092 int36 = 16738343 int37 = 7750017 int38 = 10670527 int39 = 1796303 int40 = 4786422 int41 = 5887763 int42 = 15920302 int43 = 12857823 int44 = 13416370 int45 = 8089068 int46 = 14804232 int47 = 9148717 int48 = 14661961 int49 = 15945938 int50 = 15029785 int51 = 10286598 int52 = 11117858 int53 = 414767 int54 = 5172617 int55 = 7705188 int56 = 8143308 int57 = 8025247 int58 = 964757 int59 = 15700739 int60 = 2949133 int61 = 13104415 int62 = 15617893 int63 = 4824607 int64 = 1487099 int65 = 1682034 int66 = 6057699 int67 = 1448226 int68 = 9432050 int69 = 16728226 int70 = 3244529 int71 = 14218472 int72 = 5838773 int73 = 2387633 int74 = 10299080 int75 = 2477928 int76 = 10476683 int77 = 8326096 int78 = 11626644 int79 = 8361429 int80 = 7494819 int81 = 9879213 int82 = 1870811 int83 = 1835478 int84 = 10293980 int85 = 7043428 int86 = 9540666 int87 = 1660072 int88 = 15068657 int89 = 10505423 int90 = 583596 int91 = 1240592 int92 = 6832639 int93 = 16201489 int94 = 6065199 int95 = 8319738 int96 = 1106290 int97 = 12122897 int98 = 9767964 int99 = 10538340 intlookup0 = 9136939 intlookup1 = 6951572 intlookup2 = 9797458 intlookup3 = 2924202 intlookup4 = 16134833 intlookup5 = 11578460 intlookup6 = 4908661 intlookup7 = 9437436 intlookup8 = 1835159 intlookup9 = 13813621 intlookup10 = 11994451 intlookup11 = 14124016 intlookup12 = 8071401 intlookup13 = 7528608 intlookup14 = 8945981 intlookup15 = 1946409 intlookup16 = 12509545 intlookup17 = 6572894 intlookup18 = 1141724 intlookup19 = 5881069 intlookup20 = 12401852 intlookup21 = 11949136 intlookup22 = 2162214 intlookup23 = 11663235 intlookup24 = 13364545 intlookup25 = 7728542 intlookup26 = 2852630 intlookup27 = 10036785 intlookup28 = 7557431 intlookup29 = 11701118 intlookup30 = 12139658 intlookup31 = 16694370 intlookup32 = 1875475 intlookup33 = 5159900 intlookup34 = 2841356 intlookup35 = 1233092 intlookup36 = 16738343 intlookup37 = 7750017 intlookup38 = 10670527 intlookup39 = 1796303 intlookup40 = 4786422 intlookup41 = 5887763 intlookup42 = 15920302 intlookup43 = 12857823 intlookup44 = 13416370 intlookup45 = 8089068 intlookup46 = 14804232 intlookup47 = 9148717 intlookup48 = 14661961 intlookup49 = 15945938 intlookup50 = 15029785 intlookup51 = 10286598 intlookup52 = 11117858 intlookup53 = 414767 intlookup54 = 5172617 intlookup55 = 7705188 intlookup56 = 8143308 intlookup57 = 8025247 intlookup58 = 964757 intlookup59 = 15700739 intlookup60 = 2949133 intlookup61 = 13104415 intlookup62 = 15617893 intlookup63 = 4824607 intlookup64 = 1487099 intlookup65 = 1682034 intlookup66 = 6057699 intlookup67 = 1448226 intlookup68 = 9432050 intlookup69 = 16728226 intlookup70 = 3244529 intlookup71 = 14218472 intlookup72 = 5838773 intlookup73 = 2387633 intlookup74 = 10299080 intlookup75 = 2477928 intlookup76 = 10476683 intlookup77 = 8326096 intlookup78 = 11626644 intlookup79 = 8361429 intlookup80 = 7494819 intlookup81 = 9879213 intlookup82 = 1870811 intlookup83 = 1835478 intlookup84 = 10293980 intlookup85 = 7043428 intlookup86 = 9540666 intlookup87 = 1660072 intlookup88 = 15068657 intlookup89 = 10505423 intlookup90 = 583596 intlookup91 = 1240592 intlookup92 = 6832639 intlookup93 = 16201489 intlookup94 = 6065199 intlookup95 = 8319738 intlookup96 = 1106290 intlookup97 = 12122897 intlookup98 = 9767964 intlookup99 = 10538340 Set 1: bar foo Set 1 (again): bar foo Set 2: bar t2-foo Set 1 == Set 2 ? ===> 0 Set 1 == Set 1 ? ===> 1 Union: foo bar t2-foo Intersection: bar Difference: foo libmaa-1.3.2/sl.c010064400017500000000000000317771111676220300130700ustar cheusovwheel/* sl.c -- Skip lists * Created: Sun Feb 18 11:51:06 1996 by faith@dict.org * Copyright 1996-1997, 2002 Rickard E. Faith (faith@dict.org) * Copyright 1996 Lars Nyland (nyland@cs.unc.edu) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Skip List Routines} * * \intro Skip list support is provided as an alternative to balanced * trees. Skip lists have the advantage that an inorder walk through the * list is possible in the face of additions and deletions from the list. * Balanced tree, algorithms, in contrast, make this sort of traversal * impossible because of the rotations that are necessary for the * balancing. * * For these lists, the |key| is derivable from the |datum| that is stored * in the list. This makes it possible for the actualy keys to change, as * long as the ordering of the data stay the same. This is essential for * the use of skip lists for \khepera trees. * * This code is derived from \cite{faith:Pugh90} and from a skip list * implementation by Lars Nyland. * */ #include "maaP.h" #define SL_DEBUG 0 /* Debug like crazy */ typedef struct _sl_Entry { #if MAA_MAGIC int magic; #endif const void *datum; #if SL_DEBUG int levels; /* levels for this entry */ #endif struct _sl_Entry *forward[1]; /* variable sized array */ } *_sl_Entry; typedef struct _sl_List { #if MAA_MAGIC unsigned magic; #endif int level; int count; /* number of data */ struct _sl_Entry *head; int (*compare)( const void *key1, const void *key2 ); const void *(*key)( const void *datum ); const char *(*print)( const void *datum ); } *_sl_List; static mem_Object _sl_Memory; #define _sl_MaxLevel 16 #define PRINT(l,d) ((l)->print ? (l)->print(d) : _sl_print(d)) static void _sl_check_list( _sl_List l, const char *function ) { if (!l) err_internal( function, "skip list is null\n" ); #if MAA_MAGIC if (l->magic != SL_LIST_MAGIC) err_internal( function, "Bad magic: 0x%08x (should be 0x%08x)\n", l->magic, SL_LIST_MAGIC ); #endif } #if !SL_DEBUG #define _sl_check_entry(e,f) /* */ #else static int _sl_check_entry( _sl_Entry e, const char *function ) { if (!e) err_internal( function, "entry is null\n" ); #if MAA_MAGIC if (e->magic != SL_ENTRY_MAGIC) { err_warning( function, "Bad magic: 0x%08x (should be 0x%08x)\n", e->magic, SL_ENTRY_MAGIC ); return 1; } #endif return 0; } #endif #if !SL_DEBUG #define _sl_check(x) /* */ #else static void _sl_check( sl_List list ) { _sl_List l = (_sl_List)list; int count = 0; _sl_Entry pt; _sl_check_list( list, __func__ ); for (pt = l->head->forward[0]; pt; pt = pt->forward[0] ) { ++count; if (pt && pt->forward[0] && l->compare( l->key( pt->datum ), l->key( pt->forward[0]->datum ) ) >= 0) { _sl_dump( list ); err_internal( __func__, "Datum 0x%p=%lu >= 0x%p=%lu\n", l->key( pt->datum ), (unsigned long)l->key( pt->datum ), l->key( pt->forward[0]->datum ), (unsigned long)l->key( pt->forward[0]->datum ) ); } } if (count != l->count) { err_internal( __func__, "Count should be %d instead of %d\n", count, l->count ); } } #endif static _sl_Entry _sl_create_entry( int maxLevel, const void *datum ) { _sl_Entry e; if (maxLevel > _sl_MaxLevel) err_internal( __func__, "level %d > %d\n", maxLevel, _sl_MaxLevel ); e = xmalloc( sizeof( struct _sl_Entry ) + (maxLevel + 1) * sizeof( _sl_Entry ) ); #if MAA_MAGIC e->magic = SL_ENTRY_MAGIC; #endif e->datum = datum; #if SL_DEBUG e->levels = maxLevel + 1; #endif return e; } /* \doc |sl_create| initializes a skip list. The |compare| function returns -1, 0, or 1 depending on the ordering of |key1| and |key2|. The |key| function converts a |datum| into a |key|. The |print| function returns a string representation of |datum|, and is allowed to always return a pointer to the same static buffer. |compare| must be provided. If |key| is not provided, then |datum| will be used as the key. If |print| is not provided, then the |datum| pointer will be printed when necessary. */ sl_List sl_create( int (*compare)( const void *key1, const void *key2 ), const void *(*key)( const void *datum ), const char *(*print)( const void *datum ) ) { _sl_List l; int i; if (!_sl_Memory) { _sl_Memory = mem_create_objects( sizeof( struct _sl_List ) ); } if (!compare) err_internal( __func__, "compare fuction is NULL\n" ); if (!key) err_internal( __func__, "key fuction is NULL\n" ); l = mem_get_object( _sl_Memory ); #if MAA_MAGIC l->magic = SL_LIST_MAGIC; #endif l->level = 0; l->head = _sl_create_entry( _sl_MaxLevel, NULL ); l->compare = compare; l->key = key; l->print = print; l->count = 0; for (i = 0; i <= _sl_MaxLevel; i++) l->head->forward[i] = NULL; return l; } /* \doc |sl_destroy| removes all of the memory associated with the maintenance of the specified skip |list|. The pointer to the user-defined |datum| is "not" freed -- this is the responsibility of the user. */ void sl_destroy( sl_List list ) { _sl_List l = (_sl_List)list; _sl_Entry e; _sl_Entry next; _sl_check_list( list, __func__ ); for (e = l->head; e; e = next) { next = e->forward[0]; #if MAA_MAGIC e->magic = SL_ENTRY_MAGIC_FREED; #endif xfree( e ); } #if MAA_MAGIC l->magic = SL_LIST_MAGIC_FREED; #endif mem_free_object( _sl_Memory, l ); } /* \doc |_sl_shutdown| is used to free the internal data structures used by the skip list package. Since it is called automatically by \libmaa, it should not be called explicitly by the user. */ void _sl_shutdown( void ) { if (_sl_Memory) mem_destroy_objects( _sl_Memory ); _sl_Memory = NULL; } #if 0 static int rnd( void ) /* generate bit stream */ { static int i = 0; i = !i; return i; } #endif static int _sl_random_level( void ) { int level = 1; /* FIXME! Assumes random() is. We should use our own random() to make sure. This also assumes that p == 0.5, which is probably reasonable, but maybe should be a user-defined parameter. */ while ((random() & 0x80) && level < _sl_MaxLevel) ++level; return level; } static const char *_sl_print( const void *datum ) { static char buf[1024]; sprintf( buf, "%p", datum ); return buf; } static _sl_Entry _sl_locate( _sl_List l, const void *key, _sl_Entry update[] ) { int i; _sl_Entry pt; _sl_check( l ); for (i = l->level, pt = l->head; i >= 0; i--) { while (pt->forward[i] && l->compare( l->key( pt->forward[i]->datum ), key ) < 0) pt = pt->forward[i]; update[i] = pt; } return pt->forward[0]; } /* \doc Insert |datum| into |list|. */ void sl_insert( sl_List list, const void *datum ) { _sl_List l = (_sl_List)list; _sl_Entry update[_sl_MaxLevel + 1]; _sl_Entry pt; const void *key; int i; int level = _sl_random_level(); _sl_Entry entry; _sl_check_list( list, __func__ ); key = l->key( datum ); pt = _sl_locate( l, key, update ); if (pt && !l->compare( l->key( pt->datum ), key )) err_internal( __func__, "Datum \"%s\" is already in list\n", PRINT(l,datum) ); if (level > l->level) { level = ++l->level; update[level] = l->head; } entry = _sl_create_entry( level, datum ); /* Fixup forward pointers */ for (i = 0; i <= level; i++) { entry->forward[i] = update[i]->forward[i]; update[i]->forward[i] = entry; } ++l->count; _sl_check( list ); } /* \doc Delete |datum| from |list|. */ void sl_delete( sl_List list, const void *datum ) { _sl_List l = (_sl_List)list; _sl_Entry update[_sl_MaxLevel + 1]; _sl_Entry pt; const void *key; int i; _sl_check_list( list, __func__ ); key = l->key( datum ); pt = _sl_locate( l, key, update ); if (!pt || l->compare( l->key( pt->datum ), key )) { _sl_dump( list ); err_internal( __func__, "Datum \"%s\" is not in list\n", PRINT(l,datum) ); } /* Fixup forward pointers */ for (i = 0; i <= l->level; i++) { if (update[i]->forward[i] == pt) update[i]->forward[i] = pt->forward[i]; } xfree( pt ); while (l->level && !l->head->forward[ l->level ]) --l->level; --l->count; _sl_check( list ); } /* \doc Find the datum in |list| that has an associated value of |key|. Return that datum (a pointer), or "NULL" if the |key| is not found. */ const void *sl_find( sl_List list, const void *key ) { _sl_List l = (_sl_List)list; _sl_Entry update[_sl_MaxLevel + 1]; _sl_Entry pt; _sl_check_list( list, __func__ ); pt = _sl_locate( l, key, update ); if (pt && !l->compare( l->key( pt->datum ), key )) return pt->datum; return NULL; } /* \doc Iterate |f| over every datum in |list|. If |f| returns non-zero, then abort the remainder of the iteration. Iterations are designed to do something appropriate in the face of arbitrary insertions and deletions performed by |f|. */ int sl_iterate( sl_List list, sl_Iterator f ) { _sl_List l = (_sl_List)list; _sl_Entry pt; int retcode; int count; int i; const void **copy; if (!list) return 0; _sl_check_list( list, __func__ ); /* WARNING! This *ASSUMES* that the data to the right of the current point will remain at its memory location during the walk. Only memory locations for data to the left of the point may change! */ count = l->count; copy = alloca( count * sizeof( void * ) ); for (i = 0, pt = l->head->forward[0]; pt; i++, pt = pt->forward[0]) { copy[i] = pt->datum; } for (i = 0; i < count; i++) { if ((retcode = f( copy[i] ))) return retcode; } _sl_check( list ); return 0; } /* \doc Iterate |f| over every datum in |list|. If |f| returns non-zero, then abort the remainder of the iteration. Iterations are designed to do something appropriate in the face of arbitrary insertions and deletions performed by |f|. */ int sl_iterate_arg( sl_List list, sl_IteratorArg f, void *arg ) { _sl_List l = (_sl_List)list; _sl_Entry pt; int retcode; int count; int i; const void **copy; if (!list) return 0; _sl_check_list( list, __func__ ); /* WARNING! This *ASSUMES* that the data to the right of the current point will remain at its memory location during the walk. Only memory locations for data to the left of the point may change! */ count = l->count; copy = alloca( count * sizeof( void * ) ); for (i = 0, pt = l->head->forward[0]; pt; i++, pt = pt->forward[0]) { _sl_check_entry( pt, __func__ ); copy[i] = pt->datum; } for (i = 0; i < count; i++) { if ((retcode = f( copy[i], arg ))) return retcode; } _sl_check( list ); return 0; } /* \doc Dump the internal data structures associated with |list|. This is purely for debugging. */ void _sl_dump( sl_List list ) { _sl_List l = (_sl_List)list; _sl_Entry pt; int count = 0; _sl_check_list( list, __func__ ); printf( "Level = %d, count = %d\n", l->level, l->count ); for (pt = l->head; pt; pt = pt->forward[0]) { #if SL_DEBUG int i; printf( " Entry %p (%d/%p/0x%p=%lu) has 0x%x levels:\n", pt, count++, pt->datum, pt->datum ? l->key( pt->datum ) : 0, (unsigned long)(pt->datum ? l->key( pt->datum ) : 0), pt->levels ); for (i = 0; i < pt->levels; i++) printf( " %p\n", pt->forward[i] ); #else printf( " Entry %p (%d/%p/0x%p=%lu)\n", (void *)pt, count++, pt->datum, pt->datum ? l->key( pt->datum ) : 0, (unsigned long)(pt->datum ? l->key( pt->datum ) : 0) ); #endif } } libmaa-1.3.2/sltest.c010064400017500000000000000051111112614063300137450ustar cheusovwheel/* sltest.c -- * Created: Mon Feb 19 08:57:34 1996 by faith@dict.org * Copyright 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 1, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" #include #undef DUMP static int compare( const void *datum1, const void *datum2 ) { long a = (long)datum1; long b = (long)datum2; if (a < b) return -1; if (a > b) return 1; return 0; } static int print( const void *datum ) { printf ("%li ", (long) datum); return 0; } static const void *key( const void *datum ) { return datum; } int main( int argc, char **argv ) { sl_List sl; int count; int i; maa_init( argv[0] ); if (argc == 1) { count = 10; } else if (argc != 2 ) { fprintf( stderr, "usage: sltest count\n" ); return 1; } else { count = atoi( argv[1] ); } printf( "Running test for count of %d\n", count ); sl = sl_create( compare, key, NULL ); for (i = 1; i < count; i++) { printf( "adding %d\n", i ); sl_insert( sl, (void *) (intptr_t) i ); #ifdef DUMP _sl_dump( sl ); #endif } sl_iterate( sl, print ); printf( "\n" ); sl_delete( sl, (void *)5 ); sl_iterate( sl, print ); printf( "\n" ); sl_insert( sl, (void *)0 ); sl_iterate( sl, print ); printf( "\n" ); sl_insert( sl, (void *)66 ); sl_iterate( sl, print ); printf( "\n" ); sl_insert( sl, (void *)100 ); sl_iterate( sl, print ); printf( "\n" ); sl_insert( sl, (void *)-1 ); sl_iterate( sl, print ); printf( "\n" ); sl_insert( sl, (void *)5 ); sl_iterate( sl, print ); printf( "\n" ); sl_insert( sl, (void *)67 ); sl_iterate( sl, print ); printf( "\n" ); sl_insert( sl, (void *)68 ); sl_iterate( sl,print ); printf( "\n" ); sl_insert( sl, (void *)65 ); sl_iterate( sl, print ); printf( "\n" ); sl_destroy( sl ); return 0; } libmaa-1.3.2/sltest.out010064400017500000000000000006000611415632400143350ustar cheusovwheelRunning test for count of 10 adding 1 adding 2 adding 3 adding 4 adding 5 adding 6 adding 7 adding 8 adding 9 1 2 3 4 5 6 7 8 9 1 2 3 4 6 7 8 9 0 1 2 3 4 6 7 8 9 0 1 2 3 4 6 7 8 9 66 0 1 2 3 4 6 7 8 9 66 100 -1 0 1 2 3 4 6 7 8 9 66 100 -1 0 1 2 3 4 5 6 7 8 9 66 100 -1 0 1 2 3 4 5 6 7 8 9 66 67 100 -1 0 1 2 3 4 5 6 7 8 9 66 67 68 100 -1 0 1 2 3 4 5 6 7 8 9 65 66 67 68 100 libmaa-1.3.2/source.c010064400017500000000000000275501111676220300137440ustar cheusovwheel/* source.c -- Source code management for Libmaa * Created: Mon Dec 26 19:42:03 1994 by faith@dict.org * Copyright 1994-1998, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Source Code Management} * * \intro Most of the source code management routines are designed to be * called from within a lexical analyzer. The routines support the storage * and retrieval of source code lines and source code token information. A * single, global, source code management object is supported. * * \textbf{This documentation is incomplete.} * * \textbf{These routines have not been fully implemented.} * */ #include "maaP.h" typedef struct source { const char *file; int line; int offset; int length; int index; } sourceType; #define INCREMENT 1000 static const char **Lines; static int Count; static int Used; static sourceType Info; static mem_String StringHeap; static mem_Object InfoHeap; /* \doc The |src_create| functions initializes the global source code management object. This routine should only be called once, if at all. If the other routines are used as expected, |src_create| will be called automatically when it is needed. */ void src_create( void ) { if (Lines) err_fatal( __func__, "Source manager already created\n" ); Lines = xmalloc( (Count = INCREMENT) * sizeof( char * ) ); StringHeap = mem_create_strings(); InfoHeap = mem_create_objects( sizeof( struct source ) ); } /* \doc |src_destroy| frees all memory associated with the global source code management object. */ void src_destroy( void ) { if (!Lines) return; mem_destroy_objects( InfoHeap ); mem_destroy_strings( StringHeap ); xfree( Lines ); /* terminal */ Lines = StringHeap = InfoHeap = NULL; } /* \doc |src_line| stores a |line| of length |len|. */ const char *src_line( const char *line, int len ) { char *pt; if (!Lines) src_create(); ++Info.line; Info.index = Used; Info.offset = 0; Lines[Used] = mem_strncpy( StringHeap, line, len ); for (pt = (char *)Lines[Used]; *pt; pt++) if (*pt == '\t') *pt = ' '; PRINTF(MAA_SRC,("Line %d: %s",Used,Lines[Used])); if (++Used >= Count) Lines = xrealloc( Lines, (Count += INCREMENT) * sizeof( char * ) ); return Lines[ Used - 1 ]; } /* \doc |src_new_file| specifies that |filename| is the name of the current file being read by the lexer. */ void src_new_file( const char *filename ) { Info.file = str_find( filename ); } /* \doc |src_new_line| specifies that |line| is the number of the current line being read by the lexer. Line numbers start at 1. */ void src_new_line( int line ) { Info.line = line; } /* \doc |src_advance| is used to advance the token offset pointer |length| bytes. */ void src_advance( int length ) { Info.offset += length; } void src_cpp_line( const char *line, int length ) { arg_List args; char *tmp = alloca( length + 1 ); int lineno; strncpy( tmp, line, length ); tmp [ length ] = '\0'; args = arg_argify( tmp, 0 ); if ((lineno = atoi( arg_get( args, 1 ) )) > 0) --lineno; else lineno = 1; src_new_line( lineno ); /* FIXME! This is debugging cruft to be removed. */ if (arg_count( args ) == 2) { PRINTF(MAA_SRC,( "lineno %s\n", arg_get( args, 1 ) )); } else { PRINTF(MAA_SRC,( "lineno %s in %s\n", arg_get( args, 1 ), arg_get( args, 2 ) )); src_new_file( arg_get( args, 2 ) ); } arg_destroy( args ); } /* \doc |src_get| is used to get a |src_Type| object for the current token. This object contains file, line, offset, and length information which can be used to print parse error messages and provide detailed token tracking. */ src_Type src_get( int length ) { sourceType *new; if (!Lines) err_fatal( __func__, "Source manager does not exist\n" ); Info.length = length; new = mem_get_object( InfoHeap ); new->file = Info.file; new->line = Info.line; new->offset = Info.offset; new->length = Info.length; new->index = Info.index; /* Index into Lines array. */ if (dbg_test(MAA_SRC)) { printf( "%s:%d @ %d, %d; %d\n", new->file, new->line, new->offset, new->length, new->index ); } src_advance( length ); return new; } /* \doc |src_filename| returns the |file| associated with the specified |source| information. */ const char *src_filename( src_Type source ) { sourceType *s = (sourceType *)source; if (!Lines) err_fatal( __func__, "Source manager never created\n" ); return s ? s->file : ""; } /* \doc |src_linenumber| returns the |line| associated with the specified |source| information. */ int src_linenumber( src_Type source ) { sourceType *s = (sourceType *)source; if (!Lines) err_fatal( __func__, "Source manager never created\n" ); return s ? s->line : 0; } /* \doc |src_offset| returns the token |offset| associated with the specified |source| information. */ int src_offset( src_Type source ) { sourceType *s = (sourceType *)source; if (!Lines) err_fatal( __func__, "Source manager never created\n" ); return s ? s->offset : 0; } /* \doc |src_length| returns the token |length| associated with the specified |source| information. */ int src_length( src_Type source ) { sourceType *s = (sourceType *)source; if (!Lines) err_fatal( __func__, "Source manager never created\n" ); return s ? s->length : 0; } /* \doc |src_source_line| returns the full source line associated with the specified |source| information. */ const char *src_source_line( src_Type source ) { sourceType *s = (sourceType *)source; if (!Lines) err_fatal( __func__, "Source manager never created\n" ); return s ? Lines[ s->index ] : ""; } /* \doc |src_get_stats| returns the statistics associated with the source code manager. The |src_Stats| structure is shown in \grind{src_Stats}. */ src_Stats src_get_stats( void ) { src_Stats s = xmalloc( sizeof( struct src_Stats ) ); if (Lines) { mem_StringStats ms = mem_get_string_stats( StringHeap ); mem_ObjectStats mo = mem_get_object_stats( InfoHeap ); s->lines_used = Used; s->lines_allocated = Count; s->lines_bytes = ms->bytes; s->tokens_total = mo->total; s->tokens_reused = mo->reused; s->tokens_size = mo->size; xfree( ms ); /* rare */ xfree( mo ); /* rare */ } else { s->lines_used = 0; s->lines_allocated = 0; s->lines_bytes = 0; s->tokens_total = 0; s->tokens_reused = 0; s->tokens_size = 0; } return s; } /* \doc |src_print_stats| prints the statistics about the source code manager to the specified |stream|. If |stream| is "NULL", then "stdout" will be used. */ void src_print_stats( FILE *stream ) { FILE *str = stream ? stream : stdout; src_Stats s = src_get_stats(); fprintf( str, "Statistics for source manager:\n" ); fprintf( str, " %d lines using %d bytes (%d allocated)\n", s->lines_used, s->lines_bytes, s->lines_allocated ); fprintf( str, " %d tokens using %d bytes (%d reused)\n", s->tokens_total, s->tokens_total * s->tokens_size, s->tokens_reused ); xfree( s ); /* rare */ } static void _src_print_yyerror( FILE *str, const char *message ) { const char *pt; char buf[1024]; char *b; const char *concrete; assert( str ); if (!message) { fprintf( str, "(null)" ); return; } for (pt = message; *pt; pt++) { if (*pt == '`') { /* clean up character constants */ if (pt[1] == '`' && pt[2] && pt[3] == '\'' && pt[4] == '\'') { fprintf( str, "`%c'", pt[2] ); pt += 4; } else if (pt[1] == 'T' && pt[2] == '_') { /* replace symbols */ for (b = buf, ++pt; *pt && *pt != '\''; b++, pt++) *b = *pt; *b = '\0'; if ((concrete = prs_concrete( buf ))) fprintf( str, "`%s'", concrete ); else fprintf( str, "`%s'", buf ); } else putc( *pt, str ); } else putc( *pt, str ); } } /* \doc |src_print_line| prints a line of source code, as described by |source| to the specified |stream|. If |stream| is "NULL", then "stdout" will be used. */ void src_print_line( FILE *stream, src_Type source ) { sourceType *s = (sourceType *)source; FILE *str = stream ? stream : stdout; if (s) fprintf( str, "%s:%d: %s", s->file, s->line, Lines[ s->index ] ); else fprintf( str, "?:?: \n" ); } static void _src_print_error( FILE *str, sourceType *s, int fudge ) { int i; assert( str ); src_print_line( str, s ); if (s) { PRINTF(MAA_SRC,("s->offset = %d, fudge = %d, s->length = %d\n", s->offset, fudge, s->length )); fprintf( str, "%s:%d: ", s->file, s->line ); for (i = 0; i < s->offset - fudge; i++) putc( ' ', str ); for (i = 0; i < s->length; i++) putc( '^', str ); } else { fprintf( str, "?:?: " ); } putc( '\n', str ); } /* \doc |src_parse_error| will print the error |message| to the specified |stream|, followed by the offending line of source code, as specified by |source|. If |stream| is "NULL", then "stdout" will be used. It is assumed that |message| has the format of |yyerror| so that massaging of the string can be performed to make it more readable (token names are assumed to start with ``T\_'' and will be changed to more readable names). This massaging should be done by a user-defined function, since it is relatively specific to this author's coding conventions. */ void src_parse_error( FILE *stream, src_Type source, const char *message ) { sourceType *s = (sourceType *)source; FILE *str = stream ? stream : stdout; if (s) fprintf( str, "%s:%d: ", s->file, s->line ); else fprintf( str, "?:?: " ); _src_print_yyerror( str, message ); putc( '\n', str ); _src_print_error( str, s, 0 ); } /* \doc |src_print_error| will print an arbitrary error, specified as for |printf| by the |format| variable, to the specified |stream|, followed by the line of source code specified by |source|. If |stream| is "NULL", then "stdout" will be used. */ void src_print_error( FILE *str, src_Type source, const char *format, ... ) { va_list ap; sourceType *s = (sourceType *)source; fflush( str ); if (format) { if (s) fprintf( str, "%s:%d: ", s->file, s->line ); else fprintf( str, "?:?: " ); va_start( ap, format ); vfprintf( str, format, ap ); va_end( ap ); putc( '\n', str ); } _src_print_error( str, s, 0 ); } /* \doc |src_print_message| will just print a message labeled with a line. */ void src_print_message( FILE *str, src_Type source, const char *format, ... ) { va_list ap; sourceType *s = (sourceType *)source; fflush( str ); if (format) { if (s) fprintf( str, "%s:%d: ", s->file, s->line ); else fprintf( str, "?:?: " ); va_start( ap, format ); vfprintf( str, format, ap ); va_end( ap ); putc( '\n', str ); } } libmaa-1.3.2/stack.c010064400017500000000000000065411111676220300135460ustar cheusovwheel/* stack.c -- Stack routines for Khepera * Created: Wed Nov 9 19:40:00 1994 by faith@dict.org * Copyright 1994, 1995, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{Stack Routines} * * \intro The stack routines provide support for a general stack of * pointers to "void". Because of the simplicity of the stack object, no * statistics are maintained. (Althought the list routines can also be used * as a stack, the stack implemented here is more efficient.) * */ #include "maaP.h" #include "obstack.h" #ifdef DMALLOC_FUNC_CHECK /* Must be true functions */ #define obstack_chunk_alloc malloc #define obstack_chunk_free free #else #define obstack_chunk_alloc xmalloc #define obstack_chunk_free xfree #endif typedef struct data { const void *datum; struct data *prev; } *dataType; typedef struct stack { struct data *data; struct obstack *obstack; } *stackType; /* \doc |stk_create| initializes a stack object. */ stk_Stack stk_create( void ) { stackType s; s = xmalloc( sizeof( struct stack ) ); s->data = NULL; s->obstack = xmalloc( sizeof( struct obstack ) ); obstack_init( s->obstack ); return s; } /* \doc |stk_destroy| destroys all memory associated with the |stack|. The memory used by data is \emph{not} freed---this memory is the responsibility of the user. */ void stk_destroy( stk_Stack stack ) { stackType s = (stackType)stack; obstack_free( s->obstack, NULL ); xfree( s->obstack ); xfree( stack ); /* terminal */ } /* \doc |stk_push| places |datum| on the top of the |stack|. */ void stk_push( stk_Stack stack, void *datum ) { stackType s = (stackType)stack; dataType d = (dataType)obstack_alloc( s->obstack, sizeof( struct data ) ); d->datum = datum; d->prev = s->data; s->data = d; } /* \doc |stk_pop| removes the top of the |stack| and returns the pointer. If the |stack| is empty, |stk_pop| returns "NULL". */ void *stk_pop( stk_Stack stack ) { stackType s = (stackType)stack; void *datum = NULL; if (s->data) { dataType old = s->data; datum = (void *)old->datum; /* Discard const */ s->data = s->data->prev; obstack_free( s->obstack, old ); } return datum; } /* \doc |stk_top| returns a pointer to the datum on the top of the |stack|, but does \emph{not} remove this datum from the |stack|. If the |stack| is empty, |stk_pop| returns "NULL". */ void *stk_top( stk_Stack stack ) { stackType s = (stackType)stack; if (s->data) return (void *)s->data->datum; /* Discard const */ return NULL; } libmaa-1.3.2/string.c010064400017500000000000000303011165050332400137360ustar cheusovwheel/* string.c -- String pool for Khepera * Created: Wed Dec 21 21:32:34 1994 by faith@dict.org * Copyright 1994-1997, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * \section{String Pool Routines} * * \intro These routines provide support for string pool objects. In * general, only the |str_find| and |str_findn| functions will be used. * This function takes a pointer to a null-terminated string and returns a * pointer to another null-terminated string which contains the same * information. The pointer returned will be identical for all identical * strings. Memory for string storage is automatically reclaimed at * program termination on systems that support |atexit| or |on_exit|. * */ #include "maaP.h" static str_Pool global; typedef struct poolInfo { mem_String string; hsh_HashTable hash; } *poolInfo; /* \doc |str_pool_create| initialized a string pool object. */ str_Pool str_pool_create( void ) { poolInfo pool = xmalloc( sizeof( struct poolInfo ) ); pool->string = mem_create_strings(); pool->hash = hsh_create( NULL, NULL ); return pool; } /* \doc |str_pool_destroy| destroys the string pool object, |pool|, and all memory associated with it. */ void str_pool_destroy( str_Pool pool ) { poolInfo p = (poolInfo)pool; if (!p || !p->string || !p->hash) err_fatal( __func__, "String pool improperly initialized\n" ); mem_destroy_strings( p->string ); hsh_destroy( p->hash ); xfree( p ); /* terminal */ } /* \doc |str_pool_exists| returns non-zero if the string, |s|, is already in the string pool, |pool|. */ int str_pool_exists( str_Pool pool, const char *s ) { const char *datum; poolInfo p = (poolInfo)pool; if ((datum = hsh_retrieve( p->hash, s ))) return 1; return 0; } /* \doc |str_pool_find| looks up the string, |s|, in the memory associated with the string pool object, |pool|. If the string is found, a pointer to the previously stored string is returned. Otherwise, the string is copied into string pool memory, and a pointer to the newly allocated memory is returned. */ const char *str_pool_find( str_Pool pool, const char *s ) { const char *datum; poolInfo p = (poolInfo)pool; if ((datum = hsh_retrieve( p->hash, s ))) return datum; datum = mem_strcpy( p->string, s ); hsh_insert( p->hash, datum, datum ); return datum; } /* \doc |str_pool_iterate| is used to iterate a function over every value in the |pool|. The function, |iterator|, is passed the |s| for each entry in the pool. If |iterator| returns a non-zero value, the iterations stop, and |str_pool_iterate| returns non-zero. Note that the keys are in some arbitrary order, and that this order may change between two successive calls to |str_pool_iterate|. */ int str_pool_iterate( str_Pool pool, int (*iterator)( const char *s ) ) { poolInfo p = (poolInfo) pool; hsh_HashTable hash = p -> hash; hsh_Position hash_pos; void *key; /* printf ("inside str_pool_iterate\n"); */ HSH_ITERATE_KEYS (hash, hash_pos, key){ if ((*iterator) ((const char *) key)) return 1; } return 0; } /* \doc |str_pool_iterate| is used to iterate a function over every value in the |pool|. The function, |iterator|, is passed the |s| for each entry in the pool. If |iterator| returns a non-zero value, the iterations stop, and |str_pool_iterate| returns non-zero. Note that the keys are in some arbitrary order, and that this order may change between two successive calls to |str_pool_iterate|. */ int str_pool_iterate_arg( str_Pool pool, int (*iterator)( const char *s, void *arg ), void *arg ) { poolInfo p = (poolInfo) pool; hsh_HashTable hash = p -> hash; hsh_Position hash_pos; void *key; HSH_ITERATE_KEYS (hash, hash_pos, key){ if ((*iterator) (key, arg)){ HSH_ITERATE_END (hash); return 1; } } return 0; } str_Position str_pool_init_position (str_Pool pool) { poolInfo p = (poolInfo) pool; return hsh_init_position (p -> hash); } str_Position str_pool_next_position (str_Pool pool, str_Position position) { poolInfo p = (poolInfo) pool; return hsh_next_position (p -> hash, position); } void str_pool_get_position (str_Position position, char const * const*key) { hsh_get_position (position, (void **) key); } /* \doc |str_pool_copy| returns a copy of the string, |s|, using memory from the string pool object, |pool|. This can be used for data that is known to be unique. No checks are made for uniqueness, however; and a pointer to the string is not placed in the hash table. */ const char *str_pool_copy( str_Pool pool, const char *s ) { poolInfo p = (poolInfo)pool; return mem_strcpy( p->string, s ); } /* \doc |str_pool_copyn| returns a copy of the string, |s|, using memory from the string pool object, |pool|. The string will be |length| bytes long, and will be "NULL" terminated. This can be used for data that is known to be unique. No checks are made for uniqueness, however; and a pointer to the string is not placed in the hash table. */ const char *str_pool_copyn( str_Pool pool, const char *s, int length ) { poolInfo p = (poolInfo)pool; return mem_strncpy( p->string, s, length ); } /* \doc |str_pool_grow| will grow a string in the specified |pool| until |str_pool_finish| is called. There must not be any other calls to modify the specified string |pool| between the first call to |str_pool_grow| and the call to |str_pool_finish|. */ void str_pool_grow( str_Pool pool, const char *s, int length ) { poolInfo p = (poolInfo)pool; mem_grow( p->string, s, length ); } /* \doc |str_pool_finish| will finish the growth of a string performed by multiple calls to |str_pool_grow|. The string will be null terminated and will be entered into the specified string |pool|. Calls to |str_pool_grow| follows by a call to |str_pool_finish| is equivalent to a single call to |str_pool_find|. */ const char *str_pool_finish( str_Pool pool ) { poolInfo p = (poolInfo)pool; const char *datum; mem_grow( p->string, "\0", 1 ); /* guarantee null termination */ datum = mem_finish( p->string ); hsh_insert( p->hash, datum, datum ); return datum; } /* \doc |str_pool_get_stats| returns statistics about the specified string |pool|. The |str_Stats| structure is shown in \grind{str_Stats}. */ str_Stats str_pool_get_stats( str_Pool pool ) { poolInfo p = (poolInfo)pool; str_Stats s = xmalloc( sizeof( struct str_Stats ) ); if (p) { mem_StringStats m = mem_get_string_stats( p->string ); hsh_Stats h = hsh_get_stats( p->hash ); s->count = m->count; s->bytes = m->bytes; s->retrievals = h->retrievals; s->hits = h->hits; s->misses = h->misses; xfree( h ); /* rare */ xfree( m ); /* rare */ } else { s->count = 0; s->bytes = 0; s->retrievals = 0; s->hits = 0; s->misses = 0; } return s; } /* \doc |str_pool_print_stats| prints the statistics for the specified string |pool| on the specified |stream|. If |stream| is "NULL", then "stdout" will be used. */ void str_pool_print_stats( str_Pool pool, FILE *stream ) { FILE *str = stream ? stream : stdout; str_Stats s = str_pool_get_stats( pool ); fprintf( str, "Statistics for %sstring pool at %p:\n", pool == global ? "global " : "", pool ); fprintf( str, " %d strings using %d bytes\n", s->count, s->bytes ); fprintf( str, " %d retrievals (%d from top, %d failed)\n", s->retrievals, s->hits, s->misses ); xfree( s ); /* rare */ } static void _str_check_global( void ) { if (!global) global = str_pool_create(); } /* \doc |str_exists| acts like |str_pool_exists|, except the global string pool is used. */ int str_exists( const char *s ) { return str_pool_exists( global, s ); } /* \doc |str_find| acts like |str_pool_find|, except the global string pool is used. If the global string pool has not been initialized, it will be initialized automatically. Further, on systems that support |atexit| or |on_exit|, |str_destroy| will be called automatically at program termination. */ const char *str_find( const char *s ) { _str_check_global(); return str_pool_find( global, s ); } /* \doc |str_findn| acts like |str_find|, except that the length of the string is specified, and the string does not have to be "NULL" terminated. */ const char *str_findn( const char *s, int length ) { char *tmp = alloca( sizeof( char ) * (length + 1) ); _str_check_global(); strncpy( tmp, s, length); tmp [ length ] = 0; return str_pool_find( global, tmp ); } /* \doc |str_copy| acts like |str_pool_copy|, except the global string pool is used. If the global string pool has not been initialized, it will be initialized automatically. Further, on systems that support |atexit| or |on_exit|, |str_destroy| will be called automatically at program termination. */ const char *str_copy( const char *s ) { _str_check_global(); return str_pool_copy( global, s ); } /* \doc |str_copyn| acts like |str_copy|, except that the length of the string is specified, and the string does not have to be "NULL" terminated. */ const char *str_copyn( const char *s, int length ) { return str_pool_copyn( global, s, length ); } /* \doc |str_grow| will grow a string until |str_finish| is called. There must not be any other calls to modify the global string pool between the first call to |str_grow| and the call to |str_finish|. */ void str_grow( const char *s, int length ) { _str_check_global(); str_pool_grow( global, s, length ); } /* \doc |str_finish| will finish the growth of a string performed by multiple calls to |str_grow|. The string will be null terminated and will be entered into the global string pool tables. Calls to |str_grow| follows by a call to |str_finish| is equivalent to a single call to |str_findn|. */ const char *str_finish( void ) { _str_check_global(); return str_pool_finish( global ); } /* \doc |str_unique| returns a unique string with the given prefix. This is not the most pretty way to generate unique strings, and should be improved. The string is placed in the string pool and does not need to be freed. */ const char *str_unique( const char *prefix ) { static int i = 1; char *buf = alloca( strlen( prefix ) + 100 ); do { sprintf( buf, "%s%d", prefix, i++ ); } while (str_exists( buf )); return str_find( buf ); } /* \doc |str_destroy| frees all of the memory associated with the global string pool. Since this function is called automatically at program termination on systems that support |atexit| or |on_exit|, there should be no need to call this function explicitly. If this function is called explicitly, the next call to |str_find| will re-initialize the global string pool. */ void str_destroy( void ) { if (global) str_pool_destroy( global ); global = NULL; } /* \doc |str_get_stats| returns statistics about the global string pool. The |str_Stats| structure is shown in \grindref{fig:strStats}. */ str_Stats str_get_stats( void ) { return str_pool_get_stats( global ); } /* \doc |str_print_stats| prints the statistics for the global string pool on the specified |stream|. If |stream| is "NULL", then "stdout" will be used. */ void str_print_stats( FILE *stream ) { str_pool_print_stats( global, stream ); } libmaa-1.3.2/stringtest.c010064400017500000000000000035171111676220300146470ustar cheusovwheel/* stringtest.c -- Test program for Khepera string table routines * Created: Thu Dec 22 14:05:57 1994 by faith@dict.org * Copyright 1994, 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 1, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" #include int main( int argc, char **argv ) { int i; int count; const char **orig; char buf[100]; maa_init( argv[0] ); if (argc == 1) { count = 100; } else if (argc != 2 ) { fprintf( stderr, "usage: stringtest count\n" ); return 1; } else { count = atoi( argv[1] ); } orig = xmalloc( count * sizeof( const char ** ) ); printf( "Running test for count of %d\n", count ); for (i = 0; i < count; i++) { sprintf( buf, "key%d", i ); orig[i] = str_find( buf ); } for (i = 0; i < count; i++) { const char *this; sprintf( buf, "key%d", i ); this = str_find( buf ); if (orig[i] != this) printf( "Pointers are different for \"%s\" (\"%s\"): %p and %p\n", buf, this, orig[i], this ); } xfree( orig ); printf( "Done.\n" ); return 0; } libmaa-1.3.2/stringtest.out010064400017500000000000000000440607204154700152320ustar cheusovwheelRunning test for count of 100 Done. libmaa-1.3.2/strlcpy.c010064400017500000000000000033670771447652000141610ustar cheusovwheel/* * Copyright (c) 2001 Richard Kettlewell * 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. 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 ``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. */ #include "maaP.h" size_t strlcpy_libmaa ( char *dest, const char *src, size_t size) { size_t len = strlen (src); if (len < size){ memcpy (dest, src, len + 1); }else{ if (size){ memcpy (dest, src, size - 1); dest [size - 1] = 0; } } return len; } libmaa-1.3.2/strtol.c010064400017500000000000000073420601725423400137740ustar cheusovwheel/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. This file is part of the GNU C Library. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if 0 #include #endif #include #include #include #include #include #ifdef __sparc__ extern int errno; extern int toupper(int); #endif #define CONST const #ifndef UNSIGNED #define UNSIGNED 0 #endif /* Convert NPTR to an `unsigned long int' or `long int' in base BASE. If BASE is 0 the base is determined by the presence of a leading zero, indicating octal or a leading "0x" or "0X", indicating hexadecimal. If BASE is < 2 or > 36, it is reset to 10. If ENDPTR is not NULL, a pointer to the character after the last one converted is stored in *ENDPTR. */ #if UNSIGNED unsigned long int #define strtol strtoul #else long int #endif strtol(CONST char *nptr, char **endptr, int base) { int negative; register unsigned long int cutoff; register unsigned int cutlim; register unsigned long int i; register CONST char *s; register unsigned char c; CONST char *save; int overflow; if (base < 0 || base == 1 || base > 36) base = 10; s = nptr; /* Skip white space. */ while (isspace(*s)) ++s; if (*s == '\0') goto noconv; /* Check for a sign. */ if (*s == '-') { negative = 1; ++s; } else if (*s == '+') { negative = 0; ++s; } else negative = 0; if (base == 16 && s[0] == '0' && toupper(s[1]) == 'X') s += 2; /* If BASE is zero, figure it out ourselves. */ if (base == 0) if (*s == '0') { if (toupper(s[1]) == 'X') { s += 2; base = 16; } else base = 8; } else base = 10; /* Save the pointer so we can check later if anything happened. */ save = s; cutoff = ULONG_MAX / (unsigned long int) base; cutlim = ULONG_MAX % (unsigned long int) base; overflow = 0; i = 0; for (c = *s; c != '\0'; c = *++s) { if (isdigit(c)) c -= '0'; else if (isalpha(c)) c = toupper(c) - 'A' + 10; else break; if (c >= base) break; /* Check for overflow. */ if (i > cutoff || (i == cutoff && c > cutlim)) overflow = 1; else { i *= (unsigned long int) base; i += c; } } /* Check if anything actually happened. */ if (s == save) goto noconv; /* Store in ENDPTR the address of one character past the last character we converted. */ if (endptr != NULL) *endptr = (char *) s; #if !UNSIGNED /* Check for a value that is within the range of `unsigned long int', but outside the range of `long int'. */ if (i > (negative ? - (unsigned long int) LONG_MIN : (unsigned long int) LONG_MAX)) overflow = 1; #endif if (overflow) { errno = ERANGE; #if UNSIGNED return ULONG_MAX; #else return negative ? LONG_MIN : LONG_MAX; #endif } /* Return the result of the appropriate sign. */ return (negative ? - i : i); noconv: /* There was no number to convert. */ if (endptr != NULL) *endptr = (char *) nptr; return 0L; } libmaa-1.3.2/strtoul.c010064400017500000000000000015410601725171100141510ustar cheusovwheel/* Copyright (C) 1991 Free Software Foundation, Inc. This file is part of the GNU C Library. 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define UNSIGNED 1 #include libmaa-1.3.2/text.c010064400017500000000000000046001111676220300134170ustar cheusovwheel/* text.c -- Text manipulation routines for Libmaa * Created: Wed Apr 24 14:51:51 1996 by faith@dict.org * Copyright 1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include #include "maaP.h" /* \doc Given a string, return (in a |static| buffer), the Soundex value for the string. The basic algorithm for the soundex routine is from Donald E. Knuth's THE ART OF COMPUTER PROGRAMMING, Volume 3: Sorting and Searching (Addison-Wesley Publishing Co., 1973, pages 391 and 392). Knuth notes that the method was originally described by Margaret K. Odell and Robert C. Russell [US Patents 1261167 (1918) and 1435663 (1922)]. */ void txt_soundex2( const char *string, char * result /* five chars */ ) { char *pt = result; int upper_case; /* abcdefghijklmnopqrstuvwxyz */ static const char map[] = "01230120022455012623010202"; char previous = 0; char transform; int i; strcpy( result, "Z000" ); for (i = 0; *string && i < 4; ++string) { if (isascii ( (unsigned char) *string ) && isalpha( (unsigned char) *string )) { upper_case = toupper( (unsigned char) *string ); transform = map[ upper_case - 'A' ]; if (!i) { *pt++ = upper_case; ++i; } else { if (transform != '0' && transform != previous) { *pt++ = transform; ++i; } } previous = transform; } } } const char * txt_soundex( const char *string ) { static char buf [5]; txt_soundex2 (string, buf); return buf; } libmaa-1.3.2/timer.c010064400017500000000000000164101111676220300135550ustar cheusovwheel/* timer.c -- Timer support * Created: Sat Oct 7 13:05:31 1995 by faith@dict.org * Copyright 1995-1998, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * \section{Timer Support} * * \intro These routines provide access to a microsecond-resolution time * that can be used for profiling. * */ #include "maaP.h" static hsh_HashTable _tim_Hash; typedef struct tim_Entry { double real; /* wall time in sec */ double self_user; /* user time in sec */ double self_system; /* system time in sec */ double children_user; /* user time in sec */ double children_system; /* system time in sec */ struct timeval real_mark; struct rusage self_mark; struct rusage children_mark; } *tim_Entry; static void _tim_check( void ) { if (!_tim_Hash) _tim_Hash = hsh_create( NULL, NULL ); } /* \doc Start the named timer. */ void tim_start( const char *name ) { tim_Entry entry; _tim_check(); if (!(entry = (tim_Entry)hsh_retrieve( _tim_Hash, name ))) { entry = xmalloc( sizeof( struct tim_Entry ) ); entry->real = 0.0; entry->self_user = 0.0; entry->self_system = 0.0; entry->children_user = 0.0; entry->children_system = 0.0; hsh_insert( _tim_Hash, name, entry ); } #if HAVE_GETTIMEOFDAY gettimeofday( &entry->real_mark, NULL ); #else time( &entry->real_mark.tv_sec ); entry->real_mark.tv_usec = 0; #endif getrusage( RUSAGE_SELF, &entry->self_mark ); getrusage( RUSAGE_CHILDREN, &entry->children_mark ); } /* \doc Stop the named timer. */ void tim_stop( const char *name ) { tim_Entry entry; struct timeval real; struct rusage rusage; #define DIFFTIME(now,then)\ (((now).tv_sec - (then).tv_sec) \ + ((now).tv_usec - (then).tv_usec)/1000000) _tim_check(); #if HAVE_GETTIMEOFDAY gettimeofday( &real, NULL ); #else time( &real.tv_sec ); real.tv_usec = 0; #endif if (!(entry = (tim_Entry)hsh_retrieve( _tim_Hash, name ) )) err_internal ( __func__, "No timer: %s\n", (name ? name : "") ); entry->real = DIFFTIME( real, entry->real_mark ); getrusage( RUSAGE_SELF, &rusage ); entry->self_user = DIFFTIME( rusage.ru_utime, entry->self_mark.ru_utime ); entry->self_system = DIFFTIME( rusage.ru_stime, entry->self_mark.ru_stime ); getrusage( RUSAGE_CHILDREN, &rusage ); entry->children_user = DIFFTIME( rusage.ru_utime, entry->children_mark.ru_utime ); entry->children_system = DIFFTIME( rusage.ru_stime, entry->children_mark.ru_stime ); } /* \doc Reset the named timer to zero elapsed time. Use |tim_start| to reset the start time. */ void tim_reset( const char *name ) { tim_Entry entry; _tim_check(); if (!(entry = (tim_Entry)hsh_retrieve( _tim_Hash, name ) )) err_internal ( __func__, "No timer: %s\n", (name ? name : "") ); entry->real = 0.0; entry->self_user = 0.0; entry->self_system = 0.0; entry->children_user = 0.0; entry->children_system = 0.0; } /* \doc Get the wall time in seconds from the named timer. The return value is a |double| and has microsecond resolution if the current system provides that accuracy (most don't). */ double tim_get_real( const char *name ) { tim_Entry entry; _tim_check(); if (!(entry = (tim_Entry)hsh_retrieve( _tim_Hash, name ) )) err_internal ( __func__, "No timer: %s\n", (name ? name : "") ); return entry->real; } /* \doc Get the number of seconds of user CPU time. */ double tim_get_user( const char *name ) { tim_Entry entry; _tim_check(); if (!(entry = (tim_Entry)hsh_retrieve( _tim_Hash, name ) )) err_internal ( __func__, "No timer: %s\n", (name ? name : "") ); #if 0 printf( "self: maxrss %ld ixrss %ld idrss %ld isrss %ld minflt %ld" " majflt %ld nswap %ld inblock %ld outblock %ld msgsnd %ld" " msgrcv %ld nsignals %ld nvcwm %ld nivcsm %ld\n", entry->self_mark.ru_maxrss, entry->self_mark.ru_ixrss, entry->self_mark.ru_idrss, entry->self_mark.ru_isrss, entry->self_mark.ru_minflt, entry->self_mark.ru_majflt, entry->self_mark.ru_nswap, entry->self_mark.ru_inblock, entry->self_mark.ru_oublock, entry->self_mark.ru_msgsnd, entry->self_mark.ru_msgrcv, entry->self_mark.ru_nsignals, entry->self_mark.ru_nvcsw, entry->self_mark.ru_nivcsw ); printf( "chld: maxrss %ld ixrss %ld idrss %ld isrss %ld minflt %ld" " majflt %ld nswap %ld inblock %ld outblock %ld msgsnd %ld" " msgrcv %ld nsignals %ld nvcwm %ld nivcsm %ld\n", entry->children_mark.ru_maxrss, entry->children_mark.ru_ixrss, entry->children_mark.ru_idrss, entry->children_mark.ru_isrss, entry->children_mark.ru_minflt, entry->children_mark.ru_majflt, entry->children_mark.ru_nswap, entry->children_mark.ru_inblock, entry->children_mark.ru_oublock, entry->children_mark.ru_msgsnd, entry->children_mark.ru_msgrcv, entry->children_mark.ru_nsignals, entry->children_mark.ru_nvcsw, entry->children_mark.ru_nivcsw ); #endif return (entry->self_user + entry->children_user); } /* \doc Get the number of seconds of system CPU time. */ double tim_get_system( const char *name ) { tim_Entry entry; _tim_check(); if (!(entry = (tim_Entry)hsh_retrieve( _tim_Hash, name ) )) err_internal ( __func__, "No timer: %s\n", (name ? name : "") ); return (entry->self_system + entry->children_system); } /* \doc Print the named timer values to |str|. The format is similar to "time(1)". */ void tim_print_timer( FILE *str, const char *name ) { fprintf( str, "%-20s %0.3fr %0.3fu %0.3fs\n", name, tim_get_real( name ), tim_get_user( name ), tim_get_system( name ) ); } static int _tim_iterator( const void *key, const void *datum, void *arg ) { FILE *str = (FILE *)arg; tim_print_timer( str, key ); return 0; } /* \doc Print all the timers to |str|. The order is arbitary. */ void tim_print_timers( FILE *str ) { if (_tim_Hash) hsh_iterate_arg( _tim_Hash, _tim_iterator, str ); } static int _tim_freer( const void *key, const void *datum ) { xfree( (void *)datum ); /* Discard const */ return 0; } /* \doc Free all memory associated with the timers. This function is called automatically at program termination. There should never be a need to call this function in user-level code. */ void _tim_shutdown( void ) { if (_tim_Hash) { hsh_iterate( _tim_Hash, _tim_freer ); hsh_destroy( _tim_Hash ); } _tim_Hash = NULL; } libmaa-1.3.2/xmalloc.c010064400017500000000000000041301130002213000140470ustar cheusovwheel/* xmalloc.c -- Error-checking malloc * Created: Sun Nov 6 18:14:10 1994 by faith@dict.org * Copyright 1994-1996, 2002 Rickard E. Faith (faith@dict.org) * Copyright 2002-2008 Aleksey Cheusov (vle@gmx.net) * * 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 Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include "maaP.h" #if STDC_HEADERS #include #else void *malloc(); void *calloc(); void *realloc(); void free(); #endif #ifndef DMALLOC_FUNC_CHECK void *xmalloc( size_t size ) { void *pt = malloc( size ); if (!pt) err_fatal( __func__, "Out of memory while allocating %lu bytes\n", (unsigned long)size ); return pt; } void *xcalloc( size_t num, size_t size ) { void *pt = calloc( num, size ); if (!pt) err_fatal( __func__, "Out of memory while allocating %lu X %lu byte block\n", (unsigned long)num, (unsigned long)size ); return pt; } void *xrealloc( void *pt, size_t size ) { void *new = realloc( pt, size ); if (!new) err_fatal( __func__, "Out of memory while reallocating block at %p to" " %lu bytes\n", pt, (unsigned long)size ); return new; } void xfree( void *pt ) { if (pt) free( pt ); else err_fatal( __func__, "Attempt to free null pointer\n" ); } char *xstrdup( const char *s ) { size_t len = strlen (s); char *pt = xmalloc (len + 1); if (!pt) err_fatal( __func__, "Out of memory while duplicating string\n" ); memcpy (pt, s, len + 1); return pt; } #endif libmaa-1.3.2/ChangeLog010064400017500000000000002173131200301154300140360ustar cheusovwheel2012-07-22 cheusov * NEWS, configure.in: Version -> 1.3.2 Build failure on cygwin was fixed (sf.net bug #3398121) __inline__ directives were removed * maaP.h: attempt to fix sf.net bug #3398121 * bit.c, debug.c, flags.c, maa.h: __inline__ directives were removed 2011-10-22 cheusov * NEWS, configure.in: Version -> 1.3.1. NEWS update * prtest.c: fix for build failure with gcc-4.6 * pr.c, string.c: another fixes for gcc-4.6 * maa.h, string.c: Fixed: compilation failure with gcc-4.6. Thanks to Andrey N. Oktyabrski for the report. 2011-04-10 cheusov * NEWS: minor fix * Makefile.in, NEWS, configure.in: Version -> 1.3.0 Only maa's symbols are exported from libmaa shared library (export.sym). 'libtool -export-symbols' is used for this to work. | DUE TO THIS IN ORDER TO AVOID POTENTIAL ABI INCOMPATIBILITIES, I'VE INCREASED MAJOR VERSION OF THE SHARED LIBRARY. FIXED: when both stream/file and syslog logging facilities are enabled, log_info() and other logging functions segfault on NetBSD-5.1/x86_64. va_copy magic was needed to fix this problem. It is assumed that strchr(3) is always available (no autoconf check). The same for unistd.h header file. CFLAGS set by user may override default -Wall -Werror set for GCC. Fix for warning messages produced by SunPro compiler (integer overflow detected: op "<<") -c flag was added to INSTALL_DATA invocation FIXED: compilation error on CentOS-5.4 FIXED: "make test" failed on OpenBSD-3.8. This system defines intptr_t in inttypes.h, not in stdint.h 2011-01-08 cheusov * Makefile.in, log.c: FIX: when both stream/file and syslog logging facilities are enabled, log_info() and other logging functions segfault on NetBSD-5.1. va_copy was needed to fix this problem. 2011-01-03 cheusov * maaP.h, configure.in: Always #include 2010-09-05 cheusov * export.sym: add bit_* functions * Makefile.in: ${srcdir}/ prefix for export.sym 2010-09-04 cheusov * export.sym: FIX: unexpected * sign. Thank you Darwin! * Makefile.in, export.sym: explicitely list exported symbols 2010-08-22 cheusov * Makefile.in: Add -c flag to INSTALL_DATA invocation 2010-05-01 cheusov * maa.h: Fix for warning messages produced by SunPro compiler (integer overflow detected: op "<<") 2010-04-11 cheusov * configure.in: CFLAGS set by user may override default -Wall -Werror set for GCC 2010-03-24 cheusov * maaP.h, configure.in: fixed: compilation error on CentOS-5.4 2009-12-13 cheusov * configure.in, maaP.h: FIXED: "make test" failed on OpenBSD-3.8. This system defines intptr_t in inttypes.h, but in stdint.h 2009-11-18 cheusov * NEWS: Notes about release 1.2.0 2009-11-15 cheusov * Makefile.in: more fixes for bsdmake/gnumake * Makefile.in: fix for "logtest" executable * Makefile.in, configure.in, maa.h, xmalloc.c: xmalloc, xrealloc and xcalloc function take size_t args, not unsigned int. !!! Major shared library number is changed from 1 to 2 !!! * Makefile.in: fix for previous commit * Makefile.in: GNU make is not required anymore, bsd make is good enough 2009-10-17 cheusov * configure.in, maaP.h: fix for sltest.c: in OpenBSD intptr_t is defined in stdint.h 2009-03-01 cheusov * logtest.sh: yet another fix in test 2009-02-28 cheusov * logtest.sh, logtest.sh.out: fix for test * logtest.sh: fixes 2009-02-27 cheusov * Makefile.in: fixes for logtest.sh * logtest.c, logtest.sh, logtest.sh.out, Makefile.in: New trivial test for log.c 2009-01-31 cheusov * NEWS: minor fix * NEWS: release notes * Makefile.in: clean-ups * configure.in: clean-ups, TEENY -> 1 2008-12-29 cheusov * sltest.c: fixed: gcc warning * sltest.c: fix for sf.net bug #2473314 (bigendian/PPC) 2008-12-24 cheusov * Makefile.in: fix building test tools ($LIBS) * Makefile.in: LDFLAGS/LIBS passed to configure script is used to build library and test utilities 2008-12-07 cheusov * maa.h, maaP.h: no $Id$ - I dislike it * configure.in, maaP.h: 'Revised ...' removed copyleft added * Makefile.in: autoheader+autoconf -> cvsdist target * Makefile.in: minor fix in cvsdist target * Makefile.in: correct mail addresses in ChangeLog * Makefile.in: no Makefile.conf in libmaa * configure.in: fix in checking for presense of system-wide (libc) 'facilitynames' array * configure.in, getopt.c, getopt.h, getopt1.c: I don't know any platform that has no getopt(3). Maintaining platforms existed in 70th is not my goal. If this change breaks something you really need, let me know. * arg.c, argtest.c, base26.c, base64.c, basetest.c, bit.c, bittest.c, debug.c, debugtest.c, error.c, flags.c, hash.c, hashtest.c, list.c, listtest.c, log.c, maa.c, memory.c, memtest.c, mkrnd.c, parse-concrete.c, pr.c, prime.c, primetest.c, prtest.c, rnd.c, set.c, settest.c, sl.c, sltest.c, source.c, stack.c, string.c, stringtest.c, text.c, timer.c, xmalloc.c: I removed '$Id...$ from source code because I hate it. * arg.c, argtest.c, base26.c, base64.c, basetest.c, bit.c, bittest.c, debug.c, debugtest.c, error.c, flags.c, hash.c, hashtest.c, list.c, listtest.c, log.c, maa.c, memory.c, memtest.c, mkrnd.c, parse-concrete.c, pr.c, prime.c, primetest.c, prtest.c, rnd.c, set.c, settest.c, sl.c, sltest.c, source.c, stack.c, string.c, stringtest.c, text.c, timer.c, xmalloc.c: 'Revised ... by...' comment lines removed, CVS knows better what was revised and when My copyleft added * NEWS, configure.in: version -> 1.1.0 release notes added * configure.in: clean-ups * Makefile.in, configure.in: xmalloc is an essensial part of libmaa * Makefile.in, configure.in: libtool -version-info 1:0 other clean-ups * configure.in: no $Id$ * configure.in: no '-g' hardcode for !gcc compilers no '-g -O' for gcc clean-ups in comments * Makefile.in, maa.c, version.c: removed: version.c 'dist' target -> 'cvsdist' cvsdist clean-ups 2008-11-28 cheusov * hashtest.c, hashtest.out: Statistic about hash table is not output from hashtest.c regression test. This is because it fails under 64-bit platforms. * settest.c, settest.out: Hash table statistics is removed from settest.c regression test. This is because it fails under 64-platforms. 2008-11-23 cheusov * Makefile.in: -I${srcdir} added 2008-11-15 cheusov * Makefile.in: yet another fix in target "distclean" 2008-11-10 cheusov * sltest.c: fixed: compilation bug in Linux/x86-64 2008-10-25 cheusov * log.c: compilation on ALTlinux fixed: write(2) is marked as WUR, i.e. returned value MUST be checked 2008-10-18 cheusov * Makefile.in, configure.in: added: cvsclean target minor fixes * Makefile.in, configure.in, maa.c: MAA_TEENY added. Now libmaa-1.0.3 maa_version_teeny function returning MAA_TEENY REMOVED: XTRAHEADERS, TARGETLIBS, RPATHFLAGS configure variables. Also removed are --with-purify, --with-insure, --with-efence, --with-checker, --with-local-dmalloc, --with-dmalloc, --with-gprof, --with-prof, --with-cflags and --with-cc options. Only standard CC, CPPFLAGS, CFLAGS, LDFLAGS and LIBS variables should be used for configuring 2008-10-17 cheusov * configure.in: AC_PROG_LIBTOOL added 2008-10-10 cheusov * Makefile.in: 'make test' now works correctly if it is run from external obj/ directory 2008-10-05 cheusov * maaP.h: yet another hack for Interix without -D_ALL_SOURCE 2008-10-04 cheusov * maaP.h: _unconditional_ declarations of optind and optarg * prtest.c: fixed: prtest regression test failured under Interix * xmalloc.c: no need for strdup(3) * Makefile.in: If at least one selftest fails, an exit status of 'make test' is 1 additions to '*clean' targets * obstack.h: fix for previous bcopy->memcpy bad change * xmalloc.c: return value is checked before it is used as pointer 2008-10-03 cheusov * configure.in: no AC_C_CONST * configure.in, maaP.h, strdup.c: strdup is not used anymore 2008-10-02 cheusov * configure.in: -Werror is used instead of -pedantic (for gcc only) * maaP.h: hardcodes #if defined(__INTERIX) && !defined(_ALL_SOURCE) 2008-10-01 cheusov * maaP.h: The following functions long random (void); int isascii (int c); int gethostname(char *, size_t); void vsyslog (int priority, const char *message, va_list args); are declared explicitly on Interix * obstack.h: avoid using bcopy(3), use standard memcpy(3) instead * xmalloc.c: avoid using strdup(3), it is not portable (fails under Interix without -D_ALL_SOURCE) 2008-08-30 cheusov * maa.h: there is no limit to keep "Revised:..." up-to-date 2008-07-15 cheusov * configure.in: date ---> touch 2008-05-29 cheusov * Makefile.in: target 'tests-update' renamed to 'test-update' target 'tests' renamed to 'test' * Makefile.in: fixes for DESTDIR 2008-04-06 cheusov * Makefile.in: fixed: DESTDIR support 2008-01-22 cheusov * Makefile.in: arggram2c shoul be removed in target "distclean", not in "clean" * obstack.c: fixed: gcc compilation warning (missed #include for abort(3)) 2008-01-19 cheusov * Makefile.in, configure.in: removed: AC_PROG_RANLIB. It is not used directly libtool is run with --tag=CC when C code is compiled (Now dict is compiled with c89 under NetBSD) * maaP.h: removed: declaration of fileno and srandom They are not used removed: declaration of bcopy 2008-01-11 cheusov * Makefile.in: fixed: "install" target fails when configure and make are run from outside source directory 2007-12-29 cheusov * arg.c, base26.c, base64.c, bit.c, debug.c, flags.c, hash.c, list.c, log.c, memory.c, pr.c, rnd.c, set.c, sl.c, source.c, string.c, timer.c, xmalloc.c: Not standard __FUNCTION__ macros is changed to __func__ All these changed sources can now be compiled with PCC (under NetBSD) PCC - Portable C Compiler 2007-11-10 cheusov * acconfig.h: what is this for? 2007-09-29 cheusov * Makefile.in: minor fix in distclean target 2007-08-04 cheusov * configure.in: fix for autoheader 2006-12-13 cheusov * configure.in: 0.990 -> 1.0 2006-12-11 cheusov * Makefile.in: cp/install -> $(INSTALL)/$(INSTALL_DATA) 2006-12-10 cheusov * configure.in: removed: XTRALDFLAGS XTRACFLAGS WLDFLAGS WCFLAGS LDSHARED. Only CPPFLAGS, CFLAGS and LDFLAGS are used. removed: knowledge about how shared libraries are created on different platforms 2006-12-09 cheusov * Makefile.in: removed: ALLFLAGS, CFLAGS and LDFLAGS should be separate * Makefile.in: fixed: making prtest and memtest execs * Makefile.in: removed: @ @ libtool is used for creating shared library instead of dirty hacks 2006-07-03 cheusov * configure.in: 0.99 ---> 1.990 2006-05-27 cheusov * base64.c, maa.h: added: b64_decode_buf function to libmaa library index.c:dict_word_create: minor speed-ups, avoided use of malloc() dictfmt --index-keep-orig create (if necessary) fourth column in .index file that keeps original headword which is returned by MATCH command. See dictfmt.1 for details. dictd: If opening a pid file of log file failed, error messages are printed to stderr. 2006-05-26 cheusov * hash.c: FIXED: sf.net bug #1463396 2006-04-09 cheusov * maaP.h: removed obsolete code 2006-04-08 cheusov * Makefile.in, decl.h, maaP.h, memtest.c: decl.h files seem obsolete to me. They cause problrems, do not help. 2005-12-08 cheusov * config.guess, config.sub: updated 2005-12-05 cheusov * maaP.h: fixed: compilation bugs because of alloca 2005-11-21 cheusov * log.c: FIXED: buffer overflow (segfault) in log_{error,info} functions. This may happen when dictd is run with -L option and it definitely crashes on condition that: - -dinit option is enabled; - Japanese of Chinese dictionary created by dictfmt-1.9.14 (or later) is in dictd.conf - -L This is due to too long 00-database-alphabet "definition" 2005-11-20 cheusov * log.c: fixed: strange segfault in log_info function under Interix 3.5 (4096-byte array on stack + va_XXX calls) 2005-09-22 cheusov * Makefile.in: -fPIC is always enabled for libmaa 2005-09-21 cheusov * maaP.h: fixed: compilation bug (alloca) 2005-09-05 cheusov * maaP.h: fixed: compiler warnings on FreeBSD5 2005-06-08 cheusov * decl.h: fixed: compilation bug on smarc64/xxxBSD. Thanks to micha137 for bu report and patch. 2004-12-23 cheusov * Makefile.in, arggram2c, arggram2c.in, configure.in: changes necessary for Solaris which loves old awk 1.9.14 --> 1.9.15 2004-11-17 cheusov * arg.c: removed: C++ style comments * hash.c, sl.c, string.c, arg.c: fixed: a few warning messages produced by gcc 2004-11-07 cheusov * log.c: code clean-ups 2004-10-12 cheusov * log.c: `log_syslog (NULL)' closes syslog `log_file (NULL, NULL)' closes file for logging `log_stream (NULL, NULL)' closes FILE* stream for logging * maa.h: debugging information switched on using -d option of dictd is logged to syslog/file/FILE_stream, but printf'ed to stdout. 2004-10-08 cheusov * Makefile.in: ./ --> awk -f 2004-10-05 cheusov * xmalloc.c: compiler warning message fixed 2004-06-06 cheusov * configure.in: *** empty log message *** * configure.in: libmaa version ==> 0.99 2004-05-30 cheusov * timer.c: a few checks for NULL * arggram2c: comments changed 2004-05-16 cheusov * configure.in, log.c: Where vsyslog function is determined by autoconf but the platform-dependant #defines * log.c: code clean-ups: duplicated code is separated into a function 2004-05-14 cheusov * Makefile.in, arg.c, arggram.txt, arggram2c, argtest.c, argtest.in, argtest.out: fixed: arg_argify parses string incorrectly, for example, for the input 1''2''3''4 it produces single token 1'''. As a result 'dictd' may parse TCP commands incorrectly. arg_argify is fully reimplemented and now uses Mealy machine similar to that used by lex and flex. argtest.c is reimplemented more tests for arg_argify function have been added 2004-03-18 cheusov * maa.c: maa_shutdown function is not called automatically when application terminates. Run it explicitly. 2004-03-10 cheusov * configure.in: dictd / libmaa version has been changed to 1.9.12 / 0.97 2004-01-08 cheusov * doc/Makefile.in: Documentation is not extracted from parse.c because it is no longer available. 2004-01-07 cheusov * flags.c: fixed: the following program should not end with exit code 0 #include "maa.h" int main (int argc, char **argv) { flg_register(1, "flag1" ); flg_set ("none"); flg_set ("flag1"); printf ("flag=%d\n", flg_test (1)); flg_set ("*flag1"); printf ("flag=%d\n", flg_test (1)); return 0; } 2003-12-30 cheusov * maa.h, string.c: added: new functions and defines 'str_pool_init_position', 'str_pool_next_position', 'str_pool_get_position', 'str_pool_readonly', 'str_pool_iterate', 'str_pool_iterate_arg', 'STR_ITERATE' and 'STR_ITERATE_END' to iterate over strings in the string pool. 2003-12-08 cheusov * configure.in: version ==> 1.9.11 libmaa version ==> 0.97 NEWS update 2003-10-26 cheusov * Makefile.in, configure.in, maaP.h: checking for presence of getopt(3) and SIZEOF_VOID_P define * text.c: fixed: warning messages produced by latest gcc * list.c: fixed : a warning message produced on 64-bit archs 2003-10-08 cheusov * configure.in, maaP.h: better checking for getopt(3) 2003-10-02 cheusov * config.h.in: removed: libmaa/config.h.in 2003-10-01 cheusov * string.c: fix * config.guess, config.sub: updated config.{sub,guess} files 2003-09-19 cheusov * source.c, string.c: a few strlcpy have been replaced with strncpy and memcpy 2003-08-08 cheusov * maa.h, text.c: txt_soundex2 - reenterable version of txt_soundex 2003-08-07 cheusov * maaP.h, strlcpy.c: added: initial version of Judy-based plugin 2003-08-06 cheusov * config.h.in, configure.in, maaP.h, source.c, string.c, strlcpy.c: 'strncpy' function is replaced with 'strlcpy' in both dict* and libmaa 2003-07-22 cheusov * configure.in: Local libmaa is always used. This will be removed later. DICTD version --> 1.9.10 LIBMAA version --> 0.96 2003-07-07 cheusov * Makefile.in, maa.h, parse.c: parse.c has been removed from libmaa library. This is because it declares 'extern' symbols not defined in the library. added: 'make uninstall' * config.h.in: upgrade to autoconf 2.53 * configure.in: fixed: libmaa/configure --enable-shared upgrade to autoconf 2.53 2003-04-14 cheusov * config.h.in: *** empty log message *** 2003-03-19 cheusov * maaP.h: Functions related to plugin have moved to plugin.c. Several declarations have been moved to defs.h, index.h, data.h, plugin.h It makes sources easier to understand (at least for me) UTF-8 support is optional. It is disabled on platforms which don't support 'iswalnum', 'iswspace' and 'towlower' functions. As a result 'dictd' can be compiled on CYGWIN. fixed: 'dictdb_free' function is not called 2002-12-17 cheusov * config.sub, configure.in: code cleanups libmaa version set to 0.95 dictd version set 1.9.1 2002-11-19 cheusov * text.c: fixed: possible crash in libmaa/text.c:txt_soundex My previous commit did not fix it 2002-11-18 cheusov * text.c: fixed: problems with 'toupper/tolower/isXXXX (-1) fixed: possible crash in libmaa/text.c:txt_soundex 2002-09-27 cheusov * config.h.in, configure.in, error.c: added: possibility to disable plugin support by running ./configure --disable-plugin fixed: problems with make -j. patch by Andrzej Dopierala fixed: problems with make ChangeLog added: possibility to build 'dictd' on platforms not supporting mmap() added: a lot of 'const' modifyers removed: 'goto' statement ;) from daemon.c added: --test-file argument to 'dictd' '--ftime' and '--test-file' are synonyms 'dictd --test-file' and 'dictd --test' now search in ALL databases but the first one only. added: --test-db to 'dictd' It sets the database name for --test and --test-file. plugin function dictdb_open can return version == 1. In this case before each 'dictdb_search' call, 'dictdb_set' should be called. Not fully implemented. added: DICT_PLUGIN_INITDATA_DBNAME data id for initialising plugin the databases names are passed to the plugins by the call of 'dictdb_open' This can be used to implement "virtual" databases such as "English monolingual" containing Webster, FOLDOC, WordNet etc... added: new plugin exit status DICT_PLUGIN_RESULT_EXIT which allows to stop searching. This is an easiest way to exclude some databases from '*' list. Example: 1) Webster 2) Wordnet 3) ----- dictdplugin_exit.so plugin ----- 4) man pages 5) RFC documents 6) HOWTOs 7) C++ functions 8) Perl functions Using such database list, you will search only Webster and Wordnet databases by running 'dict apple'. If you want to get RFC document e.g., specify database name explicitly. Of course, plugin may exit with such exit status not only unconditionally added: dictdplugin_exit.so plugin Stops searching unconditionally. added: new plugin exit status DICT_PLUGIN_RESULT_PREPROCESSED which allows to implement a preprocessor of the requested word. Simple examples: - Converting German umlauts to UE, OE etc. - Converting Cyrillic YO character to YE After plugin converts the requested word, all following databases will be searched for converted one. In order this to work, it is necessary to create .index files without umlauts and Cyrillic YO characters. Database list example: 1) ---- plugin converting German umlauts ------ 2) ---- plugin converting Cyrillic YO to YE --- 3) German-English dictionary 4) Russian-English dictionary fixed: bug in 'dict_search_plugin' function 2002-09-16 cheusov * Makefile.in, config.h.in, configure.in: fixed: bug in configure.in ./configure --sysconfdir was completely ignored changed: The default "prefix" directory from /usr to /usr/local just like most other packages do. removed: --with-etcdir argument of configure script. Use --sysconfdir instead. Run "./configure --prefix /usr --sysconfdir /etc" to get "configure" script behaviour similar to older dictd "configure". plugin improvements/changes: - plugin.h renamed to dictdplugin.h - In order to avoid confusing several #defines have been renamed. Now all #defines have DICT_ prefix. - "all" Makefile target builds library libdictdplugin.a. Link plugins with it. - dictdplugin-config configuration tool. It is like gtk-config. Error message is returned by dictd if the request is not a valid UTF-8 string and remaining databases will not be checked. fixed: warning messages produced by autoreconf 2002-08-05 cheusov * list.c: added: possibility to search using all characters but the alphanumeric and space only. 00-database-allchars special entry in the index file is used. * Makefile.in, log.c, maa.h: added: utf-8 functions in utf8_ucs4.c changed: 'distclean' target of Makefile.in added: argument '--test-strategy' it can be used for debugging. fixed: crash at fclose(NULL) fixed: crash of dictd with --ftest fixed: "8bit" bug in compare:index.c changed: comparions count in the debugging mode is calculated without optStart array initialization fixed: "8bit" bug in suffix/substring searching strategy changed: PRINTF and FPRINTF macroses. old variants cause problems with the nested if/else added: UTF-8 support 2002-08-02 faith * Makefile.in, arg.c, argtest.c, base26.c, base64.c, basetest.c, bit.c, bittest.c, configure.in, debug.c, debugtest.c, decl.h, error.c, flags.c, hash.c, hashtest.c, list.c, listtest.c, log.c, maa.c, maa.h, maaP.h, memory.c, memtest.c, mkrnd.c, parse-concrete.c, parse.c, pr.c, prime.c, primetest.c, prtest.c, rnd.c, set.c, settest.c, sl.c, sltest.c, source.c, stack.c, strdup.c, string.c, stringtest.c, text.c, timer.c, xmalloc.c: Update with 1.7.1 release 2002-05-03 faith * debugtest.c, decl.h, error.c, flags.c, hash.c, hashtest.c, list.c, listtest.c, log.c, maa.c, maa.h, maaP.h, memory.c, memtest.c, mkrnd.c, parse-concrete.c, parse.c, pr.c, prime.c, primetest.c, prtest.c, rnd.c, set.c, settest.c, sl.c, sltest.c, source.c, stack.c, strdup.c, string.c, stringtest.c, text.c, timer.c, version.c, xmalloc.c, Makefile.in, acconfig.h, arg.c, argtest.c, base26.c, base64.c, basetest.c, bit.c, bittest.c, config.h.in, configure.in, debug.c: Sync sourceforge.net repository with dictd-1.7.0 release 2000-12-31 faith * decl.h, text.c: Made minor changes for Solaris 5.7 compilation 1999-12-23 Julian Squires * maaP.h: Added OpenBSD to list of BSDs to allow smooth compilation. 1999-12-23 faith * bit.c, hash.c, hashtest.c, listtest.c, settest.c: Update for 64-bit machines 1999-12-22 faith * decl.h: Update for Linux/Sparc * log.c: Changes for OSF (DEC Unix) for Alpha * log.c: Changes from Stephen L Moshier to support Cygnus B20 under Windows 98 * hash.c: Patches from Bob and Kirk Hilliard: Fix error in code that causes logging to fail Fix stdout initialization in dict Fix defs for linux on sparc Fix hash type (for alpha?) Fix parse error message misalignment Fix some annoying compilation warnings Fix syntax in dictd configuration file Add include keyword to dictd configuration file syntax Add switch to specify pager (or lack thereof) Add documentation for pager option Drop root as soon as daemon starts Also, fix --prefix on configuration 1998-07-05 faith * configure.in: Fixed Makefile.in and configure.in syntax per email from Ian T Zimmerman * timer.c, configure.in, Makefile.in: Fixed timer wrap-around between 49 and 50 days Fixed Makefile.in and configure.in syntax per email from Ian T Zimmerman 1998-02-22 faith * log.c, maa.h: Minimize warnings with Linux glibc * source.c: Fixed NULL pointer dereference in err_ routines * maaP.h: Port to BSDI 1998-01-16 faith * log.c, maaP.h, decl.h: Changes for HPUX 1998-01-05 faith * maaP.h, log.c: Port to DG/UX * maaP.h: Port to FreeBSD 1997-11-30 faith * sl.c: Update for dissertation benchmarks 1997-11-08 faith * list.c, maa.h: This version is buggy, do not check out 1997-09-25 faith * version.c, log.c, decl.h: Updates for DSL Example under Solaris 1997-09-19 faith * maaP.h: Fix Solaris predefined macros 1997-09-14 faith * set.c, maa.h: Reimplemented algorithm based on write-up in dissertation. Now using the same algorithm in both places. 1997-09-12 faith * decl.h, configure.in: Preparing DSL example snapshot 1997-08-21 faith * maa.h: Got breakpoint tracking and navigation working 1997-08-15 faith * arg.c: More work on tracking 1997-07-11 faith * error.c: Allow routine name to be NULL 1997-07-07 faith * timer.c: Use millisecond resolution for timer, instead of microseconds 1997-06-23 faith * timer.c: Made timers return parent and children times 1997-06-21 faith * maa.h, log.c, flags.c, debug.c: Made timestamps on logs optional Fixed typos 1997-06-02 faith * version.c, parse.c, configure.in: Only make weak symbols when compiling a shared library. Otherwise, everything fails when the library is not shared. Bumped version number 1997-05-21 faith * Makefile.in: Fixed ChangeLog target * doc/libmaa.tex, doc/libmaa.600dpi.ps, doc/Makefile.in, configure.in, source.c, config.h.in, Makefile.in: Fixed a few problems with the docs -- others remain * parse.c, configure.in, Makefile.in: Add support for shared libs under Linux Add installation target in Makefile * version.c: Bump version 1997-05-20 faith * string.c, maa.h, hash.c: Added hash function caching Added str_copy* support for strings which are known to be unque (e.g., source lines). Both of these changes should speed up scanning and parsing. 1997-05-10 faith * source.c: Fixed core dump when sourceType is not available 1997-05-01 faith * argtest.out, argtest.c, arg.c: Fix arg_argify, again 1997-04-21 faith * version.c, set.c, maa.h, list.c, Makefile.in: Keep version numbers from automatically bouncing. Make remaining iterators return non-zero if the iteration ended early. 1997-03-19 faith * version.c, source.c, argtest.out, maa.h, pr.c, arg.c, argtest.c: Allow arg_argify to quote in different ways. 1997-03-18 faith * version.c, source.c: Increased buffer size for error reporting * version.c, parse.c, maa.h: Added new parser entry point 1997-03-15 faith * version.c, sl.c: Finished implementing Algorithms 1-6 Wrote up algorithm descriptions Benchmarked algorithms with qsort: % Algorithm 0: % 0 nodes have been labelled ( 0 relabelled, 0 needs comp.) % 18.500u 0.200s 22.217 84% % % Algorithm 1: % 5425575 nodes have been labelled ( 0 relabelled, 0 needs comp.) % 1:55.31u 0.210s 1:58.44 97% % % Algorithm 2: % 22067 nodes have been labelled (5403508 relabelled, 0 needs comp.) % 17.640u 0.250s 20.219 88% % % Algorithm 3: % 5425575 nodes have been labelled ( 0 relabelled, 5425575 needs comp.) % 2:06.19u 0.210s 2:08.83 98% % % Algorithm 4: % 22067 nodes have been labelled (5403508 relabelled, 5425575 needs comp.) % 25.470u 0.320s 28.606 90% % % Algorithm 5: % 22067 nodes have been labelled (5403508 relabelled, 662227 needs comp.) % 21.250u 0.270s 23.765 90% % % Algorithm 6: % 22067 nodes have been labelled (349455 relabelled, 662227 needs comp.) % 11.910u 0.180s 14.250 84% 1997-03-13 faith * version.c: Added -a option to select fast labeling algorithms Implemented Algorithm 0, 1, 2, noting speed improvement I plan to break Algorithm 3 into 3 and 4 (and 5?), since it is a big step up from Algorithm 2, and may not be any faster... 1997-03-12 faith * version.c, timer.c, maa.h, log.c, decl.h: Fixed bug in timers Improved logging Added more C prototypes for SunOS 1997-03-11 faith * version.c, log.c: Fixed log_stream bug 1997-03-10 faith * version.c, maa.h, text.c, log.c, error.c, argtest.c, argtest.out, arg.c, Makefile.in: Fixed bug in arg parsing Added generalized logging capabilities 1997-03-08 faith * version.c, decl.h: Compile without warnings under SunOS * argtest.c, argtest.out, version.c, arg.c: Updated arg functions to skip over whitespace in a reasonable way.\ Updated argtest to test these updates. 1997-03-01 faith * version.c: Example ocnfig file * version.c, timer.c, source.c, parse.c, maa.h: Fixed bugs in timer and error routines 1997-02-28 faith * doc/Makefile.in, version.c: Removed parse and source support from Khepera library * doc/Makefile.in, version.c, source.c, parse-concrete.c, parse.c, maa.h, maa.c, Makefile.in: Moved source and parser support to libmaa 1997-02-21 faith * README: Updated credits information and version 1997-02-08 faith * version.c: Fix typos 1996-12-26 faith * version.c: 1) Make top-level "tests" target to run all regression tests. 2) Do not free nseqs after the "return" statement. 3) Add .dq debugging flag to debug the pending delete queue. 4) Fix typo that prevented -pg from working (this was most important). 1996-12-25 faith * version.c: 1) Re-did all the Range stuff again. Here is how it works: At parse time, but never again: (N_SeqRange (N_Range1 .)) 1 .. last (doesn't exist at parse time) (N_SeqRange (N_Range2 . .)) first .. last (N_SeqRange (N_Range3 . . .)) first, second .. last After post-parse processing, and thereafter: (N_SeqRange1 .) 1 .. last (N_SeqRange2 . .) first .. last (N_SeqRange3 . . .) first .. last .. step 2) Added the new dpl_st_range_step_i call, which takes (first, last, step). 3) Use dpl_copy whenever an nseq is assigned to another nseq (these assignments should be (automatically) removed when value tracking and CSE are addes). 4) Moved dom-removal from pl.k to simple.k. This is more appropriate. * version.c: Major milestone: qsort runs to completion after a little tweaking. Here's what needs fixing: nseq assignment needs to use dpl_copy dpl_st_range uses the old style ranges, not the ones used by N_Range Other stuff in this checking: 1) Exapanded ex4.pro so debug indexing 2) Finished implementation of flat indexing (vs. SelectSeq) 3) Added new functions: leseq, combine, flatten, concat 4) Convert dom into range1 5) Output DPL for index, concatreduce, combine 6) Added ad hoc on-the-fly type generation for indexing (similar to that for insert/extract) 7) Fix insert/extract on-the-fly type generation 8) Print out types of all assignments -- this helps with debugging 9) Fix type printing as called by tre_print. Now type variables in a tre_print will be correctly identified as 'a, 'b, etc. Before they might all be called 'a even when they were different. (This was an error of printing -- the types were correctly stored as differentiated variables.) 1996-12-23 faith * version.c: 1) Get insert/extract working. For type checking, there is now a callback that will be called whenever a type definition cannot be found in the usual ways (this is a ``last resort'' callback). The extract/insert type creation callback examines the current tree and creates an inference rule for it, making an entry in the symbol table so that this won't have to be regenerated again (although this may not currently be in the proper scope). Next, I'll use this same callback to generate inference rules for indexing instances. 2) Re-did all the range stuff. Now N_Range1, N_Range2, and N_Range3 are carried through the transformations end-to-end. This allows early detection of range1, and prevents a lot of dists of 1's. It also means that we can avoid dpl_st_range_p at the Proteus-source level, since this function is not working in DPL. 3) Added transforms to DPL calls for #, +/, ++, and a few others (?). 4) Fixed some places where _tre_DeleteQueueProhibited was not being properly restored. This led to a situation where the delete queue was never emptied, which led to infinite attempts to delete the deleted node. Next, figure out how to type check indexing. Was the type system designed to handle this? 1996-12-22 faith * version.c: 1) Removed some calls to fixup_scopes() since these should no longer be necessary (because of the hook which calls fixup_scopes() automatically at tree-insertion time). 2) Added extensive debugging printouts to flatten.k and simple.k 3) Added checks to make sure flattening and simplification actually worked. 4) Fixed some dpl types in header.pro that were overly restrictive. 5) Delayed removal of primed operators until type checking is no longer done. 6) Totally re-wrote let simplification to deal correctly with changing scopes. This was needed to get qsort.pro to transform. qsort.pro transforms now, but the output won't compile. I need to get type checking working for Insert/Extract before I can look for other bugs in the transformations. Although the type inference engine should be able to deal with these functions (it was designed to do so), it has never been hooked up to the high-level (e.g., Proteus language) code and tested. Instead of using these type inference features to typecheck these functions, I'm going to try to use the backdoor I installed for the typechecking of the higher-order primed functions. This should be easier to get working, and still makes use of the type inference engine, it just bypasses the arithmetic type clauses. 1996-12-14 faith * version.c: 1) Changed spacing of ChangeLog 2) Re-wrote let flattening (Palmer96 Rule1). But still need to fixup scope. 3) Re-wrote zip flattening (Palmer96 Rule5). Would like to simplify this by adding a Khepera "optional" match. 4) Added much more readable output for -V tracing (-dverbose). 5) Added sscope fixups to be automatically applied at each insertion. 6) Added printing support for unique node values (-d.unique). 7) Experimented with removing symbols from the symbol table. This is probably a very bad idea, but I'll leave the code there for now. (The functions aren't used.) 8) Made removal of pending nodes and queuing of pending nodes a critical section. 9) Made fast post-order walks actually work. (The logic had been inverted, so they were incorrectly used on small trees, but not on the main tree.) Still working on let scoping debugging. 1996-12-09 faith * Makefile.in: Fix ChangeLog creation * doc/extract.pl, version.c, Makefile.in: Added dist target to makefile Fixed perl script to work under Perl 5 1996-12-07 faith * version.c: 1) Temporarily removed FORTRAN transformations from build. They need to be updated in the face of other global changes, but they probably need to be completely re-written. 2) Added support for a dpl subdirectory. 3) Made other changes to get tiny test program to compile with C+DPL. Now I'm working on qsort and am running into scope problems -- the transformations don't automaticallly preserve scope, so scopes must be propagated by hand. Hence, forgetting when the scopes need updating is easy to do. The quick fix is probably to re-run the scope updates from the ASTRoot frequently. 4) Make main() function that includes call to dpl_setmem. Need to add a return 0. 5) Add last-use detection for variables, and insert calls to dpl_fre_nseq. This all means that this simple example now compiles with C+DPL: #include "header.pro" function foo(i:int, j:int):int { return i*j; } print [i in [1..30]: foo(i,i)]; Tomorrow: get qsort to compile as well. 1996-12-01 faith * version.c: Added query and if-then-else simplification. * version.c: When looking for cpp, first try to use the one that comes with gcc. Then look on the system for one. We should probably incorporate the GNU cpp and hack it so that it won't print warnings for Proteus code. For now, just redirect errors to /dev/null. 1996-11-26 faith * version.c, error.c: 1) Added simplify.k and moved all the simplifications there. 2) Re-wrote the simplifications based on knowledge contained in the post-mortem analysis of trans. Specifically, internested let and if-then-else expressions must be handled correctly. I did the let part and will do the if-then-else part next. 3) Make the uncall functions put identifiers in the top-level scope and mark them as DECLARED. This prevents a N_Var declaration being made for them later. If will also permit us to write type signatures for all of these functions, and treat them as builtins. I think this will eliminate the need for moving back-and-forth between infix notation and functional notation, since it looks like that only thing that currently needs infix notation is the type checker. 4) Added is_literal call to identifier Proteus literals. 5) Ripped out the N_Build stuff and added more general call/uncall support for nodes which take an N_ExpressionList as an argument (currently, N_Sequence and N_Print). 6) Make things which are already declared as declared, and insert N_Var declarations for everything else. 7) Add C pretty-printing for types in N_Var, N_Param, and N_Function. 8) Removed number from tree printouts unless -d.enum is used. These numbers were for debugging, but are not useful since we use the N_ names for node everywhere. The other names should probably be deprecated (but are still used for default pretty-printing). 9) In the Khepera language compiler, don't declare any variables introduced in a rebuild statement. Previously, only the root of the rebuild wasn't decalred. This should all be done with typechecking, and will be in the next re-write of the Khepera language compiler :) 1996-11-23 faith * version.c: 1) Make add_primed_func_defns propagate the return type as well as the argument types. 2) Added functions to push [a in a_p, b in b_p, ... : ... ] through the expression as index operations (alternatively, this could be implemented with the now-non-existent zip primitive). 3) Added functions to handle simple dom() simplification. More complex functions will be easy to add as needed. 4) Convert (N_Sequence (N_ExpressionList ...)) into (N_Build ...) so that these node can be interconverted with N_Call nodes, allowing iterators to be pushed through them. 5) Added support for the "walk" keyword in the Khepera language. This allows a pre-order walk to be performed of an arbitrary node, much like the "children" keyword allows the children to be iterated over. 6) Fixed bug where deleting nodes which were queued for deletion caused a non-reentrant function to be called twice. (Made tre_delete_queued reentrant.) 7) Added font-lock mode definition as a comment in khepera-mode.el. This all means that Dan's Rule 0 through Rule 5 are fully impemented. I'm going to work on function call parameter lifting next, and then on last-use detection so that DPL memory management can be added.... 1996-11-19 faith * version.c: 1) Finally got Palmer96 rules 1-5 implemented. There are a few problems: a) Primed function duplication doesn't work unless the type of the function is either specified or can be derived. It can't be derived if the prime function isn't used. The right way to do this is to delete primed functions (or not generated them) unless they are used. However, due to POLYMORPHISM, this isn't possible without cooperation from the type system. Adding this cooperation will take time. Hence, I'm punting on this until we deal with polymorphism in general. b) I used the "James" method of generating primed functions, and I haven't written the part that pushed the zip'd components through to indexing. I'll do that next. 2) Removed Lar's optimiztion.k for the time being. It doesn't help us to actually generate code and only confuses things. I'll put it back after we can generate C+DPL. 3) Redid all the call/uncall stuff using a header file. Now, one line has to be added and the call/uncall functions will get created _and_ mapped into the xfm Rule body. See functions.h for the list. 4) Deactivated a bunch of transformations that do not get us any closer to executable code. 5) Commented some of the rules. 6) Fixed a few aesthetic bugs in error printing. 7) Saved Lar's transform.c as transform.lars.c. 8) Tried to fix the enclosed version of cpp to implement the ANSI # stringification directive. Gave up. Patched the parser routines to find the native cpp instead. Will delete the local cpp next time -- its just too old to be useful, and ptrans requires an ANSI C compiler anyway. 9) tre_fast_postorder_allowed lets you know if a tre_fast_postorder walk is possible. It isn't right now if you aren't walking from the root of the labeled tree. 1996-11-15 faith * version.c: New example 1996-11-11 faith * version.c, maa.c: Broke out type dumping routines (for debugging with readable types). Make top-level dist target. Added top-level version.c and version/copyright printing stuff. To bump the version, make version.stamp and check in the new version.c. Tried to free memory that the type inference system creates. I got some of this, but not all of it. Specifically, I can't figure out how to safely free type expressions (Expr in khepera/lib/typ.c). These maintain their own reference counts, but only for internal references, not for references from the AST or from the symbol table. Sometimes types get destroyed on-the-fly, so a simple list of all allocated type expressions is not sufficient. It would be nice to get this done sometime, since then we could look for real memory leaks and make better use of the debugging malloc technology we have available. Fixed all obvious memory leaks in the khepera language translator program (which doesn't use the type system, and only had some leaks related to the symbol-table). * version.c: 1) Added code to take advantage of 1 and 2 parameter versions of dpl_range* 2) Added transformations for dpl_dist*, dpl_restrict* 3) Print warning when an AST node does not have an entry in header.pro (a type isn't needed, just an entry -- at least this way we know about it; and, because of the powerful type inference engine, everything doesn't have to be explicitly typed -- the engine will figure out what the type has to be most (all?) of the time). todo) work on -fflatten and -fsimple, especially for if statements 1996-11-10 faith * version.c, memory.c, maa.h, basetest.c, basetest.out, base64.c, base26.c, Makefile.in: 1) Fixed up name mangling for multi-arity types. 2) Hooked up Libmaa memory objects to the type inference. This gives maybe a 10% improvement on short examples. Oh well. 3) Made type printing more pretty by using letters instead of %p (this is what the base 26 stuff is for in Libmaa). 4) Looked really hard at how to get polymorphic (and primed functions) to print out in executable code. The problem here is that the type system figures out monomorphic types for each instance of a function use. E.g., at the N_Call node, monomorphic types have to exist for type checking to complete. However, after figuring out all this information, the type system just THROWS IT AWAY! This is a fine thing to do for a type system, since it can just re-figure it out again later. But it isn't very helpful if you want to generate executable monomorphic instances for the functions. I looked in the type engine at the function where the monomorphic-instance information exists (inf_infer_definition), but there isn't enough information at that point to let the high-level code know that a new monomorphic instance needs to be generated. Fixing this is going to require kludging the type system so that it has enough information to notify the high-level code via a callback. Then the high-level code has to deal with renaming the monomorphic instance and generating the necessary monomorphic executable code. Getting all of these details right was one of the biggest problems that I had with the type inference engine in trans. Based on previous experience with trans, I think this problem will take several weeks to fix in ptrans. Hence, I'm going to ignore polymorphic functions for now. Code will only be generated for typed functions and for functions that analyze to a single monomorphic instance (and, maybe not even the later, since there still isn't enough information at the top level to generate a typed C or Fortran function -- that information is also lost even though the function is just untyped and isn't actually polymorphic). Primed functions can be handled with Lar's kludge: generate (typed) primed versions of all user-defined functions early, and generate code for them regardless of the need for such code. 5) The next big hurdles are to get DPL memory management working, and to get all the appropriate DPL functions generated. The I can start checking the flattening transformations. I need to get all of this done by the middle or end of the week so that I can start on the debugging support. In fact, even without memory management, I can start working on debugging support, so that's probably what I should do as soon as compilable DPL can be generated... * version.c: Recursive typechecking works. Joy. 1996-11-08 faith * version.c: Recursive functions do _not_ typecheck. Fuck. Made automatic function name mangling work for variable-argument functions. Fixed types.k (these rules are far too application order-dependent). Make ground matching work (e.g., (N_Node 0) matches N_Node without any children) in Khephera language. 1996-11-04 faith * version.c: Fixed pp_* so that default printing styles works. Added a bunch of dpl_* primitives. Fixed local cpp copy so that ## token concatenation has no warning. Added a queue of nodes that have a delete pending. This allows the node that is currently being walked in the tree to be deleted. This had been an impossible operation previously. Tightened up error checking in tree walkers. Made 'else' actually work in Khepera if clauses. Previously the else clause was executed along with the then clause. 1996-11-02 faith * version.c: Starting to add primitive dpl_mul-like operations. 1996-10-31 faith * version.c: Added dpl_build_* Added ability to use .. (sametypes) wildcard in var declaration (this is essential to be able to type dpl_build_*) 1996-10-30 faith * version.c, config.sub: Added topl.c and pl.k for transformations to a generic parallel library Transform various ranges into dpl_st_range_* Remove conf.cache when building configure files Make config.sub recognize i686 Removed verbose tree printing so that new tree printing can be more selective (e.g., for debugging) Fixed bug where a poiner from alloca was used as a symbol name 1996-10-07 faith * maaP.h, version.c: Changes for Solaris cc compiler 1996-10-03 faith * prtest.out, version.c, Makefile.in: Added -with-nox option to inhibit building X applications Added prtest to libmaa suite * version.c, prtest.c, pr.c, maa.h, error.c: Made error messages more uniform Made process support use file descriptors instead of stream I/O. You should still be able to fdopen on a fd returned from a function, if you do all of the I/O yourself. However, a filter function was added, so playing with I/O probably isn't needed. Coprocesses, or a coprocess chain, should be fairly easy to set up now, in a generalized fashion. Signals still aren't handled in a POSIX way, and deaths of children aren't caught asynchronously, so support can still be made better. 1996-10-02 faith * pr.c: Before ripping out stream I/O 1996-09-30 faith * version.c, error.c: Make error messages prettier 1996-09-26 faith * version.c, maa.h, pr.c, base64.c: Work on base64 and process management 1996-09-25 faith * version.c, hash.c, maaP.h, decl.h: Finish Solaris port * maa.h, version.c, arg.c: Make ptrans compile and use internal cpp * version.c, hash.c, configure.in, config.h.in, Makefile.in: Hash bigendian and little endian integers the same way This allows us to have test programs that produce the same results on different architectures. * settest.out, settest.c: Print out random stuff * version.c, settest.out, settest.c, rnd.c, hashtest.c, hashtest.out, Makefile.in: Hardcoded random numbers for test functions * version.c, settest.c, maaP.h, mkrnd.c, decl.h, hashtest.c, configure.in, Makefile.in: Stuff for Solaris port * config.guess: Make sure all library functions are under LGPL Update configure support from autoconf-2.10 1996-09-24 faith * sltest.c, version.c, maaP.h, maa.h, Makefile.in, base64.c: Added base64 routines Fixed warnings generated under Linux 1996-09-23 faith * xmalloc.c, stringtest.c, timer.c, string.c, sl.c, strdup.c, settest.c, set.c, prime.c, primetest.c, listtest.c, list.c, error.c, debugtest.c, decl.h, debug.c, bit.c, Makefile.in, COPYING.LIB, COPYING: Make sure all library routines are under GNU LGPL. Make sure all test programs are under GNU GPL. Include copies of GPL and LGPL for stand-alone libmaa. 1996-09-02 faith * version.c: Random fixes 1996-08-26 faith * version.c: Work on Fortran -- checkin to take home 1996-08-21 faith * version.c: Fortran types 1996-08-17 faith * version.c: Added Fortran declarations, but still\ need to remove debugging statements. Also need to think about unique\ labeling routine in terms of efficiency. 1996-07-17 faith * debug.c: Catch possible error 1996-06-24 faith * version.c, string.c, maa.h, debug.c: Moving toward FORTRAN output. I need to fix the FORTRAN declarations and get the appropriate wrapper around the code. Some sets of transformations were disabled for debugging, and I still need to turn those back on. 1996-06-17 faith * version.c, maa.h, flags.c: Added FORTRAN pretty-printing 1996-05-27 faith * prtest.c, version.c, pr.c, maa.h: Merged rik-3 to main branch 1996-05-24 nyland * version.c: Added rule to uncomplicate assignment expressions. FOund problems with tracking and partialmatch. 1996-05-14 faith * version.c: Checkpoint. Working on viewer... 1996-05-10 faith * version.c, prtest.c, pr.c, maa.h: Checkpoint. Preliminary two-window version of ra is working. 1996-04-24 faith * version.c, maa.h, text.c: Added soundex routine * install-sh, config.guess: Updated from GNU autoconf-2.9 1996-04-15 faith * version.c: Log inf_infer for replay; Add .replay debugging option to print out addresses of nodes when logging; Change tabs to spaces in source code manager; Add tracking support for partial replay; Break up logging into three files; Add partial replay support to ptrans (-i option); Make sure optimize.k routines are initialized properly; 1996-04-03 faith * version.c: Merged rik-2 with main trunk; Fixed tracking bug. 1996-04-03 nyland * version.c: Continued work on xform rules. Fixed a parser bug. 1996-03-29 yakowenk * version.c, list.c: Made a minor adjustment to output format of lst_dump 1996-03-27 faith * xmalloc.c, sl.c, version.c, maaP.h: Merged rik-1 onto Main Branch 1996-03-26 nyland * version.c: Working on transformations/optimizations. Added Tag support. 1996-03-26 yakowenk * version.c: increment version number 1996-03-24 faith * version.c: Added summary information for creation, destruction, and replacement tracking. * version.c, sl.c: Added recursive-clean target to top-level Makefile. Added unique identifiers to tree nodes (different from node labels). Added functions to track debugging information. Changed log (-l command line option) to log tracking information. Documented xfm.c functions. Changed khepera to support new logging mechanism (more precise). Unset skip list pedantic debugging flag (20% speed improvement). * version.c: Fixed up makefile in doc directory. Made most lines < 80 characters long in header.pro. Fixed mangling so that var 'foo' is found (as well as var foo). This will not be available on the main branch until the next major merge. Hence, main branch users may want to edit header.pro to remove the var 'foo' syntax for builtin functions. Added magic matching to new functions in typ.c. Avoided core dump in source.c when no source info is available. * version.c: Minor fixes. This is mostly a test of branches. 1996-03-23 faith * doc/Makefile.in: Added flag.c * version.c, maa.h, maa.c, debug.c, flags.c, Makefile.in: Added flg_* functions. These work just like dbg_*, except they use a different set of bits, and they don't reserve the last 30 bits for internal use. So there are about 120 flags available with flg_. Both flg_* and dbg_* now allow -flag ro remove a flag and +flag to add a flag. So, for example, flg_set( "all" ) can be called and then flg_set( "-new-code" ), and all the flags will be set except the one associated with FLG_NEW_CODE (assuming ptrans naming conventions). Or you can say flg_set( "none" ) and then add a single flag with flg_set( "+new-code" ) or flg_set( "new-code" ). 1996-03-19 faith * version.c: Now only one % is required in .k files, not two. The khepera language supports if-then-else instead of just if-then. 1996-03-11 yakowenk * version.c, maa.h: Added support to the type inference engine for tuples, primed-functions, and inferred function types. Access by field name is allowed only on tuples declared with those names. Strings can be used in type expressions to allow field names to be part of the tuple type. Symbol-table-pointers can be used in type expressions to allow limited type-checking of prime functions whose nesting depth won't be known until run time. The function-name-mangler adds inference rules for newly-created functions to the symbol table when it is called to generate their names. * list.c: Added support to the type inference engine for tuples, primed-functions, and inferred function types. Access by field name is allowed only on tuples declared with those names. Strings can be used in type expressions to allow field names to be part of the tuple type. Symbol-table-pointers can be used in type expressions to allow limited type-checking of prime functions whose nesting depth won't be known until run time. The function-name-mangler adds inference rules for newly-created functions to the symbol table when it is called to generate their names. 1996-03-05 nyland * version.c: Added more transformations. Turned off Fortran printing (unless you type -dfortran). Split flatten.k into two files (new = optimize.k). 1996-03-03 faith * version.c: Added rebuild, if, break, return to Khepera language. I need to think about a way to detect and/or mark builds that result in memory leaks... 1996-02-27 faith * version.c, sl.c: Make a local copy of skiplist data prior to the iteration, and then walk over the copy. This appears to generate results identical to those produced by the -d.slow walk in all cases. Thanks to Jan Prins for suggeting this solution to the walking problem. * version.c, decl.h: Added spaces to default S-expression fallback in the pretty printer. Added support for precedence which can be used to insert parens where needed. This is fairly primitive right now, but the key function is needs_paren in support.c -- enhance it at will. 1996-02-26 faith * strdup.c: For MIPSEL/DECstation port * version.c, stringtest.c, stack.c, maaP.h: Moving toward 64-bit support... * version.c, timer.c, sl.c, set.c, maaP.h, maa.h, list.c, hash.c, debug.c, configure.in: Made libmaa compile with -ansi -pendantic. Removed all nested functions from libmaa, since they are not in the current ANSI C standard. I hope they will be in C 9X :). Also, added HSH_ITERATE macro and support, and *_iterate_arg functions to allow an arbitrary argument to be passed to the iterator. This eliminates the need for nested functions, but can make the code uglier. * config.sub, config.guess: Update to files from autoconf-2.7 1996-02-25 faith * doc/refalpha.bst, doc/libmaa.tex, doc/libmaa.bib, doc/Makefile.in, version.c, sltest.out, sltest.c, sl.c: Added user-specific callbacks for tre_match. You register these with tre_register_compare, and then if you pass a flag to tre_match, it will use them. I also got the documentation to print, but it is not pretty yet. It still might be helpful. * version.c, sl.c: Robustify skip list walks. sl_iterate should now be stable in the face of arbitrary insertions and deletions that occur during the walk. * version.c, sl.c, maa.h, maa.c: Fixed skip list iterator to work with deletions. p1.pro finally does _exactly_ the same thing with and without -d.slow, where _exactly_ means that the log and node labels are identical. I have one additional test case I want to work up to make sure that this is finally finished -- it must be a rule that replaces a child with a node type of the same kind as both the matched node and this child (I doubt this happens often). For now, treat -d.slow as the gold-standard, but try not using it. 1996-02-24 faith * version.c: Bump version. 1996-02-23 faith * version.c, sltest.c, sl.c, set.c, maa.h, maa.c, hash.c, Makefile.in: Replaced red-black trees with skiplists. Before I merged in the stuff Lars just added, this appeared to work... 1996-02-18 faith * version.c: Red-black trees finally work. I gave up on not using sentinels, and just implemented the algorithms in Cormen, et al., directly. There is still a discrepancy between the log with and without -d.binary, so if anything looks odd, jump back to -d.binary (or even -d.slow) just to make sure. 1996-02-16 faith * version.c: More RB tree work. Do not use this version. 1996-02-12 faith * version.c: Toward red-black tree. I am going to add parent node and use the algorithms from Cormen, et al. Until then, use the -d.binary switch for unbalanced trees. 1996-02-11 faith * version.c, decl.h: Fixed unbalanced binary trees and related bugs 1996-02-09 faith * doc/libmaa.tex, doc/extract.pl, doc/lgrindefs, doc/Makefile.in, version.c, maa.c, list.c: Fixed up documentation 1996-02-06 faith * version.c, Makefile.in: Minor typographical changes. 1996-02-04 faith * version.c: Added stubs so that work on flattening transforms can progress. Made all *.k files compile directly to a *.o file, instead of being included in some other file. This is much better. 1996-02-02 faith * set.c, version.c, pr.c, memory.c, maa.h, list.c, maa.c, hash.c, error.c, arg.c, Makefile.in: Replaced Khepera-specific things with Libmaa-specific things. 1996-01-31 faith * version.c, maa.h, hash.c: Changed hsh_iterate to return non-zero if it was terminated early. All iterators should be updated to do this. 1996-01-30 faith * version.c, configure.in, Makefile.in: Adjust configuration to support --with-prof and --with-gprof; Make version.c updates more compatible with cvs. 1996-01-29 nyland * version.c: Added some type inference rules. 1996-01-29 faith * version.c: Made most nodes constant arity -- the type-declaration nodes can probably be of variable arity without problems. 1996-01-28 faith * version.c, maa.c: Tag subtrees rooted at N_TreeVar; Add the ability to suppress printing in tree.c and pp.c; Suppress the printing of N_TreeVar subtrees unless -dheader is given; Make -dtypes dump types in a somewhat readable format (use typ_print()) * version.c: Fixed forest support Iterator expansion rules that we added Friday now work. * version.c: Added forest support to Khepera language * version.c: Fixed latest parsing problem Added support for pre-processor line number directives Trying to get interesting symbols printed better -- need to tag all of the treevar variables as special, so they will not be printed every time.\ Need to add support for forest replacements to Khepera language. 1996-01-27 faith * version.c: unhose version.c 1996-01-26 nyland * version.c: Added some rules, and added some example proteus programs. 1996-01-23 faith * version.c: Make top-level make friendlier * version.c, Makefile.in: Fix distclean rule * configure.in, version.c, Makefile.in: Make new tree hierarchy configure and compile 1996-01-20 faith * doc/Makefile.in: *** empty log message *** * doc/Makefile.in, version.c, install-sh, pr.c, configure.in, config.guess, config.sub, Makefile.in: Making libmaa a standalone library 1996-01-15 faith * timer.c, string.c, pr.c, prtest.c, maaP.h, maa.h, maa.c, error.c, configure.in, config.h.in, arg.c, argtest.c, Makefile.in: Started to add process management routines; fixed bugs in argument processing; fixed other bugs 1996-01-08 faith * doc/Makefile.in: Added doc to libmaa * settest.out, version.c, memory.c, pr.c, maa.h, maa.c, hashtest.out, configure.in, config.h.in, argtest.out, argtest.c, arg.c, Makefile.in: Adding arg and pr to libmaa Making libmaa more independent for eventual isolation Improvided viewer 1996-01-02 faith * decl.h: Minor fixes for Sparc * stringtest.c, primetest.c, maa.h, maa.c, listtest.c, error.c, debugtest.c, Makefile.in: Viewer demo works (under Linux) 1996-01-01 faith * Makefile.in, stringtest.out, primetest.out, settest.out, listtest.out, debugtest.out, hashtest.out, bittest.out: Added simple test suite * list.c: More work on viewer. 1995-12-31 faith * timer.c, string.c, bit.c, prime.c: Updated documentation 1995-12-11 faith * xmalloc.c, set.c, error.c, hash.c: Fixed recursive labeling; Made sets use {}; Better magic/structure checks in tree.c; Added .. and 0 to Khepera Language; Added rules to unnnest iterators; Misc. bug fixes in libmaa. 1995-12-04 faith * set.c, hash.c: Farey Fractions replaced with Integer Labels 1995-12-03 faith * maa.h, maa.c: Start of Farey Fraction to Integer Labels -- unfinished -- do not check out 1995-12-01 faith * maa.h: Fixed __attribute__((unused)) bug 1995-11-20 faith * hash.c: Finally fixed whitespace bug in Proteus parser; other bugs fixes 1995-11-19 faith * decl.h: Filter input files through cpp * timer.c, xmalloc.c, stringtest.c, strdup.c, string.c, settest.c, stack.c, set.c, prime.c, primetest.c, maaP.h, memory.c, maa.h, listtest.c, maa.c, list.c, khepera.h, kh.c, kh.h, hashtest.c, hash.c, error.c, debugtest.c, decl.h, debug.c, bit.c, bittest.c, Makefile.in: Moved low-level data-structure stuff from libkhepera to libmaa * khepera.h: Added syntax directed xfm; made logging sane 1995-11-18 faith * kh.c, khepera.h: More transformation engine work 1995-11-18 yakowenk * khepera.h: Handle monomorphism in scopes Initialize sym->typeExpr when creating a sym_Entry Node-name mangler always calls str_find() Also print lower-level scopes when printing a symbol table Allow type definitions on final sequences of children nodes using '..' 1995-11-15 faith * timer.c, khepera.h, hash.c, kh.c, Makefile.in: Added scopes for Khepera and Proteus; merged CVS changes; fixed bugs 1995-11-13 yakowenk * khepera.h, kh.c: Added a debugging switch to get detailed type info Dropped some unused variables 1995-11-12 faith * khepera.h: *** empty log message *** 1995-11-10 faith * timer.c: Prevent overflow 1995-11-08 yakowenk * khepera.h, kh.c: getting ready to really handle polymorphism making set-constraints work improved output for type clashes 1995-11-07 faith * string.c, khepera.h: Added more scope support 1995-11-01 yakowenk * khepera.h, hash.c: corrected various bugs and hacked initialization of polymorphics to allow type inference on our example 1995-10-31 faith * khepera.h: *** empty log message *** 1995-10-27 faith * timer.c, khepera.h, kh.c, hash.c: Build inference rules on tree 1995-10-24 faith * khepera.h: Fixed most of last nights problems, but it still does not link, probably because the functions names are not right or do not exist. * kh.c, khepera.h: Working on inference rule trees 1995-10-23 yakowenk * khepera.h: check node id's during AST unification, allow wildcards remove sample function-name-mangler from symbol.c * set.c: bug fix: deleting the first item in a bucket dropped the whole bucket 1995-10-23 faith * timer.c, khepera.h, kh.c: More memory leaks; started on xfm routines 1995-10-22 faith * timer.c, kh.c: Fixed memory leaks in timer.c and debug.c * timer.c, khepera.h, kh.c: Got scopes working on Proteus AST; fixed bugs; added comments * khepera.h: Fun with CVS... 1995-10-22 yakowenk * khepera.h: ref count bug fix inf initialization hacks 1995-10-11 faith * khepera.h, kh.c: Added example directory; tre_replace 1995-10-08 faith * timer.c, khepera.h, string.c, kh.h, kh.c, debug.c, bittest.c, bit.c, Makefile.in: Expanded Khepera langauge; added timers 1995-10-02 faith * khepera.h, error.c, Makefile.in: Work on typechecking merge 1995-09-29 yakowenk * khepera.h, error.c, Makefile.in: added type inference programs 1995-09-29 faith * khepera.h, debug.c, bit.c: Add bits; fix bugs * xmalloc.c: Fix inline * getopt.c: Fix compiler warnings 1995-09-11 faith * khepera.h, kh.c, Makefile.in: Getting ptrans parser in shape. Misc. changes elsehere. 1995-09-04 faith * khepera.h, error.c: Misc changes. Added proteus subdir. 1995-08-29 faith * set.c, khepera.h: Changed selfOrganize to readonly and enforced readonly conventions. * settest.c, khepera.h: Fixed typo in SET_ITERATE macro * list.c: Fixed typo (test of remote cvs) * khepera.h: Fixed typo 1995-08-28 faith * set.c, memory.c, list.c, khepera.h, hash.c: Added SET_ITERATE macro for Bill. Added self organization flag to sets, per Bill's suggestion. This is actually necessary for set iteration and should be used as a flag which means that the set is not to be modified. I'll add this next. Added MAGIC to hash tables, sets, and lists. 1995-08-25 faith * kh.h, memtest.c: Fixed more __sparc__ problems. * strtol.c: Fixed declarations and include files * strtoul.c, settest.c, strtol.c, set.c, primetest.c, list.c, khepera.h, kh.h: Added more lst_ and set_ functions and a new LST_ iterator. Added strtoul.c for non-Linux systems. 1995-08-24 faith * primetest.c: Fix for Suns;clean up config * string.c, stringtest.c, stack.c, set.c, primetest.c, prime.c, memtest.c, memory.c, listtest.c, list.c, khepera.h, kh.h, hashtest.c, kh.c, hash.c, getopt.h, getopt1.c, getopt.c, debugtest.c, debug.c, Makefile.in: Updating CVS tree with latest work. 1995-04-21 faith * Makefile.in, alloca.c, debug.c, debugtest.c, error.c, hash.c, hashtest.c, kh.c, kh.h, khepera.h, memory.c, obstack.c, obstack.h, set.c, settest.c, stack.c, strdup.c, string.c, stringtest.c, xmalloc.c: New file. libmaa-1.3.2/config.h.in010064400017500000000000000112471200301155600143110ustar cheusovwheel/* config.h.in. Generated from configure.in by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* 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 to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* 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_LIMITS_H /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `on_exit' function. */ #undef HAVE_ON_EXIT /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* 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 `strerror' function. */ #undef HAVE_STRERROR /* 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 `strlcpy' function. */ #undef HAVE_STRLCPY /* 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 you have the `sysconf' function. */ #undef HAVE_SYSCONF /* 1. Description */ #undef HAVE_SYSLOG_NAMES /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_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_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 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 `vsyslog' function. */ #undef HAVE_VSYSLOG /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long long int', as computed by sizeof. */ #undef SIZEOF_LONG_LONG_INT /* The size of `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* 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 runtime. 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 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 WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* 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 `unsigned int' if does not define. */ #undef size_t