parser-3.5.1/0000755000076400007640000000000014740300546010030 500000000000000parser-3.5.1/buildall0000755000076400007640000001753614733312235011502 00000000000000#!/bin/sh # $Id: buildall,v 1.40 2024/12/18 19:20:55 moko Exp $ install_directory=$HOME/parser3install sendmail_command="/usr/sbin/sendmail -i -t -f postmaster" parser3_dir=`pwd` cd .. project_dir=`pwd` build_xml="yes" build_pcre2="yes" build_gmime="" build_apache="" build_stripped="" direct_download="" options="--with-included-ltdl" options="$options --with-gc=$project_dir/gc/lib" #options="$options --disable-stringstream" printf "Building statically linked parser3" for PARAM in "$@"; do case "$PARAM" in "--without-xml") printf ", without xml" build_xml="" ;; "--without-pcre2") printf ", without pcre2 library" build_pcre2="" ;; "--with-apache") printf ", with apache module" options="$options --with-apache" build_apache="yes" ;; "--with-mailreceive") printf ", with mail receiving" options="$options --with-mailreceive=$project_dir/gnome" build_gmime="yes" ;; "--with-system-mailreceive") printf ", with mail receiving" options="$options --with-mailreceive" ;; "--strip") printf ", without debug information" build_stripped="yes" ;; "--direct-download") printf ", download sources from master" direct_download="yes" ;; "--help") echo echo "Usage: buildall [--without-xml] [--without-pcre2] [--with-apache] [--with-mailreceive] [--with-system-mailreceive] [--strip] [--direct-download] [--disable-safe-mode] [other configure options ...]" exit 1 ;; *) options="$options $PARAM" ;; esac done if test "$build_xml" = "yes"; then options="$options --with-xml=$project_dir/gnome" fi bits=`getconf LONG_BIT` if test "$bits" = "64" -o "$build_apache" = "yes"; then cflags="$cflags --with-pic" else cflags="$cflags --without-pic" fi if test ! "$build_apache" = "yes"; then cflags="$cflags --disable-shared" fi download=`which fetch 2>/dev/null` if test -f "$download"; then download="fetch -p" else download="wget -c --passive-ftp" fi ############################### Support functions ################################ prepare () { cd $project_dir/src if test ! -f "$1"; then if test "$direct_download" = "yes"; then echo "Downloading $lib from $2..." $download $2$1 else echo "Downloading $lib (master at $2)..." $download https://www.parser.ru/off-line/download/libs/$1 fi fi echo "Unpacking $lib..." rm -rf $lib } prepare_gz () { prepare $1 $2 gunzip -c $1 | tar xf - >/dev/null cd $lib } prepare_xz () { prepare $1 $2 xzcat $1 | tar xf - >/dev/null cd $lib } cleanup () { cd .. rm -rf $lib } #################################### Building #################################### echo mkdir src >/dev/null 2>&1 if test ! -f "$project_dir/gc/lib/libgc.a"; then lib="libatomic_ops-7.6.2" prepare_gz ${lib}.tar.gz http://www.hboehm.info/gc/gc_source/ lib="gc-8.0.4" prepare_gz ${lib}.tar.gz http://www.hboehm.info/gc/gc_source/ mv ../libatomic_ops-7.6.2 libatomic_ops echo "Configuring $lib..." CPPFLAGS="-DUSE_MMAP -DDONT_ADD_BYTE_AT_END" \ ./configure --prefix=$project_dir/gc \ --disable-shared \ --disable-parallel-mark \ --silent $cflags echo "Building $lib..." make install cleanup fi if test "$build_pcre2" = "yes"; then options="$options --with-pcre=$project_dir/pcre2" if test ! -f "$project_dir/pcre2/lib/libpcre2-8.a"; then lib="pcre2-10.44" prepare_gz $lib.tar.gz https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.44/ echo "Configuring $lib..." ./configure --prefix="$project_dir/pcre2" \ --enable-jit \ --with-match-limit-depth=10000 \ --disable-shared \ --silent $cflags echo "Building $lib..." make install cleanup fi else options="$options --with-pcre=$project_dir/pcre" if test ! -f "$project_dir/pcre/lib/libpcre.a"; then lib="pcre-8.45" prepare_gz $lib.tar.gz https://sourceforge.net/projects/pcre/files/pcre/8.45/ echo "Configuring $lib..." ./configure --prefix="$project_dir/pcre" \ --with-match-limit-recursion=10000 \ --enable-utf8 \ --enable-unicode-properties \ --disable-shared \ --disable-cpp \ --disable-pcregrep-libz \ --disable-pcregrep-libbz2 \ --silent $cflags echo "Building $lib..." make install cleanup fi fi if test "$build_xml" = "yes" -a ! -f "$project_dir/gnome/lib/libxml2.a"; then lib="libxml2-2.9.9" prepare_gz $lib.tar.gz http://xmlsoft.org/download/ #sax1, output, tree, xinclude[in libxslt], html[in libxslt, mode=html?], xptr[xinclude], pattern -- needed! echo "Configuring $lib..." ./configure --prefix=$project_dir/gnome \ --without-catalog \ --without-iconv \ --without-debug \ --without-iso8859x \ --without-legacy \ --without-push \ --without-python \ --without-writer \ --without-readline \ --without-regexps \ --without-schemas \ --without-schematron \ --without-modules \ --without-ftp \ --without-http \ --without-docbook \ --without-zlib \ --without-lzma \ --disable-shared \ --silent $cflags echo "Building $lib..." make install cleanup fi if test "$build_xml" = "yes" -a ! -f "$project_dir/gnome/lib/libxslt.a"; then lib="libxslt-1.1.34" prepare_gz $lib.tar.gz http://xmlsoft.org/download/ echo "Configuring $lib..." CFLAGS="$CFLAGS -D__stub_clock_gettime -Dclock_gettime=choke_me" \ ./configure --prefix=$project_dir/gnome \ --with-libxml-prefix=$project_dir/gnome \ --without-debug \ --without-debugger \ --without-crypto \ --without-plugins \ --disable-shared \ --silent $cflags echo "Building $lib..." make install cleanup fi if test "$build_gmime" = "yes"; then glib_ldflags="" gmime_cflags="" gmime_ldflags="-L$project_dir/gmime/lib/" os=`uname` if test "$os" = "FreeBSD"; then gmime_cflags="CFLAGS=-I/usr/local/include CXXFLAGS=-I/usr/local/include" glib_ldflags="LDFLAGS=-L/usr/local/lib" gmime_ldflags="$gmime_ldflags -L/usr/local/lib" fi if test ! -f "$project_dir/gmime/lib/libglib-2.0.a"; then lib="glib-2.28.8" prepare_xz $lib.tar.xz ftp://ftp.gnome.org/pub/GNOME/sources/glib/2.28/ echo "Configuring $lib..." ./configure --prefix=$project_dir/gmime \ --enable-dtrace=no \ --enable-debug=no \ --enable-iconv-cache=no \ --disable-fam \ --disable-selinux \ --disable-xattr \ --disable-shared \ --enable-static \ --silent $cflags $gmime_cflags $glib_ldflags echo "Building $lib..." make install cleanup fi if test ! -f "$project_dir/gmime/lib/libgmime-2.4.a"; then lib="gmime-2.4.32" prepare_xz $lib.tar.xz ftp://ftp.gnome.org/pub/GNOME/sources/gmime/2.4/ echo "Configuring $lib..." ./configure --prefix=$project_dir/gmime \ --disable-glibtest \ --disable-mono \ --disable-shared \ --enable-static \ --silent $cflags $gmime_cflags LDFLAGS="$gmime_ldflags" PKG_CONFIG_PATH="$project_dir/gmime/lib/pkgconfig" echo "Building $lib..." make install cleanup fi fi cd $parser3_dir if test ! -f "Makefile"; then echo "Configuring parser3..." ./configure --prefix=$install_directory \ --sysconfdir=$install_directory/bin \ --datadir=$install_directory/bin \ --datarootdir="\$confdir" \ --libdir="\$confdir/lib" \ --with-sendmail="$sendmail_command" \ $options $cflags $gmime_cflags fi echo "Building parser3..." make install if test $? -ne 0; then exit 1; fi if test "$build_stripped" = "yes"; then strip ${install_directory}/bin/parser3 fi echo "DONE" echo echo "********************************************************************************************************" echo "Now you can copy $install_directory/bin to your cgi-bin directory" echo "Read more about installing Parser here:" echo " http://www.parser.ru/en/docs/lang/install4apachecgi.htm in English" echo " http://www.parser.ru/docs/lang/install4apachecgi.htm in Russian" echo "********************************************************************************************************" parser-3.5.1/etc/0000755000076400007640000000000014740300546010603 500000000000000parser-3.5.1/etc/parser3.charsets/0000755000076400007640000000000014740300546013775 500000000000000parser-3.5.1/etc/parser3.charsets/windows-1251.cfg0000644000076400007640000001201011445753746016465 00000000000000char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 x x 0x90 0x0402 0x81 x x 0x83 0x0403 0x82 0x201A 0x83 x x 0x0453 0x84 0x201E 0x85 0x2026 0x86 0x2020 0x87 0x2021 0x88 0x20AC 0x89 0x2030 0x8A x x 0x9A 0x0409 0x8B 0x2039 0x8C x x 0x9C 0x040A 0x8D x x 0x9D 0x040C 0x8E x x 0x9E 0x040B 0x8F x x 0x9F 0x040F 0x90 x x 0x0452 0x91 0x2018 0x92 0x2019 0x93 0x201C 0x94 0x201D 0x95 0x2022 0x96 0x2013 0x97 0x2014 0x99 0x2122 0x9A x x 0x0459 0x9B 0x203A 0x9C x x 0x045A 0x9D x x 0x045C 0x9E x x 0x045B 0x9F x x 0x045F 0xA0 x 0xA1 x x 0xA2 0x040E 0xA2 x x 0x045E 0xA3 x x 0xBC 0x0408 0xA4 0xA5 x x 0xB4 0x0490 0xA6 0xA7 0xA8 x x 0xB8 0x0401 0xA9 0xAA x x 0xBA 0x0404 0xAB 0xAC 0xAD 0xAE 0xAF x x 0xBF 0x0407 0xB0 0xB1 0xB2 x x 0xB3 0x0406 0xB3 x x 0x0456 0xB4 x x 0x0491 0xB5 0xB6 0xB7 0xB8 x x 0x0451 0xB9 0x2116 0xBA x x 0x0454 0xBB 0xBC x x 0x0458 0xBD x x 0xBE 0x0405 0xBE x x 0x0455 0xBF x x 0x0457 0xC0 x x 0xE0 0x0410 0xC1 x x 0xE1 0x0411 0xC2 x x 0xE2 0x0412 0xC3 x x 0xE3 0x0413 0xC4 x x 0xE4 0x0414 0xC5 x x 0xE5 0x0415 0xC6 x x 0xE6 0x0416 0xC7 x x 0xE7 0x0417 0xC8 x x 0xE8 0x0418 0xC9 x x 0xE9 0x0419 0xCA x x 0xEA 0x041A 0xCB x x 0xEB 0x041B 0xCC x x 0xEC 0x041C 0xCD x x 0xED 0x041D 0xCE x x 0xEE 0x041E 0xCF x x 0xEF 0x041F 0xD0 x x 0xF0 0x0420 0xD1 x x 0xF1 0x0421 0xD2 x x 0xF2 0x0422 0xD3 x x 0xF3 0x0423 0xD4 x x 0xF4 0x0424 0xD5 x x 0xF5 0x0425 0xD6 x x 0xF6 0x0426 0xD7 x x 0xF7 0x0427 0xD8 x x 0xF8 0x0428 0xD9 x x 0xF9 0x0429 0xDA x x 0xFA 0x042A 0xDB x x 0xFB 0x042B 0xDC x x 0xFC 0x042C 0xDD x x 0xFD 0x042D 0xDE x x 0xFE 0x042E 0xDF x x 0xFF 0x042F 0xE0 x x 0x0430 0xE1 x x 0x0431 0xE2 x x 0x0432 0xE3 x x 0x0433 0xE4 x x 0x0434 0xE5 x x 0x0435 0xE6 x x 0x0436 0xE7 x x 0x0437 0xE8 x x 0x0438 0xE9 x x 0x0439 0xEA x x 0x043A 0xEB x x 0x043B 0xEC x x 0x043C 0xED x x 0x043D 0xEE x x 0x043E 0xEF x x 0x043F 0xF0 x x 0x0440 0xF1 x x 0x0441 0xF2 x x 0x0442 0xF3 x x 0x0443 0xF4 x x 0x0444 0xF5 x x 0x0445 0xF6 x x 0x0446 0xF7 x x 0x0447 0xF8 x x 0x0448 0xF9 x x 0x0449 0xFA x x 0x044A 0xFB x x 0x044B 0xFC x x 0x044C 0xFD x x 0x044D 0xFE x x 0x044E 0xFF x x 0x044F #$Id: windows-1251.cfg,v 1.14 2010/09/20 21:53:42 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT parser-3.5.1/etc/parser3.charsets/windows-1257.cfg0000644000076400007640000001107511445753747016506 00000000000000char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 0x20AC 0x82 0x201A 0x84 0x201E 0x85 0x2026 0x86 0x2020 0x87 0x2021 0x89 0x2030 0x8B 0x2039 0x8D 0x00A8 0x8E 0x02C7 0x8F 0x00B8 0x91 0x2018 0x92 0x2019 0x93 0x201C 0x94 0x201D 0x95 0x2022 0x96 0x2013 0x97 0x2014 0x99 0x2122 0x9B 0x203A 0x9D 0x00AF 0x9E 0x02DB 0xA0 x 0xA2 0xA3 0xA4 0xA6 0xA7 0xA8 x x 0xB8 0x00D8 0xA9 0xAA x x 0xBA 0x0156 0xAB 0xAC 0xAD 0xAE 0xAF x x 0xBF 0x00C6 0xB0 0xB1 0xB2 x x 0xB3 x x 0xB4 0xB5 0xB6 0xB7 0xB8 x x 0x00F8 0xB9 x x 0xBA x x 0x0157 0xBB 0xBC 0xBD 0xBE 0xBF x x 0x00E6 0xC0 x x 0xE0 0x0104 0xC1 x x 0xE1 0x012E 0xC2 x x 0xE2 0x0100 0xC3 x x 0xE3 0x0106 0xC4 x x 0xE4 0xC5 x x 0xE5 0xC6 x x 0xE6 0x0118 0xC7 x x 0xE7 0x0112 0xC8 x x 0xE8 0x010C 0xC9 x x 0xE9 0xCA x x 0xEA 0x0179 0xCB x x 0xEB 0x0116 0xCC x x 0xEC 0x0122 0xCD x x 0xED 0x0136 0xCE x x 0xEE 0x012A 0xCF x x 0xEF 0x013B 0xD0 x x 0xF0 0x0160 0xD1 x x 0xF1 0x0143 0xD2 x x 0xF2 0x0145 0xD3 x x 0xF3 0xD4 x x 0xF4 0x014C 0xD5 x x 0xF5 0xD6 x x 0xF6 0xD7 0xD8 x x 0xF8 0x0172 0xD9 x x 0xF9 0x0141 0xDA x x 0xFA 0x015A 0xDB x x 0xFB 0x016A 0xDC x x 0xFC 0xDD x x 0xFD 0x017B 0xDE x x 0xFE 0x017D 0xDF x x 0xE0 x x 0x0105 0xE1 x x 0x012F 0xE2 x x 0x0101 0xE3 x x 0x0107 0xE4 x x 0xE5 x x 0xE6 x x 0x0119 0xE7 x x 0x0113 0xE8 x x 0x010D 0xE9 x x 0xEA x x 0x017A 0xEB x x 0x0117 0xEC x x 0x0123 0xED x x 0x0137 0xEE x x 0x012B 0xEF x x 0x013C 0xF0 x x 0x0161 0xF1 x x 0x0144 0xF2 x x 0x0146 0xF3 x x 0xF4 x x 0x014D 0xF5 x x 0xF6 x x 0xF7 0xF8 x x 0x0173 0xF9 x x 0x0142 0xFA x x 0x015B 0xFB x x 0x016B 0xFC x x 0xFD x x 0x017C 0xFE x x 0x017E 0xFF 0x02D9 #$Id: windows-1257.cfg,v 1.3 2010/09/20 21:53:43 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT parser-3.5.1/etc/parser3.charsets/Makefile.in0000644000076400007640000003626714740273415016004 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = etc/parser3.charsets ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(charsetsdir)" DATA = $(charsets_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ charsetsdir = @datadir@/charsets charsets_DATA = cp866.cfg koi8-r.cfg koi8-u.cfg windows-1250.cfg windows-1251.cfg windows-1254.cfg windows-1257.cfg x-mac-cyrillic.cfg EXTRA_DIST = $(charsets_DATA) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/parser3.charsets/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu etc/parser3.charsets/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-charsetsDATA: $(charsets_DATA) @$(NORMAL_INSTALL) @list='$(charsets_DATA)'; test -n "$(charsetsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(charsetsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(charsetsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(charsetsdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(charsetsdir)" || exit $$?; \ done uninstall-charsetsDATA: @$(NORMAL_UNINSTALL) @list='$(charsets_DATA)'; test -n "$(charsetsdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(charsetsdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(charsetsdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-charsetsDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-charsetsDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-charsetsDATA install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-charsetsDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/etc/parser3.charsets/koi8-u.cfg0000644000076400007640000001202011446221750015504 00000000000000char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 0x2500 0x81 0x2502 0x82 0x250C 0x83 0x2510 0x84 0x2514 0x85 0x2518 0x86 0x251C 0x87 0x2524 0x88 0x252C 0x89 0x2534 0x8A 0x253C 0x8B 0x2580 0x8C 0x2584 0x8D 0x2588 0x8E 0x258C 0x8F 0x2590 0x90 0x2591 0x91 0x2592 0x92 0x2593 0x93 0x2320 0x94 0x25A0 0x95 0x2219 0x96 0x221A 0x97 0x2248 0x98 0x2264 0x99 0x2265 0x9A 0x00A0 0x9B 0x2321 0x9C 0xB0 0x9D 0x00B2 0x9E 0x00B7 0x9F 0x00F7 0xA0 0x2550 0xA1 0x2551 0xA2 0x2552 0xA3 x x 0x0451 0xA4 x x 0x0454 0xA5 0x2554 0xA6 x x 0x0456 0xA7 x x 0x0457 0xA8 0x2557 0xA9 0x2558 0xAA 0x2559 0xAB 0x255A 0xAC 0x255B 0xAD x x 0x0491 0xAE 0x255D 0xAF 0x255E 0xB0 0x255F 0xB1 0x2560 0xB2 0x2561 0xB3 x x 0xA3 0x0401 0xB4 x x 0xA4 0x0404 0xB5 0x2563 0xB6 x x 0xA6 0x0406 0xB7 x x 0xA7 0x0407 0xB8 0x2566 0xB9 0x2567 0xBA 0x2568 0xBB 0x2569 0xBC 0x256A 0xBD x x 0xAD 0x0490 0xBE 0x256C 0xBF 0x00A9 0xC0 x x 0x044E 0xC1 x x 0x0430 0xC2 x x 0x0431 0xC3 x x 0x0446 0xC4 x x 0x0434 0xC5 x x 0x0435 0xC6 x x 0x0444 0xC7 x x 0x0433 0xC8 x x 0x0445 0xC9 x x 0x0438 0xCA x x 0x0439 0xCB x x 0x043A 0xCC x x 0x043B 0xCD x x 0x043C 0xCE x x 0x043D 0xCF x x 0x043E 0xD0 x x 0x043F 0xD1 x x 0x044F 0xD2 x x 0x0440 0xD3 x x 0x0441 0xD4 x x 0x0442 0xD5 x x 0x0443 0xD6 x x 0x0436 0xD7 x x 0x0432 0xD8 x x 0x044C 0xD9 x x 0x044B 0xDA x x 0x0437 0xDB x x 0x0448 0xDC x x 0x044D 0xDD x x 0x0449 0xDE x x 0x0447 0xDF x x 0x044A 0xE0 x x 0xC0 0x042E 0xE1 x x 0xC1 0x0410 0xE2 x x 0xC2 0x0411 0xE3 x x 0xC3 0x0426 0xE4 x x 0xC4 0x0414 0xE5 x x 0xC5 0x0415 0xE6 x x 0xC6 0x0424 0xE7 x x 0xC7 0x0413 0xE8 x x 0xC8 0x0425 0xE9 x x 0xC9 0x0418 0xEA x x 0xCA 0x0419 0xEB x x 0xCB 0x041A 0xEC x x 0xCC 0x041B 0xED x x 0xCD 0x041C 0xEE x x 0xCE 0x041D 0xEF x x 0xCF 0x041E 0xF0 x x 0xD0 0x041F 0xF1 x x 0xD1 0x042F 0xF2 x x 0xD2 0x0420 0xF3 x x 0xD3 0x0421 0xF4 x x 0xD4 0x0422 0xF5 x x 0xD5 0x0423 0xF6 x x 0xD6 0x0416 0xF7 x x 0xD7 0x0412 0xF8 x x 0xD8 0x042C 0xF9 x x 0xD9 0x042B 0xFA x x 0xDA 0x0417 0xFB x x 0xDB 0x0428 0xFC x x 0xDC 0x042D 0xFD x x 0xDD 0x0429 0xFE x x 0xDE 0x0427 0xFF x x 0xDF 0x042A #$Id: koi8-u.cfg,v 1.1 2010/09/21 21:30:16 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-U.TXT parser-3.5.1/etc/parser3.charsets/Makefile.am0000644000076400007640000000027711764601311015754 00000000000000charsetsdir=@datadir@/charsets charsets_DATA=cp866.cfg koi8-r.cfg koi8-u.cfg windows-1250.cfg windows-1251.cfg windows-1254.cfg windows-1257.cfg x-mac-cyrillic.cfg EXTRA_DIST=$(charsets_DATA)parser-3.5.1/etc/parser3.charsets/windows-1254.cfg0000644000076400007640000001055711445753746016506 00000000000000char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 0x20AC 0x82 0x201A 0x83 x x 0x0192 0x84 0x201E 0x85 0x2026 0x86 0x2020 0x87 0x2021 0x88 0x02C6 0x89 0x2030 0x8A x x 0x9A 0x0160 0x8B 0x2039 0x8C x x 0x9C 0x0152 0x91 0x2018 0x92 0x2019 0x93 0x201C 0x94 0x201D 0x95 0x2022 0x96 0x2013 0x97 0x2014 0x98 0x02DC 0x99 0x2122 0x9A x x 0x0161 0x9B 0x203A 0x9C x x 0x0153 0x9F x x 0xFF 0x0178 0xA0 x 0xA1 0xA2 0xA3 0xA4 0xA5 0xA6 0xA7 0xA8 0xA9 0xAA 0xAB 0xAC 0xAD 0xAE 0xAF 0xB0 0xB1 0xB2 x x 0xB3 x x 0xB4 0xB5 0xB6 0xB7 0xB8 0xB9 x x 0xBA 0xBB 0xBC 0xBD 0xBE 0xBF 0xC0 x x 0xE0 0xC1 x x 0xE1 0xC2 x x 0xE2 0xC3 x x 0xE3 0xC4 x x 0xE4 0xC5 x x 0xE5 0xC6 x x 0xE6 0xC7 x x 0xE7 0xC8 x x 0xE8 0xC9 x x 0xE9 0xCA x x 0xEA 0xCB x x 0xEB 0xCC x x 0xEC 0xCD x x 0xED 0xCE x x 0xEE 0xCF x x 0xEF 0xD0 x x 0xF0 0x011E 0xD1 x x 0xF1 0xD2 x x 0xF2 0xD3 x x 0xF3 0xD4 x x 0xF4 0xD5 x x 0xF5 0xD6 x x 0xF6 0xD7 0xD8 x x 0xF8 0xD9 x x 0xF9 0xDA x x 0xFA 0xDB x x 0xFB 0xDC x x 0xFC 0xDD x x 0x0130 0xDE x x 0xFE 0x015E 0xDF x x 0xE0 x x 0xE1 x x 0xE2 x x 0xE3 x x 0xE4 x x 0xE5 x x 0xE6 x x 0xE7 x x 0xE8 x x 0xE9 x x 0xEA x x 0xEB x x 0xEC x x 0xED x x 0xEE x x 0xEF x x 0xF0 x x 0x011F 0xF1 x x 0xF2 x x 0xF3 x x 0xF4 x x 0xF5 x x 0xF6 x x 0xF7 0xF8 x x 0xF9 x x 0xFA x x 0xFB x x 0xFC x x 0xFD x x 0x0131 0xFE x x 0x015F 0xFF x x #$Id: windows-1254.cfg,v 1.2 2010/09/20 21:53:42 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT parser-3.5.1/etc/parser3.charsets/koi8-r.cfg0000644000076400007640000001176011446221750015513 00000000000000char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 0x2500 0x81 0x2502 0x82 0x250C 0x83 0x2510 0x84 0x2514 0x85 0x2518 0x86 0x251C 0x87 0x2524 0x88 0x252C 0x89 0x2534 0x8A 0x253C 0x8B 0x2580 0x8C 0x2584 0x8D 0x2588 0x8E 0x258C 0x8F 0x2590 0x90 0x2591 0x91 0x2592 0x92 0x2593 0x93 0x2320 0x94 0x25A0 0x95 0x2219 0x96 0x221A 0x97 0x2248 0x98 0x2264 0x99 0x2265 0x9A 0x00A0 0x9B 0x2321 0x9C 0xB0 0x9D 0x00B2 0x9E 0x00B7 0x9F 0x00F7 0xA0 0x2550 0xA1 0x2551 0xA2 0x2552 0xA3 x x 0x0451 0xA4 0x2553 0xA5 0x2554 0xA6 0x2555 0xA7 0x2556 0xA8 0x2557 0xA9 0x2558 0xAA 0x2559 0xAB 0x255A 0xAC 0x255B 0xAD 0x255C 0xAE 0x255D 0xAF 0x255E 0xB0 0x255F 0xB1 0x2560 0xB2 0x2561 0xB3 x x 0xA3 0x0401 0xB4 0x2562 0xB5 0x2563 0xB6 0x2564 0xB7 0x2565 0xB8 0x2566 0xB9 0x2567 0xBA 0x2568 0xBB 0x2569 0xBC 0x256A 0xBD 0x256B 0xBE 0x256C 0xBF 0x00A9 0xC0 x x 0x044E 0xC1 x x 0x0430 0xC2 x x 0x0431 0xC3 x x 0x0446 0xC4 x x 0x0434 0xC5 x x 0x0435 0xC6 x x 0x0444 0xC7 x x 0x0433 0xC8 x x 0x0445 0xC9 x x 0x0438 0xCA x x 0x0439 0xCB x x 0x043A 0xCC x x 0x043B 0xCD x x 0x043C 0xCE x x 0x043D 0xCF x x 0x043E 0xD0 x x 0x043F 0xD1 x x 0x044F 0xD2 x x 0x0440 0xD3 x x 0x0441 0xD4 x x 0x0442 0xD5 x x 0x0443 0xD6 x x 0x0436 0xD7 x x 0x0432 0xD8 x x 0x044C 0xD9 x x 0x044B 0xDA x x 0x0437 0xDB x x 0x0448 0xDC x x 0x044D 0xDD x x 0x0449 0xDE x x 0x0447 0xDF x x 0x044A 0xE0 x x 0xC0 0x042E 0xE1 x x 0xC1 0x0410 0xE2 x x 0xC2 0x0411 0xE3 x x 0xC3 0x0426 0xE4 x x 0xC4 0x0414 0xE5 x x 0xC5 0x0415 0xE6 x x 0xC6 0x0424 0xE7 x x 0xC7 0x0413 0xE8 x x 0xC8 0x0425 0xE9 x x 0xC9 0x0418 0xEA x x 0xCA 0x0419 0xEB x x 0xCB 0x041A 0xEC x x 0xCC 0x041B 0xED x x 0xCD 0x041C 0xEE x x 0xCE 0x041D 0xEF x x 0xCF 0x041E 0xF0 x x 0xD0 0x041F 0xF1 x x 0xD1 0x042F 0xF2 x x 0xD2 0x0420 0xF3 x x 0xD3 0x0421 0xF4 x x 0xD4 0x0422 0xF5 x x 0xD5 0x0423 0xF6 x x 0xD6 0x0416 0xF7 x x 0xD7 0x0412 0xF8 x x 0xD8 0x042C 0xF9 x x 0xD9 0x042B 0xFA x x 0xDA 0x0417 0xFB x x 0xDB 0x0428 0xFC x x 0xDC 0x042D 0xFD x x 0xDD 0x0429 0xFE x x 0xDE 0x0427 0xFF x x 0xDF 0x042A #$Id: koi8-r.cfg,v 1.8 2010/09/21 21:30:16 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT parser-3.5.1/etc/parser3.charsets/x-mac-cyrillic.cfg0000644000076400007640000001177011445753747017237 00000000000000char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x80 x x 0xE0 0x0410 0x81 x x 0xE1 0x0411 0x82 x x 0xE2 0x0412 0x83 x x 0xE3 0x0413 0x84 x x 0xE4 0x0414 0x85 x x 0xE5 0x0415 0x86 x x 0xE6 0x0416 0x87 x x 0xE7 0x0417 0x88 x x 0xE8 0x0418 0x89 x x 0xE9 0x0419 0x8A x x 0xEA 0x041A 0x8B x x 0xEB 0x041B 0x8C x x 0xEC 0x041C 0x8D x x 0xED 0x041D 0x8E x x 0xEE 0x041E 0x8F x x 0xEF 0x041F 0x90 x x 0xF0 0x0420 0x91 x x 0xF1 0x0421 0x92 x x 0xF2 0x0422 0x93 x x 0xF3 0x0423 0x94 x x 0xF4 0x0424 0x95 x x 0xF5 0x0425 0x96 x x 0xF6 0x0426 0x97 x x 0xF7 0x0427 0x98 x x 0xF8 0x0428 0x99 x x 0xF9 0x0429 0x9A x x 0xFA 0x042A 0x9B x x 0xFB 0x042B 0x9C x x 0xFC 0x042C 0x9D x x 0xFD 0x042D 0x9E x x 0xFE 0x042E 0x9F x x 0xDF 0x042F 0xA0 0x2020 0xA1 0x00B0 0xA2 0x0490 0xA3 0xA4 0x00A7 0xA5 0x2022 0xA6 0x00B6 0xA7 x x 0xB4 0x0406 0xA8 0x00AE 0xA9 0xAA 0x2122 0xAB 0x0402 0xAC 0x0452 0xAD 0x2260 0xAE 0x0403 0xAF 0x0453 0xB0 0x221E 0xB1 0x00B1 0xB2 0x2264 0xB3 0x2265 0xB4 x x 0x0456 0xB5 0xB6 0x0491 0xB7 0x0408 0xB8 x x 0xB9 0x0404 0xB9 x x 0x0454 0xBA x x 0xBB 0x0407 0xBB x x 0x0457 0xBC 0x0409 0xBD 0x0459 0xBE 0x040A 0xBF 0x045A 0xC0 0x0458 0xC1 0x0405 0xC2 0x00AC 0xC3 0x221A 0xC4 0x0192 0xC5 0x2248 0xC6 0x2206 0xC7 0x00AB 0xC8 0x00BB 0xC9 0x2026 0xCA x 0x00A0 0xCB 0x040B 0xCC 0x045B 0xCD 0x040C 0xCE 0x045C 0xCF 0x0455 0xD0 0x2013 0xD1 0x2014 0xD2 0x201C 0xD3 0x201D 0xD4 0x2018 0xD5 0x2019 0xD6 0x00F7 0xD7 0x201E 0xD8 0x040E 0xD9 0x045E 0xDA 0x040F 0xDB 0x045F 0xDC 0x2116 0xDD x x 0xDE 0x0401 0xDE x x 0x0451 0xDF x x 0x044F 0xE0 x x 0x0430 0xE1 x x 0x0431 0xE2 x x 0x0432 0xE3 x x 0x0433 0xE4 x x 0x0434 0xE5 x x 0x0435 0xE6 x x 0x0436 0xE7 x x 0x0437 0xE8 x x 0x0438 0xE9 x x 0x0439 0xEA x x 0x043A 0xEB x x 0x043B 0xEC x x 0x043C 0xED x x 0x043D 0xEE x x 0x043E 0xEF x x 0x043F 0xF0 x x 0x0440 0xF1 x x 0x0441 0xF2 x x 0x0442 0xF3 x x 0x0443 0xF4 x x 0x0444 0xF5 x x 0x0445 0xF6 x x 0x0446 0xF7 x x 0x0447 0xF8 x x 0x0448 0xF9 x x 0x0449 0xFA x x 0x044A 0xFB x x 0x044B 0xFC x x 0x044C 0xFD x x 0x044D 0xFE x x 0x044E 0xFF 0x20AC #$Id: x-mac-cyrillic.cfg,v 1.3 2010/09/20 21:53:43 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT parser-3.5.1/etc/parser3.charsets/windows-1250.cfg0000644000076400007640000001127511445753746016500 00000000000000char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 0x20AC 0x82 0x201A 0x84 0x201E 0x85 0x2026 0x86 0x2020 0x87 0x2021 0x89 0x2030 0x8A x x 0x9A 0x0160 0x8B 0x2039 0x8C x x 0x9C 0x015A 0x8D x x 0x9D 0x0164 0x8E x x 0x9E 0x017D 0x8F x x 0x9F 0x0179 0x91 0x2018 0x92 0x2019 0x93 0x201C 0x94 0x201D 0x95 0x2022 0x96 0x2013 0x97 0x2014 0x99 0x2122 0x9A x x 0x0161 0x9B 0x203A 0x9C x x 0x015B 0x9D x x 0x0165 0x9E x x 0x017E 0x9F x x 0x017A 0xA0 x 0xA1 0x02C7 0xA2 0x02D8 0xA3 x x 0xB3 0x0141 0xA4 0xA5 x x 0xB9 0x0104 0xA6 0xA7 0xA8 0xA9 0xAA x x 0xBA 0x015E 0xAB 0xAC 0xAD 0xAE 0xAF x x 0xBF 0x017B 0xB0 0xB1 0xB2 0x02DB 0xB3 x x 0x0142 0xB4 0xB5 0xB6 0xB7 0xB8 0xB9 x x 0x0105 0xBA x x 0x015F 0xBB 0xBC x x 0xBE 0x013D 0xBD 0x02DD 0xBE x x 0x013E 0xBF x x 0x017C 0xC0 x x 0xE0 0x0154 0xC1 x x 0xE1 0xC2 x x 0xE2 0xC3 x x 0xE3 0x0102 0xC4 x x 0xE4 0xC5 x x 0xE5 0x0139 0xC6 x x 0xE6 0x0106 0xC7 x x 0xE7 0xC8 x x 0xE8 0x010C 0xC9 x x 0xE9 0xCA x x 0xEA 0x0118 0xCB x x 0xEB 0xCC x x 0xEC 0x011A 0xCD x x 0xED 0xCE x x 0xEE 0xCF x x 0xEF 0x010E 0xD0 x x 0xF0 0x0110 0xD1 x x 0xF1 0x0143 0xD2 x x 0xF2 0x0147 0xD3 x x 0xF3 0xD4 x x 0xF4 0xD5 x x 0xF5 0x0150 0xD6 x x 0xF6 0xD7 0xD8 x x 0xF8 0x0158 0xD9 x x 0xF9 0x016E 0xDA x x 0xFA 0xDB x x 0xFB 0x0170 0xDC x x 0xFC 0xDD x x 0xFD 0xDE x x 0xFE 0x0162 0xDF x x 0xE0 x x 0x0155 0xE1 x x 0xE2 x x 0xE3 x x 0x0103 0xE4 x x 0xE5 x x 0x013A 0xE6 x x 0x0107 0xE7 x x 0xE8 x x 0x010D 0xE9 x x 0xEA x x 0x0119 0xEB x x 0xEC x x 0x011B 0xED x x 0xEE x x 0xEF x x 0x010F 0xF0 x x 0x0111 0xF1 x x 0x0144 0xF2 x x 0x0148 0xF3 x x 0xF4 x x 0xF5 x x 0x0151 0xF6 x x 0xF7 0xF8 x x 0x0159 0xF9 x x 0x016F 0xFA x x 0xFB x x 0x0171 0xFC x x 0xFD x x 0xFE x x 0x0163 0xFF 0x02D9 #$Id: windows-1250.cfg,v 1.2 2010/09/20 21:53:42 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT parser-3.5.1/etc/parser3.charsets/cp866.cfg0000644000076400007640000001201511534227423015243 00000000000000char white-space digit hex-digit letter word lowercase unicode1 unicode2 0x09 x 0x0A x 0x0B x 0x0C x 0x0D x 0x20 x ! 0x0021 0xFF01 0x22 0x0022 0xFF02 0x23 0x0023 0xFF03 $ 0x0024 0xFF04 % 0x0025 0xFF05 & 0x0026 0xFF06 ' 0x0027 0xFF07 ( 0x0028 0xFF08 ) 0x0029 0xFF09 * 0x002A 0xFF0A + 0x002B 0xFF0B , 0x002C 0xFF0C - 0x002D 0xFF0D . 0x002E 0xFF0E / 0x002F 0xFF0F 0 x x x 0x0030 0xFF10 1 x x x 0x0031 0xFF11 2 x x x 0x0032 0xFF12 3 x x x 0x0033 0xFF13 4 x x x 0x0034 0xFF14 5 x x x 0x0035 0xFF15 6 x x x 0x0036 0xFF16 7 x x x 0x0037 0xFF17 8 x x x 0x0038 0xFF18 9 x x x 0x0039 0xFF19 : 0x003A 0xFF1A ; 0x003B 0xFF1B < 0x003C 0xFF1C = 0x003D 0xFF1D > 0x003E 0xFF1E ? 0x003F 0xFF1F @ 0x0040 0xFF20 A x x x a 0x0041 0xFF21 B x x x b 0x0042 0xFF22 C x x x c 0x0043 0xFF23 D x x x d 0x0044 0xFF24 E x x x e 0x0045 0xFF25 F x x x f 0x0046 0xFF26 G x x g 0x0047 0xFF27 H x x h 0x0048 0xFF28 I x x i 0x0049 0xFF29 J x x j 0x004A 0xFF2A K x x k 0x004B 0xFF2B L x x l 0x004C 0xFF2C M x x m 0x004D 0xFF2D N x x n 0x004E 0xFF2E O x x o 0x004F 0xFF2F P x x p 0x0050 0xFF30 Q x x q 0x0051 0xFF31 R x x r 0x0052 0xFF32 S x x s 0x0053 0xFF33 T x x t 0x0054 0xFF34 U x x u 0x0055 0xFF35 V x x v 0x0056 0xFF36 W x x w 0x0057 0xFF37 X x x x 0x0058 0xFF38 Y x x y 0x0059 0xFF39 Z x x z 0x005A 0xFF3A [ 0x005B 0xFF3B \ 0x005C 0xFF3C ] 0x005D 0xFF3D ^ 0x005E 0xFF3E _ x 0x005F 0xFF3F ` 0x0060 0xFF40 a x x x 0x0061 0xFF41 b x x x 0x0062 0xFF42 c x x x 0x0063 0xFF43 d x x x 0x0064 0xFF44 e x x x 0x0065 0xFF45 f x x x 0x0066 0xFF46 g x x 0x0067 0xFF47 h x x 0x0068 0xFF48 i x x 0x0069 0xFF49 j x x 0x006A 0xFF4A k x x 0x006B 0xFF4B l x x 0x006C 0xFF4C m x x 0x006D 0xFF4D n x x 0x006E 0xFF4E o x x 0x006F 0xFF4F p x x 0x0070 0xFF50 q x x 0x0071 0xFF51 r x x 0x0072 0xFF52 s x x 0x0073 0xFF53 t x x 0x0074 0xFF54 u x x 0x0075 0xFF55 v x x 0x0076 0xFF56 w x x 0x0077 0xFF57 x x x 0x0078 0xFF58 y x x 0x0079 0xFF59 z x x 0x007A 0xFF5A { 0x007B 0xFF5B | 0x007C 0xFF5C } 0x007D 0xFF5D ~ 0x007E 0xFF5E 0x7F 0x80 x x 0xA0 0x0410 0x81 x x 0xA1 0x0411 0x82 x x 0xA2 0x0412 0x83 x x 0xA3 0x0413 0x84 x x 0xA4 0x0414 0x85 x x 0xA5 0x0415 0x86 x x 0xA6 0x0416 0x87 x x 0xA7 0x0417 0x88 x x 0xA8 0x0418 0x89 x x 0xA9 0x0419 0x8A x x 0xAA 0x041A 0x8B x x 0xAB 0x041B 0x8C x x 0xAC 0x041C 0x8D x x 0xAD 0x041D 0x8E x x 0xAE 0x041E 0x8F x x 0xAF 0x041F 0x90 x x 0xE0 0x0420 0x91 x x 0xE1 0x0421 0x92 x x 0xE2 0x0422 0x93 x x 0xE3 0x0423 0x94 x x 0xE4 0x0424 0x95 x x 0xE5 0x0425 0x96 x x 0xE6 0x0426 0x97 x x 0xE7 0x0427 0x98 x x 0xE8 0x0428 0x99 x x 0xE9 0x0429 0x9A x x 0xEA 0x042A 0x9B x x 0xEB 0x042B 0x9C x x 0xEC 0x042C 0x9D x x 0xED 0x042D 0x9E x x 0xEE 0x042E 0x9F x x 0xEF 0x042F 0xA0 x x 0x0430 0xA1 x x 0x0431 0xA2 x x 0x0432 0xA3 x x 0x0433 0xA4 x x 0x0434 0xA5 x x 0x0435 0xA6 x x 0x0436 0xA7 x x 0x0437 0xA8 x x 0x0438 0xA9 x x 0x0439 0xAA x x 0x043A 0xAB x x 0x043B 0xAC x x 0x043C 0xAD x x 0x043D 0xAE x x 0x043E 0xAF x x 0x043F 0xB0 0x2591 0xB1 0x2592 0xB2 0x2593 0xB3 0x2502 0xB4 0x2524 0xB5 0x2561 0xB6 0x2562 0xB7 0x2556 0xB8 0x2555 0xB9 0x2563 0xBA 0x2551 0xBB 0x2557 0xBC 0x255d 0xBD 0x255c 0xBE 0x255b 0xBF 0x2510 0xC0 0x2514 0xC1 0x2534 0xC2 0x252c 0xC3 0x251c 0xC4 0x2500 0xC5 0x253c 0xC6 0x255e 0xC7 0x255f 0xC8 0x255a 0xC9 0x2554 0xCA 0x2569 0xCB 0x2566 0xCC 0x2560 0xCD 0x2550 0xCE 0x256c 0xCF 0x2567 0xD0 0x2568 0xD1 0x2564 0xD2 0x2565 0xD3 0x2559 0xD4 0x2558 0xD5 0x2552 0xD6 0x2553 0xD7 0x256b 0xD8 0x256a 0xD9 0x2518 0xDA 0x250c 0xDB 0x2588 0xDC 0x2584 0xDD 0x258c 0xDE 0x2590 0xDF 0x2580 0xE0 x x 0x0440 0xE1 x x 0x0441 0xE2 x x 0x0442 0xE3 x x 0x0443 0xE4 x x 0x0444 0xE5 x x 0x0445 0xE6 x x 0x0446 0xE7 x x 0x0447 0xE8 x x 0x0448 0xE9 x x 0x0449 0xEA x x 0x044A 0xEB x x 0x044B 0xEC x x 0x044C 0xED x x 0x044D 0xEE x x 0x044E 0xEF x x 0x044F 0xF0 x x 0xF1 0x0401 0xF1 x x 0x0451 0xF2 x x 0xF3 0x0404 0xF3 x x 0x0454 0xF4 x x 0xF5 0x0407 0xF5 x x 0x0457 0xF6 x x 0xF7 0x040E 0xF7 x x 0x045E 0xF8 0x00b0 0xF9 0x2219 0xFA 0x00b7 0xFB 0x221a 0xFC 0x2116 0xFD 0x00a4 0xFE 0x25a0 0xFF 0x00a0 #$Id: cp866.cfg,v 1.2 2011/03/04 18:27:31 moko Exp $ #Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP866.TXT parser-3.5.1/etc/Makefile.in0000644000076400007640000005250114740273415012577 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = etc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = auto.p CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(confdir)" DATA = $(conf_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/auto.p.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = parser3.charsets confdir = @sysconfdir@ conf_DATA = auto.p all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu etc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): auto.p: $(top_builddir)/config.status $(srcdir)/auto.p.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-confDATA: $(conf_DATA) @$(NORMAL_INSTALL) @list='$(conf_DATA)'; test -n "$(confdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(confdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(confdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(confdir)" || exit $$?; \ done uninstall-confDATA: @$(NORMAL_UNINSTALL) @list='$(conf_DATA)'; test -n "$(confdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(confdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(confdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-confDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-confDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-confDATA install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-confDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/etc/auto.p.in0000644000076400007640000001516114734016311012262 00000000000000#$Id: auto.p.in,v 1.18 2024/12/28 14:00:52 moko Exp $ @auto[] #source/client charsets $request:charset[utf-8] $response:charset[utf-8] $response:content-type[ $.value[text/html] $.charset[$response:charset] ] #$SQL.connect-string[mysql://user:pass@host/db?charset=utf8] #$SQL.connect-string[sqlite://db] #$SQL.connect-string[pgsql://user:pass@host/db] #$SQL.connect-string[odbc://DSN=datasource^;UID=user^;PWD=password] @conf[filespec] $confdir[^file:dirname[$filespec]] $charsetsdir[@datarootdir@/charsets] $sqldriversdir[@libdir@] $CHARSETS[ # $.cp866[$charsetsdir/cp866.cfg] # $.koi8-r[$charsetsdir/koi8-r.cfg] # $.koi8-u[$charsetsdir/koi8-u.cfg] # $.windows-1250[$charsetsdir/windows-1250.cfg] # $.windows-1251[$charsetsdir/windows-1251.cfg] # $.windows-1254[$charsetsdir/windows-1254.cfg] # $.windows-1257[$charsetsdir/windows-1257.cfg] # $.x-mac-cyrillic[$charsetsdir/x-mac-cyrillic.cfg] ] #change your client libraries paths to those on your system $SQL[ $.drivers[^table::create{protocol driver client mysql $sqldriversdir/libparser3mysql.@dll_extension@ libmysqlclient.@dll_extension@ #sqlite $sqldriversdir/libparser3sqlite.@dll_extension@ libsqlite3.@dll_extension@ #pgsql $sqldriversdir/libparser3pgsql.@dll_extension@ libpq.@dll_extension@ #oracle $sqldriversdir/libparser3oracle.@dll_extension@ libclntsh.@dll_extension@ }] ] #for ^file::load[name;user-name] mime-type autodetection $MIME-TYPES[^table::create{ext mime-type 7z application/x-7z-compressed avi video/x-msvideo bmp image/bmp css text/css cvs text/csv doc application/msword docx application/vnd.openxmlformats-officedocument.wordprocessingml.document dtd application/xml-dtd gif image/gif gz application/x-gzip htm text/html html text/html ico image/x-icon jpeg image/jpeg jpg image/jpeg js application/javascript json application/json log text/plain mov video/quicktime mp3 audio/mpeg mp4 video/mp4 mpg video/mpeg mpeg video/mpeg mts application/metastream otf font/otf pdf application/pdf png image/png ppt application/powerpoint rar application/vnd.rar rdf application/rdf+xml rss application/rss+xml rtf application/rtf svg image/svg+xml tar application/x-tar tgz application/x-gzip tif image/tiff tiff image/tiff ttf font/ttf txt text/plain wav audio/x-wav xls application/vnd.ms-excel xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xml text/xml xsl text/xml webm video/webm webp image/webp woff font/woff woff2 font/woff2 zip application/zip }] $LIMITS[ $.post_max_size(64*0x400*0x400) # $.max_file_size(512*0x400*0x400) # $.max_loop(100000) # $.max_array(1000000) # $.max_recursion(1000) ] #$HTTPD[ # $.mode[threaded] #] #$MAIL[ # $.SMTP[localhost] #] @fatal_error[title;subtitle;body] $response:status(500) $response:content-type[ $.value[text/html] $.charset[$response:charset] ] $title

^if(def $subtitle){$subtitle;$title}

$body #for [x] MSIE friendly ^for[i](0;512/8){} @unhandled_exception_debug[exception;stack] ^fatal_error[Unhandled Exception^if(def $exception.type){ ($exception.type)};$exception.source;
^untaint[html]{$exception.comment}
^if(def $exception.file){ ^untaint[html]{$exception.file^(${exception.lineno}:$exception.colno^)} } ^if($stack){
^stack.menu{ }
$stack.name$stack.file^(${stack.lineno}:$stack.colno^)
} ] @unhandled_exception_release[exception;stack] ^fatal_error[Unhandled Exception;;

The server encountered an unhandled exception and was unable to complete your request.

Please contact the server administrator, $env:SERVER_ADMIN and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the Parser error log or in debug version of unhandled_exception.

] @is_developer[] #change mask to your ip address $result(def $env:REMOTE_ADDR && ^env:REMOTE_ADDR.match[^^127\.0\.0\.1^$]) @unhandled_exception[exception;stack] #developer? use debug version to see problem details ^if(^is_developer[]){ ^unhandled_exception_debug[$exception;$stack] }{ ^if($exception.type eq "file.missing"){ # $response:location[/404/] ^httpd:404[] }{ ^unhandled_exception_release[$exception;$stack] } } @CLASS httpd @OPTIONS partial @auto[] ^if(-f "/httpd.p"){ ^use[/httpd.p] } @include[filename] ^use[$filename; $.main(true) ] ^MAIN:main[] @index[dir][list] ^fatal_error[Index of $dir;Index of $dir; $list[^file:list[$dir]] ^list.sort{^if($list.dir)[0;1] $list.name} ^list.menu{ ^if($list.dir){/}$list.name
} ] $response:status(200) # option can be method, URL or text/code @option[option] $result[^if($option is junction){^option[]}(^option.match[$cfg.parser]){^include[$option]}{$option}] @file[filename] $result[^if(^filename.match[$cfg.parser]){^include[$filename]}{$response:body[ $.file[$filename] $.name[] ]}] @log[filename;detail][now;line] $now[^date::now[]] $line[$env:REMOTE_ADDR [^now.sql-string[]] "$request:method $request:uri"$detail^#0A] ^line.save[append;$filename] @404[] $response:status[404] The requested URL was not found on this server. @config[result] @preprocess[return] @main[result][basic] #$request:document-root[/website/folder] $cfg[^config[ $.parser[\.(html)^$] $.index[index.html] # $.autoindex(true) $.404[$404] # $.404[/404.html] # $.fix-trailing-slash(true) # $.auth[ $.url[^^/\.?admin/] $.login[admin] $.password[change me] $.realm[site administration] ] $.deny[(/\.ht[^^/]+|\.p|\.cfg)^$] $.403[Permission denied] $.memory(64000) # $.log[/access.log] ]] $response:server[Parser$env:PARSER_VERSION] $response:date[^date::now[]] $response:connection[close] $uri[$request:path] ^if(def $cfg.log){ ^log[$cfg.log] } ^if(def $cfg.memory && $status:memory.ever_allocated_since_compact > $cfg.memory){ ^memory:compact[] } ^if(def $cfg.auth.url && ^uri.match[$cfg.auth.url]){ $basic[$cfg.auth.login:$cfg.auth.password] ^if($env:HTTP_AUTHORIZATION ne "Basic ^basic.base64[]"){ $response:WWW-Authenticate[Basic realm="$cfg.auth.realm"] $response:status[401] ^return[Authorization Required] } $env:REMOTE_USER[$cfg.auth.login] } ^if(def $cfg.deny && ^uri.match[$cfg.deny]){ $response:status[403] ^return[^option[$cfg.403]] }(def $cfg.[fix-trailing-slash] && ^uri.match[^^[^^.]+[^^/.]^$]){ ^return[$response:location[$uri/^if(def $request:query){?^taint[as-is;$request:query]}]] } ^preprocess{^return[]} ^if(def $cfg.index && -f "$uri/$cfg.index"){ $result[^file[$uri/$cfg.index]] }($cfg.autoindex && -d "$uri"){ $result[^index[$uri]] }(-f $uri){ $result[^file[$uri]] }{ $result[^option[$cfg.404]] } parser-3.5.1/etc/Makefile.am0000644000076400007640000000010113763451205012552 00000000000000SUBDIRS = parser3.charsets confdir=@sysconfdir@ conf_DATA=auto.p parser-3.5.1/gnu.vcproj0000644000076400007640000000420110734724454011772 00000000000000 parser-3.5.1/config.sub0000644000076400007640000010624613111545410011731 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-03-08' # 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 3 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # 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 1992-2015 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-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) 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 | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -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 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -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/'` ;; -sco5v6*) # 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*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -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 \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*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-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | amd64-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | powerpcspe-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # 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 ;; 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 ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; 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 ;; cr16 | cr16-*) basic_machine=cr16-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 ;; dicos) basic_machine=i686-pc os=-dicos ;; 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*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 ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; 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 ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; 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 ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; 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 ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) 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 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; 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 ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; 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 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; 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 ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) 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. -auroraux) os=-auroraux ;; -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* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -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* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -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* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # 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 ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -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 score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) 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 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; 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 ;; -cnk*|-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: parser-3.5.1/src/0000755000076400007640000000000014740300546010617 500000000000000parser-3.5.1/src/include/0000755000076400007640000000000014740300546012242 500000000000000parser-3.5.1/src/include/pa_charset.h0000644000076400007640000001365214726405317014461 00000000000000/** @file Parser: Charset connection decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_CHARSET_H #define PA_CHARSET_H #define IDENT_PA_CHARSET_H "$Id: pa_charset.h,v 1.60 2024/12/11 21:57:35 moko Exp $" #include "pa_exception.h" #include "pa_common.h" #include "pa_hash.h" #include "pa_array.h" #ifdef HAVE_PCRE2 #include #else #include #endif // we are using some pcre_internal.h stuff as well #include "../lib/pcre/pa_pcre_internal.h" #ifdef XML #include "libxml/xmlstring.h" #include "libxml/encoding.h" #endif // defines #define MAX_CHARSETS 10 #define MAX_CHARSET_UNI_CODES 500 #ifndef XMLCh typedef unsigned int XMLCh; #endif #ifndef XMLByte typedef unsigned char XMLByte; #endif // helpers typedef HashString HashStringString; /** charset holds name & transcode tables registers libxml transcoders */ class Charset: public PA_Object { public: Charset(Request_charsets* charsets, const String::Body ANAME, const String* afile_spec); const String::Body NAME() const { return FNAME; } const char* NAME_CSTR() const { return FNAME_CSTR; } bool isUTF8() const { return fisUTF8; } static String::C transcode(const String::C src, const Charset& source_charset, const Charset& dest_charset); static String::Body transcode(const String::Body src, const Charset& source_transcoder, const Charset& dest_transcoder); static String& transcode(const String& src, const Charset& source_transcoder, const Charset& dest_transcoder); static void transcode(ArrayString& src, const Charset& source_transcoder, const Charset& dest_transcoder); static void transcode(HashStringString& src, const Charset& source_transcoder, const Charset& dest_transcoder); static String::C escape(const String::C src, const Charset& source_charset); static String::Body escape(const String::Body src, const Charset& source_charset); static String& escape(const String& src, const Charset& source_charset); static String::C escape_JSON(const String::C src, const Charset& source_charset); static String::Body escape_JSON(const String::Body src, const Charset& source_charset); static String& escape_JSON(const String& src, const Charset& source_charset); void store_Char(XMLByte*& outPtr, XMLCh src, XMLByte not_found); #ifdef XML xmlCharEncodingHandler& transcoder(const String::Body NAME); #endif public: unsigned char pcre_tables[tables_length]; private: void load_definition(Request_charsets& charsets, const String& afile_spec); void sort_ToTable(); const String::C transcodeToUTF8(const String::C src) const; const String::C transcodeFromUTF8(const String::C src) const; const String::C transcodeToCharset(const String::C src, const Charset& dest_transcoder) const; public: struct Tables { struct Rec { XMLCh intCh; XMLByte extCh; }; XMLCh fromTable[0x100]; Rec toTable[MAX_CHARSET_UNI_CODES]; uint toTableSize; }; struct UTF8CaseTable { struct Rec { XMLCh from, to; }; uint size; Rec* records; }; private: const String::Body FNAME; char* FNAME_CSTR; bool fisUTF8; Tables tables; static size_t calc_escaped_length_UTF8(XMLByte* src, size_t src_length); static size_t calc_escaped_length(const XMLByte* src, size_t src_length, const Charset::Tables& tables); static size_t calc_escaped_length(const String::C src, const Charset& source_charset); static size_t escape_UTF8(const XMLByte* src, size_t src_length, XMLByte* dest); static size_t escape(const XMLByte* src, size_t src_length, XMLByte* dest, const Charset::Tables& tables); static size_t calc_JSON_escaped_length_UTF8(XMLByte* src, size_t src_length); static size_t calc_JSON_escaped_length(const XMLByte* src, size_t src_length, const Charset::Tables& tables); static size_t calc_JSON_escaped_length(const String::C src, const Charset& source_charset); static size_t escape_JSON_UTF8(const XMLByte* src, size_t src_length, XMLByte* dest); static size_t escape_JSON(const XMLByte* src, size_t src_length, XMLByte* dest, const Charset::Tables& tables); #ifdef XML private: void addEncoding(char* name_cstr); void initTranscoder(const String::Body name, const char* name_cstr); public: /// converts xmlChar* null-terminated string to char* String::C transcode_cstr(const xmlChar* s); /// converts xmlChar* null-terminated string to parser String const String& transcode(const xmlChar* s); /** converts sized char* to xmlChar* @returns xmlChar* WHICH CALLER SHOULD FREE */ xmlChar* transcode_buf2xchar(const char* buf, size_t buf_size); /// converts parser String to xmlChar* xmlChar* transcode(const String& s); /// converts parser String::Body to xmlChar* xmlChar* transcode(const String::Body s); private: xmlCharEncodingHandler* ftranscoder; #endif }; // externs extern Charset::UTF8CaseTable UTF8CaseToUpper; extern Charset::UTF8CaseTable UTF8CaseToLower; void change_case_UTF8(const XMLByte* srcData, size_t srcLen, XMLByte* toFill, size_t toFillLen, const Charset::UTF8CaseTable& table); size_t getUTF8BytePos(const XMLByte* srcBegin, const XMLByte* srcEnd, size_t charPos/*position in characters*/); size_t getUTF8CharPos(const XMLByte* srcBegin, const XMLByte* srcEnd, size_t bytePos/*position in bytes*/); size_t lengthUTF8(const XMLByte* srcBegin, const XMLByte* srcEnd); unsigned int lengthUTF8Char(const XMLByte c); const char *fixUTF8(const char *src); class UTF8_string_iterator { public: UTF8_string_iterator(const String& astring): fsrcPtr((XMLByte*)astring.cstr()), fsrcEnd(fsrcPtr + astring.length()) {} UTF8_string_iterator(XMLByte* asrcPtr, size_t length): fsrcPtr(asrcPtr), fsrcEnd(fsrcPtr + length) {} bool has_next(); XMLCh next() { return fUTF8Char; } XMLByte getFirstByte(){ return ffirstByte; } size_t getCharSize(){ return fcharSize; } private: const XMLByte* fsrcPtr; const XMLByte* fsrcEnd; size_t fcharSize; XMLByte ffirstByte; XMLCh fUTF8Char; }; #endif parser-3.5.1/src/include/pa_socks.h0000644000076400007640000000070614712042465014142 00000000000000/** @file Parser: socks initialization/finalization decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_SOCKS_H #define PA_SOCKS_H #define IDENT_PA_SOCKS_H "$Id: pa_socks.h,v 1.23 2024/11/04 03:53:25 moko Exp $" void pa_socks_init(); void pa_socks_done(); int pa_socks_errno(); const char* pa_socks_strerr(int no); #endif parser-3.5.1/src/include/pa_types.h0000644000076400007640000000234114712042465014161 00000000000000/** @file Parser: generally used types & constants decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_TYPES_H #define PA_TYPES_H #define IDENT_PA_TYPES_H "$Id: pa_types.h,v 1.59 2024/11/04 03:53:25 moko Exp $" #include "pa_config_includes.h" /// for rare cases of undefined length using this-sized strings #define MAX_STRING 0x400 /// buffer size for parser.log #define MAX_LOG_STRING 0x400*4 /// for snprintf(buf, MAX_NUMBER, "%.2f") #define MAX_NUMBER 40 //{@ handy types #undef uchar typedef unsigned char uchar; #undef ushort typedef unsigned short ushort; #undef uint typedef unsigned int uint; #undef ulong typedef unsigned long ulong; //}@ #ifndef LLONG_MAX #define LLONG_MAX 9223372036854775807LL #endif #ifndef ULLONG_MAX #define ULLONG_MAX 18446744073709551615ULL #endif #ifndef SSIZE_MAX #define SSIZE_MAX (sizeof(size_t)==4 ? INT_MAX : LLONG_MAX) #endif inline int clip2int(double value) { return value <= INT_MIN ? INT_MIN : ( value >= INT_MAX ? INT_MAX : (int)value ); } inline uint clip2uint(double value) { return value <= 0 ? 0 : ( value >= UINT_MAX ? UINT_MAX : (uint)value ); } #endif parser-3.5.1/src/include/pa_sql_connection.h0000644000076400007640000001203414712042465016033 00000000000000/** @file Parser: sql fconnection decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_SQL_CONNECTION_H #define PA_SQL_CONNECTION_H #define IDENT_PA_SQL_CONNECTION_H "$Id: pa_sql_connection.h,v 1.49 2024/11/04 03:53:25 moko Exp $" #include "pa_sql_driver.h" #include "pa_sql_driver_manager.h" // defines /// @see SQL_Driver_services_impl::_throw #ifdef PA_WITH_SJLJ_EXCEPTIONS #define SQL_CONNECTION_SERVICED_FUNC_GUARDED(actions) \ use(); \ actions #else #define SQL_CONNECTION_SERVICED_FUNC_GUARDED(actions) \ use(); \ if(!setjmp(fservices.mark)) { \ actions; \ } else \ fservices.propagate_exception(); #endif /// SQL_Driver_services Pooled implementation class SQL_Driver_services_impl: public SQL_Driver_services { const String* furl; Exception fexception; const char* frequest_charset; const char* fdocument_root; public: SQL_Driver_services_impl(const char* arequest_charset, const char* adocument_root): furl(0), frequest_charset(arequest_charset), fdocument_root(adocument_root) {} void set_url(const String& aurl) { furl=&aurl;} const String& url_without_login() const; override void* malloc(size_t size) { return pa_malloc(size); } override void* malloc_atomic(size_t size) { return pa_malloc_atomic(size); } override void* realloc(void *ptr, size_t size) { return pa_realloc(ptr, size); } override const char* request_charset() { return frequest_charset; } override const char* request_document_root() { return fdocument_root; } override void transcode(const char* src, size_t src_length, const char*& dst, size_t& dst_length, const char* charset_from_name, const char* charset_to_name ); /** normally we can't 'throw' from dynamic library, so the idea is to #1 jump to C++ some function to main body, where every function stack frame has exception unwind information and from there... #2 propagate_exception() but when parser configured --with-sjlj-exceptions one can simply 'throw' from dynamic library. [sad story: one can not longjump/throw due to some bug in gcc as of 3.2.1 version] */ override void _throw(const SQL_Error& aexception) { // converting SQL_exception to parser Exception // hiding passwords and addresses from accidental show [imagine user forgot @exception] #ifdef PA_WITH_SJLJ_EXCEPTIONS throw #else fexception= #endif Exception(aexception.type() ? aexception.type() : "sql.connect", &url_without_login(), aexception.comment()); #ifndef PA_WITH_SJLJ_EXCEPTIONS longjmp(mark, 1); #endif } virtual void propagate_exception() { #ifndef PA_WITH_SJLJ_EXCEPTIONS throw fexception; #endif } }; /// SQL connection. handy wrapper around low level SQL_Driver class SQL_Connection: public PA_Object { const String& furl; SQL_Driver& fdriver; SQL_Driver_services_impl fservices; void *fconnection; time_t time_used; public: SQL_Connection(const String& aurl, SQL_Driver& adriver, const char* arequest_charset, const char* adocument_root): furl(aurl), fdriver(adriver), fservices(arequest_charset, adocument_root), fconnection(0), time_used(0) { } SQL_Driver_services_impl& services() { return fservices; } const String& get_url() { return furl; } void set_url() { fservices.set_url(furl); } void use() { time_used=time(0); // they started to use at this time } bool expired(time_t older_dies) { return time_usedclose_connection(furl, this); } }; #endif parser-3.5.1/src/include/pa_config_fixed.h0000644000076400007640000000335714712207735015454 00000000000000/** @file Parser: Configure file for autoconf-disabled platforms. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_CONFIG_FIXED_H #define PA_CONFIG_FIXED_H #define IDENT_PA_CONFIG_FIXED_H "$Id: pa_config_fixed.h,v 1.94 2024/11/04 18:18:05 moko Exp $" #if _MSC_VER < 1310 #define inline __inline #endif #define HAVE_STDIO_H #define HAVE_SYS_TYPES_H #define HAVE_SYS_STAT_H #define HAVE_STDLIB_H #define HAVE_STDDEF_H #define HAVE_MEMORY_H #define HAVE_STRING_H #define HAVE_ASSERT_H #define HAVE_LIMITS_H #define HAVE_CTYPE_H #define HAVE_MATH_H #define HAVE_PROCESS_H #define HAVE_STDARG_H #define HAVE_SETJMP_H #define HAVE_ERRNO_H #define HAVE_FCNTL_H #define HAVE_IO_H #define HAVE_SYS_LOCKING_H #define HAVE_WINSOCK_H #define HAVE_TLS 1 #define HAVE_TIME_H #define HAVE_TIMEZONE #define HAVE_DAYLIGHT #define USE_SMTP #define PA_LITTLE_ENDIAN #define PA_WITH_SJLJ_EXCEPTIONS //types #ifndef ssize_t typedef int ssize_t; #endif #ifndef uint8_t typedef unsigned __int8 uint8_t; #endif #ifndef uint16_t typedef unsigned __int16 uint16_t; #endif #ifndef uint32_t typedef unsigned __int32 uint32_t; #endif #ifndef uint64_t typedef unsigned __int64 uint64_t; #endif #define LT_MODULE_EXT ".dll" // disable any execs (file::exec, file::cgi, unix mail:send) //#define NO_PA_EXECS // disable stringstream usage //#define NO_STRINGSTREAM #define GC_NOT_DLL // otherwise functions in libpcre will be declared as __declspec(dllimport) #define PCRE_STATIC //xml-abled parser #define XML #define XML_STATIC // otherwise functions in libxml2 will be declared as __declspec(dllimport) #ifdef XML_STATIC #define LIBXML_STATIC #endif #endif parser-3.5.1/src/include/pa_uue.h0000644000076400007640000000063314712042465013615 00000000000000/** @file Parser: uue encoding module. Copyright (c) 2000-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_UUE_H #define PA_UUE_H #define IDENT_PA_UUE_H "$Id: pa_uue.h,v 1.16 2024/11/04 03:53:25 moko Exp $" const char* pa_uuencode(const unsigned char* in, size_t in_size, const char* file_name); #endif parser-3.5.1/src/include/pa_http.h0000644000076400007640000000522014712042465013773 00000000000000/** @file Parser: commonly used functions. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_HTTP_H #define PA_HTTP_H #define IDENT_PA_HTTP_H "$Id: pa_http.h,v 1.35 2024/11/04 03:53:25 moko Exp $" #include "pa_vstring.h" #include "pa_vint.h" #include "pa_vhash.h" #include "pa_vtable.h" #include "pa_socks.h" #include "pa_charset.h" #include "pa_request.h" #define HTTP_COOKIES_NAME "cookies" #ifdef _MSC_VER #include #define socklen_t int #else #define closesocket close #define INVALID_SOCKET -1 typedef int SOCKET; #endif #ifndef DOXYGEN struct File_read_http_result { char *str; size_t length; HashStringValue* headers; }; #endif class HTTP_Headers { public: class Header { public: String::Body name; String::Body value; Header(String::Body aname, String::Body avalue) : name(aname), value(avalue) {} void transcode(Charset &charset, Charset &source){ name=Charset::transcode(name, charset, source); value=Charset::transcode(value, charset, source); } }; Array
headers; String::Body content_type; uint64_t content_length; HTTP_Headers() : content_type(""), content_length(0){} bool add_header(const char *line); void clear(){ headers.clear(); content_type=""; content_length=0; } }; /*** http part ***/ Table* parse_cookies(Request& r, Table *cookies); void tables_update(HashStringValue& tables, const String::Body name, const String& value); char *pa_http_safe_header_name(const char *name); File_read_http_result pa_internal_file_read_http(Request& r, const String& file_spec, bool as_text, HashStringValue *options=0, bool transcode_text_result=true); /*** httpd part ***/ //#define HTTPD_DEBUG class HTTPD_request; class HTTPD_Connection : public PA_Allocated { public: SOCKET sock; const char *remote_addr; HTTPD_request *request; HTTPD_Connection() : sock(INVALID_SOCKET), remote_addr(NULL), request(NULL){} ~HTTPD_Connection(); Array &headers(); const char *method(); const char *uri(); const char *content_type(); uint64_t content_length(); const char *query(){ if(uri()){ const char *result=strchr(uri(), '?'); if(result++ && *result) return result; } return NULL; } bool accept(SOCKET, int); bool read_header(); size_t read_post(char *, size_t); size_t send_body(const void *, size_t); }; class HTTPD_Server : public PA_Allocated { public: enum HTTPD_MODE { SEQUENTIAL, PARALLEL, MULTITHREADED } static mode; static const char *port; static void set_mode(const String&); static SOCKET bind(const char *); }; #endif parser-3.5.1/src/include/pa_version.h0000644000076400007640000000035714740272737014517 00000000000000/* specified manually on Windows [automaticaly set on Unix] */ #ifndef PARSER_VERSION #ifdef _WIN64 #define PARSER_VERSION "3.5.1 (compiled on amd64-pc-win64)" #else #define PARSER_VERSION "3.5.1 (compiled on i386-pc-win32)" #endif #endif parser-3.5.1/src/include/Makefile.in0000644000076400007640000003767614740273415014256 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ pa_config_auto.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/pa_config_auto.h.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = pa_version.h pa_pool.h pa_os.h pa_common.h pa_base64.h pa_operation.h pa_request_charsets.h pa_request_info.h pa_array.h pa_cache_managers.h pa_charset.h pa_charsets.h pa_config_fixed.h pa_config_includes.h pa_dictionary.h pa_dir.h pa_exception.h pa_xml_exception.h pa_exec.h pa_globals.h pa_xml_io.h pa_hash.h pa_opcode.h pa_memory.h pa_request.h pa_sapi.h pa_socks.h pa_sql_connection.h pa_sql_driver_manager.h pa_stack.h pa_string.h pa_stylesheet_connection.h pa_stylesheet_manager.h pa_table.h pa_threads.h pa_types.h pa_uue.h pa_http.h pa_random.h pa_symbols.h all: pa_config_auto.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): pa_config_auto.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/pa_config_auto.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/include/pa_config_auto.h $(srcdir)/pa_config_auto.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f pa_config_auto.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) pa_config_auto.h installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/include/pa_stack.h0000644000076400007640000000312314712042465014121 00000000000000/** @file Parser: stack class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_STACK_H #define PA_STACK_H #define IDENT_PA_STACK_H "$Id: pa_stack.h,v 1.34 2024/11/04 03:53:25 moko Exp $" #include "pa_array.h" /// simple stack based on Array template class Stack: public Array { public: Stack(size_t initial=4) : Array(initial){} inline void push(T item) { if(this->is_full()) expand(this->fallocated); // free is not called, so expanding a lot to decrease memory waste this->felements[this->fsize++]=item; } inline T pop() { return this->felements[--this->fsize]; } inline bool is_empty() { return this->fsize==0; } inline size_t top_index() { return this->fsize; } inline void set_top_index(size_t atop) { this->fsize=atop; } inline T top_value() { assert(!is_empty()); return this->felements[this->fsize-1]; } /// call this prior to collecting garbage [in unused part of stack there may be pointers(unused)] void wipe_unused() { if(size_t above_top_size=this->fallocated-this->fsize) memset((void *)&this->felements[this->fsize], 0, above_top_size*sizeof(T)); } protected: void expand(size_t delta) { size_t new_allocated=this->fallocated+delta; // we can't use realloc as MethodParams references allocated stack T* new_elements = (T *)pa_malloc(new_allocated*sizeof(T)); memcpy(new_elements, this->felements, this->fallocated*sizeof(T)); this->felements=new_elements; this->fallocated=new_allocated; } }; #endif parser-3.5.1/src/include/pa_base64.h0000644000076400007640000000126214712042465014102 00000000000000/** @file Parser: base64 functions. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_BASE64_H #define PA_BASE64_H #define IDENT_PA_BASE64_H "$Id: pa_base64.h,v 1.8 2024/11/04 03:53:25 moko Exp $" #include "pa_string.h" struct Base64Options { bool strict; bool wrap; bool pad; const char *abc; Base64Options(bool awrap = true); void set_url_safe_abc(); }; size_t pa_base64_decode(const char *in, size_t in_size, char*& result, Base64Options options); char* pa_base64_encode(const char *in, size_t in_size, Base64Options options = Base64Options()); #endif parser-3.5.1/src/include/pa_request.h0000644000076400007640000003503314712042465014511 00000000000000/** @file Parser: request class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_REQUEST_H #define PA_REQUEST_H #define IDENT_PA_REQUEST_H "$Id: pa_request.h,v 1.268 2024/11/04 03:53:25 moko Exp $" #include "pa_pool.h" #include "pa_hash.h" #include "pa_wcontext.h" #include "pa_value.h" #include "pa_stack.h" #include "pa_request_info.h" #include "pa_request_charsets.h" #include "pa_sapi.h" // defines for externs #define EXCEPTION_HANDLED_PART_NAME "handled" // externs extern const String main_method_name; extern const String auto_method_name; extern const String exception_type_part_name; extern const String exception_source_part_name; extern const String exception_comment_part_name; extern const String exception_handled_part_name; // defines for statics #define MAIN_CLASS_NAME "MAIN" #define AUTO_FILE_NAME "auto.p" // consts const size_t pseudo_file_no__process=1; // forwards class Temp_lang; class Methoded; class VMethodFrame; class VMail; class VForm; class VResponse; class VCookie; class VStateless_class; class VConsole; extern int pa_loop_limit; extern int pa_array_limit; extern int pa_execute_recursion_limit; extern int pa_httpd_timeout; extern size_t pa_file_size_limit; /// Main workhorse. class Request: public PA_Object { friend class Temp_lang; friend class Temp_connection; friend class Temp_request_self; friend class Temp_value_element; friend class Temp_recursion; friend class Request_context_saver; friend class Exception_trace; public: class Trace { const String* fname; Operation::Origin forigin; public: Trace(): fname(0) {} void clear() { fname=0; } Trace(const String* aname, const Operation::Origin aorigin): fname(aname), forigin(aorigin) {} const String* name() const { return fname; } const Operation::Origin origin() const { return forigin; } }; enum Skip { SKIP_NOTHING, SKIP_CONTINUE, SKIP_BREAK, SKIP_RETURN, SKIP_INTERRUPTED }; private: Pool fpool; public: Pool& pool() { return fpool; } private: union StackItem { Value* fvalue; ArrayOperation* fops; VMethodFrame* fmethod_frame; public: Value& value() const { return *fvalue; } const String& string() const { return fvalue->as_string(); } ArrayOperation& ops() const { return *fops; } VMethodFrame& method_frame() const { return *fmethod_frame; } StackItem(Value& avalue): fvalue(&avalue) {} StackItem(ArrayOperation& aops): fops(&aops) {} StackItem(VMethodFrame& amethod_frame): fmethod_frame(&amethod_frame) {} }; class Exception_trace: public Stack { size_t fbottom; public: Exception_trace(): fbottom(0) {} size_t bottom_index() { return fbottom; } void set_bottom_index(size_t abottom) { fbottom=abottom; } element_type bottom_value() { return get(bottom_index()); } void clear() { fsize=fbottom=0; } bool is_empty() { return fsize==fbottom; } Table &table(Request &r); }; ///@{ core data /// classes HashString fclasses; /// already used files to avoid cyclic uses HashString used_files; HashString searched_along_class_path; /// list of all used files, Operation::file_no = index to it Array file_list; /// endless execute(execute(... preventing counter int anti_endless_execute_recursion; ///@} /// execution stack Stack stack; /// exception stack trace Exception_trace exception_trace; public: bool allow_class_replace; //@{ request processing status /// contexts VMethodFrame* method_frame; Value* rcontext; WContext* wcontext; /// current language String::Language flang; /// current connection SQL_Connection* fconnection; //@} private: int fin_cycle; Skip fskip; VMethodFrame* freturn_method_frame; public: uint register_file(String::Body file_spec); struct Exception_details { const Operation::Origin origin; const String* problem_source; VHash& vhash; Exception_details(const Operation::Origin aorigin, const String* aproblem_source, VHash& avhash): origin(aorigin), problem_source(aproblem_source), vhash(avhash) {} }; Exception_details get_details(const Exception& e); const char* get_exception_cstr(const Exception& e, Exception_details& details); /// @see Stack::wipe_unused void wipe_unused_execution_stack() { stack.wipe_unused(); } #ifdef RESOURCES_DEBUG /// measures double sql_connect_time; double sql_request_time; #endif Request(SAPI_Info& asapi_info, Request_info& arequest_info, String::Language adefault_lang ///< all tainted data default untainting lang ); ~Request(); /// global classes HashString& classes() { return fclasses; } VStateless_class* get_class(const String& name); VStateless_class& get_class_ref(const String& name); void put_class(VStateless_class *aclass){ classes().put(aclass->type(), aclass); } bool add_class(const char* atype, VStateless_class *aclass); /** core request processing BEWARE: may throw exception to you: catch it! */ void core(const char* config_filespec, bool header_only, const String& amain_method_name = main_method_name, const String* amain_class_name = NULL); /// executes ops void execute(ArrayOperation& ops); // execute.C template void call(Frame& frame){ VMethodFrame *saved_method_frame=method_frame; Value* saved_rcontext=rcontext; WContext *saved_wcontext=wcontext; rcontext=wcontext=method_frame=&frame; frame.call(*this); wcontext=saved_wcontext; rcontext=saved_rcontext; method_frame=saved_method_frame; } template void call_write(Frame& frame){ VMethodFrame *saved_method_frame=method_frame; Value* saved_rcontext=rcontext; rcontext=method_frame=&frame; frame.call(*this); rcontext=saved_rcontext; method_frame=saved_method_frame; } Value& construct(VStateless_class &class_value, const Method &method); /// execute ops with anti-recursion check void recursion_checked_execute(ArrayOperation& ops) { if(++anti_endless_execute_recursion==pa_execute_recursion_limit) { anti_endless_execute_recursion=0; // give @exception a chance throw Exception(PARSER_RUNTIME, 0, "call canceled - endless recursion detected"); } execute(ops); // execute it anti_endless_execute_recursion--; } /// void use_file_directly(const String& file_spec, bool fail_on_file_absence=true, bool with_auto_p=false); /// compiles the file in main class context by default void use_file(const String& file_name, const String* use_filespec, bool with_auto_p=false); /// for @USE only, calls ^use (which may be user-defined) void use_file(const String& file_name, const String* use_filespec, Operation::Origin origin); /// compiles a @a source buffer void use_buf(VStateless_class& aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset=0); /// processes any code-junction there may be inside of @a value Value& process_getter(Junction& junction); // execute.C Value& process(Value& input_value); // execute.C void process_write(Value& input_value); // execute.C //@{ convinient helpers const String& process_to_string(Value& input_value) { return process(input_value).as_string(); } //@} const Operation::Origin get_method_origin(const Method* method); // execute.C const String* get_method_filespec(const Method* method); // execute.C const String* get_used_filespec(uint file_no); /// appending string with it's languages inline void write(const String& astring) { wcontext->write(astring); } /// in [] and {} appending string if get_string is not null, else appending value /// in () appending string if is_string, else appending value inline void write(Value& avalue) { wcontext->write_as_string(avalue); } /// allways appending value inline void write_value(Value& avalue) { wcontext->write(avalue); } /// returns relative to @a path path to @a file const String& relative(const char* apath, const String& relative_name); const String& full_disk_path(const String& relative_name); /// returns the mime type of 'user_file_name' const String& mime_type_of(const String* file_name); /// returns the mime type of 'user_file_name_cstr' const String& mime_type_of(const char* user_file_name_cstr); /// returns current SQL connection if any SQL_Connection* connection(bool fail_on_error=true) { if(fail_on_error && !fconnection) throw Exception(PARSER_RUNTIME, 0, "outside of 'connect' operator"); return fconnection; } Skip get_skip() { return fskip; } void set_skip(Skip askip) { fskip=askip; } void set_skip_return(VMethodFrame& amethod_frame) { fskip=SKIP_RETURN; freturn_method_frame=&amethod_frame; } inline bool check_skip_break() { bool result=fskip >= SKIP_BREAK; if(fskip <= SKIP_BREAK) fskip=SKIP_NOTHING; return result; } inline void check_skip_return() { if(fskip==SKIP_RETURN && method_frame==freturn_method_frame) fskip=SKIP_NOTHING; } void set_in_cycle(int adelta) { fin_cycle+=adelta; } bool get_in_cycle() { return fin_cycle>0; } public: /// info from web server Request_info& request_info; /// info about ServerAPI SAPI_Info& sapi_info; /// source, client, mail charsets Request_charsets charsets; /// 'MAIN' class conglomerat & operators are methods of this class VStateless_class& main_class; /// $form:elements VForm& form; /// $mail VMail& mail; /// $response:elements VResponse& response; /// $cookie:elements VCookie& cookie; /// $console VConsole& console; /// classes configured data HashString classes_conf; public: // status read methods VMethodFrame *get_method_frame() { return method_frame; } Value& get_self(); #define GET_SELF(request, type) (static_cast(request.get_self())) /// public for ^reflection:copy[] void put_element(Value& ncontext, const String& name, Value* value); /// for @main[] and parser://method/call const String* execute_method(VStateless_class& aclass, const String& method_name, Value* optional_param = 0); //{ for @conf[filespec] and @auto[filespec] bool execute_method_if_exists(VStateless_class& aclass, const String& method_name, Value* optional_param); bool execute_auto_method_if_exists(VStateless_class& aclass, const String& method_name, Value* optional_param); //} #ifdef XML public: // charset helpers /// @see Charset::transcode xmlChar* transcode(const String& s); /// @see Charset::transcode xmlChar* transcode(const String::Body s); /// @see Charset::transcode const String& transcode(const xmlChar* s); #endif private: /// already executed some @conf method bool configure_admin_done; void configure_admin(VStateless_class& conf_class); void configure(); private: // compile.C ArrayClass& compile(VStateless_class* aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset); private: // execute.C Value& get_element(Value& ncontext, const String& name); #ifdef FEATURE_GET_ELEMENT4CALL Value& get_element4call(Value& ncontext, const String& name); #endif private: // defaults const String::Language fdefault_lang; private: // mime types /// $MAIN:MIME-TYPES Table *mime_types; private: // connection manipulation SQL_Connection* set_connection(SQL_Connection* aconnection) { SQL_Connection* result=fconnection; fconnection=aconnection; return result; } void restore_connection(SQL_Connection* aconnection) { fconnection=aconnection; } private: void output_result(VFile* body_file, bool header_only, bool as_attachment); }; /// Auto-object used to save request context across ^try body class Request_context_saver { Request& fr; /// exception stack trace size_t exception_trace_top; size_t exception_trace_bottom; /// execution stack size_t stack; uint anti_endless_execute_recursion; /// contexts VMethodFrame* method_frame; Value* rcontext; WContext* wcontext; /// current language String::Language flang; /// current connection SQL_Connection* fconnection; public: Request_context_saver(Request& ar) : fr(ar), exception_trace_top(ar.exception_trace.top_index()), exception_trace_bottom(ar.exception_trace.bottom_index()), stack(ar.stack.top_index()), anti_endless_execute_recursion(ar.anti_endless_execute_recursion), method_frame(ar.method_frame), rcontext(ar.rcontext), wcontext(ar.wcontext), flang(ar.flang), fconnection(ar.fconnection) {} void restore() { fr.exception_trace.set_top_index(exception_trace_top); fr.exception_trace.set_bottom_index(exception_trace_bottom); fr.stack.set_top_index(stack); fr.anti_endless_execute_recursion=anti_endless_execute_recursion; fr.method_frame=method_frame, fr.rcontext=rcontext; fr.wcontext=wcontext; fr.flang=flang; fr.fconnection=fconnection; } }; /// Auto-object used for temporary changing Request::fconnection. class Temp_connection { Request& frequest; SQL_Connection* saved_connection; public: Temp_connection(Request& arequest, SQL_Connection* aconnection) : frequest(arequest), saved_connection(arequest.set_connection(aconnection)) { } ~Temp_connection() { frequest.restore_connection(saved_connection); } }; /// Auto-object used for break out of cycle check class InCycle { Request& frequest; public: InCycle(Request& arequest) : frequest(arequest) { frequest.set_in_cycle(1); } ~InCycle() { frequest.set_in_cycle(-1); } }; /// Auto-object used for break out of cycle check class TempSkip4Delimiter { Request& frequest; Request::Skip fskip; public: TempSkip4Delimiter(Request& arequest) : frequest(arequest), fskip(arequest.get_skip()) { frequest.set_skip(Request::SKIP_NOTHING); } // returns true if break required, should be called bool check_break() { if(frequest.get_skip()) fskip=frequest.get_skip(); frequest.set_skip(fskip <= Request::SKIP_BREAK ? Request::SKIP_NOTHING : fskip); return fskip >= Request::SKIP_BREAK; } }; /// Auto-object used for temporary changing Request::allow_class_replace. class Temp_class_replace { Request& frequest; public: Temp_class_replace(Request& arequest, bool avalue) : frequest(arequest){ frequest.allow_class_replace=avalue; } ~Temp_class_replace() { frequest.allow_class_replace=false; } }; /// Auto-object used for temporarily substituting/removing elements class Temp_value_element { Request& frequest; Value& fwhere; const String& fname; Value* saved; public: Temp_value_element(Request& arequest, Value& awhere, const String& aname, Value* awhat); ~Temp_value_element(); }; /// Auto-object that temporarily increases recursion class Temp_recursion { Request& frequest; public: Temp_recursion(Request& arequest) : frequest(arequest){ frequest.anti_endless_execute_recursion++; } ~Temp_recursion(){ frequest.anti_endless_execute_recursion--; } }; #endif parser-3.5.1/src/include/pa_stylesheet_connection.h0000644000076400007640000000457014712042465017433 00000000000000/** @file Parser: Stylesheet connection decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_STYLESHEET_CONNECTION_H #define PA_STYLESHEET_CONNECTION_H #define IDENT_PA_STYLESHEET_CONNECTION_H "$Id: pa_stylesheet_connection.h,v 1.50 2024/11/04 03:53:25 moko Exp $" #include "libxslt/xslt.h" #include "libxslt/xsltInternals.h" #include "pa_xml_exception.h" #include "pa_common.h" #include "pa_globals.h" #include "pa_xml_io.h" // defines /** Connection with stylesheet: remembers time and can figure out that it needs recompilation */ class Stylesheet_connection: public PA_Object { friend class Stylesheet_connection_ptr; private: String::Body ffile_spec; xsltStylesheet *fstylesheet; HashStringBool* dependencies; time_t time_used; time_t prev_disk_time; public: Stylesheet_connection(String::Body afile_spec): ffile_spec(afile_spec), fstylesheet(0), dependencies(0), time_used(0), prev_disk_time(0), used(0) {} String::Body file_spec() { return ffile_spec; } bool uncachable() { return !dependencies /*means they were external*/; } bool expired(time_t older_dies) { return uncachable() || (!used && time_usedprev_disk_time?now_disk_time:0; } void load(time_t new_disk_time); time_t get_disk_time(); private: // connection usage methods int used; void use() { time_used=time(0); // they started to use at this time used++; } void unuse() { used--; if(!used) close(); } }; /// Auto-object used to track Stylesheet_connection usage class Stylesheet_connection_ptr { Stylesheet_connection *fconnection; public: Stylesheet_connection_ptr(Stylesheet_connection *aconnection) : fconnection(aconnection) { fconnection->use(); } ~Stylesheet_connection_ptr() { fconnection->unuse(); } Stylesheet_connection* operator->() { return fconnection; } }; #endif parser-3.5.1/src/include/pa_dictionary.h0000644000076400007640000000255514712042465015171 00000000000000/** @file Parser: dictionary class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_DICTIONARY_H #define PA_DICTIONARY_H #define IDENT_PA_DICTIONARY_H "$Id: pa_dictionary.h,v 1.25 2024/11/04 03:53:25 moko Exp $" #include "pa_table.h" /// simple dictionary, speding up lookups on contained two columned table class Dictionary: public PA_Object { public: struct Subst { const char *from; size_t from_length; const String* to; Subst(int): from(0) {} Subst(const char* afrom, const String* ato): from(afrom), to(ato) { from_length=strlen(afrom); } operator bool() { return from!=0; } }; /// construct wrapper, grabbing first letters of first column into @b first Dictionary(Table& atable); /// construct simple dictionary within a single pair only Dictionary(const String& from, const String& to); /// find first row that contains string in first column which starts @b src Subst first_that_begins(const char* str) const; private: Array substs; private: void append_subst(const String* from, const String* to, const char* exception=0); int starting_line_of[0x100]; int constructor_line; public: size_t count() const { return substs.count(); } Subst get(size_t index) const { return substs.get(index); } }; #endif parser-3.5.1/src/include/Makefile.am0000644000076400007640000000110713562620045014215 00000000000000noinst_HEADERS = pa_version.h pa_pool.h pa_os.h pa_common.h pa_base64.h pa_operation.h pa_request_charsets.h pa_request_info.h pa_array.h pa_cache_managers.h pa_charset.h pa_charsets.h pa_config_fixed.h pa_config_includes.h pa_dictionary.h pa_dir.h pa_exception.h pa_xml_exception.h pa_exec.h pa_globals.h pa_xml_io.h pa_hash.h pa_opcode.h pa_memory.h pa_request.h pa_sapi.h pa_socks.h pa_sql_connection.h pa_sql_driver_manager.h pa_stack.h pa_string.h pa_stylesheet_connection.h pa_stylesheet_manager.h pa_table.h pa_threads.h pa_types.h pa_uue.h pa_http.h pa_random.h pa_symbols.h parser-3.5.1/src/include/pa_charsets.h0000644000076400007640000000171314712042465014633 00000000000000/** @file Parser: sql driver manager decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian global sql driver manager, must be thread-safe */ #ifndef PA_CHARSETS_H #define PA_CHARSETS_H #define IDENT_PA_CHARSETS_H "$Id: pa_charsets.h,v 1.23 2024/11/04 03:53:25 moko Exp $" #include "pa_hash.h" #include "pa_charset.h" /// convention: use UPPERCASE keys class Charsets: public HashString { public: Charsets(); Charset& get(String::Body ANAME); Charset& get_direct(const char *ANAME); void load_charset(Request_charsets& charsets, String::Body ANAME, const String& afile_spec); // detects charset if it's not enforced, skips BOM signature if it complies charset static Charset* checkBOM(char *&body,size_t &body_size, Charset* enforced_charset); }; //@{ globals extern Charset pa_UTF8_charset; extern Charsets pa_charsets; //@} #endif parser-3.5.1/src/include/pa_dir.h0000644000076400007640000000333214712042465013574 00000000000000/** @file Parser: directory scanning for different OS-es decls. Copyright (c) 2000-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_DIR_H #define PA_DIR_H #define IDENT_PA_DIR_H "$Id: pa_dir.h,v 1.33 2024/11/04 03:53:25 moko Exp $" #include "pa_config_includes.h" /** @struct ffblk win32/unix unified directory entry structure name for findfirst/next/close interface */ #ifdef _MSC_VER #include #define MAXPATH ((MAX_PATH)*2) /*UTF-16*/ struct ffblk { struct _WIN32_FIND_DATAW stat; HANDLE handle; const char *name(); bool is_dir(bool); double size(); time_t c_timestamp(); time_t m_timestamp(); time_t a_timestamp(); }; #else #define MAXPATH 1000 /*NAME_MAX*/ struct ffblk { /*as if in windows :)*/ char ff_name[ MAXPATH ]; /*helpers*/ DIR *dir; const char *filePath; struct stat _st; #ifdef HAVE_STRUCT_DIRENT_D_TYPE unsigned char _d_type; #endif const char *name(){ return ff_name; } bool is_dir(bool); void stat_file(); double size(); time_t c_timestamp(); time_t m_timestamp(); time_t a_timestamp(); }; #endif bool findfirst(const char* _pathname, struct ffblk *_ffblk, int _attrib); bool findnext(struct ffblk *_ffblk); void findclose(struct ffblk *_ffblk); /// main dir workhorse: calles win32/unix unified functions findfirst/next/close [skip . and ..] #define LOAD_DIR(dir,action) { \ ffblk ffblk; \ if(!findfirst(dir, &ffblk, 0)) { \ do { \ const char *file_name=ffblk.name(); \ if(*file_name && !(file_name[0]=='.' && (file_name[1]==0 || file_name[1]=='.' && file_name[2]==0) )) { \ action; \ } \ } while(!findnext(&ffblk)); \ findclose(&ffblk); \ } \ } #endif parser-3.5.1/src/include/pa_xml_exception.h0000644000076400007640000000246414712042465015701 00000000000000/** @file Parser: xml exception decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_XML_EXCEPTION_H #define PA_XML_EXCEPTION_H #ifdef XML #define IDENT_PA_XML_EXCEPTION_H "$Id: pa_xml_exception.h,v 1.15 2024/11/04 03:53:25 moko Exp $" const char* const XML_VALUE_MUST_BE_STRING = "value must be string"; const char* const XML_DATA_MUST_BE_STRING = "data must be string"; const char* const XML_NAMESPACEURI_MUST_BE_STRING = "namespaceURI must be string"; const char* const XML_QUALIFIED_NAME_MUST_BE_STRING = "qualifiedName must be string"; const char* const XML_NC_NAME_MUST_BE_STRING = "NCName must be string"; const char* const XML_LOCAL_NAME_MUST_BE_STRING = "localName must be string"; const char* const XML_INVALID_QUALIFIED_NAME = "invalid qualifiedName '%s'"; const char* const XML_INVALID_NC_NAME = "invalid NCName '%s'"; const char* const XML_INVALID_LOCAL_NAME = "invalid localName '%s'"; // includes #include "pa_exception.h" #include "pa_request.h" // defines class XmlException: public Exception { public: XmlException(const String* aproblem_source, const char* aproblem_comment, ...); XmlException(const String* aproblem_source, Request& r); XmlException(); }; #endif #endif parser-3.5.1/src/include/pa_os.h0000644000076400007640000000170014712042465013434 00000000000000/** @file Parser: commonly used functions. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_OS_H #define PA_OS_H #define IDENT_PA_OS_H "$Id: pa_os.h,v 1.14 2024/11/04 03:53:25 moko Exp $" #define PA_LOCK_ATTEMPTS 20 #define PA_LOCK_WAIT_TIMEOUT_SECS 0 #define PA_LOCK_WAIT_TIMEOUT_USECS 500000 extern unsigned int pa_lock_attempts; // 'blocking' mean we will wait till other process release lock // but we'll make PA_LOCK_ATTEMPTS attempts with PA_LOCK_WAIT_TIMEOUT secs delaus between attempts // 'nonblocking' mean we will make only 1 attempt without waiting int pa_lock_shared_blocking(int fd); int pa_lock_exclusive_blocking(int fd); int pa_lock_exclusive_nonblocking(int fd); int pa_unlock(int fd); /// yields to OS for secs secs and usecs microseconds (1E-6) int pa_sleep(unsigned long secs, unsigned long usecs); #endif parser-3.5.1/src/include/pa_cache_managers.h0000644000076400007640000000207014712042465015734 00000000000000/** @file Parser: cache managers center decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_CACHE_MANAGERS_H #define PA_CACHE_MANAGERS_H #define IDENT_PA_CACHE_MANAGERS_H "$Id: pa_cache_managers.h,v 1.25 2024/11/04 03:53:25 moko Exp $" #include "pa_hash.h" #include "pa_value.h" // defines /// can return status and can expire it contents class Cache_manager: public PA_Object { public: /// if filter_server_id not null, returns status only Cachable -s with matching cacheable_item_server_id() virtual Value* get_status() =0; virtual void maybe_expire_cache() {} virtual ~Cache_manager() {} }; /// maintains name=>Cache_manager association, can expire its contents class Cache_managers: public HashString { public: Cache_managers(); virtual ~Cache_managers(); /// maybe-expires all caches it contains, each cache manager desides it itself void maybe_expire(); }; /// global extern Cache_managers* cache_managers; #endif parser-3.5.1/src/include/pa_stylesheet_manager.h0000644000076400007640000000333614712042465016705 00000000000000/** @file Parser: Stylesheet manager decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian global sql driver manager, must be thread-safe */ #ifndef PA_STYLESHEET_MANAGER_H #define PA_STYLESHEET_MANAGER_H #define IDENT_PA_STYLESHEET_MANAGER_H "$Id: pa_stylesheet_manager.h,v 1.30 2024/11/04 03:53:25 moko Exp $" #include "pa_hash.h" #include "pa_table.h" #include "pa_cache_managers.h" #include "pa_stack.h" #include "pa_stylesheet_connection.h" /** XSLT stylesheet driver manager maintains stylesheet cache expiring unused stylesheets */ class Stylesheet_manager: public Cache_manager { friend class Stylesheet_connection; public: Stylesheet_manager(); override ~Stylesheet_manager(); /** check for disk update of "{file_spec}" or "{file_spec}.stamp", if not updated return cached version[if any] otherwise load/compile/return */ Stylesheet_connection* get_connection(String::Body file_spec); private: // cache Stylesheet_connection* get_connection_from_cache(String::Body file_spec); void put_connection_to_cache(String::Body file_spec, Stylesheet_connection& connection); private: time_t prev_expiration_pass_time; private: // for stylesheet /// caches connection void close_connection(String::Body file_spec, Stylesheet_connection& connection); public: typedef Stack connection_cache_value_type; typedef HashString connection_cache_type; private: connection_cache_type connection_cache; public: // Cache_manager override Value* get_status(); override void maybe_expire_cache(); }; /// global extern Stylesheet_manager* stylesheet_manager; #endif parser-3.5.1/src/include/pa_exec.h0000644000076400007640000000156214712042465013745 00000000000000/** @file Parser: program executing for different OS-es decls. Copyright (c) 2000-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_EXEC_H #define PA_EXEC_H #define IDENT_PA_EXEC_H "$Id: pa_exec.h,v 1.26 2024/11/04 03:53:25 moko Exp $" #include "pa_string.h" #include "pa_hash.h" #include "pa_array.h" #include "pa_value.h" #include "pa_charset.h" struct PA_exec_result { int status; ///< exit code File_read_result out; String& err; PA_exec_result(): status(0), out(), err(*new String) {} }; PA_exec_result pa_exec( bool forced_allow, ///< allow execution regardles of --disable-execs const String& file_spec, const HashStringString* env, ///< 0 | Hash of String const ArrayString& argv, ///< 0 | Array of command line arguments String::C in); #endif parser-3.5.1/src/include/pa_pool.h0000644000076400007640000000303614712042465013770 00000000000000/** @file Parser: pool class decl. Copyright (c) 2000-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_POOL_H #define PA_POOL_H #define IDENT_PA_POOL_H "$Id: pa_pool.h,v 1.97 2024/11/04 03:53:25 moko Exp $" #include "pa_config_includes.h" #include "pa_array.h" /** Pool mechanizm allows users not to free up allocated objects, leaving that problem to 'pools'. @see Pooled */ class Pool { public: struct Cleanup : public PA_Allocated { void (*cleanup) (void *); void *data; Cleanup(void (*acleanup) (void *), void *adata): cleanup(acleanup), data(adata) {} }; Pool(); ~Pool(); /// registers a routine to clean up non-pooled allocations void register_cleanup(void (*cleanup) (void *), void *data); /// unregister it, looking it up by it's data void unregister_cleanup(void *cleanup_data); private: Array cleanups; private: //{ /// @name implementation defined bool real_register_cleanup(void (*cleanup) (void *), void *data); //} private: /// throws register cleanup exception void fail_register_cleanup() const; private: //disabled Pool(const Pool&); Pool& operator= (const Pool&); }; /** Base for all classes that are allocated in 'pools'. Holds Pool object. */ class Pooled { // the pool i'm allocated on Pool& fpool; public: Pooled(Pool& apool); /// my pool //Pool& pool() const { return *fpool; } /// Sole: this got called automatically from Pool::~Pool() virtual ~Pooled(); }; #endif parser-3.5.1/src/include/pa_string.h0000644000076400007640000005510714712042465014333 00000000000000/** @file Parser: string class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_STRING_H #define PA_STRING_H #define IDENT_PA_STRING_H "$Id: pa_string.h,v 1.234 2024/11/04 03:53:25 moko Exp $" // includes #include "pa_types.h" #include "pa_array.h" extern "C" { // cord's author forgot to do that #define CORD_NO_IO #include "../lib/cord/include/cord.h" #ifdef CORD_CAT_OPTIMIZATION #define CORD_cat(x, y) CORD_cat_optimized(x, y) #define CORD_cat_char_star(x, y, leny) CORD_cat_char_star_optimized(x, y, leny) #endif } // defines // cache hash code in String::Body for faster hash access #define HASH_CODE_CACHING // cache String::Body.length() for char* strings only, CORDs have own length #define STRING_LENGTH_CACHING // cord extension /* Returns true if x does contain */ /* char not_c at positions i..i+n. Value i,i+n must be < CORD_len(x). */ int CORD_range_contains_chr_greater_then(CORD x, size_t i, size_t n, int c); size_t CORD_block_count(CORD x); // forwards class Charset; class Table; class SQL_Connection; class Dictionary; class Request_charsets; class String; class VRegex; #ifdef NDEBUG typedef Array ArrayString; #else class ArrayString : public Array { public: inline ArrayString(size_t initial=0) : Array(initial){ } inline Array& operator+=(element_type src) { assert(src != NULL); return Array::operator+=(src); } inline element_type get(size_t index) const { element_type result=Array::get(index); assert(result != NULL); return result; } }; #endif // generally useful double pa_atod(const char* str, const String* problem_source); int pa_atoi(const char* str, int base=10, const String* problem_source=0); unsigned int pa_atoui(const char *str, int base=10, const String* problem_source=0); uint64_t pa_atoul(const char *str, int base=10, const String* problem_source=0); /// this is result of pos functions which mean that substr were not found #define STRING_NOT_FOUND ((size_t)-1) /// CORD can't be empty string, thus checking it in assigment #define AS_CORD(v) ((v) && *(v) ? (CORD)(v):0) /** String which knows the lang of all it's langs. All pieces remember - whether they are tainted or not, and the lang which should be used to detaint them */ class String: public PA_Object { friend class StringSplitHelper; public: /** piece is tainted or not. the lang to use when detaint remember to change String_Untaint_lang_name @ untaint.C along WARNING WARNING WARNING WARNING WARNING WARNING pos function compares(<=) languages, that is used in searching for table column separator being L_CLEAN or L_AS_IS. they search for AS_IS, meaning AS_IS|CLEAN [doing <=L_AS_IS check]. letters assigned for debugging, but it's important for no language-letter come before L_AS_IS other then L_CLEAN WARNING WARNING WARNING WARNING WARNING WARNING */ #if _MSC_VER >= 1900 /// required for VS2015+ to make sizeof(Languages::opt) == sizeof(CORD), will be 16 byte under x64 without it enum Language : size_t { #else enum Language { #endif L_UNSPECIFIED=0, ///< no real string has parts of this lange: it's just convinient to check when string's empty // these two must go before others, there are checks for >L_AS_IS L_CLEAN='0', ///< clean WARNING: read above warning before changing L_AS_IS='A', ///< leave all characters intact WARNING: read above warning before changing L_TAINTED='T', ///< tainted, untaint lang as assigned later // untaint langs. assigned by ^untaint[lang]{...} L_FILE_SPEC='F', ///< file specification L_HTTP_HEADER='h', ///< text in HTTP response header L_MAIL_HEADER='m', ///< text in mail header L_URI='U', ///< text in uri L_SQL='Q', ///< ^table:sql body L_JS='J', ///< JavaScript code L_XML='X', ///< ^xdoc:create xml L_HTML='H', ///< HTML code L_REGEX='R', ///< RegExp L_JSON='S', ///< JSON code L_HTTP_COOKIE='C', ///< cookies encoded as %uXXXX for compartibility with js functions encode/decode L_PARSER_CODE='p', ///< ^process body // READ WARNING ABOVE BEFORE ADDING ANYTHING L_OPTIMIZE_BIT = 0x80 ///< flag, requiring cstr whitespace optimization }; enum Trim_kind { TRIM_BOTH, TRIM_START, TRIM_END }; class Body; union Languages { struct { #ifdef PA_LITTLE_ENDIAN Language lang:8; size_t is_not_just_lang:sizeof(CORD)*8-8; #elif defined(PA_BIG_ENDIAN) size_t is_not_just_lang:sizeof(CORD)*8-8; Language lang:8; #else # error word endianness not determined for some obscure reason #endif } opt; CORD langs; CORD make_langs(const Body& current) const { return opt.is_not_just_lang?langs:CORD_chars((char)opt.lang, current.length()); } CORD make_langs(size_t aoffset, size_t alength) const { return opt.is_not_just_lang? CORD_substr(langs, aoffset, alength, 0) :CORD_chars((char)opt.lang, alength); } /// appending when 'langs' already contain something [simple cases handled elsewhere] void append(size_t current, const CORD to_nonempty_target_langs) { assert(langs); if(opt.is_not_just_lang) langs=CORD_cat(langs, to_nonempty_target_langs); else { assert(current); langs=CORD_cat(CORD_chars((char)opt.lang, current), to_nonempty_target_langs); } } void append(const Body& current, const CORD to_nonempty_target_langs) { assert(langs); if(opt.is_not_just_lang) langs=CORD_cat(langs, to_nonempty_target_langs); else { size_t current_size=current.length(); assert(current_size); langs=CORD_cat(CORD_chars((char)opt.lang, current_size), to_nonempty_target_langs); } } public: const char* visualize() const; void dump() const; Languages(): langs(0) {} Languages(Language alang) { opt.lang=alang; opt.is_not_just_lang=0; } /// MUST be called exactly prior to modification of current [uses it's length] void append(size_t current, Language alang, size_t length) { assert(alang); assert(length); if(!opt.is_not_just_lang) { if(opt.lang) { if(opt.lang==alang) // same language? ignoring return; } else { opt.lang=alang; // to uninitialized return; } } append(current, CORD_chars((char)alang, length)); } void append(const Body ¤t, Language alang, size_t length) { assert(alang); assert(length); if(!opt.is_not_just_lang) { if(opt.lang) { if(opt.lang==alang) // same language? ignoring return; } else { opt.lang=alang; // to uninitialized return; } } append(current, CORD_chars((char)alang, length)); } void appendHelper(const Body& current, Language alang, const Body &length_helper) { assert(alang); if(!opt.is_not_just_lang) { if(opt.lang) { if(opt.lang==alang) // same language? ignoring return; } else { opt.lang=alang; // to uninitialized return; } } append(current, CORD_chars((char)alang, length_helper.length())); } void appendHelper(const Body& current, const Languages &src, const Body& length_helper) { if(!langs){ langs=src.langs; // to uninitialized #ifdef CORD_CAT_OPTIMIZATION if(opt.is_not_just_lang && !CORD_IS_STRING(langs)) CORD_concatenation_protect(langs); #endif } else if(!src.opt.is_not_just_lang) appendHelper(current, src.opt.lang, length_helper); // simplifying when simple source else append(current, src.make_langs(length_helper)); } /// MUST be called exactly prior to modification of current [uses it's length] void append(const Body& current, const Languages src, size_t aoffset, size_t alength) { assert(alength); if(!langs) // to uninitialized? if(src.opt.is_not_just_lang) langs=CORD_substr(src.langs, aoffset, alength, 0); // to uninitialized complex else opt.lang=src.opt.lang; // to uninitialized simple else if(!opt.is_not_just_lang && !src.opt.is_not_just_lang && opt.lang==src.opt.lang) // both simple & of same language? return; // ignoring else append(current, src.make_langs(aoffset, alength)); } /// checks if we have lang<=alang all from aoffset to aoffset+alength bool check_lang(Language alang, size_t aoffset, size_t alength) const { if(alang==L_UNSPECIFIED) // ignore lang? return true; if(opt.is_not_just_lang) return CORD_range_contains_chr_greater_then(langs, aoffset, alength, (unsigned)alang)==0; else return (unsigned)opt.lang<=(unsigned)alang; } /// @returns count of blocks /// @todo currently there can be adjucent blocks of same language. someday merge them size_t count() const { return opt.is_not_just_lang? CORD_block_count(langs) : opt.lang? 1 : 0; }; template void for_each(size_t current, int callback(char, size_t, I), I info) const { if(opt.is_not_just_lang) CORD_block_iter(langs, 0, (CORD_block_iter_fn)callback, info); else callback(opt.lang, current, info); } template void for_each(const Body& current, int callback(char, size_t, I), I info) const { if(opt.is_not_just_lang) CORD_block_iter(langs, 0, (CORD_block_iter_fn)callback, info); else callback(opt.lang, current.length(), info); } bool invariant(size_t current_length) const { if(!langs) return current_length==0; if(opt.is_not_just_lang) return CORD_len(langs)==current_length; return true; // uncheckable, actually } }; struct C { const char *str; size_t length; C(): str(0), length(0) {} C(const char *astr, size_t asize): str(astr), length(asize) {} explicit C(Body abody): str(abody.cstr()), length(abody.length()) {} }; struct Cm { char *str; size_t length; Cm(): str(0), length(0) {} Cm(char *astr, size_t asize): str(astr), length(asize) {} explicit Cm(Body abody): str(abody.cstrm()), length(abody.length()) {} }; class Body { CORD body; #ifdef HASH_CODE_CACHING // cached hash code is not reseted on write operations as test shows // that string body does not change after it is stored as a hash key mutable uint hash_code; #define INIT_HASH_CODE(c) ,hash_code(c) #define ZERO_HASH_CODE hash_code=0; #else #define INIT_HASH_CODE(c) #define ZERO_HASH_CODE #endif #ifdef STRING_LENGTH_CACHING // cached length is reseted on modification, used only for char*, not CORD mutable size_t string_length; #define INIT_LENGTH(l) ,string_length(l) #define ZERO_LENGTH string_length=0; #else #define INIT_LENGTH(l) #define ZERO_LENGTH #endif public: void dump() const; Body(): body(CORD_EMPTY) INIT_HASH_CODE(0) INIT_LENGTH(0) {} Body(const char *abody): body(AS_CORD(abody)) INIT_HASH_CODE(0) INIT_LENGTH(0) {} Body(CORD abody, uint ahash_code): body(abody) INIT_HASH_CODE(ahash_code) INIT_LENGTH(0) {} explicit Body(C ac): body(AS_CORD(ac.str)) INIT_HASH_CODE(0) INIT_LENGTH(ac.length) {} explicit Body(CORD abody): body(abody) INIT_HASH_CODE(0) INIT_LENGTH(0) { #ifdef CORD_CAT_OPTIMIZATION assert(!body // no body || *body // ordinary string || body[1]==1 // CONCAT_HDR || body[1]==3 // CONCAT_HDR_READ_ONLY || body[1]==4 // FN_HDR || body[1]==6 // SUBSTR_HDR ); #else assert(!body // no body || *body // ordinary string || body[1]==1 // CONCAT_HDR || body[1]==4 // FN_HDR || body[1]==6 // SUBSTR_HDR ); #endif } void clear() { ZERO_LENGTH ZERO_HASH_CODE body=CORD_EMPTY; } bool operator! () const { return is_empty(); } inline CORD get_cord() const { return body; } uint get_hash_code() const; // never null const char* cstr() const { #ifdef STRING_LENGTH_CACHING string_length = length(); if(string_length){ const char *result=CORD_to_const_char_star(body, string_length); const_cast(this)->body=(CORD)result; return result; } #endif return CORD_to_const_char_star(body, length()); } // never null char* cstrm() const { return CORD_to_char_star(body, length()); } #ifdef STRING_LENGTH_CACHING void set_length(size_t alength){ string_length = alength; } size_t length() const { return body ? CORD_IS_STRING(body) ? string_length ? string_length : (string_length=strlen((const char *)body)) : CORD_len(body) : 0; } #else size_t length() const { return CORD_len(body); } #endif inline bool is_empty() const { return body==CORD_EMPTY; } void append_know_length(const char *str, size_t known_length) { if(known_length){ if(body){ body = CORD_cat_char_star(body, str, known_length); ZERO_LENGTH } else { body=(CORD)str; #ifdef STRING_LENGTH_CACHING string_length=known_length; #endif } } } void append_strdup_know_length(const char* str, size_t known_length) { if(known_length) append_know_length(pa_strdup(str, known_length), known_length); } void append(char c) { ZERO_LENGTH body=CORD_cat_char(body, c); } Body& operator << (const Body src) { ZERO_LENGTH body=CORD_cat(body, src.body); return *this; } Body& operator << (const char* str) { append_know_length(str, strlen(str)); return *this; } bool operator < (const Body src) const { return CORD_cmp(body, src.body)<0; } bool operator > (const Body src) const { return CORD_cmp(body, src.body)>0; } bool operator <= (const Body src) const { return CORD_cmp(body, src.body)<=0; } bool operator >= (const Body src) const { return CORD_cmp(body, src.body)>=0; } bool operator != (const Body src) const { return CORD_cmp(body, src.body)!=0; } bool operator == (const Body src) const { return CORD_cmp(body, src.body)==0; } bool operator != (const char *src) const { return CORD_cmp(body, AS_CORD(src))!=0; } bool operator == (const char *src) const { return CORD_cmp(body, AS_CORD(src))==0; } int ncmp(size_t x_begin, const Body y, size_t y_begin, size_t size) const { return CORD_ncmp(body, x_begin, y.body, y_begin, size); } char fetch(size_t index) const { return CORD_fetch(body, index); } Body mid(size_t aindex, size_t alength) const { return Body(CORD_substr(body, aindex, alength, length())); } size_t pos(const char* substr, size_t offset=0) const { return CORD_str(body, offset, AS_CORD(substr), length()); } size_t pos(const Body substr, size_t offset=0) const { if(substr.is_empty()) return STRING_NOT_FOUND; // in this case CORD_str returns 0 [parser users got used to -1] // CORD_str checks for bad offset [CORD_chr does not] return CORD_str(body, offset, substr.body, length()); } size_t pos(char c, size_t offset=0) const { if(offset>=length()) // CORD_chr does not check that [and ABORT's in that case] return STRING_NOT_FOUND; return CORD_chr(body, offset, c); } size_t strrpbrk(const char* chars, size_t left, size_t right) const; size_t rskipchars(const char* chars, size_t left, size_t right) const; template int for_each(int (*f)(char c, I), I info) const { return CORD_iter(body, (CORD_iter_fn)f, (void*)info); } template int for_each(int (*f1)(char c, I), int (*f2)(const char* s, I), I info) const { return CORD_iter5(body, 0, (CORD_iter_fn)f1, (CORD_batched_iter_fn)f2, info); } void set_pos(CORD_pos& pos, size_t index) const { CORD_set_pos(pos, body, index); } /// @returns this or 0 or mid. if returns this or 0 out_* are not filled Body trim(Trim_kind kind=TRIM_BOTH, const char* chars=0, size_t* out_start=0, size_t* out_length=0, Charset* source_charset=0) const; }; private: Body body; ///< all characters of string Languages langs; ///< string characters lang void dump() const; #define ASSERT_STRING_INVARIANT(string) \ assert((string).langs.invariant((string).body.length())) public: static const String Empty; explicit String(){}; explicit String(const char* cstr, Language alang=L_CLEAN) : body(cstr){ if(body.get_cord()){ langs=alang; } } explicit String(C ac, Language alang=L_CLEAN) : body(ac){ if(body.get_cord()){ langs=alang; } } String(Body abody, Language alang): body(abody), langs(alang) { ASSERT_STRING_INVARIANT(*this); } String(const String& src): body(src.body), langs(src.langs) { ASSERT_STRING_INVARIANT(*this); } String(int value, const char *format); /// for convinient hash lookup #ifdef HASH_CODE_CACHING operator const Body&() const { return body; } #else operator const Body() const { return body; } #endif bool is_empty() const { return body.is_empty(); } size_t length() const { return body.length(); } size_t length(Charset& charset) const; /// convert to CORD forcing lang tainting Body cstr_to_string_body_taint(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const; /// convert to CORD with tainting dirty to lang Body cstr_to_string_body_untaint(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const; /// from body const char* cstr() const { return body.cstr(); } char* cstrm() const { return body.cstrm(); } /// convert to constant C string forcing lang tainting const char* taint_cstr(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const { return cstr_to_string_body_taint(lang, connection, charsets).cstr(); } char *taint_cstrm(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const { return cstr_to_string_body_taint(lang, connection, charsets).cstrm(); } /// convert to constant C string with tainting dirty to lang const char* untaint_cstr(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const { return cstr_to_string_body_untaint(lang, connection, charsets).cstr(); } char *untaint_cstrm(Language lang, SQL_Connection* connection=0, const Request_charsets *charsets=0) const { return cstr_to_string_body_untaint(lang, connection, charsets).cstrm(); } const char* untaint_and_transcode_cstr(Language lang, const Request_charsets *charsets) const; bool is_not_just_lang() const { return langs.opt.is_not_just_lang !=0; } Language just_lang() const { return langs.opt.lang; } char* visualize_langs() const; /// puts pieces to buf Cm serialize(size_t prolog_size) const; /// appends pieces from buf to self bool deserialize(size_t prolog_size, void *buf, size_t buf_size); /// @see Body::append_know_length String& append_know_length(const char* str, size_t known_length, Language lang); /// @see Body::append_help_length String& append_help_length(const char* str, size_t helper_length, Language lang); String& append_strdup(const char* str, size_t helper_length, Language lang); bool operator == (const char* y) const { return body==Body(y); } bool operator != (const char* y) const { return body!=Body(y); } /// this starts with y bool starts_with(const char* y) const { return body.ncmp(0/*x_begin*/, Body(y), 0/*y_begin*/, strlen(y))==0; } /// x starts with this bool this_starts(const char* x) const { return Body(x).ncmp(0/*x_begin*/, body, 0/*y_begin*/, length())==0; } String& append_to(String& dest) const; String& append_to(String& dest, Language lang, bool forced=false) const; String& append(const String& src, Language lang, bool forced=false) { return src.append_to(*this, lang, forced); } String& append_quoted(const String* src, Language lang=L_JSON){ *this << "\""; if(src) this->append(*src, lang, true/*forced lang*/); *this << "\""; return *this; } String& operator << (const String& src) { return src.append_to(*this); } String& operator << (const char* src) { return append_help_length(src, 0, L_AS_IS); } String& operator << (const Body& src){ langs.appendHelper(body, L_AS_IS, src); body< (const String& src) const { return body>src.body; } bool operator <= (const String& src) const { return body<=src.body; } bool operator >= (const String& src) const { return body>=src.body; } bool operator != (const String& src) const { return body!=src.body; } bool operator == (const String& src) const { return body==src.body; } /// extracts [start, finish) piece of string String& mid(size_t substr_begin, size_t substr_end) const; String& mid(Charset& charset, size_t from, size_t to, size_t helper_length=0) const; /** ignore lang if it's L_UNSPECIFIED but when specified: look for substring that lies in ONE fragment in THAT lang @return position of substr in string, -1 means "not found" [const char* version] */ size_t pos(const Body substr, size_t this_offset=0, Language lang=L_UNSPECIFIED) const; /// String version of @see pos(const char*, int, Language) size_t pos(const String& substr, size_t this_offset=0, Language lang=L_UNSPECIFIED) const; size_t pos(char c, size_t this_offset=0) const { return body.pos(c, this_offset); } size_t pos(Charset& charset, const String& substr, size_t this_offset=0, Language lang=L_UNSPECIFIED) const; size_t strrpbrk(const char* chars, size_t left=0) const { return (length()) ? body.strrpbrk(chars, left, length()-1) : STRING_NOT_FOUND; } size_t strrpbrk(const char* chars, size_t left, size_t right) const { return body.strrpbrk(chars, left, right); } size_t rskipchars(const char* chars, size_t left=0) const { return (length()) ? body.rskipchars(chars, left, length()-1) : STRING_NOT_FOUND; } size_t rskipchars(const char* chars, size_t left, size_t right) const { return body.rskipchars(chars, left, right); } void split(ArrayString& result, size_t pos_after, const char* delim, Language lang=L_UNSPECIFIED) const; void split(ArrayString& result, size_t pos_after, const String& delim, Language lang=L_UNSPECIFIED) const; typedef void (*Row_action)(Table& table, ArrayString* row, int prestart, int prefinish, int poststart, int postfinish, void *info); /** @return table of found items, if any. table format is defined and fixed[can be used by others]: @verbatim prematch/match/postmatch/1/2/3/... @endverbatim */ Table* match(VRegex* vregex, Row_action row_action, void *info, int& matches_count) const; enum Change_case_kind { CC_UPPER, CC_LOWER }; String& change_case(Charset& source_charset, Change_case_kind kind) const; const String& replace(const Dictionary& dict) const; const String& trim(Trim_kind kind=TRIM_BOTH, const char* chars=0, Charset* source_charset=0) const; double as_double() const { return pa_atod(cstr(), this); } int as_int() const { return pa_atoi(cstr(), 0, this); } bool as_bool() const { return as_int()!=0; } const String& escape(Charset& source_charset) const; private: //disabled String& operator = (const String&) { return *this; } }; #ifndef HASH_CODE_CACHING /// simple hash code of string. used by Hash inline uint hash_code(const String::Body self) { return self.get_hash_code(); } #endif #endif parser-3.5.1/src/include/pa_threads.h0000644000076400007640000000253014712042465014447 00000000000000/** @file Parser: mutex & helpers decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_THREADS_H #define PA_THREADS_H #define IDENT_PA_THREADS_H "$Id: pa_threads.h,v 1.39 2024/11/04 03:53:25 moko Exp $" #include "pa_config_includes.h" #include "pa_types.h" #ifdef _MSC_VER #include #endif /// get caller thread ID uint pa_get_thread_id(); class AutoSYNCHRONIZED; /// simple semaphore object class Mutex { friend class AutoSYNCHRONIZED; #ifdef _MSC_VER HANDLE handle; #else pthread_mutex_t handle; #endif public: Mutex(); ~Mutex(); private: // for AutoSYNCHRONIZED void acquire(); void release(); }; extern Mutex global_mutex; /** Helper to ensure paired Mutex::acquire() and Mutex::release(). Use it with SYNCHRONIZED macro */ class AutoSYNCHRONIZED { public: AutoSYNCHRONIZED() { global_mutex.acquire(); } ~AutoSYNCHRONIZED() { global_mutex.release(); } }; /** put it to first line of a function to ensure thread safety. @verbatim void someclass::somefunc(...) { SYNCHRONIZED; ... } @endverbatim WARNING: don't use THROW or PTHROW with such thread safety mechanizm - longjmp would leave global_mutex acquired, which is wrong! */ #define SYNCHRONIZED AutoSYNCHRONIZED autoSYNCHRONIZED #endif parser-3.5.1/src/include/pa_sql_driver_manager.h0000644000076400007640000000422614712042465016665 00000000000000/** @file Parser: sql driver manager decl. global sql driver manager, must be thread-safe Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_SQL_DRIVER_MANAGER_H #define PA_SQL_DRIVER_MANAGER_H #define IDENT_PA_SQL_DRIVER_MANAGER_H "$Id: pa_sql_driver_manager.h,v 1.43 2024/11/04 03:53:25 moko Exp $" #include "pa_sql_driver.h" #include "pa_hash.h" #include "pa_table.h" #include "pa_string.h" #include "pa_cache_managers.h" #include "pa_stack.h" // defines #define MAIN_SQL_NAME "SQL" #define MAIN_SQL_DRIVERS_NAME "drivers" // forwards class SQL_Connection; /// sql driver manager class SQL_Driver_manager: public Cache_manager { public: typedef HashString driver_cache_type; typedef Stack connection_cache_element_base_type; typedef HashString connection_cache_type; private: friend class SQL_Connection; driver_cache_type driver_cache; connection_cache_type connection_cache; public: SQL_Driver_manager(); override ~SQL_Driver_manager(); /** connect to specified url, using driver dynamic library found in table, if not loaded yet checks driver version */ SQL_Connection* get_connection(const String& aurl, Table *protocol2driver_and_client, const char* arequest_charset, const char* adocument_root); private: // driver cache SQL_Driver *get_driver_from_cache(driver_cache_type::key_type protocol); void put_driver_to_cache(driver_cache_type::key_type protocol, driver_cache_type::value_type driver); private: // connection cache SQL_Connection* get_connection_from_cache(connection_cache_type::key_type url); void put_connection_to_cache(connection_cache_type::key_type url, SQL_Connection* connection); private: time_t prev_expiration_pass_time; private: // for SQL_Connection /// caches connection void close_connection(connection_cache_type::key_type url, SQL_Connection* connection); public: // Cache_manager override Value* get_status(); override void maybe_expire_cache(); }; /// global extern SQL_Driver_manager* SQL_driver_manager; #endif parser-3.5.1/src/include/pa_array.h0000644000076400007640000001724414732404263014143 00000000000000/** @file Parser: Array & Array_iterator classes decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_ARRAY_H #define PA_ARRAY_H #define IDENT_PA_ARRAY_H "$Id: pa_array.h,v 1.102 2024/12/23 16:59:17 moko Exp $" // includes #include "pa_memory.h" #include "pa_types.h" #include "pa_exception.h" // forwards template class Array_iterator; template class Array_robust_iterator; template class Array_reverse_iterator; // defines #define ARRAY_OPTION_LIMIT_ALL ((size_t)-1) /// Simple Array template class Array: public PA_Object { friend class Array_iterator; friend class Array_robust_iterator; friend class Array_reverse_iterator; protected: /// elements[growing size] here T *felements; // allocated size size_t fallocated; // array size size_t fsize; public: typedef Array_iterator Iterator; typedef Array_robust_iterator RobustIterator; typedef Array_reverse_iterator ReverseIterator; struct Action_options { size_t offset; size_t limit; //< ARRAY_OPTION_LIMIT_ALL means 'all'. zero limit means 'nothing' bool reverse; bool defined; Action_options( size_t aoffset=0, size_t alimit=ARRAY_OPTION_LIMIT_ALL, bool areverse=false): offset(aoffset), limit(alimit), reverse(areverse), defined(false) {} bool adjust(size_t count) { if(!count || !limit) return false; if(offset>=count) return false; // max(limit) size_t m=reverse? offset+1 :count-offset; if(!m) return false; // fix limit if(limit>m) limit=m; return true; } }; typedef T element_type; inline Array(size_t initial=0): fallocated(initial), fsize(0) { felements=fallocated?(T *)pa_malloc(fallocated*sizeof(T)):0; } #ifdef USE_DESTRUCTORS inline ~Array(){ if(felements) pa_free(felements); } #endif /// how many items are in Array inline size_t count() const { return fsize; } /// append to array inline Array& operator+=(T src) { if(is_full()) expand(); felements[fsize++]=src; return *this; } /// append other Array portion to this one. starting from offset void append(const Array& src, size_t offset=0, size_t limit=ARRAY_OPTION_LIMIT_ALL) { //< zero limit means 'nothing' size_t src_count=src.count(); // skip tivials if(!src_count || !limit || offset>=src_count) return; // max(limit) size_t m=src_count-offset; // fix limit if(limit>m) limit=m; fit(fsize-1+limit); memcpy(felements+fsize, src.felements+offset, limit * sizeof(T)); fsize+=limit; } /// get index-element inline T get(size_t index) const { assert(index void for_each(void (*callback)(T, I), I info) const { T *last=felements+fsize; for(T *current=felements; current void for_each(bool (*callback)(T, I), I info) const { T *last=felements+fsize; for(T *current=felements; current void for_each_ref(void (*callback)(T&, I), I info) { T *last=felements+fsize; for(T *current=felements; current T first_that(bool (*callback)(T, I), I info) const { T *last=felements+fsize; for(T *current=felements; current0 ? fallocated+fallocated/2+2 : 3); // 3 is PAF default, confirmed by tests } inline void fit(size_t index){ if(index >= fallocated) resize(max(fallocated+fallocated/4, index+1)); } void resize(size_t asize) { if(fallocated){ felements=(T *)pa_realloc(felements, asize*sizeof(T)); fallocated=asize; } else { fallocated=asize; felements=(T *)pa_malloc(asize*sizeof(T)); } } private: //disabled Array(const Array&) {} Array& operator = (const Array&) { return *this; } }; /// Commonly used, templated to work with any integer type template char* pa_itoa(T n, T base=10){ char buf[MAX_NUMBER + 1]; char* pos=buf + MAX_NUMBER; *pos='\0'; bool negative=n < 0; if (n < 0){ n=-n; } do { *(--pos)=(char)(n % base) + '0'; n/=base; } while (n > 0); if (negative) { *(--pos) = '-'; } return pa_strdup(pos, buf + MAX_NUMBER - pos); } template char* pa_uitoa(T n, T base=10){ char buf[MAX_NUMBER + 1]; char* pos=buf + MAX_NUMBER; *pos='\0'; do { *(--pos)=(char)(n % base) + '0'; n/=base; } while (n > 0); return pa_strdup(pos, buf + MAX_NUMBER - pos); } /** Array iterator, usage: @code // Array a; for(Array_iterator i(a); i; ) { T& element=i.next(); ... } @endcode */ template class Array_iterator { const Array& farray; T *fcurrent; T *flast; public: Array_iterator(const Array& aarray): farray(aarray) { fcurrent=farray.felements; flast=farray.felements + farray.fsize; } /// there are still elements inline operator bool () { return fcurrent < flast; } /// returns the current element and advances the iterator inline T next() { return *(fcurrent++); } /// returns the current element inline T value() { return *(fcurrent); } // returns the current index of the iterator inline size_t index() { return fcurrent - farray.felements; } // returns the current index string value of the iterator inline char *key() { return pa_uitoa(index()); } }; // Slower array iterator for arrays that can be modified during iteration template class Array_robust_iterator { const Array& farray; size_t findex; public: Array_robust_iterator(const Array& aarray) : farray(aarray), findex(0) {} inline operator bool() { return findex < farray.fsize; } inline void next() { findex++; } inline T value() { return farray.felements[findex]; } inline size_t index() { return findex; } inline char* key() { return pa_uitoa(findex); } }; // Robust as used for arrays that can be modified during iteration template class Array_reverse_iterator { const Array& farray; size_t findex; public: Array_reverse_iterator(const Array& aarray): farray(aarray), findex(aarray.fsize) {} inline operator bool () { return (findex > 0) && (findex <= farray.fsize); } inline T prev() { return farray.felements[--findex]; } inline size_t index() { return findex; } inline char *key() { return pa_uitoa(index()); } }; #endif parser-3.5.1/src/include/pa_opcode.h0000644000076400007640000000713614712042465014275 00000000000000/** @file Parser: compiled code related decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef OPCODE_H #define OPCODE_H namespace OP { #define IDENT_PA_OPCODE_H "$Id: pa_opcode.h,v 1.59 2024/11/04 03:53:25 moko Exp $" #define OPTIMIZE_BYTECODE_GET_ELEMENT // $a ^a #define OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT // $a.b ^a.b #define OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT // $a.$b ^a.$b #define OPTIMIZE_BYTECODE_STRING_POOL #define OPTIMIZE_BYTECODE_OBJECT_POOL // $var[$a.b], $var[$a.$b] #define OPTIMIZE_BYTECODE_CUT_REM_OPERATOR // cut rem with all params #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT #define OPTIMIZE_BYTECODE_CONSTRUCT // $a(expr), $a[value] #endif // $.a(expr), $.a[value] // $self.a(expr), $self.a[value] #define OPTIMIZE_BYTECODE_GET_SELF_ELEMENT // $self.a ^self.a #define OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL // .CLASS, .CLASS_NAME #define FEATURE_GET_ELEMENT4CALL // ^o.m[] calls get_element4call("m"), not get_element("m") /// Compiled operation code enum OPCODE { //@{ /// @name literals OP_VALUE, OP_CURLY_CODE__STORE_PARAM, OP_EXPR_CODE__STORE_PARAM, OP_NESTED_CODE, //@} //@{ /// @name actions OP_WITH_ROOT, OP_WITH_SELF, OP_WITH_READ, OP_WITH_WRITE, OP_VALUE__GET_CLASS, OP_VALUE__GET_BASE_CLASS, OP_CONSTRUCT_VALUE, OP_CONSTRUCT_EXPR, OP_CURLY_CODE__CONSTRUCT, OP_CONSTRUCT_ARRAY, OP_WRITE_VALUE, OP_WRITE_EXPR_RESULT, OP_STRING__WRITE, #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT OP_VALUE__GET_ELEMENT_OR_OPERATOR, #else OP_GET_ELEMENT_OR_OPERATOR, #endif OP_GET_ELEMENT, OP_GET_ELEMENT__WRITE, #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT OP_VALUE__GET_ELEMENT, OP_VALUE__GET_ELEMENT__WRITE, OP_WITH_ROOT__VALUE__GET_ELEMENT, #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT OP_GET_OBJECT_ELEMENT, // $a.b & ^a.b OP_GET_OBJECT_ELEMENT__WRITE, // $a.b & ^a.b #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT OP_GET_OBJECT_VAR_ELEMENT, // $a.$b & ^a.$b OP_GET_OBJECT_VAR_ELEMENT__WRITE, // $a.$b & ^a.$b #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT OP_WITH_SELF__VALUE__GET_ELEMENT, OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE, #endif #ifdef FEATURE_GET_ELEMENT4CALL OP_GET_ELEMENT4CALL, #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT OP_GET_OBJECT_ELEMENT4CALL, #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT OP_GET_OBJECT_VAR_ELEMENT4CALL, #endif #endif // FEATURE_GET_ELEMENT4CALL OP_OBJECT_POOL, OP_STRING_POOL, OP_PREPARE_TO_CONSTRUCT_OBJECT, OP_CONSTRUCT_OBJECT, OP_CONSTRUCT_OBJECT__WRITE, OP_CALL, OP_CALL__WRITE, #ifdef OPTIMIZE_BYTECODE_CONSTRUCT OP_WITH_ROOT__VALUE__CONSTRUCT_EXPR, OP_WITH_ROOT__VALUE__CONSTRUCT_VALUE, OP_WITH_WRITE__VALUE__CONSTRUCT_EXPR, OP_WITH_WRITE__VALUE__CONSTRUCT_VALUE, OP_WITH_SELF__VALUE__CONSTRUCT_EXPR, OP_WITH_SELF__VALUE__CONSTRUCT_VALUE, #endif //@} #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL OP_GET_ELEMENT__SPECIAL, OP_GET_ELEMENT__SPECIAL__WRITE, #endif //@{ /// @name expression ops: unary OP_NEG, OP_INV, OP_NOT, OP_DEF, OP_IN, OP_FEXISTS, OP_DEXISTS, //@} //@{ /// @name expression ops: binary OP_SUB, OP_ADD, OP_MUL, OP_DIV, OP_MOD, OP_INTDIV, OP_BIN_SL, OP_BIN_SR, OP_BIN_AND, OP_BIN_OR, OP_BIN_XOR, OP_LOG_AND, OP_LOG_OR, OP_LOG_XOR, OP_NUM_LT, OP_NUM_GT, OP_NUM_LE, OP_NUM_GE, OP_NUM_EQ, OP_NUM_NE, OP_STR_LT, OP_STR_GT, OP_STR_LE, OP_STR_GE, OP_STR_EQ, OP_STR_NE, OP_IS //@} }; } #endif parser-3.5.1/src/include/pa_sapi.h0000644000076400007640000000414614713777072013770 00000000000000/** @file Parser: web server api interface object decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_SAPI_H #define PA_SAPI_H #define IDENT_PA_SAPI_H "$Id: pa_sapi.h,v 1.41 2024/11/10 00:28:42 moko Exp $" // includes #include "pa_common.h" #include "pa_array.h" #include "pa_exception.h" // forwards class SAPI_Info; /// target web-Server API struct SAPI { /// log error message static void log(SAPI_Info& info, const char* fmt, ...); /// log error message & exit static void die(const char* fmt, ...); /// read POST request bytes static size_t read_post(SAPI_Info& info, char *buf, size_t max_bytes); /// add response header attribute [but do not send it to client] static void add_header_attribute(SAPI_Info& info, const char* dont_store_key, const char* dont_store_value); /// send collected header attributes to client static void send_headers(SAPI_Info& info); /// clear collected header attributes static void clear_headers(SAPI_Info& info); /// output body bytes static size_t send_body(SAPI_Info& info, const void *buf, size_t size); // send error to client static void send_error(SAPI_Info& info, const char *exception_cstr, const char *status = "500"); class Env { public: /// entire environment static const char* const* get(SAPI_Info& ainfo); /// single environment string static char* get(SAPI_Info& ainfo, const char* name); static bool set(SAPI_Info& ainfo, const char* name, const char* value); class Iterator { private: const char* const* pairs; const char* pair; const char* eq_at; public: Iterator(SAPI_Info& asapi_info) : pair(NULL), eq_at(NULL){ if(pairs=SAPI::Env::get(asapi_info)) next(); } operator bool () { return pair!=0; } void next() { while(pair=*pairs++) if(eq_at=strchr(pair, '=')) // valid pair (key=value) if(eq_at[1]) // value is not empty break; } char* key(){ return pa_strdup(pair, eq_at-pair); } char* value(){ return pa_strdup(eq_at+1); } }; }; }; #endif parser-3.5.1/src/include/pa_table.h0000644000076400007640000000755114726331736014123 00000000000000/** @file Parser: table class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_TABLE_H #define PA_TABLE_H #define IDENT_PA_TABLE_H "$Id: pa_table.h,v 1.78 2024/12/11 15:46:38 moko Exp $" #include "pa_types.h" #include "pa_hash.h" #include "pa_string.h" class Temp_current; /** VTable backend. holds: - column names[if any] - data rows - current row pointer uses String for column names and data items hence most of tables are "named", no need to uptimize nameless onces. rows and strings stored are read-only. once stored they can be removed, but not altered. that's handy for quick copying & co. see table:join */ class Table: public Array { public: typedef ArrayString* columns_type; Table(columns_type acolumns, size_t initial_rows=3); Table(const Table& src, Action_options& options); /// gets column names columns_type columns() { return fcolumns; } /// @return current pointer size_t current() const { return fcurrent; } /// sets @a current pointer, can be out of range when restoring current in modified table void set_current(size_t acurrent) { fcurrent=acurrent0 ? count()-1 : 0; } /// sets or offsets @a current pointer, wrapping within the table void offset(bool absolute, int offset); /// is that @c index falid? bool valid(size_t index) const { return index=0?item(index):0; } /// saves to text file void save(bool nameless_save, const String& file_spec); template void table_for_each(void (*func)(Table& self, I* info), I* info, Action_options& o); template bool table_first_that(bool (*func)(Table& self, I info), I info, Action_options& o) { if(!o.adjust(count())) return false; size_t saved_current=current(); size_t row=o.offset; if(o.reverse) { // reverse for(size_t i=0; inumber lookup table typedef HashString name2number_hash_class; name2number_hash_class* name2number; }; /// Auto-object that temporarily saves and restores current class Temp_current { Table& ftable; size_t fcurrent; public: Temp_current(Table& atable) : ftable(atable), fcurrent(atable.current()){} ~Temp_current(){ ftable.set_current(fcurrent); } }; template void Table::table_for_each(void (*func)(Table& self, I* info), I* info, Action_options& o) { if(!o.adjust(count())) return; Temp_current tc(*this); size_t row=o.offset; if(o.reverse) { // reverse for(size_t i=0; i, Alexandr Petrosian */ #ifndef OPERATION_H #define OPERATION_H #define IDENT_PA_OPERATION_H "$Id: pa_operation.h,v 1.13 2024/11/04 03:53:25 moko Exp $" #include "pa_array.h" #include "pa_opcode.h" #include "pa_value.h" // forwards union Operation; typedef Array ArrayOperation; /** Parser source code got compiled into intermediate form of Operation-s, which are executed afterwards. It is compiled into Array of Operation-s. Each Operation can be either OPCODE or data pointer, following the literal-instruction. - OP_VALUE followed by Origin, followed by Value* - OP_CURLY_CODE__STORE_PARAM followed by ArrayOperation* - OP_EXPR_CODE__STORE_PARAM followed by ArrayOperation* - OP_NESTED_CODE followed by ArrayOperation* */ union Operation { struct Origin { uint file_no:8; ///< file number (max: 255): index in Request::file_list uint line:8+8; ///< line number (max: 64535) uint col:8; ///< column number (max: 255) static Origin create(uint afile_no, uint aline, uint acol) { Origin result={afile_no, aline, acol}; return result; } }; OP::OPCODE code; ///< operation code Origin origin; ///< not an operation, but rather debug information: [OP_VALUE; debug_info; Value*] Value* value; ///< not an operation, but rather value stored after argumented op ArrayOperation* ops; ///< not an operation, but rather code array stored after argumented op /// needed to fill unused Array entries Operation() {} Operation(OP::OPCODE acode): code(acode) {} Operation(uint afile_no, uint aline, uint acol): origin(Origin::create(afile_no, aline, acol)) {} Operation(Value* avalue): value(avalue) {} Operation(ArrayOperation* aops): ops(aops) {} }; // defines #define OPERATIONS_PER_OPVALUE 3 #endif parser-3.5.1/src/include/pa_hash.h0000644000076400007640000004375114740300505013743 00000000000000/** @file Parser: hash class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_HASH_H #define PA_HASH_H #define IDENT_PA_HASH_H "$Id: pa_hash.h,v 1.105 2025/01/06 19:47:18 moko Exp $" #include "pa_memory.h" #include "pa_types.h" #include "pa_string.h" const int HASH_ALLOCATES_COUNT=29; // nearest primes to 5 * 2^n static uint Hash_allocates[HASH_ALLOCATES_COUNT]={ 5, 11, 19, 41, 79, 163, 317, 641, 1279, 2557, 5119, 10243, 20479, 40961, 81919, 163841, 327673, 655357, 1310719, 2621447, 5242883, 10485767, 20971529, 41943049, 83886091, 167772161, 335544323, 671088637, 1342177283}; /// useful generic hash function inline void generic_hash_code(uint& result, char c) { result=(result<<4)+c; if(uint g=(result&0xF0000000)) { result=result^(g>>24); result=result^g; } } /// useful generic hash function inline void generic_hash_code(uint& result, const char* s) { while(char c=*s++) { result=(result<<4)+c; if(uint g=(result&0xF0000000)) { result=result^(g>>24); result=result^g; } } } /// useful generic hash function inline void generic_hash_code(uint& result, const char* buf, size_t size) { const char* end=buf+size; while(buf>24); result=result^g; } } } /// simple hash code of int. used by EXIF mapping inline uint hash_code(int self) { uint result=0; generic_hash_code(result, (const char*)&self, sizeof(self)); return result; } #endif // PA_HASH_H #ifndef PA_HASH_CLASS #define PA_HASH_CLASS /** Simple hash. Automatically rehashed when almost is_full. Contains no 0 values. get returning 0 means there were no such. "put value 0" means "remove" */ #ifdef HASH_ORDER #undef HASH #undef HASH_STRING #undef HASH_NEW_PAIR #undef HASH_ORDER_CLEAR #undef HASH_FOR_EACH #define HASH OrderedHash #define HASH_STRING OrderedHashString #define HASH_NEW_PAIR(code, key, value) *ref=new Pair(code, key, value, *ref, this->last); this->last=&((*ref)->next) #define HASH_ORDER_CLEAR() first=0; last=&first #define HASH_FOR_EACH \ for(Pair *pair=this->first; pair; pair=pair->next) #else #define HASH Hash #define HASH_STRING HashString #define HASH_NEW_PAIR(code, key, value) *ref=new Pair(code, key, value, *ref) #define HASH_ORDER_CLEAR() #define HASH_FOR_EACH \ Pair **ref=this->refs; \ for(int index=0; indexallocated; index++) \ for(Pair *pair=*ref++; pair; pair=pair->link) #endif template class HASH: public PA_Object { protected: class Pair; public: typedef K key_type; typedef V value_type; HASH() { allocated=Hash_allocates[allocates_index=0]; fpairs_count=fused_refs=0; refs=new(PointerGC) Pair*[allocated]; HASH_ORDER_CLEAR(); } HASH(const HASH& source) { allocates_index=source.allocates_index; allocated=source.allocated; fused_refs=source.fused_refs; fpairs_count=source.fpairs_count; refs=new(PointerGC) Pair*[allocated]; // clone & rehash #ifdef HASH_ORDER HASH_ORDER_CLEAR(); for(Pair *pair=source.first; pair; pair=pair->next) { uint index=pair->code%allocated; Pair **ref=&refs[index]; HASH_NEW_PAIR(pair->code, pair->key, pair->value); } #else for(int i=0; ilink) { Pair **ref=&refs[i]; HASH_NEW_PAIR(pair->code, pair->key, pair->value); } #endif } #ifdef USE_DESTRUCTORS ~HASH() { Pair **ref=refs; for(int index=0; indexlink; delete pair; pair=next; } operator delete[](refs); } #endif /// put a [value] under the [key] @returns existed or not bool put(K key, V value) { if(!value) { remove(key); return false; } if(is_full()) expand(); uint code=hash_code(key); uint index=code%allocated; Pair **ref=&refs[index]; for(Pair *pair=*ref; pair; pair=pair->link) if(pair->code==code && pair->key==key) { // found a pair with the same key pair->value=value; return true; } // proper pair not found -- create&link_in new pair if(!*ref) // root cell were fused_refs? fused_refs++; // not, we'll use it and record the fact HASH_NEW_PAIR(code, key, value); fpairs_count++; return false; } /// remove the [key] @returns existed or not bool remove(K key) { uint code=hash_code(key); uint index=code%allocated; for(Pair **ref=&refs[index]; *ref; ref=&(*ref)->link){ Pair *pair=*ref; if(pair->code==code && pair->key==key) { // found a pair with the same key Pair *next=pair->link; #ifdef HASH_ORDER *(pair->prev)=pair->next; if(pair->next) pair->next->prev=pair->prev; else last=pair->prev; #endif *ref=next; --fpairs_count; return true; } } return false; } /// return true if key exists bool contains(K key){ uint code=hash_code(key); uint index=code%allocated; for(Pair *pair=refs[index]; pair; pair=pair->link){ if(pair->code==code && pair->key==key) return true; } return false; } /// get associated [value] by the [key] V get(K key) const { uint code=hash_code(key); uint index=code%allocated; for(Pair *pair=refs[index]; pair; pair=pair->link) if(pair->code==code && pair->key==key) return pair->value; return V(0); } #ifdef HASH_ORDER String::Body first_key() const { #ifdef HASH_CODE_CACHING return (first) ? String::Body(first->key, first->code) : String::Body(); #else return (first) ? first->key : String::Body(); #endif } V first_value() const { return (first) ? first->value : V(0); } inline Pair* last_pair() const { return (fpairs_count) ? (Pair*)((char *)last - offsetof(Pair, next)) : NULL; } String::Body last_key() const { if(Pair* pair = last_pair()) { #ifdef HASH_CODE_CACHING return String::Body(pair->key, pair->code); #else return pair->key; #endif } else { return String::Body(); } } V last_value() const { if(Pair* pair = last_pair()) return pair->value; return NULL; } void order_clear() { HASH_ORDER_CLEAR(); } void order_next(Pair* pair) { pair->prev=last; pair->next=0; *last=pair; last=&(pair->next); } #endif //HASH_ORDER /// put a [value] under the [key] if that [key] existed @returns existed or not bool put_replaced(K key, V value) { if(!value) { remove(key); return false; } uint code=hash_code(key); uint index=code%allocated; for(Pair *pair=refs[index]; pair; pair=pair->link) if(pair->code==code && pair->key==key) { // found a pair with the same key, replacing pair->value=value; return true; } // proper pair not found return false; } /// put a [value] under the [key] if that [key] NOT existed @returns existed or not bool put_dont_replace(K key, V value) { if(!value) { remove(key); return false; } if(is_full()) expand(); uint code=hash_code(key); uint index=code%allocated; Pair **ref=&refs[index]; for(Pair *pair=*ref; pair; pair=pair->link) if(pair->code==code && pair->key==key) { // found a pair with the same key, NOT replacing return true; } // proper pair not found -- create&link_in new pair if(!*ref) // root cell were fused_refs? fused_refs++; // not, we'll use it and record the fact HASH_NEW_PAIR(code, key, value); fpairs_count++; return false; } /// put all 'src' values if NO with same key existed void merge_dont_replace(const HASH& src) { #ifdef HASH_ORDER for(Pair *pair=src.first; pair; pair=pair->next) #else for(int i=0; ilink) #endif put_dont_replace(pair->key, pair->value); } /// number of elements in hash int count() const { return fpairs_count; } /// iterate over all pairs template void for_each(void callback(K, V, I), I info) const { HASH_FOR_EACH callback(pair->key, pair->value, info); } /// iterate over all pairs template void for_each_ref(void callback(K, V&, I), I info) const { HASH_FOR_EACH callback(pair->key, pair->value, info); } /// iterate over all pairs until condition becomes true, return that element template V first_that(bool callback(K, V, I), I info) const { HASH_FOR_EACH if(callback(pair->key, pair->value, info)) return pair->value; return V(0); } /// remove all elements void clear() { memset(refs, 0, sizeof(*refs)*allocated); fpairs_count=fused_refs=0; HASH_ORDER_CLEAR(); } protected: /// the index of [allocated] in [Hash_allocates] int allocates_index; /// number of allocated pairs int allocated; /// used pairs int fused_refs; /// stored pairs total (including those by links) int fpairs_count; /// pair storage class Pair: public PA_Allocated { public: uint code; K key; V value; Pair *link; #ifdef HASH_ORDER Pair **prev; Pair *next; Pair(uint acode, K akey, V avalue, Pair *alink, Pair **aprev) : code(acode), key(akey), value(avalue), link(alink), prev(aprev), next(0) { *aprev=this; } #else Pair(uint acode, K akey, V avalue, Pair *alink) : code(acode), key(akey), value(avalue), link(alink) {} #endif } **refs; #ifdef HASH_ORDER Pair *first; Pair **last; #endif /// filled to threshold (THRESHOLD_PERCENT=75), needs expanding bool is_full() { return fused_refs + allocated/4 >= allocated; } /// allocate larger buffer & rehash void expand() { int old_allocated=allocated; Pair **old_refs=refs; if (allocates_indexlink; uint new_index=pair->code%allocated; Pair **new_ref=&refs[new_index]; pair->link=*new_ref; *new_ref=pair; pair=next; } operator delete[](old_refs); } private: //disabled HASH& operator = (const HASH&) { return *this; } }; /** Simple String::body hash. Allows hash code caching */ #ifdef HASH_CODE_CACHING template class HASH_STRING: public HASH { public: typedef typename HASH::Pair Pair; typedef const String::Body &K; typedef K key_type; /// put a [value] under the [key] @returns existed or not bool put(K str, V value) { if(!value) { remove(str); return false; } if(this->is_full()) this->expand(); CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code % this->allocated; Pair **ref=&this->refs[index]; for(Pair *pair=*ref; pair; pair=pair->link) if(pair->code==code && CORD_cmp(pair->key,key)==0) { // found a pair with the same key pair->value=value; return true; } // proper pair not found -- create&link_in new pair if(!*ref) // root cell were fused_refs? this->fused_refs++; // not, we'll use it and record the fact HASH_NEW_PAIR(code, key, value); this->fpairs_count++; return false; } /// remove the [key] @returns existed or not bool remove(K str) { CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code % this->allocated; for(Pair **ref=&this->refs[index]; *ref; ref=&(*ref)->link){ Pair *pair=*ref; if(pair->code==code && CORD_cmp(pair->key,key)==0) { // found a pair with the same key Pair *next=pair->link; #ifdef HASH_ORDER *(pair->prev)=pair->next; if(pair->next) pair->next->prev=pair->prev; else this->last=pair->prev; #endif *ref=next; --this->fpairs_count; return true; } } return false; } /// return true if key exists bool contains(K str){ CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code % this->allocated; for(Pair *pair=this->refs[index]; pair; pair=pair->link){ if(pair->code==code && CORD_cmp(pair->key,key)==0) return true; } return false; } /// get associated [value] by the [key] V get(K str) const { CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code % this->allocated; for(Pair *pair=this->refs[index]; pair; pair=pair->link) if(pair->code==code && CORD_cmp(pair->key,key)==0) return pair->value; return V(0); } /// get associated [value] by the [key], optimized V get(const char *key) const { uint code=0; if(key && *key){ generic_hash_code(code, key); } else { key=0; } uint index=code % this->allocated; for(Pair *pair=this->refs[index]; pair; pair=pair->link) if(pair->code==code && CORD_cmp(pair->key,(CORD)key)==0) return pair->value; return V((const char *)0); } /// put a [value] under the [key] if that [key] existed @returns existed or not bool put_replaced(K str, V value) { if(!value) { remove(str); return false; } CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code % this->allocated; for(Pair *pair=this->refs[index]; pair; pair=pair->link) if(pair->code==code && CORD_cmp(pair->key,key)==0) { // found a pair with the same key, replacing pair->value=value; return true; } // proper pair not found return false; } /// put a [value] under the [key] if that [key] NOT existed @returns existed or not bool put_dont_replace(K str, V value) { if(!value) { remove(str); return false; } if(this->is_full()) this->expand(); CORD key=str.get_cord(); uint code=str.get_hash_code(); uint index=code % this->allocated; Pair **ref=&this->refs[index]; for(Pair *pair=*ref; pair; pair=pair->link) if(pair->code==code && CORD_cmp(pair->key,key)==0) { // found a pair with the same key, NOT replacing return true; } // proper pair not found -- create&link_in new pair if(!*ref) // root cell were fused_refs? this->fused_refs++; // not, we'll use it and record the fact HASH_NEW_PAIR(code, key, value); this->fpairs_count++; return false; } /// rename $.from[] to $.to[] void rename(K from, K to) { CORD key_from=from.get_cord(); uint code_from=from.get_hash_code(); uint index_from=code_from % this->allocated; CORD key_to=to.get_cord(); uint code_to=to.get_hash_code(); uint index_to=code_to % this->allocated; if(code_from == code_to && CORD_cmp(key_from, key_to)==0) return; for(Pair **ref=&this->refs[index_from]; *ref; ref=&(*ref)->link){ Pair *pair=*ref; if(pair->code==code_from && CORD_cmp(pair->key,key_from)==0) { // found a pair with the required key // remove it from the from key first Pair *next=pair->link; *ref=next; // to simplify code remove(to); // change pair key pair->code=code_to; (CORD &)(pair->key)=key_to; // link to the to key, hash order left intact if(!(pair->link=this->refs[index_to])) // root was unused? this->fused_refs++; // we've used it and record the fact this->refs[index_to]=pair; return; } } } /// put all 'src' values if NO with same key existed void merge_dont_replace(const HASH_STRING& src) { #ifdef HASH_ORDER for(Pair *pair=src.first; pair; pair=pair->next) #else for(int i=0; ilink) #endif put_dont_replace(String::Body(pair->key, pair->code), pair->value); } /// iterate over all pairs template void for_each(void callback(K, V, I), I info) const { HASH_FOR_EACH callback(String::Body(pair->key, pair->code), pair->value, info); } /// iterate over all pairs template void for_each_ref(void callback(K, V&, I), I info) const { HASH_FOR_EACH callback(String::Body(pair->key, pair->code), pair->value, info); } /// iterate over all pairs until condition becomes true, return that element template V first_that(bool callback(K, V, I), I info) const { HASH_FOR_EACH if(callback(String::Body(pair->key, pair->code), pair->value, info)) return pair->value; return V(0); } #else //HASH_CODE_CACHING template class HASH_STRING: public HASH{ public: typedef typename HASH::Pair Pair; #endif //HASH_CODE_CACHING /// simple hash iterator class Iterator { const HASH_STRING& fhash; Pair *fcurrent; #ifndef HASH_ORDER int i; #endif public: #ifdef HASH_ORDER Iterator(const HASH_STRING& ahash): fhash(ahash) { fcurrent=fhash.first; } void next() { fcurrent=fcurrent->next; } #else Iterator(const HASH_STRING& ahash): fhash(ahash) { fcurrent=0; for(i=0; ilink) return; for(i++; ikey, fcurrent->code); #else return fcurrent->key; #endif } V value(){ return fcurrent->value; } Pair *pair(){ return fcurrent; } }; #ifdef HASH_ORDER /// simple reverse hash iterator class ReverseIterator { const HASH_STRING& fhash; Pair *fcurrent; public: ReverseIterator(const HASH_STRING& ahash): fhash(ahash) { fcurrent=fhash.last_pair(); } void prev() { fcurrent=(fcurrent->prev == &fhash.first) ? NULL : (Pair*)((char *)fcurrent->prev - offsetof(Pair, next)); } operator bool () { return fcurrent != NULL; } String::Body key(){ #ifdef HASH_CODE_CACHING return String::Body(fcurrent->key, fcurrent->code); #else return fcurrent->key; #endif } V value(){ return fcurrent->value; } Pair *pair(){ return fcurrent; } }; #endif }; #ifndef HASH_ORDER /// Auto-object used to temporarily substituting/removing string hash values template class Temp_hash_value { H *fhash; String::Body fname; V saved_value; public: Temp_hash_value(H *ahash, String::Body aname, V avalue) : fhash(ahash), fname(aname) { if(fhash){ saved_value=fhash->get(aname); fhash->put(aname, avalue); } } ~Temp_hash_value() { if(fhash) fhash->put(fname, saved_value); } }; #endif #endif //PA_HASH_CLASS parser-3.5.1/src/include/pa_symbols.h0000644000076400007640000000272214720373040014503 00000000000000/** @file Parser: static symbols cache. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_SYMBOLS_H #define PA_SYMBOLS_H #define IDENT_PA_SYMBOLS_H "$Id: pa_symbols.h,v 1.12 2024/11/23 15:34:56 moko Exp $" #include "pa_common.h" // cache symbols for faster comparation #define SYMBOLS_CACHING #ifdef SYMBOLS_CACHING #define SYMBOLS_EQ(a,b) (&(a)==&(Symbols::b)) // pointer comparation #else #define SYMBOLS_EQ(a,b) ((a)==(Symbols::b)) // string comparation #endif class Symbols: public HashStringValue{ public: static const String SELF_SYMBOL; static const String CALLER_SYMBOL; static const String RESULT_SYMBOL; static const String CLASS_SYMBOL; static const String CLASS_NAME_SYMBOL; static const String METHOD_SYMBOL; static const String NAME_SYMBOL; static const String STATIC_SYMBOL; static const String DYNAMIC_SYMBOL; static const String LOCALS_SYMBOL; static const String PARTIAL_SYMBOL; static const String REM_SYMBOL; static const String FIELDS_SYMBOL; static const String _DEFAULT_SYMBOL; static const String TABLES_SYMBOL; static const String FILES_SYMBOL; static const String IMAP_SYMBOL; static const String ELEMENTS_SYMBOL; #ifdef SYMBOLS_CACHING void add(const String &astring); void set(const String &astring); static Symbols &instance(); static void init(); #endif }; #ifdef SYMBOLS_CACHING extern Symbols *symbols; #endif #endif parser-3.5.1/src/include/pa_request_charsets.h0000644000076400007640000000235014712042465016401 00000000000000/** @file Parser: request charsets class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_REQUEST_CHARSETS_H #define PA_REQUEST_CHARSETS_H #define IDENT_PA_REQUEST_CHARSETS_H "$Id: pa_request_charsets.h,v 1.11 2024/11/04 03:53:25 moko Exp $" class Request_charsets { friend class Temp_client_charset; Charset *fsource; Charset *fclient; Charset *fmail; public: Request_charsets( Charset& asource, Charset& aclient, Charset& amail): fsource(&asource), fclient(&aclient), fmail(&amail) {} Charset& source() const { return *fsource; } void set_source(Charset& asource) { fsource=&asource; } Charset& client() const { return *fclient; } void set_client(Charset& aclient) { fclient=&aclient; } Charset& mail() const { return *fmail; } void set_mail(Charset& amail) { fmail=&amail; } }; class Temp_client_charset { Request_charsets& fcharsets; Charset &fclient; public: Temp_client_charset(Request_charsets& acharsets, Charset& aclient): fcharsets(acharsets), fclient(acharsets.client()) { fcharsets.set_client(aclient); } ~Temp_client_charset(){ fcharsets.set_client(fclient); } }; #endif parser-3.5.1/src/include/pa_xml_io.h0000644000076400007640000000114214712042465014302 00000000000000/** @file Parser: plugins to xml library, controlling i/o. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #ifdef XML #ifndef PA_XML_IO_H #define PA_XML_IO_H #define IDENT_PA_XML_IO_H "$Id: pa_xml_io.h,v 1.12 2024/11/04 03:53:25 moko Exp $" #include "pa_string.h" #include "pa_hash.h" void pa_xml_io_init(); typedef HashString HashStringBool; HashStringBool* pa_xmlStartMonitoringDependencies(); HashStringBool* pa_xmlGetDependencies(); #endif #endif parser-3.5.1/src/include/pa_common.h0000644000076400007640000002136314732404263014312 00000000000000/** @file Parser: commonly used functions. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_COMMON_H #define PA_COMMON_H #define IDENT_PA_COMMON_H "$Id: pa_common.h,v 1.196 2024/12/23 18:30:55 moko Exp $" #include "pa_string.h" #include "pa_hash.h" class Request; // defines #define HTTP_STATUS "status" #define HTTP_STATUS_CAPITALIZED "Status" #define HTTP_CONTENT_LENGTH "content-length" #define HTTP_CONTENT_TYPE "content-type" #define HTTP_CONTENT_TYPE_UPPER "CONTENT-TYPE" #define HTTP_CONTENT_TYPE_CAPITALIZED "Content-Type" #define CONTENT_DISPOSITION "content-disposition" #define CONTENT_DISPOSITION_UPPER "CONTENT-DISPOSITION" #define CONTENT_DISPOSITION_CAPITALIZED "Content-Disposition" #define CONTENT_DISPOSITION_ATTACHMENT "attachment" #define CONTENT_DISPOSITION_INLINE "inline" #define CONTENT_DISPOSITION_FILENAME_NAME "filename" #define HTTP_CONTENT_TYPE_FORM_URLENCODED "application/x-www-form-urlencoded" #define HTTP_CONTENT_TYPE_MULTIPART_FORMDATA "multipart/form-data" #define HTTP_CONTENT_TYPE_MULTIPART_RELATED "multipart/related" #define HTTP_CONTENT_TYPE_MULTIPART_MIXED "multipart/mixed" extern const String content_disposition_filename_name; #define HASH_ORDER #ifdef HASH_ORDER #undef PA_HASH_CLASS #include "pa_hash.h" #endif class Value; typedef HASH_STRING HashStringValue; // replace system s*nprintf with our versions #undef vsnprintf int pa_vsnprintf(char *, size_t, const char* , va_list); #define vsnprintf pa_vsnprintf #undef snprintf int pa_snprintf(char *, size_t, const char* , ...); #define snprintf pa_snprintf #ifdef _MSC_VER //access #define F_OK 0 #define X_OK 1 #define W_OK 2 #define R_OK 4 #ifndef strcasecmp # define strcasecmp _stricmp #endif #ifndef strncasecmp # define strncasecmp _strnicmp #endif #define stat __stat64 #define pa_fstat _fstat64 int pa_stat(const char *pathname, struct stat *buffer); int pa_open(const char *pathname, int flags, int mode=0); FILE *pa_fopen(const char *pathname, const char *mode); #define pa_lseek _lseeki64 #else #define pa_stat stat #define pa_fstat fstat #define pa_open open #define pa_fopen fopen #define pa_lseek lseek #endif /** file related functions */ #define FILE_BUFFER_SIZE (128*0x400) int pa_lock_shared_blocking(int fd); int pa_lock_exclusive_blocking(int fd); int pa_lock_exclusive_nonblocking(int fd); int pa_unlock(int fd); void create_dir_for_file(const String& file_spec); int pa_get_valid_file_options_count(HashStringValue& options); typedef void (*File_read_action)(struct stat& finfo, int f, const String& file_spec, void *context); /** shared-lock specified file, do actions under lock. if fail_on_read_problem is true[default] throws an exception @returns true if read OK */ bool file_read_action_under_lock(const String& file_spec, const char* action_name, File_read_action action, void *context, bool as_text=false, bool fail_on_read_problem=true); /** read specified text file if fail_on_read_problem is true[default] throws an exception WARNING: charset is used for http header case conversion, it's not a charset of input file! */ char *file_read_text(Request_charsets& charsets, const String& file_spec, bool fail_on_read_problem = true); char *file_load_text(Request& r, const String& file_spec, bool fail_on_read_problem = true, HashStringValue* options = 0, bool transcode_result = true); struct File_read_result { bool success; char* str; size_t length; HashStringValue* headers; }; /** read specified binary file if fail_on_read_problem is true[default] throws an exception */ File_read_result file_read_binary(const String& file_spec, bool fail_on_read_problem = true, char* buf = 0, uint64_t offset = 0, size_t limit = 0); /** load specified file if fail_on_read_problem is true[default] throws an exception */ File_read_result file_load(Request& r, const String& file_spec, bool as_text, HashStringValue* options=0, bool fail_on_read_problem=true, bool transcode_text_result=true); typedef void (*File_write_action)(int f, void *context); /** lock specified file exclusively, do actions under lock. throws an exception in case of problems if block=false does non-blocking lock @returns true if locked OK, or false if non-blocking locking failed */ bool file_write_action_under_lock( const String& file_spec, const char* action_name, File_write_action action, void *context, bool as_text=false, bool do_append=false, bool do_block=true, bool fail_on_lock_problem=true); /** write data to specified file, throws an exception in case of problems */ void file_write( Request_charsets& charsets, const String& file_spec, const char* data, size_t size, bool as_text, bool do_append=false, Charset* asked_charset=0); /** delete specified file throws an exception in case of problems */ bool file_delete(const String& file_spec, bool fail_on_problem=true, bool keep_empty_dirs=false); /** move specified file throws an exception in case of problems */ void file_move(const String& old_spec, const String& new_spec, bool keep_empty_dirs=false); bool entry_exists(const char* fname, struct stat *afinfo=0); bool entry_exists(const String& file_spec); bool file_exist(const String& file_spec); bool dir_exists(const String& file_spec); const String* file_exist(const String& path, const String& name); bool file_executable(const String& file_spec); bool file_stat(const String& file_spec, uint64_t& rsize, time_t& ratime, time_t& rmtime, time_t& rctime, bool fail_on_read_problem=true); size_t check_file_size(uint64_t size, const String* file_spec); size_t stdout_write(const void *buf, size_t size); void check_safe_mode(struct stat finfo, const String& file_spec, const char* fname); ssize_t file_block_read(const int f, void* buffer, const size_t size); /** String related functions */ /** under WIN32 "t" mode fixes DOS chars OK, can't say that about other systems/ line break styles */ void fix_line_breaks(char *str, size_t& length /* < may change! used to speedup next actions */); char *getrow(char **row_ref,char delim='\n'); char *lsplit(char *string, char delim); char *lsplit(char **string_ref,char delim); char *rsplit(char *string, char delim); const char* format_double(double value, const char *fmt); char* unescape_chars(const char* cp, int len, Charset* client_charset=0, bool js=false/*true==decode \uXXXX and don't convert '+' to space*/); char *search_stop(char*& current, char cstop_at); inline int pa_strncasecmp(const char* str, const char* substr, size_t count=0) { return strncasecmp(str, substr, count ? count : strlen(substr)); } #ifdef WIN32 void back_slashes_to_slashes(char *s); #endif size_t strpos(const char *str, const char *substr); size_t remove_crlf(char *start, char *end); inline bool pa_isalpha(unsigned char c) { return (((c>='A') && (c<='Z')) || ((c>='a') && (c<='z'))); } inline bool pa_isalnum(unsigned char c) { return (((c>='0') && (c<='9')) || pa_isalpha(c)); } void pa_strncpy(char *dst, const char *src, size_t n); char *pa_strcat(const char *a, const char *b, const char *c = 0); const char *pa_filename(const char *path); const char* capitalize(const char* s); char *str_lower(const char *s, size_t length); char *str_upper(const char *s, size_t length); inline char *str_lower(const char *s) { return str_lower(s, strlen(s)); } inline char *str_upper(const char *s) { return str_upper(s, strlen(s)); } const char* hex_string(unsigned char* bytes, size_t size, bool upcase); extern const char* hex_digits; const char *pa_idna_encode(const char *in, Charset &source); const char *pa_idna_decode(const char *in, Charset &source); unsigned long pa_crc32(const char *in, size_t in_size); unsigned long pa_crc32(const String& file_spec); /** Mix functions */ #define PA_DEFAULT(A,B) ((A) ? (A):(B) ) Charset* detect_charset(const char* content_type); // globals extern const String file_status_name; // global defines for file options which are handled but not checked elsewhere, we check them #define PA_COLUMN_SEPARATOR_NAME "separator" #define PA_COLUMN_ENCLOSER_NAME "encloser" #define PA_CHARSET_NAME "charset" #define PA_RESPONSE_CHARSET_NAME "response-charset" // globals defines for sql options #define SQL_BIND_NAME "bind" #define PA_SQL_LIMIT_NAME "limit" #define PA_SQL_OFFSET_NAME "offset" #define SQL_DEFAULT_NAME "default" #define SQL_DISTINCT_NAME "distinct" #define SQL_VALUE_TYPE_NAME "type" extern String sql_bind_name; extern String sql_limit_name; extern String sql_offset_name; extern String sql_default_name; extern String sql_distinct_name; extern String sql_value_type_name; #ifndef DOXYGEN enum Table2hash_distint { D_ILLEGAL, D_FIRST }; enum Table2hash_value_type { C_HASH, C_STRING, C_TABLE, C_CODE }; #endif #endif parser-3.5.1/src/include/pa_globals.h0000644000076400007640000000213014712042465014434 00000000000000/** @file Parser: global decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_GLOBALS_H #define PA_GLOBALS_H #define IDENT_PA_GLOBALS_H "$Id: pa_globals.h,v 1.120 2024/11/04 03:53:25 moko Exp $" #ifdef XML # include "libxml/tree.h" #endif class Request; /// initialize global variables void pa_globals_init(); /// finalize global variables void pa_globals_done(); /// for lt_dlinit to be called once void pa_dlinit(); /// hex_value[c] = hex value of c extern short hex_value[0x100]; #ifdef XML /// flag whether there were some xml generic errors on current thread bool xmlHaveGenericErrors(); /// get xml generic error accumulated for current thread. WARNING: it is up to caller to free up const char* xmlGenericErrors(); #endif /// register request for local thread to retrive later with pa_get_request() void pa_register_thread_request(Request&); /// retrives request set by pa_set_request function, useful in contextless places [slow] Request& pa_thread_request(); #endif parser-3.5.1/src/include/pa_config_includes.h0000644000076400007640000001236714732404263016161 00000000000000/** @file Parser: includes all Configure-d headers Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian when used Configure [HAVE_CONFIG_H] it uses defines from Configure, fixed otherwise. */ #ifndef PA_CONFIG_INCLUDES_H #define PA_CONFIG_INCLUDES_H #if HAVE_CONFIG_H # include "pa_config_auto.h" #else # include "pa_config_fixed.h" #endif // AC_INCLUDES_DEFAULT #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STDDEF_H # include #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 // other includes #ifdef HAVE_ASSERT_H # include #endif #ifdef HAVE_LIMITS_H # include #endif #ifdef HAVE_CTYPE_H # include #endif #ifdef HAVE_MATH_H # include #endif #ifdef HAVE_PROCESS_H # include #endif #ifdef HAVE_STDARG_H # include #endif #ifdef HAVE_SETJMP_H # include #endif #ifdef HAVE_SIGNAL_H # include #endif #ifdef HAVE_PTHREAD_H # include #endif #ifdef HAVE_ERRNO_H # include #endif #ifdef HAVE_DIRENT_H # include #endif #ifdef HAVE_FCNTL_H # include #endif #ifdef HAVE_IO_H # include #endif #ifdef HAVE_SYS_FILE_H # include #endif #ifdef HAVE_SYS_LOCKING_H # include #endif #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_RESOURCE_H # include #endif #ifdef HAVE_SYS_WAIT_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef HAVE_NETINET_IN_H # include #endif #ifdef HAVE_ARPA_INET_H # include #endif #ifdef HAVE_NETDB_H # include #endif #if TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef HAVE_PCRE2 #define PCRE2_CODE_UNIT_WIDTH 8 #endif // math function replacements #ifdef __cplusplus #ifndef HAVE_TRUNC inline double trunc(double param) { return param > 0? floor(param) : ceil(param); } #endif #ifndef HAVE_ROUND inline double round(double param) { return floor(param+0.5); } #endif #ifndef HAVE_SIGN inline double sign(double param) { return param > 0 ? 1 : ( param < 0 ? -1 : 0 ); } #endif #if !defined(max) inline int max(int a, int b) { return a>b ? a : b; } inline int min(int a, int b){ return ab ? a : b; } inline size_t min(size_t a, size_t b){ return a= 7) #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" // case without break #endif #ifdef _MSC_VER // VS 2003 #pragma warning(disable:4355) // using this in calls to parent constructors #pragma warning(disable:4291) // no matching operator delete found; memory will not be freed if initialization throws an exception #pragma warning(disable:4512) // assignment operator could not be generated #pragma warning(disable:4127) // conditional expression is constant; while(true) OK #pragma warning(disable:4706) // assignment within conditional expression if(type var=somethig) OK #pragma warning(disable:4996) // memcpy deprecation #pragma warning(disable:4702) // unreachable code #pragma warning(disable:4511) // copy constructor could not be generated (vs2003 specific) // VS 2015 #pragma warning(disable:4267) // conversion from 'size_t' to 'int', possible loss of data #endif #endif parser-3.5.1/src/include/pa_request_info.h0000644000076400007640000000303014712042465015514 00000000000000/** @file Parser: request info class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_REQUEST_INFO_H #define PA_REQUEST_INFO_H #define IDENT_PA_REQUEST_INFO_H "$Id: pa_request_info.h,v 1.19 2024/11/04 03:53:25 moko Exp $" // include #include "pa_config_includes.h" /// some information from web server class Request_info { public: //@{ these filled by Request class user const char* document_root; const char* path_translated; const char* method; const char* query_string; const char* uri; const char* content_type; size_t content_length; const char* cookie; char** argv; bool mail_received; //@} //@{ these are filed by Request class itself: user's post data const char* post_data; size_t post_size; //@} // see feature #1116 for details bool can_have_body(){ return method && strcasecmp(method, "GET") != 0 && strcasecmp(method, "HEAD") != 0 && strcasecmp(method, "TRACE") != 0; } static const char* strip_absolute_uri(const char *auri){ if(!auri || *auri == '/') return auri; // extractring https?://site.name prefix allowed by http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2 if(!pa_strncasecmp(auri, "http://")) auri+=7; else if(!pa_strncasecmp(auri, "https://")) auri+=8; else return auri; for(; *auri && *auri != '/'; auri++); return auri; } Request_info() { memset(this, 0, sizeof(*this)); // OK as Request_info is POD } }; #endif parser-3.5.1/src/include/pa_config_auto.h.in0000644000076400007640000003055514740273415015731 00000000000000/* src/include/pa_config_auto.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* using cygwin building environment */ #undef CYGWIN /* FreeBSD1X.X target platform */ #undef FREEBSD1X /* FreeBSD4.X target platform */ #undef FREEBSD4 /* Define to 1 if you have the `argz_add' function. */ #undef HAVE_ARGZ_ADD /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the `argz_create_sep' function. */ #undef HAVE_ARGZ_CREATE_SEP /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_insert' function. */ #undef HAVE_ARGZ_INSERT /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #undef HAVE_ASSERT_H /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* Define to 1 if you have the `crypt' function. */ #undef HAVE_CRYPT /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if you don't. */ #undef HAVE_DECL_CYGWIN_CONV_PATH /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the header file. */ #undef HAVE_DLD_H /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Define to 1 if you have the header file. */ #undef HAVE_ERRNO_H /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the `fchmod' function. */ #undef HAVE_FCHMOD /* Define to 1 if you have the `fcntl' function. */ #undef HAVE_FCNTL /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `flock' function. */ #undef HAVE_FLOCK /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE /* Define to 1 if you have the `getrusage' function. */ #undef HAVE_GETRUSAGE /* Define if you have gettid() */ #undef HAVE_GETTID /* 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_IO_H /* Define to 1 if you have the `isfinite' (maybe built-in) math function function. */ #undef HAVE_ISFINITE /* Define to 1 if you have the `crypt' library (-lcrypt). */ #undef HAVE_LIBCRYPT /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if libdlloader will be built on this platform */ #undef HAVE_LIBDLLOADER /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `xnet' library (-lxnet). */ #undef HAVE_LIBXNET /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the `lockf' function. */ #undef HAVE_LOCKF /* Define this if a modern libltdl is already installed */ #undef HAVE_LTDL /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the header file. */ #undef HAVE_MATH_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR /* PCRE2 is available */ #undef HAVE_PCRE2 /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS /* Define to 1 if you have the header file. */ #undef HAVE_PROCESS_H /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the `qsort' function. */ #undef HAVE_QSORT /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR /* Define to 1 if you have the `round' (maybe built-in) math function function. */ #undef HAVE_ROUND /* Define to 1 if you have the header file. */ #undef HAVE_SETJMP_H /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the `siglongjmp' function. */ #undef HAVE_SIGLONGJMP /* Define to 1 if you have the `sign' (maybe built-in) math function function. */ #undef HAVE_SIGN /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the `sigsetjmp' function. */ #undef HAVE_SIGSETJMP /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* 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 `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if `d_type' is a member of `struct dirent'. */ #undef HAVE_STRUCT_DIRENT_D_TYPE /* Define to 1 if you have the `syslog' function. */ #undef HAVE_SYSLOG /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LOCKING_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_RESOURCE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define if you have timezone external variable in */ #undef HAVE_TIMEZONE /* Define if you have Thread-Local Storage */ #undef HAVE_TLS /* Define if you have tm_gmtoff member of tm structure in */ #undef HAVE_TM_GMTOFF /* Define if you have tm_tzadj member of tm structure in */ #undef HAVE_TM_TZADJ /* Define to 1 if you have the `trunc' (maybe built-in) math function function. */ #undef HAVE_TRUNC /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unsetenv' function. */ #undef HAVE_UNSETENV /* This value is set to 1 to indicate that the system argz facility works */ #undef HAVE_WORKING_ARGZ /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the system default library search path. */ #undef LT_DLSEARCH_PATH /* The archive extension */ #undef LT_LIBEXT /* The archive prefix */ #undef LT_LIBPREFIX /* Define to the extension used for runtime loadable modules, say, ".so". */ #undef LT_MODULE_EXT /* Define to the name of the environment variable that determines the run-time module search path. */ #undef LT_MODULE_PATH_VAR /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to the shared library suffix, say, ".dylib". */ #undef LT_SHARED_EXT /* assertions disabled */ #undef NDEBUG /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* pa_exec disabled */ #undef NO_PA_EXECS /* stringstream disabled */ #undef NO_STRINGSTREAM /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* parser version */ #undef PARSER_VERSION /* compile for sparc processor */ #undef PA_BIG_ENDIAN /* Define if you have 0..9999 year date range support */ #undef PA_DATE64 /* parser uses this command instead of user-defined sendmail commands */ #undef PA_FORCED_SENDMAIL /* compile for intel processor or compatible */ #undef PA_LITTLE_ENDIAN /* disabled reading of files belonging to group+user other then effective */ #undef PA_SAFE_MODE /* one can throw from dynamic library */ #undef PA_WITH_SJLJ_EXCEPTIONS /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* system-wide auto.p */ #undef SYSTEM_CONFIG_FILE /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Windows32 target platform */ #undef WIN32 /* has \$mail:received */ #undef WITH_MAILRECEIVE /* 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 /* xml-abled parser */ #undef XML /* Enable large inode numbers on Mac OS X 10.5. */ #ifndef _DARWIN_USE_64_BIT_INODE # define _DARWIN_USE_64_BIT_INODE 1 #endif /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint64_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT64_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* Define so that glibc/gnulib argp.h does not typedef error_t. */ #undef __error_t_defined /* Define to a type to use for `error_t' if it is not otherwise available. */ #undef error_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef uint64_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t parser-3.5.1/src/include/pa_exception.h0000644000076400007640000000560114726202557015022 00000000000000/** @file Parser: exception decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_EXCEPTION_H #define PA_EXCEPTION_H #define IDENT_PA_EXCEPTION_H "$Id: pa_exception.h,v 1.75 2024/12/11 03:22:23 moko Exp $" const char* const PARSER_RUNTIME = "parser.runtime"; const char* const IMAGE_FORMAT = "image.format"; const char* const PCRE_EXCEPTION_TYPE = "pcre.execute"; const char* const DATE_RANGE_EXCEPTION_TYPE = "date.range"; const char* const BASE64_FORMAT = "base64.format"; const char* const NAME_MUST_BE_STRING = "name must be string"; const char* const FILE_NAME_MUST_BE_STRING = "file name must be string"; const char* const FILE_NAME_MUST_BE_STRING_OR_FILE = "file name must be string or file"; const char* const FILE_NAME_MUST_BE_NE_STRING = "file name must be not empty string"; const char* const VALUE_MUST_BE_STRING = "value must be string"; const char* const PARAMETER_MUST_BE_STRING = "parameter must be string"; const char* const COLUMN_NAME_MUST_BE_STRING = "column name must be string"; const char* const FILE_NAME_MUST_BE_SPECIFIED = "file name must be specified"; const char* const PARAM_MUST_NOT_BE_CODE = "param must not be code"; const char* const PARAM_MUST_BE_HASH = "param must be hash"; const char* const MODE_MUST_BE_STRING = "mode must be string"; const char* const OPTIONS_MUST_NOT_BE_CODE = "options must not be code"; const char* const CALLED_WITH_INVALID_OPTION = "called with invalid option"; // includes #include "pa_memory.h" // forwards class String; // defines class Exception { public: Exception(); Exception(const char* atype, const String* aproblem_source, const char* comment_fmt, ...); Exception(const Exception& src); operator bool() { return ftype || fproblem_source || fcomment; } Exception& operator =(const Exception& src); /// extracts exception type const char* type(bool can_be_empty=false) const { return can_be_empty || ftype ? ftype : ""; } /// extracts exception problem_source const String* problem_source() const; /// extracts exception comment const char* comment(bool can_be_empty=false) const { const char* result=fcomment && *fcomment ? fcomment : 0; return can_be_empty || result ? result : ""; } // modifies exception to fine-tune error reporting void set_source(const String* aproblem_source) { if(!problem_source()) fproblem_source=aproblem_source; } void add_comment(const char* acomment); #define ALTER_EXCEPTION_SOURCE(code, source) \ try { \ code; \ } catch (Exception& e) { \ e.set_source(source); \ rethrow; \ } #define ALTER_EXCEPTION_COMMENT(code, comment) \ try { \ code; \ } catch (Exception& e) { \ e.add_comment(comment); \ rethrow; \ } protected: const char* ftype; const String* fproblem_source; const char* fcomment; }; #endif parser-3.5.1/src/include/pa_memory.h0000644000076400007640000001007114712042465014324 00000000000000/** @file Parser: memory reference counting classes decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_MEMORY_H #define PA_MEMORY_H #define IDENT_PA_MEMORY_H "$Id: pa_memory.h,v 1.45 2024/11/04 03:53:25 moko Exp $" // include #include "pa_config_includes.h" #include // define destructors use for Array, Hash and VMethodFrame #define USE_DESTRUCTORS // std::basic_stringstream used in ^table.csv-string[] is compatible with delete usage check only under Debian 9/10, FreeBSD 12 // #define CHECK_DELETE_USAGE // forwards void *pa_fail_alloc(const char* what, size_t size); // inlines inline void *pa_malloc(size_t size) { if(void *result=GC_MALLOC(size)) return result; return pa_fail_alloc("allocate", size); } inline void *pa_malloc_atomic(size_t size) { if(void *result=GC_MALLOC_ATOMIC(size)) return result; return pa_fail_alloc("allocate clean", size); } /// length may be zero, and this is normal inline char *pa_strdup(const char* auto_variable_never_null, size_t known_length) { if(char *result=static_cast(GC_MALLOC_ATOMIC(known_length+1))) { memcpy(result, auto_variable_never_null, known_length); result[known_length]=0; return result; } return static_cast(pa_fail_alloc("allocate clean", known_length+1)); } inline char *pa_strdup(const char* auto_variable_never_null) { return pa_strdup(auto_variable_never_null, strlen(auto_variable_never_null)); } inline void pa_free(void *ptr) { GC_FREE(ptr); } inline void *pa_realloc(void *ptr, size_t size) { if(void *result=GC_REALLOC(ptr, size)) return result; return pa_fail_alloc("reallocate to", size); } /// memory allocation/dallocation goes via pa_malloc/pa_free. class PA_Allocated { public: /// the sole: instances allocated using our functions static void *operator new(size_t size) { return pa_malloc(size); } static void operator delete(void *ptr) { pa_free(ptr); } static void *operator new[](size_t size) { return pa_malloc(size); } static void operator delete[](void *ptr) { pa_free(ptr); } }; // new(PointerFreeGC)/new(PointerGC) should be used to allocate types not inherited from PA_Allocated #define PointerFreeGC (true) #define PointerGC (false) inline void *operator new[] (size_t size, bool pointer_free) { return pointer_free ? pa_malloc_atomic(size) : pa_malloc(size); } inline void *operator new (size_t size, bool pointer_free) { return pointer_free ? pa_malloc_atomic(size) : pa_malloc(size); } /// Base for all Parser classes typedef PA_Allocated PA_Object; // defines #define override #define rethrow throw #if defined(_MSC_VER) || (__cplusplus>=201103L) #define PA_THROW(what) #else #define PA_THROW(what) throw(what) #endif #if !defined(_MSC_VER) && !defined(FREEBSD1X) // regular new/delete are disabled from accidental use // no checks for FreeBSD1X.X due to https://bugs.llvm.org/show_bug.cgi?id=40161 bug void *new_disabled(); void delete_disabled(); inline void *operator new[] (std::size_t) PA_THROW(std::bad_alloc){ return new_disabled(); } inline void operator delete[](void *) throw(){ delete_disabled(); } inline void operator delete[](void *, std::size_t) throw(){ delete_disabled(); } inline void *operator new(std::size_t) PA_THROW(std::bad_alloc){ return new_disabled(); } #ifdef CHECK_DELETE_USAGE inline void operator delete(void *) throw(){ delete_disabled(); } #endif #ifndef PA_DEBUG_DISABLE_GC // other regular allocators as disabled from accidental use as well void *calloc_disabled(); void *malloc_disabled(); void *realloc_disabled(); void free_disabled(); char *strdup_disabled(); inline void *calloc(size_t) { return calloc_disabled(); } inline void *malloc(size_t) { return malloc_disabled(); } inline void *realloc(void *, size_t) { return realloc_disabled(); } inline void free(void *) { free_disabled(); } inline char *strdup(const char*, size_t){ return strdup_disabled(); } #endif // PA_DEBUG_DISABLE_GC #endif // _MSC_VER void pa_gc_collect(bool forced=false); void pa_gc_set_free_space_divisor(int); #endif parser-3.5.1/src/include/pa_random.h0000644000076400007640000000122514712042465014275 00000000000000/** @file Parser: random related functions. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_RANDOM_H #define PA_RANDOM_H #define IDENT_PA_RANDOM_H "$Id: pa_random.h,v 1.13 2024/11/04 03:53:25 moko Exp $" #include "pa_types.h" void random(void *buffer, size_t size); static inline int _random(int top) { uint32_t raw; random(&raw, sizeof(raw)); return int( double(raw) / ((double)UINT_MAX+1) * top ); } char *get_uuid_cstr(bool lower, bool solid); char *get_uuid7_cstr(bool lower, bool solid); char *get_uuid_boundary(); #endif parser-3.5.1/src/Makefile.in0000644000076400007640000004602614740273415012620 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = include main sql types classes lib targets all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/classes/0000755000076400007640000000000014740300546012254 500000000000000parser-3.5.1/src/classes/hash.C0000644000076400007640000006072314732404263013235 00000000000000/** @file Parser: @b hash parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_charsets.h" #include "pa_vhash.h" #include "pa_varray.h" #include "pa_vvoid.h" #include "pa_sql_connection.h" #include "pa_vtable.h" #include "pa_vbool.h" #include "pa_vmethod_frame.h" volatile const char * IDENT_HASH_C="$Id: hash.C,v 1.169 2024/12/23 18:30:55 moko Exp $"; // class class MHash: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VHash(); } public: MHash(); }; // global variable DECLARE_CLASS_VAR(hash, new MHash); // methods #ifndef DOXYGEN class Hash_sql_event_handlers: public SQL_Driver_query_event_handlers { bool distinct; HashStringValue& result; Value* row_value; int column_index; ArrayString* columns; bool one_bool_column; Table2hash_value_type value_type; int columns_count; public: Table* empty; public: Hash_sql_event_handlers(bool adistinct, HashStringValue& aresult, Table2hash_value_type avalue_type): distinct(adistinct), result(aresult), row_value(0), column_index(0), columns(new ArrayString), one_bool_column(false), value_type(avalue_type), empty(0) { } bool add_column(SQL_Error& error, const char* str, size_t ) { try { if(columns_count){ // another query in multi_statements mode columns=new ArrayString; columns_count=0; } *columns+=new String(str, String::L_TAINTED /* no length as 0x00 can be inside */); return false; } catch(...) { error=SQL_Error("exception occurred in Hash_sql_event_handlers::add_column"); return true; } } bool before_rows(SQL_Error& error) { columns_count=columns->count(); if(columns_count<1) { error=SQL_Error("no columns"); return true; } if(columns_count==1) { one_bool_column=true; } else { switch(value_type){ case C_STRING: { if(columns_count>2){ error=SQL_Error("only 2 columns allowed for $.type[string]"); return true; } break; } case C_TABLE: { // create empty table which we'll copy later empty=new Table(columns); break; } } } return false; } bool add_row(SQL_Error& /*error*/) { column_index=0; return false; } bool add_row_cell(SQL_Error& error, const char *str, size_t ) { try { const String& cell=str ? *new String(str, String::L_TAINTED /* no length as 0x00 can be inside */) : String::Empty; if(column_index==columns_count){ // should never happen, buggy driver case error=SQL_Error("columns index exceed the columns count"); return true; } bool duplicate=false; if(one_bool_column) { duplicate=result.put_dont_replace(cell, &VBool::get(true)); // put. existed? } else if(column_index==0) { switch(value_type){ case C_HASH: { VHash* row_vhash=new VHash; row_value=row_vhash; duplicate=result.put_dont_replace(cell, row_vhash); // put. existed? break; } case C_STRING: { VString* row_vstring=new VString(); row_value=row_vstring; duplicate=result.put_dont_replace(cell, row_vstring); // put. existed? break; } case C_TABLE: { VTable* vtable=(VTable*)result.get(cell); if(vtable) { // table with this key exist? if(!distinct) { duplicate=true; break; } } else { // no? creating table of same structure as source Table::Action_options table_options(0, 0); vtable=new VTable(new Table(*empty, table_options/*no rows, just structure*/)); result.put(cell, vtable); // put } ArrayString* row=new ArrayString(columns_count); row_value=(Value*)row; *row+=&cell; *vtable->get_table()+=row; break; } } } else { switch(value_type) { case C_HASH: { row_value->get_hash()->put(*columns->get(column_index), new VString(cell)); break; } case C_STRING: { VString* row_string=(VString*)row_value; row_string->set_string(cell); break; } case C_TABLE: { ArrayString* row=(ArrayString*)row_value; *row+=&cell; break; } } } if(duplicate & !distinct) { error=SQL_Error("duplicate key"); return true; } column_index++; return false; } catch(...) { error=SQL_Error("exception occurred in Hash_sql_event_handlers::add_row_cell"); return true; } } }; #endif static void _create_or_add(Request& r, MethodParams& params) { if(params.count()) { Value& vsrc=params.as_no_junction(0, PARAM_MUST_BE_HASH); VHashBase& self=GET_SELF(r, VHashBase); HashStringValue* self_hash=&(self.hash()); HashStringValue* src_hash; if(VArray* src=dynamic_cast(&vsrc)) { for(ArrayValue::Iterator i(src->array()); i; i.next()){ if(i.value()) self_hash->put(i.key(), i.value()); } return; } else if(VHashBase* src=dynamic_cast(&vsrc)) { src_hash=&(src->hash()); if(src_hash==self_hash) // same: doing nothing return; if(Value* vdefault=src->get_default()) self.set_default(vdefault); } else { // allows $h[^hash::create[non-blank string]], thus as_hash("param") is more correct, but is not backward compatible src_hash=vsrc.get_hash(); } if(src_hash) for(HashStringValue::Iterator i(*src_hash); i; i.next()) self_hash->put(i.key(), i.value()); } } static void _sub(Request& r, MethodParams& params) { if(HashStringValue* src=params.as_hash(0, "param")) { HashStringValue* self=&(GET_SELF(r, VHashBase).hash()); if(src==self) { // same: clearing self->clear(); return; } for(HashStringValue::Iterator i(*src); i; i.next()) self->remove(i.key()); } } static void copy_all_dontoverwrite_to(HashStringValue::key_type key, HashStringValue::value_type value, HashStringValue* dest) { dest->put_dont_replace(key, value); } static void _union(Request& r, MethodParams& params) { // dest = copy of self Value& result=*new VHash(GET_SELF(r, VHashBase).hash()); // dest += b if(HashStringValue* src=params.as_hash(0, "param")) src->for_each(copy_all_dontoverwrite_to, result.get_hash()); // return result r.write(result); } #ifndef DOXYGEN struct Copy_intersection_to_info { HashStringValue* b; HashStringValue* dest; }; #endif static void copy_intersection_by_arg(HashStringValue::key_type key, HashStringValue::value_type, Copy_intersection_to_info *info) { if(HashStringValue::value_type value=info->b->get(key)) info->dest->put_dont_replace(key, value); } static void copy_intersection_by_self(HashStringValue::key_type key, HashStringValue::value_type value, Copy_intersection_to_info *info) { if(info->b->get(key)) info->dest->put_dont_replace(key, value); } static void _intersection(Request& r, MethodParams& params) { Value& result=*new VHash; bool order_by_arg=false; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "options")) { int valid_options=0; if(Value* vorder=options->get("order")) { const String &sorder=r.process(*vorder).as_string(); if(sorder == "arg") order_by_arg=true; else if(sorder != "self") throw Exception(PARSER_RUNTIME, &sorder, "'order' must be 'self' or 'arg'"); valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } if(HashStringValue* b=params.as_hash(0, "param")) { if(order_by_arg){ Copy_intersection_to_info info={&GET_SELF(r, VHashBase).hash(), result.get_hash()}; b->for_each(copy_intersection_by_arg, &info); } else { Copy_intersection_to_info info={b, result.get_hash()}; GET_SELF(r, VHashBase).hash().for_each(copy_intersection_by_self, &info); } } r.write(result); } static bool intersects( HashStringValue::key_type key, HashStringValue::value_type /*value*/, HashStringValue* b) { return b->get(key)!=0; } static void _intersects(Request& r, MethodParams& params) { bool result=false; if(HashStringValue* b=params.as_hash(0, "param")) { HashStringValue* self=&(GET_SELF(r, VHashBase).hash()); if(b==self) { r.write(VBool::get(true)); return; } result=self->first_that(intersects, b)!=0; } // return result r.write(VBool::get(result)); } extern Table2hash_value_type get_value_type(Value& vvalue_type); extern int marshal_binds(HashStringValue& hash, SQL_Driver::Placeholder*& placeholders); extern void unmarshal_bind_updates(HashStringValue& hash, int placeholder_count, SQL_Driver::Placeholder* placeholders); static void _sql(Request& r, MethodParams& params) { Value& statement=params.as_junction(0, "statement must be code"); HashStringValue* bind=0; ulong limit=SQL_NO_LIMIT; ulong offset=0; bool distinct=false; Table2hash_value_type value_type=C_HASH; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "sql options")) { int valid_options=0; for(HashStringValue::Iterator i(*options); i; i.next() ){ String::Body key=i.key(); Value* value=i.value(); if(key == sql_bind_name) { bind=value->get_hash(); valid_options++; } else if(key == sql_limit_name) { limit=(ulong)r.process(*value).as_double(); valid_options++; } else if(key == sql_offset_name) { offset=(ulong)r.process(*value).as_double(); valid_options++; } else if (key == sql_distinct_name) { distinct=r.process(*value).as_bool(); valid_options++; } else if (key == sql_value_type_name) { value_type=get_value_type(r.process(*value)); valid_options++; } } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } SQL_Driver::Placeholder* placeholders=0; uint placeholders_count=0; if(bind) placeholders_count=marshal_binds(*bind, placeholders); const String& statement_string=r.process_to_string(statement); const char* statement_cstr=statement_string.untaint_cstr(String::L_SQL, r.connection()); HashStringValue& hash=GET_SELF(r, VHashBase).hash(); hash.clear(); Hash_sql_event_handlers handlers(distinct, hash, value_type); r.connection()->query(statement_cstr, placeholders_count, placeholders, offset, limit, handlers, statement_string); if(bind) unmarshal_bind_updates(*bind, placeholders_count, placeholders); } static void keys_collector(HashStringValue::key_type key, HashStringValue::value_type, Table *table) { Table::element_type row(new ArrayString(1)); *row+=new String(key, String::L_TAINTED); *table+=row; } static void _keys(Request& r, MethodParams& params) { const String* keys_column_name; if(params.count()>0) keys_column_name=¶ms.as_string(0, COLUMN_NAME_MUST_BE_STRING); else keys_column_name=new String("key"); Table::columns_type columns(new ArrayString(1)); *columns+=keys_column_name; Table* table=new Table(columns); GET_SELF(r, VHashBase).hash().for_each(keys_collector, table); r.write(*new VTable(table)); } static void _count(Request& r, MethodParams&) { r.write(*new VInt(GET_SELF(r, VHashBase).hash().count())); } static void _delete(Request& r, MethodParams& params) { if(params.count()>0) GET_SELF(r, VHashBase).hash().remove(params.as_string(0, "key must be string")); else GET_SELF(r, VHashBase).hash().clear(); } static void _contains(Request& r, MethodParams& params) { VHashBase& self=GET_SELF(r, VHashBase); const String& key_name=params.as_string(0, "key must be string"); bool result=SYMBOLS_EQ(key_name,_DEFAULT_SYMBOL) ? (self.get_default() != 0) : self.hash().contains(key_name); r.write(VBool::get(result)); } static void _foreach(Request& r, MethodParams& params) { InCycle temp(r); const String* key_var_name=¶ms.as_string(0, "key-var name must be string"); const String* value_var_name=¶ms.as_string(1, "value-var name must be string"); Value* body_code=¶ms.as_junction(2, "body must be code"); Value* delim_maybe_code=params.count()>3?¶ms[3]:0; Value& caller=*r.get_method_frame()->caller(); if(key_var_name->is_empty()) key_var_name=0; if(value_var_name->is_empty()) value_var_name=0; HashStringValue& hash=GET_SELF(r, VHashBase).hash(); if(delim_maybe_code){ // delimiter set bool need_delim=false;; for(HashStringValue::Iterator i(hash); i; i.next()){ if(key_var_name){ VString* vkey=new VString(*new String(i.key(), String::L_TAINTED)); r.put_element(caller, *key_var_name, vkey); } if(value_var_name) r.put_element(caller, *value_var_name, i.value()); Value& sv_processed=r.process(*body_code); TempSkip4Delimiter skip(r); const String* s_processed=sv_processed.get_string(); if(s_processed && !s_processed->is_empty()) { // we have body if(need_delim) // need delim & iteration produced string? r.write(r.process(*delim_maybe_code)); else need_delim=true; } r.write(sv_processed); if(skip.check_break()) break; } } else { for(HashStringValue::Iterator i(hash); i; i.next()){ if(key_var_name){ VString* vkey=new VString(*new String(i.key(), String::L_TAINTED)); r.put_element(caller, *key_var_name, vkey); } if(value_var_name) r.put_element(caller, *value_var_name, i.value()); r.process_write(*body_code); if(r.check_skip_break()) break; } } } enum AtResultType { AtResultTypeValue = 0, AtResultTypeKey = 1, AtResultTypeHash = 2 }; static Value& SingleElementHash(String::Body akey, Value* avalue) { Value& result=*new VHash; result.put_element(*new String(akey, String::L_TAINTED), avalue); return result; } #ifndef DOXYGEN struct Hash_seq_item : public PA_Allocated { HashStringValue::Pair *hash_pair; union { const char *c_str; double d; } value; }; #endif static int sort_cmp_string(const void *a, const void *b) { return strcmp( static_cast(a)->value.c_str, static_cast(b)->value.c_str ); } static int sort_cmp_double(const void *a, const void *b) { double va=static_cast(a)->value.d; double vb=static_cast(b)->value.d; if(vavb) return +1; else return 0; } static void _sort(Request& r, MethodParams& params){ #ifdef HASH_ORDER const String& key_var_name=params.as_string(0, "key-var name must be string"); const String& value_var_name=params.as_string(1, "value-var name must be string"); Value& key_maker=params.as_junction(2, "key-maker must be code"); bool reverse=params.count()>3 /*..[desc|asc|]*/ && params.as_no_junction(3, "order must not be code").as_string()=="desc"; // default=asc const String* key_var=key_var_name.is_empty()? 0 : &key_var_name; const String* value_var=value_var_name.is_empty()? 0 : &value_var_name; VMethodFrame* context=r.get_method_frame()->caller(); HashStringValue& hash=GET_SELF(r, VHashBase).hash(); int count=hash.count(); Hash_seq_item* seq=new Hash_seq_item[count]; int pos=0; bool key_values_are_strings=true; for(HashStringValue::Iterator i(hash); i; i.next(), pos++ ){ if(key_var) r.put_element(*context, *key_var, new VString(*new String(i.key(), String::L_TAINTED))); if(value_var) r.put_element(*context, *value_var, i.value()); Value& value=r.process(key_maker); if(pos==0) // determining key values type by first one key_values_are_strings=value.is_string(); seq[pos].hash_pair=i.pair(); if(key_values_are_strings) seq[pos].value.c_str=value.as_string().cstr(); else seq[pos].value.d=value.as_expr_result().as_double(); } // @todo: handle this elsewhere if(r.charsets.source().NAME()=="KOI8-R" && key_values_are_strings) for(pos=0; pos=0; pos--) hash.order_next(seq[pos].hash_pair); else for(pos=0; pos 1) { const String& stype=params.as_string(1, "type must be string"); if(stype == "key") result_type=AtResultTypeKey; else if(stype == "hash") result_type=AtResultTypeHash; else if(stype != "value") throw Exception(PARSER_RUNTIME, &stype, "type must be 'key', 'value' or 'hash'"); } int pos=params.as_index(0, count, r); if(count && pos >= 0 && (size_t)pos < count){ switch(result_type) { case AtResultTypeKey: { #ifdef HASH_ORDER if(pos == 0) { r.write(*new VString(*new String(hash.first_key(), String::L_TAINTED))); } else if((size_t)pos == count-1) { r.write(*new VString(*new String(hash.last_key(), String::L_TAINTED))); } else #endif { for(HashStringValue::Iterator i(hash); i; i.next(), pos-- ) if(!pos){ r.write(*new VString(*new String(i.key(), String::L_TAINTED))); break; } } break; } case AtResultTypeValue: { #ifdef HASH_ORDER if(pos == 0) { r.write(*hash.first_value()); } else if((size_t)pos == count-1) { r.write(*hash.last_value()); } else #endif { for(HashStringValue::Iterator i(hash); i; i.next(), pos-- ) if(!pos){ r.write(*i.value()); break; } } break; } case AtResultTypeHash: { #ifdef HASH_ORDER if(pos == 0) { r.write(SingleElementHash(hash.first_key(), hash.first_value())); } else if((size_t)pos == count-1) { r.write(SingleElementHash(hash.last_key(), hash.last_value())); } else #endif { for(HashStringValue::Iterator i(hash); i; i.next(), pos-- ) if(!pos){ r.write(SingleElementHash(i.key(), i.value())); break; } } break; } } } } static void _set(Request& r, MethodParams& params) { HashStringValue& hash=GET_SELF(r, VHashBase).hash(); size_t count=hash.count(); int pos=params.as_index(0, count, r); if(count && pos >= 0 && (size_t)pos < count){ #ifdef HASH_ORDER if((size_t)pos == count-1) { hash.last_pair()->value=&r.process(params[1]); return; } else #endif { for(HashStringValue::Iterator i(hash); i; i.next(), pos-- ) if(!pos){ i.pair()->value=&r.process(params[1]); return; } } } if(count) throw Exception(PARSER_RUNTIME, 0, "index '%d' is out of range 0..%d", pos, count-1); throw Exception(PARSER_RUNTIME, 0, "index '%d' is out of range: hash is empty", pos); } extern String table_reverse_name; static void _select(Request& r, MethodParams& params) { InCycle temp(r); const String* key_var_name=¶ms.as_string(0, "key-var name must be string"); const String* value_var_name=¶ms.as_string(1, "value-var name must be string"); Value& vcondition=params.as_expression(2, "condition must be number, bool or expression"); if(key_var_name->is_empty()) key_var_name=0; if(value_var_name->is_empty()) value_var_name=0; HashStringValue& source_hash=GET_SELF(r, VHashBase).hash(); Value& caller=*r.get_method_frame()->caller(); int limit=source_hash.count(); bool reverse=false; bool copy_default=false; if(params.count()>3) if(HashStringValue* options=params.as_hash(3)) { int valid_options=0; if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; limit=r.process(*vlimit).as_int(); } if(Value* vreverse=options->get(table_reverse_name)) { valid_options++; reverse=r.process(*vreverse).as_bool(); } if(Value* vcopy_default=options->get(sql_default_name)) { valid_options++; copy_default=r.process(*vcopy_default).as_bool(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } HashStringValue& result_hash=*new HashStringValue(); if(limit>0){ #ifdef HASH_ORDER if(reverse){ for(HashStringValue::ReverseIterator i(source_hash); i; i.prev()){ if(key_var_name) r.put_element(caller, *key_var_name, new VString(*new String(i.key(), String::L_TAINTED))); if(value_var_name) r.put_element(caller, *value_var_name, i.value()); bool condition=r.process(vcondition).as_bool(); if(r.check_skip_break()) break; if(condition){ result_hash.put(i.key(), i.value()); if(!--limit) break; } } } else { #else { #endif for(HashStringValue::Iterator i(source_hash); i; i.next() ){ if(key_var_name) r.put_element(caller, *key_var_name, new VString(*new String(i.key(), String::L_TAINTED))); if(value_var_name) r.put_element(caller, *value_var_name, i.value()); bool condition=r.process(vcondition).as_bool(); if(r.check_skip_break()) break; if(condition){ result_hash.put(i.key(), i.value()); if(!--limit) break; } } } } VHash *result=new VHash(result_hash); if(copy_default){ result->set_default(GET_SELF(r, VHashBase).get_default()); } r.write(*result); } static void _reverse(Request& r, MethodParams&) { VHashBase& self=GET_SELF(r, VHashBase); HashStringValue& source_hash=self.hash(); HashStringValue& result_hash=*new HashStringValue(); #ifdef HASH_ORDER for(HashStringValue::ReverseIterator i(source_hash); i; i.prev()) result_hash.put(i.key(), i.value()); #else for(HashStringValue::Iterator i(source_hash); i; i.next() ) result_hash.put(i.key(), i.value()); #endif VHashBase& result=*new VHash(result_hash); if(Value* vdefault=self.get_default()) result.set_default(vdefault); r.write(result); } static void _rename(Request& r, MethodParams& params) { HashStringValue& hash=GET_SELF(r, VHashBase).hash(); if(params.count()>1){ const String& key_from=params.as_string(0, "from key must be string"); const String& key_to=params.as_string(1, "to key must be string"); hash.rename(key_from, key_to); } else { HashStringValue* names=params.as_hash(0,"single parameter"); for(HashStringValue::Iterator i(*names); i; i.next()) hash.rename(i.key(), i.value()->as_string()); } } // constructor MHash::MHash(): Methoded("hash") { // ^hash::create[[copy_from]] add_native_method("create", Method::CT_DYNAMIC, _create_or_add, 0, 1); // ^hash.add[add_from] add_native_method("add", Method::CT_DYNAMIC, _create_or_add, 1, 1); // ^hash.sub[sub_from] add_native_method("sub", Method::CT_DYNAMIC, _sub, 1, 1); // ^a.union[b] = hash add_native_method("union", Method::CT_DYNAMIC, _union, 1, 1); // ^a.intersection[b][options hash] = hash add_native_method("intersection", Method::CT_DYNAMIC, _intersection, 1, 2); // ^a.intersects[b] = bool add_native_method("intersects", Method::CT_DYNAMIC, _intersects, 1, 1); // ^a.delete[key] add_native_method("delete", Method::CT_DYNAMIC, _delete, 0, 1); // ^a.contains[key] add_native_method("contains", Method::CT_DYNAMIC, _contains, 1, 1); // backward add_native_method("contain", Method::CT_DYNAMIC, _contains, 1, 1); // ^hash::sql[query][options hash] add_native_method("sql", Method::CT_DYNAMIC, _sql, 1, 2); // ^hash._keys[[column name]] add_native_method("_keys", Method::CT_DYNAMIC, _keys, 0, 1); // ^hash._count[] add_native_method("_count", Method::CT_DYNAMIC, _count, 0, 0); // ^hash.foreach[key;value]{code}[delim] add_native_method("foreach", Method::CT_DYNAMIC, _foreach, 2+1, 2+1+1); // ^hash.sort[key;value]{string-key-maker}[[asc|desc]] // ^hash.sort[key;value](numeric-key-maker)[[asc|desc]] add_native_method("sort", Method::CT_DYNAMIC, _sort, 3, 4); // ^hash.select[key;value](bool-condition)[options hash] add_native_method("select", Method::CT_DYNAMIC, _select, 3, 4); // ^hash.reverse[] add_native_method("reverse", Method::CT_DYNAMIC, _reverse, 0, 0); // ^hash._at[first|last[;'key'|'value'|'hash']] // ^hash._at([-+]index)[['key'|'value'|'hash']] add_native_method("_at", Method::CT_DYNAMIC, _at, 1, 2); // ^hash.set[first|last;value] // ^hash.set([-+]index)[value] add_native_method("set", Method::CT_DYNAMIC, _set, 2, 2); // ^hash.rename[from;to] // ^hash.rename[ $.from[to] ... ] add_native_method("rename", Method::CT_DYNAMIC, _rename, 1, 2); #ifdef FEATURE_GET_ELEMENT4CALL // aliases without "_" add_native_method("keys", Method::CT_DYNAMIC, _keys, 0, 1); add_native_method("count", Method::CT_DYNAMIC, _count, 0, 0); add_native_method("at", Method::CT_DYNAMIC, _at, 1, 2); #endif } parser-3.5.1/src/classes/json.C0000644000076400007640000005060014712042465013254 00000000000000/** @file Parser: @b json parser class. Copyright (c) 2000-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vbool.h" #include "pa_varray.h" #include "pa_charset.h" #include "pa_charsets.h" #include "pa_json.h" #ifdef XML #include "pa_vxdoc.h" #endif volatile const char * IDENT_JSON_C="$Id: json.C,v 1.66 2024/11/04 03:53:25 moko Exp $"; // class class MJson: public Methoded { public: MJson(); override Value* get_element(const String&); override const VJunction* put_element(const String&, Value*); }; // global variable DECLARE_CLASS_VAR(json, new MJson); bool handle_array_default=true; // methods struct Json : public PA_Allocated { Stack stack; Stack key_stack; String* key; Value* result; Junction* hook_object; Junction* hook_array; Request* request; Charset *charset; String::Language taint; bool handle_double; bool handle_int; bool handle_array; enum Distinct { D_EXCEPTION, D_FIRST, D_LAST, D_ALL } distinct; Json(Charset* acharset): stack(), key_stack(), key(NULL), result(NULL), hook_object(NULL), hook_array(NULL), request(NULL), charset(acharset), taint(String::L_TAINTED), handle_double(true), handle_int(true), handle_array(handle_array_default), distinct(D_EXCEPTION){} bool set_distinct(const String &value){ if (value == "first") distinct = D_FIRST; else if (value == "last") distinct = D_LAST; else if (value == "all") distinct = D_ALL; else return false; return true; } bool set_handle_array(const String &value){ if (value == "array") handle_array = true; else if (value == "hash") handle_array = false; else return false; return true; } }; Value* MJson::get_element(const String& aname) { if (aname=="array"){ return new VString(*new String(handle_array_default ? "array" : "hash")); } return Methoded::get_element(aname); } const VJunction* MJson::put_element(const String& aname, Value* avalue) { if (aname=="array"){ Json json(NULL); if (avalue->get_string()){ const String& sarray=avalue->as_string(); if (json.set_handle_array(sarray)){ handle_array_default=json.handle_array; return 0; } throw Exception(PARSER_RUNTIME, &sarray, "$json:array must be 'array' or 'hash'"); } throw Exception(PARSER_RUNTIME, 0, "$json:array must be 'array' or 'hash'"); } return Methoded::put_element(aname, avalue); } static void set_json_value(Json *json, Value *value){ VHashBase *top = json->stack.top_value(); if(json->key == NULL){ top->add(value); } else { switch (json->distinct){ case Json::D_EXCEPTION: if (top->hash().put_dont_replace(*json->key, value)) throw Exception(PARSER_RUNTIME, json->key, "duplicate key"); break; case Json::D_FIRST: top->hash().put_dont_replace(*json->key, value); break; case Json::D_LAST: top->hash().put(*json->key, value); break; case Json::D_ALL: if (top->hash().put_dont_replace(*json->key, value)){ for(int i=2;;i++){ String key; key << *json->key << "_" << pa_uitoa(i); if (!top->hash().put_dont_replace(key, value)) break; } } break; } json->key=NULL; } } String* json_string(Json *json, const char *value, uint32_t length){ String::C result = json->charset !=NULL ? Charset::transcode(String::C(value, length), pa_UTF8_charset, *json->charset) : String::C(pa_strdup(value, length), length); return new String(result, json->taint); } static Value *json_hook(Request &r, Junction *hook, String* key, Value* value){ Value *params[]={new VString(key ? *key : String::Empty), value}; METHOD_FRAME_ACTION(*hook->method, r.method_frame, hook->self, { frame.store_params(params, 2); r.call(frame); return &frame.result(); }); } static int json_callback(Json *json, int type, const char *value, uint32_t length) { switch(type) { case JSON_OBJECT_BEGIN:{ VHash *v = new VHash(); if (json->hook_object){ json->key_stack.push(json->key); json->key=NULL; } else { if (json->stack.count()) set_json_value(json, v); } json->stack.push(v); break; } case JSON_OBJECT_END:{ if (json->hook_object){ String* key = json->key_stack.pop(); json->result = json_hook(*json->request, json->hook_object, key, json->stack.pop()); if (json->stack.count()){ json->key = key; set_json_value(json, json->result); } } else { json->result = json->stack.pop(); } break; } case JSON_ARRAY_BEGIN:{ if (json->hook_array){ json->key_stack.push(json->key); json->key=NULL; json->stack.push(new VHash); } else { VHashBase *v = json->handle_array ? (VHashBase *)new VArray : (VHashBase *)new VHash; if (json->stack.count()) set_json_value(json, v); json->stack.push(v); } break; } case JSON_ARRAY_END: // libjson supports array at top level, we too if (json->hook_array){ String* key = json->key_stack.pop(); json->result = json_hook(*json->request, json->hook_array, key, json->stack.pop()); if (json->stack.count()){ json->key = key; set_json_value(json, json->result); } } else { json->result = json->stack.pop(); } break; case JSON_KEY: json->key = json_string(json, value, length); break; case JSON_INT: if (json->handle_int){ set_json_value(json, new VDouble( json_string(json, value, length)->as_double() )); } else { // JSON_STRING set_json_value(json, new VString(*json_string(json, value, length))); } break; case JSON_FLOAT: if (json->handle_double){ set_json_value(json, new VDouble( json_string(json, value, length)->as_double() )); break; } // else is JSON_STRING case JSON_STRING: set_json_value(json, new VString(*json_string(json, value, length))); break; case JSON_NULL: set_json_value(json, VVoid::get()); break; case JSON_TRUE: set_json_value(json, &VBool::get(true)); break; case JSON_FALSE: set_json_value(json, &VBool::get(false)); break; } return 0; } static const char* json_error_message(int error_code){ static const char* error_messages[] = { NULL, "out of memory", "bad character", "stack empty", "pop unexpected mode", "nesting limit", "data limit", "comment not allowed by config", "unexpected character", "missing unicode low surrogate", "unexpected unicode low surrogate", "error comma out of structure", "error in a callback" }; return error_messages[error_code]; } extern String::Language get_untaint_lang(const String& lang_name); #define SOURCE_MAX_LEN 60 void json_exception_with_source(Request& r, const char* msg, const char* json, int offset){ int i; int line=0; int start=0; int end=strlen(json); if(offset>end) offset=end; for(i = 0; i < offset; i++){ if(json[i]=='\n'){ line++; } } if(offset > SOURCE_MAX_LEN/2) start = offset - SOURCE_MAX_LEN/2; for(i = offset-1; i>=start; i--){ if(json[i]=='\n'){ start=i+1; break; } } if(start+SOURCE_MAX_LEN < end) end=start+SOURCE_MAX_LEN; for(i = offset+1; i0){ String s_source(pa_strdup(source,source_offset)); source_offset=s_source.length(r.charsets.source()); } } throw Exception("json.parse", 0, "%s at line %d\n%s\n%*s", msg, line+1, source, source_offset+1, "^"); } static void _parse(Request& r, MethodParams& params) { const String& json_string=params.as_string(0, "json must be string"); Json json(r.charsets.source().isUTF8() ? NULL : &(r.charsets.source())); json_config config = { 0, // buffer_initial_size 128, // max_nesting 0, // max_data 1, // allow_c_comments 1, // allow_yaml_comments pa_malloc, pa_realloc, pa_free }; if(params.count() == 2) if(HashStringValue* options=params.as_hash(1)) { int valid_options=0; if(Value* value=options->get("depth")) { config.max_nesting=r.process(*value).as_int(); valid_options++; } if(Value* value=options->get("double")) { json.handle_double=r.process(*value).as_bool(); valid_options++; } if(Value* value=options->get("int")) { json.handle_int=r.process(*value).as_bool(); valid_options++; } if(Value* value=options->get("distinct")) { const String& sdistinct=value->as_string(); if (!json.set_distinct(sdistinct)) throw Exception(PARSER_RUNTIME, &sdistinct, "must be 'first', 'last' or 'all'"); valid_options++; } if(Value* value=options->get("taint")) { json.taint=get_untaint_lang(value->as_string()); valid_options++; } if(Value* value=options->get("object")) { json.hook_object=value->get_junction(); json.request=&r; if (!json.hook_object || !json.hook_object->method || !json.hook_object->method->params_names || !(json.hook_object->method->params_count == 2)) throw Exception(PARSER_RUNTIME, 0, "$.object must be parser method with 2 parameters"); valid_options++; } if(Value* value=options->get("array")) { if(value->get_string()){ const String& sarray=value->as_string(); if (!json.set_handle_array(sarray)) throw Exception(PARSER_RUNTIME, &sarray, "$.array must be parser method with 2 parameters or 'array' or 'hash'"); } else { json.hook_array=value->get_junction(); json.request=&r; if (!json.hook_array || !json.hook_array->method || !json.hook_array->method->params_names || !(json.hook_array->method->params_count == 2)) throw Exception(PARSER_RUNTIME, 0, "$.array must be parser method with 2 parameters or 'array' or 'hash'"); } valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } const String::Body json_body = json_string.cstr_to_string_body_untaint(String::L_JSON, r.connection(false), &r.charsets); const char *json_cstr = json.charset != NULL ? Charset::transcode(json_body, *json.charset, pa_UTF8_charset).cstr() : json_body.cstr(); json_parser parser; if(int result = json_parser_init(&parser, &config, (json_parser_callback)&json_callback, &json)) throw Exception("json.parse", 0, "%s", json_error_message(result)); if(!*json_cstr) throw Exception("json.parse", 0, "empty string is not valid json"); const char *first_quote=strchr(json_cstr,'"'); if(first_quote && first_quote>json_cstr && *(--first_quote) == '\\') json_exception_with_source(r, "illegal quote escape, json may be tainted", json_cstr, first_quote-json_cstr); uint32_t processed; if(int result = json_parser_string(&parser, json_cstr, strlen(json_cstr), &processed)) json_exception_with_source(r, json_error_message(result), json_cstr, processed); if (!json_parser_is_done(&parser)) json_exception_with_source(r, "unexpected end of json data", json_cstr, processed); json_parser_free(&parser); if (json.result) r.write(*json.result); } const uint ANTI_ENDLESS_JSON_STRING_RECURSION=128; char *get_indent(uint level){ static char* cache[ANTI_ENDLESS_JSON_STRING_RECURSION]={}; if (!cache[level]){ char *result = static_cast(pa_malloc_atomic(level+1)); memset(result, '\t', level); result[level]='\0'; return cache[level]=result; } return cache[level]; } String *get_delim(uint level){ static String* cache[ANTI_ENDLESS_JSON_STRING_RECURSION]={}; if (!cache[level]){ char *result = static_cast(pa_malloc_atomic(level+2+1+1)); result[0]=','; result[1]='\n'; memset(result+2, '\t', level); result[level+2]='"'; result[level+3]='\0'; return cache[level] = new String(result, String::L_AS_IS); } return cache[level]; } String *get_array_delim(uint level){ static String* cache[ANTI_ENDLESS_JSON_STRING_RECURSION]={}; if (!cache[level]){ char *result = static_cast(pa_malloc_atomic(level+2+1)); result[0]=','; result[1]='\n'; memset(result+2, '\t', level); result[level+2]='\0'; return cache[level] = new String(result, String::L_AS_IS); } return cache[level]; } class Json_string_recursion { Json_options& foptions; public: Json_string_recursion(Json_options& aoptions) : foptions(aoptions) { if(++foptions.json_string_recursion==ANTI_ENDLESS_JSON_STRING_RECURSION) throw Exception(PARSER_RUNTIME, 0, "call canceled - endless json recursion detected"); } ~Json_string_recursion() { if(foptions.json_string_recursion) foptions.json_string_recursion--; } }; const String& value_json_string(String::Body key, Value& v, Json_options& options); const String* Json_options::hash_json_string(HashStringValue *hash) { if(!hash || !hash->count()) return new String("{}", String::L_AS_IS); Json_string_recursion go_down(*this); String& result = *new String("{\n", String::L_AS_IS); if (indent){ String *delim=NULL; indent=get_indent(json_string_recursion); for(HashStringValue::Iterator i(*hash); i; i.next() ){ if (delim){ result << *delim; } else { result << indent << "\""; delim = get_delim(json_string_recursion); } result << String(i.key(), String::L_JSON) << "\":" << value_json_string(i.key(), *i.value(), *this); } result << "\n" << (indent=get_indent(json_string_recursion-1)) << "}"; } else { bool need_delim=false; for(HashStringValue::Iterator i(*hash); i; i.next() ){ result << (need_delim ? ",\n\"" : "\""); result << String(i.key(), String::L_JSON) << "\":" << value_json_string(i.key(), *i.value(), *this); need_delim=true; } result << "\n}"; } return &result; } const String* Json_options::array_json_string(ArrayValue *array) { if(!array || !array->count()) return new String("[]", String::L_AS_IS); Json_string_recursion go_down(*this); String& result = *new String("[\n", String::L_AS_IS); if (indent){ String *delim=NULL; indent=get_indent(json_string_recursion); for(ArrayValue::Iterator i(*array); i; i.next() ){ if (delim){ result << *delim; } else { result << indent; delim = get_array_delim(json_string_recursion); } result << value_json_string(i.key(), i.value() ? *i.value() : static_cast(*VVoid::get()), *this); } result << "\n" << (indent=get_indent(json_string_recursion-1)) << "]"; } else { bool need_delim=false; for(ArrayValue::Iterator i(*array); i; i.next() ){ if(need_delim) result << ",\n"; result << value_json_string(i.key(), i.value() ? *i.value() : static_cast(*VVoid::get()), *this); need_delim=true; } result << "\n]"; } return &result; } const String* Json_options::array_compact_json_string(ArrayValue *array) { if(!array || !array->count()) return new String("[]", String::L_AS_IS); Json_string_recursion go_down(*this); String& result = *new String("[\n", String::L_AS_IS); if (indent){ String *delim=NULL; indent=get_indent(json_string_recursion); for(ArrayValue::Iterator i(*array); i; i.next() ){ if (i.value()){ if (delim){ result << *delim; } else { result << indent; delim = get_array_delim(json_string_recursion); } result << value_json_string(i.key(), *i.value(), *this); } } result << "\n" << (indent=get_indent(json_string_recursion-1)) << "]"; } else { bool need_delim=false; for(ArrayValue::Iterator i(*array); i; i.next() ){ if (i.value()){ if(need_delim) result << ",\n"; result << value_json_string(i.key(), *i.value(), *this); need_delim=true; } } result << "\n]"; } return &result; } static bool based_on(HashStringValue::key_type key, HashStringValue::value_type /*value*/, Value* v) { return v->is(key.cstr()); } const String& value_json_string(String::Body key, Value& v, Json_options& options) { if(options.methods) { Value* method=options.methods->get(v.type()); if(!method){ method=options.methods->first_that(based_on, &v); options.methods->put(v.type(), method ? method : VVoid::get()); } if(method && !method->is_void()) { Junction* junction=method->get_junction(); HashStringValue* params_hash=options.params && options.indent ? options.params->get_hash() : NULL; Temp_hash_value indent(params_hash, "indent", new VString(*new String(options.indent, String::L_AS_IS))); Value *params[]={new VString(*new String(key, String::L_JSON)), &v, options.params ? options.params : VVoid::get()}; METHOD_FRAME_ACTION(*junction->method, options.r->method_frame, junction->self, { frame.store_params(params, 3); options.r->call(frame); return frame.result().as_string(); }); } } options.key=key; return *v.get_json_string(options); } static void _string(Request& r, MethodParams& params) { Json_options json(&r); if(params.count() == 2) if(HashStringValue* options=params.as_hash(1)) { json.params=¶ms[1]; HashStringValue* methods=new HashStringValue(); int valid_options=0; HashStringValue* vvalue; for(HashStringValue::Iterator i(*options); i; i.next() ){ String::Body key=i.key(); Value* value=i.value(); if(key == "skip-unknown"){ json.skip_unknown=r.process(*value).as_bool(); valid_options++; } else if(key == "one-line"){ json.one_line=r.process(*value).as_bool(); valid_options++; } else if(key == "date" && value->is_string()){ const String& svalue=value->as_string(); if(!json.set_date_format(svalue)) throw Exception(PARSER_RUNTIME, &svalue, "must be 'sql-string', 'gmt-string', 'iso-string' or 'unix-timestamp'"); valid_options++; } else if(key == "indent"){ if(value->is_string()){ json.indent=value->as_string().cstr(); json.json_string_recursion=strlen(json.indent); } else json.indent=r.process(*value).as_bool() ? "" : NULL; valid_options++; } else if(key == "table" && value->is_string()){ const String& svalue=value->as_string(); if(!json.set_table_format(svalue)) throw Exception(PARSER_RUNTIME, &svalue, "must be 'array', 'object' or 'compact'"); valid_options++; } else if(key == "array" && value->is_string()){ const String& svalue=value->as_string(); if(!json.set_array_format(svalue)) throw Exception(PARSER_RUNTIME, &svalue, "must be 'array', 'object' or 'compact'"); valid_options++; } else if(key == "file" && value->is_string()){ const String& svalue=value->as_string(); if(!json.set_file_format(svalue)) throw Exception(PARSER_RUNTIME, &svalue, "must be 'base64', 'text' or 'stat'"); valid_options++; } else if(key == "void" && value->is_string()){ const String& svalue=value->as_string(); if(!json.set_void_format(svalue)) throw Exception(PARSER_RUNTIME, &svalue, "must be 'string' or 'null'"); valid_options++; #ifdef XML } else if(key == "xdoc" && (vvalue = value->get_hash())){ json.xdoc_options=new XDocOutputOptions(); json.xdoc_options->append(r, vvalue); valid_options++; #endif } else if(Junction* junction=value->get_junction()){ if(!junction->method || !junction->method->params_names || junction->method->params_count != 3) throw Exception(PARSER_RUNTIME, 0, "$.%s must be parser method with 3 parameters", key.cstr()); methods->put(key, value); valid_options++; } } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); // special handling for $._default if(VHashBase* vhash=dynamic_cast(¶ms[1])) if(Value* value=vhash->get_default()) { if(!value->is_string()){ Junction* junction=value->get_junction(); if(!junction || !junction->method || !junction->method->params_names || junction->method->params_count != 3) throw Exception(PARSER_RUNTIME, 0, "$._default must be string or parser method with 3 parameters"); } json.default_method=value; } if(methods->count()) json.methods=methods; } const String& result_string=value_json_string(String::Body(), r.process(params[0]), json); String::Body result_body=result_string.cstr_to_string_body_untaint(String::L_JSON, r.connection(false), &r.charsets); if(json.one_line){ char *result=result_body.cstrm(); for(char *c=result;*c;c++) if(*c=='\n') *c=' '; result_body=result; } r.write(*new String(result_body, String::L_AS_IS)); } // constructor MJson::MJson(): Methoded("json") { add_native_method("parse", Method::CT_STATIC, _parse, 1, 2); add_native_method("string", Method::CT_STATIC, _string, 1, 2); } parser-3.5.1/src/classes/curl.C0000644000076400007640000006344114727031464013262 00000000000000/** @file Parser: @b curl parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev */ #include "pa_config_includes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_charsets.h" #include "pa_vstring.h" #include "pa_vdate.h" #include "pa_vtable.h" #include "pa_common.h" #include "pa_http.h" #include "ltdl.h" volatile const char * IDENT_CURL_C="$Id: curl.C,v 1.75 2024/12/13 13:14:28 moko Exp $"; class MCurl: public Methoded { public: MCurl(); }; // global variables DECLARE_CLASS_VAR(curl, new MCurl); #include "curl.h" typedef CURL *(*t_curl_easy_init)(); t_curl_easy_init f_curl_easy_init; typedef CURLcode (*t_curl_easy_setopt)(CURL *, CURLoption option, ...); t_curl_easy_setopt f_curl_easy_setopt; typedef CURLcode (*t_curl_easy_perform)(CURL *); t_curl_easy_perform f_curl_easy_perform; typedef void (*t_curl_easy_cleanup)(CURL *); t_curl_easy_cleanup f_curl_easy_cleanup; typedef const char *(*t_curl_easy_strerror)(CURLcode); t_curl_easy_strerror f_curl_easy_strerror; typedef CURLcode (*t_curl_easy_getinfo)(CURL *curl, CURLINFO info, ...); t_curl_easy_getinfo f_curl_easy_getinfo; typedef struct curl_slist *(*t_curl_slist_append)(struct curl_slist *,const char *); t_curl_slist_append f_curl_slist_append; typedef const char *(*t_curl_version)(); t_curl_version f_curl_version; typedef CURLFORMcode (*t_curl_formadd)(struct curl_httppost **httppost, struct curl_httppost **last_post, ...); t_curl_formadd f_curl_formadd; typedef void (*t_curl_formfree)(struct curl_httppost *form); t_curl_formfree f_curl_formfree; #define GLINK(name) f_##name=(t_##name)lt_dlsym(handle, #name); #define DLINK(name) GLINK(name) if(!f_##name) return "function " #name " was not found"; static const char *dlink(char *dlopen_file_spec) { pa_dlinit(); lt_dlhandle handle; do { char *next=lsplit(dlopen_file_spec, ','); handle=lt_dlopen(dlopen_file_spec); dlopen_file_spec=next; } while (!handle && dlopen_file_spec); if(!handle){ if(const char* result=lt_dlerror()) return result; return "cannot open the dynamic link module"; } DLINK(curl_easy_init); DLINK(curl_easy_cleanup); DLINK(curl_version); DLINK(curl_easy_setopt); DLINK(curl_easy_perform); DLINK(curl_easy_strerror); DLINK(curl_easy_getinfo); DLINK(curl_slist_append); DLINK(curl_formadd); DLINK(curl_formfree); return 0; } struct ParserOptions : public PA_Allocated { // real options const String *filename; const String *content_type; bool is_text; Charset *charset, *response_charset; // stuff for internal use const char *url; struct curl_httppost *f_post; FILE *f_stderr; // if response content-length check required bool no_body; // stuff to walkaround curl request content-length bugs bool is_post; bool has_content_length; ParserOptions() : filename(0), content_type(0), is_text(true), charset(0), response_charset(0), url(0), f_post(0), f_stderr(0), no_body(false), is_post(false), has_content_length(false){} ~ParserOptions() { f_curl_formfree(f_post); if(f_stderr) fclose(f_stderr); } }; // using TLS instead of keeping variables in request THREAD_LOCAL CURL *fcurl = 0; THREAD_LOCAL ParserOptions *foptions = 0; static CURL *curl(){ if(!fcurl) throw Exception("curl", 0, "outside of 'session' operator"); return fcurl; } static ParserOptions &options(){ if(!foptions) throw Exception("curl", 0, "outside of 'session' operator"); return *foptions; } // using temporal object scheme to garanty cleanup call class Temp_curl { CURL *saved_curl; ParserOptions *saved_options; // every TLS should be referenced elsewhere, or GC will collect it CURL *thread_curl; ParserOptions *thread_options; public: Temp_curl() : saved_curl(fcurl), saved_options(foptions){ thread_curl = fcurl = f_curl_easy_init(); thread_options = foptions = new ParserOptions(); f_curl_easy_setopt(fcurl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); // avoid ipv6 by default } ~Temp_curl() { f_curl_easy_cleanup(fcurl); fcurl = saved_curl; delete foptions; foptions = saved_options; } }; #ifdef WIN32 #define CURL_LIBRARY "libcurl" LT_MODULE_EXT #else #define CURL_LIBRARY "libcurl" LT_MODULE_EXT ",libcurl" LT_MODULE_EXT ".4" #endif bool curl_linked = false; const char *curl_status = 0; const char *curl_library=CURL_LIBRARY; static void temp_curl(void (*action)(Request&, MethodParams&), Request& r, MethodParams& params){ if(!curl_linked) curl_status=dlink(pa_strdup(curl_library)); if(curl_status == 0){ curl_linked=true; Temp_curl temp_curl; action(r,params); } else { const char *hint=strcmp(curl_library, CURL_LIBRARY) ? "" : " (before use, call ^curl:options[ $.library[correct.libcurl" LT_MODULE_EXT ".name] ])"; throw Exception("curl", 0, "failed to load curl library %s%s", curl_status, hint); } } static void _curl_session_action(Request& r, MethodParams& params){ Value& body_code=params.as_junction(0, "body must be code"); r.process_write(body_code); } static void _curl_session(Request& r, MethodParams& params){ temp_curl(_curl_session_action, r, params); } static void _curl_version_action(Request& r, MethodParams& ){ r.write(*new VString(*new String(f_curl_version(), String::L_TAINTED))); } static void _curl_version(Request& r, MethodParams& params){ fcurl ? _curl_version_action(r, params) : temp_curl(_curl_version_action, r, params); } struct CurlOption : public PA_Allocated{ enum OptionType { CURL_STRING, CURL_URLENCODE, // url-encoded string CURL_URL, CURL_INT, CURL_NO_BODY, CURL_POST, CURL_POSTFIELDS, CURL_FORM, CURL_HEADERS, CURL_FILE, CURL_STDERR, CURL_HTTP_VERSION, PARSER_LIBRARY, PARSER_NAME, PARSER_CONTENT_TYPE, PARSER_MODE, PARSER_CHARSET, PARSER_RESPONSE_CHARSET }; CURLoption id; OptionType type; CurlOption(CURLoption aid, OptionType atype): id(aid), type(atype) {} }; class CurlOptionHash: public HashString { public: CurlOptionHash() { #define CURL_OPT(type, name) put(str_lower(#name),new CurlOption(CURLOPT_##name, CurlOption::type)); #define PARSER_OPT(type, name) put(name,new CurlOption((CURLoption)0, CurlOption::type)); CURL_OPT(CURL_URL, URL); CURL_OPT(CURL_STRING, INTERFACE); CURL_OPT(CURL_INT, LOCALPORT); CURL_OPT(CURL_INT, PORT); CURL_OPT(CURL_INT, VERBOSE); CURL_OPT(CURL_STDERR, STDERR); CURL_OPT(CURL_INT, MAXFILESIZE); CURL_OPT(CURL_INT, HTTPAUTH); CURL_OPT(CURL_STRING, USERPWD); CURL_OPT(CURL_STRING, USERNAME); CURL_OPT(CURL_STRING, PASSWORD); CURL_OPT(CURL_URLENCODE, USERAGENT); CURL_OPT(CURL_URLENCODE, REFERER); CURL_OPT(CURL_INT, AUTOREFERER); CURL_OPT(CURL_STRING, ENCODING); // gzip or deflate CURL_OPT(CURL_STRING, ACCEPT_ENCODING); // gzip or deflate CURL_OPT(CURL_INT, FOLLOWLOCATION); CURL_OPT(CURL_INT, UNRESTRICTED_AUTH); CURL_OPT(CURL_INT, IPRESOLVE); CURL_OPT(CURL_POST, POST); CURL_OPT(CURL_INT, HTTPGET); CURL_OPT(CURL_NO_BODY, NOBODY); CURL_OPT(CURL_STRING, CUSTOMREQUEST); CURL_OPT(CURL_POSTFIELDS, POSTFIELDS); // hopefully is safe too CURL_OPT(CURL_POSTFIELDS, COPYPOSTFIELDS); CURL_OPT(CURL_FORM, HTTPPOST); CURL_OPT(CURL_HEADERS, HTTPHEADER); CURL_OPT(CURL_URLENCODE, COOKIE); CURL_OPT(CURL_URLENCODE, COOKIELIST); CURL_OPT(CURL_INT, COOKIESESSION); CURL_OPT(CURL_INT, IGNORE_CONTENT_LENGTH); CURL_OPT(CURL_INT, HTTP_CONTENT_DECODING); CURL_OPT(CURL_INT, HTTP_TRANSFER_DECODING); CURL_OPT(CURL_INT, MAXREDIRS); CURL_OPT(CURL_INT, POSTREDIR); CURL_OPT(CURL_STRING, RANGE); CURL_OPT(CURL_INT, TIMEOUT); CURL_OPT(CURL_INT, TIMEOUT_MS); CURL_OPT(CURL_INT, LOW_SPEED_LIMIT); CURL_OPT(CURL_INT, LOW_SPEED_TIME); CURL_OPT(CURL_INT, MAXCONNECTS); CURL_OPT(CURL_STRING, PROXY); CURL_OPT(CURL_INT, PROXYPORT); CURL_OPT(CURL_INT, PROXYTYPE); CURL_OPT(CURL_INT, HTTPPROXYTUNNEL); CURL_OPT(CURL_STRING, PROXYUSERPWD); CURL_OPT(CURL_INT, PROXYAUTH); CURL_OPT(CURL_INT, FRESH_CONNECT); CURL_OPT(CURL_INT, FORBID_REUSE); CURL_OPT(CURL_INT, CONNECTTIMEOUT); CURL_OPT(CURL_INT, CONNECTTIMEOUT_MS); CURL_OPT(CURL_INT, FAILONERROR); CURL_OPT(CURL_FILE, SSLCERT); CURL_OPT(CURL_STRING, SSLCERTTYPE); CURL_OPT(CURL_FILE, SSLKEY); CURL_OPT(CURL_STRING, SSLKEYTYPE); CURL_OPT(CURL_STRING, KEYPASSWD); CURL_OPT(CURL_STRING, SSLENGINE); CURL_OPT(CURL_STRING, SSLENGINE_DEFAULT); CURL_OPT(CURL_FILE, ISSUERCERT); CURL_OPT(CURL_FILE, CRLFILE); CURL_OPT(CURL_STRING, CAINFO); CURL_OPT(CURL_FILE, CAPATH); CURL_OPT(CURL_INT, SSL_VERIFYPEER); CURL_OPT(CURL_INT, SSL_VERIFYHOST); CURL_OPT(CURL_STRING, SSL_CIPHER_LIST); CURL_OPT(CURL_INT, SSL_SESSIONID_CACHE); CURL_OPT(CURL_INT, SSLVERSION); CURL_OPT(CURL_HTTP_VERSION, HTTP_VERSION); PARSER_OPT(PARSER_LIBRARY, "library"); PARSER_OPT(PARSER_NAME, "name"); PARSER_OPT(PARSER_CONTENT_TYPE, "content-type"); PARSER_OPT(PARSER_MODE, "mode"); PARSER_OPT(PARSER_CHARSET, "charset"); PARSER_OPT(PARSER_RESPONSE_CHARSET, "response-charset"); } } *curl_options=0; struct CurlInfo : public PA_Allocated{ enum OptionType { CURL_STRING, CURL_INT, CURL_DOUBLE, CURL_HTTP_VERSION }; CURLINFO id; OptionType type; CurlInfo(CURLINFO aid, OptionType atype): id(aid), type(atype) {} }; class CurlInfoHash: public OrderedHashString { public: CurlInfoHash() { #define CURL_INF(type, name) put(str_lower(#name),new CurlInfo(CURLINFO_##name, CurlInfo::type)); CURL_INF(CURL_STRING, SCHEME); CURL_INF(CURL_HTTP_VERSION, HTTP_VERSION); CURL_INF(CURL_STRING, EFFECTIVE_URL); CURL_INF(CURL_STRING, CONTENT_TYPE); CURL_INF(CURL_INT, RESPONSE_CODE); CURL_INF(CURL_INT, OS_ERRNO); CURL_INF(CURL_DOUBLE, NAMELOOKUP_TIME); CURL_INF(CURL_DOUBLE, APPCONNECT_TIME); CURL_INF(CURL_DOUBLE, PRETRANSFER_TIME); CURL_INF(CURL_DOUBLE, STARTTRANSFER_TIME); CURL_INF(CURL_DOUBLE, CONNECT_TIME); CURL_INF(CURL_DOUBLE, TOTAL_TIME); CURL_INF(CURL_DOUBLE, CONTENT_LENGTH_DOWNLOAD); CURL_INF(CURL_DOUBLE, CONTENT_LENGTH_UPLOAD); CURL_INF(CURL_INT, HEADER_SIZE); CURL_INF(CURL_INT, REQUEST_SIZE); CURL_INF(CURL_DOUBLE, SIZE_DOWNLOAD); CURL_INF(CURL_DOUBLE, SIZE_UPLOAD); CURL_INF(CURL_DOUBLE, SPEED_DOWNLOAD); CURL_INF(CURL_DOUBLE, SPEED_UPLOAD); CURL_INF(CURL_INT, NUM_CONNECTS); CURL_INF(CURL_STRING, PRIMARY_IP); CURL_INF(CURL_INT, HTTPAUTH_AVAIL); CURL_INF(CURL_INT, PROXYAUTH_AVAIL); CURL_INF(CURL_INT, REDIRECT_COUNT); CURL_INF(CURL_DOUBLE, REDIRECT_TIME); CURL_INF(CURL_STRING, REDIRECT_URL); CURL_INF(CURL_INT, SSL_VERIFYRESULT); } } *curl_infos=0; static const char *curl_urlencode(const String &s, Request& r){ if(options().charset){ Temp_client_charset temp(r.charsets, *options().charset); return s.untaint_and_transcode_cstr(String::L_URI, &r.charsets); } else return s.untaint_cstr(String::L_URI); } static struct curl_slist *curl_headers(HashStringValue *value_hash, Request& r) { struct curl_slist *slist=NULL; for(HashStringValue::Iterator i(*value_hash); i; i.next() ){ String header = String(pa_http_safe_header_name(capitalize(i.key().cstr())), String::L_AS_IS) << ": " << String(i.value()->as_string(), String::L_HTTP_HEADER); slist=f_curl_slist_append(slist, curl_urlencode(header, r)); } return slist; } static const char* curl_transcode(const String &s, Request& r){ return options().charset ? Charset::transcode(s.cstr(), r.charsets.source(), *options().charset).cstr() : s.cstr(); } static void curl_form(HashStringValue *value_hash, Request& r){ struct curl_httppost *f_last=0; for(HashStringValue::Iterator i(*value_hash); i; i.next() ){ const char *key = curl_transcode(String(i.key().cstr()), r); if(const String* svalue = i.value()->get_string()){ // string f_curl_formadd(&options().f_post, &f_last, CURLFORM_PTRNAME, key, CURLFORM_PTRCONTENTS, curl_transcode(String(svalue->cstr()), r), CURLFORM_END); } else if(Table* tvalue = i.value()->get_table()){ // table for(size_t t = 0; t < tvalue->count(); t++) { f_curl_formadd(&options().f_post, &f_last, CURLFORM_PTRNAME, key, CURLFORM_PTRCONTENTS, curl_transcode(String(tvalue->get(t)->get(0)->cstr()), r), CURLFORM_END); } } else if(VFile* fvalue=dynamic_cast(i.value())){ // file f_curl_formadd(&options().f_post, &f_last, CURLFORM_PTRNAME, key, CURLFORM_BUFFER, curl_transcode(String(fvalue->fields().get("name")->as_string(), String::L_FILE_SPEC), r), CURLFORM_BUFFERLENGTH, (long)fvalue->value_size(), CURLFORM_BUFFERPTR, fvalue->value_ptr(), CURLFORM_CONTENTTYPE, fvalue->fields().get("content-type")->as_string().taint_cstr(String::L_URI), CURLFORM_END); } else { throw Exception("curl", new String(i.key(), String::L_TAINTED), "is %s, form option value can be string, table or file only", i.value()->type()); } } } static const char *curl_check_file(const String &file_spec){ const char *file_spec_cstr=file_spec.taint_cstr(String::L_FILE_SPEC); struct stat finfo; if(pa_stat(file_spec_cstr, &finfo)==0) check_safe_mode(finfo, file_spec, file_spec_cstr); return file_spec_cstr; } static long curl_http_version(const String &name){ if(name.is_empty()) return CURL_HTTP_VERSION_NONE; if(name == "1.0") return CURL_HTTP_VERSION_1_0; if(name == "1.1") return CURL_HTTP_VERSION_1_1; if(name == "2") return CURL_HTTP_VERSION_2; if(name == "2.0") return CURL_HTTP_VERSION_2_0; const char *sname = str_upper(name.cstr()); if(!strcmp(sname,"2TLS")) return CURL_HTTP_VERSION_2TLS; if(!strcmp(sname,"2ONLY")) return CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE; throw Exception("curl", &name, "invalid http_version option value"); } static const char *curl_http_version_name(long value){ if(value == CURL_HTTP_VERSION_NONE) return "none"; if(value == CURL_HTTP_VERSION_1_0) return "1.0"; if(value == CURL_HTTP_VERSION_1_1) return "1.1"; if(value == CURL_HTTP_VERSION_2) return "2"; throw Exception("curl", 0, "invalid http version '%d' in info", value); } static void curl_setopt(HashStringValue::key_type key, HashStringValue::value_type value, Request& r) { CurlOption *opt=curl_options->get(key); if(opt==0) throw Exception("curl", 0, "called with invalid option '%s'", key.cstr()); CURLcode res = CURLE_OK; Value &v=r.process(*value); switch (opt->type){ case CurlOption::CURL_STRING:{ // string curl option const char *value_str=v.as_string().cstr(); res=f_curl_easy_setopt(curl(), opt->id, value_str); break; } case CurlOption::CURL_URLENCODE:{ // url-encoded string curl option const char *value_str=curl_urlencode(v.as_string(), r); res=f_curl_easy_setopt(curl(), opt->id, value_str); break; } case CurlOption::CURL_URL:{ // url-encoded string curl_url option const String url = v.as_string(); if(!url.starts_with("http://") && !url.starts_with("https://")) throw Exception("curl", 0, "failed to set option '%s': invalid url scheme '%s'", key.cstr(), url.cstr()); options().url=curl_urlencode(url, r); res=f_curl_easy_setopt(curl(), opt->id, options().url); break; } case CurlOption::CURL_INT:{ // integer curl option long value_int=(long)v.as_double(); res=f_curl_easy_setopt(curl(), opt->id, value_int); break; } case CurlOption::CURL_NO_BODY:{ // integer curl option long value_int=(long)v.as_double(); res=f_curl_easy_setopt(curl(), opt->id, value_int); options().no_body=value_int != 0; break; } case CurlOption::CURL_POST:{ // integer curl option long value_int=(long)v.as_double(); res=f_curl_easy_setopt(curl(), opt->id, value_int); options().is_post=value_int != 0; break; } case CurlOption::CURL_POSTFIELDS:{ // http post curl option if(v.get_string()){ if( (res=f_curl_easy_setopt(curl(), CURLOPT_POSTFIELDSIZE, -1L)) == CURLE_OK ) res=f_curl_easy_setopt(curl(), opt->id, curl_urlencode(v.as_string(), r)); } else { VFile *file=v.as_vfile(); if( (res=f_curl_easy_setopt(curl(), CURLOPT_POSTFIELDSIZE, (long)file->value_size())) == CURLE_OK ) res=f_curl_easy_setopt(curl(), opt->id, file->value_ptr()); } options().has_content_length=true; break; } case CurlOption::CURL_FORM:{ HashStringValue *value_hash = v.as_hash("failed to set option 'httppost': value"); if(value_hash){ curl_form(value_hash, r); } else { if(options().f_post) f_curl_formfree(options().f_post); options().f_post = 0; } res=f_curl_easy_setopt(curl(), CURLOPT_HTTPPOST, foptions->f_post); options().has_content_length=true; break; } case CurlOption::CURL_HEADERS:{ // http headers curl option HashStringValue *value_hash=v.as_hash("failed to set option 'httpheader': value"); res=f_curl_easy_setopt(curl(), opt->id, value_hash ? curl_headers(value_hash, r) : 0); break; } case CurlOption::CURL_FILE:{ // file-spec curl option const char *file_spec_cstr=curl_check_file(r.full_disk_path(v.as_string())); res=f_curl_easy_setopt(curl(), opt->id, file_spec_cstr); break; } case CurlOption::CURL_STDERR:{ // verbose output redirection from stderr to file curl option const char *file_spec_cstr=curl_check_file(r.full_disk_path(v.as_string())); FILE *f_stderr=options().f_stderr=pa_fopen(file_spec_cstr, "wt"); if (f_stderr){ res=f_curl_easy_setopt(curl(), opt->id, f_stderr); } else { throw Exception("curl", 0, "failed to set option '%s': unable to open file '%s'", key.cstr(), file_spec_cstr); } break; } case CurlOption::CURL_HTTP_VERSION:{ // http protocol version name curl option long value_int=curl_http_version(v.as_string()); res=f_curl_easy_setopt(curl(), opt->id, value_int); break; } case CurlOption::PARSER_LIBRARY:{ // 'library' parser option if(!curl_linked){ curl_library=v.as_string().taint_cstr(String::L_FILE_SPEC); if(!curl_library[0]) curl_library=CURL_LIBRARY; } else throw Exception("curl", 0, "failed to set option '%s': already loaded", key.cstr()); break; } case CurlOption::PARSER_NAME:{ // 'name' parser option options().filename=&v.as_string(); break; } case CurlOption::PARSER_CONTENT_TYPE:{ // 'content-type' parser option options().content_type=&v.as_string(); break; } case CurlOption::PARSER_MODE:{ // 'mode' parser option options().is_text=VFile::is_text_mode(v.as_string()); break; } case CurlOption::PARSER_CHARSET:{ // 'charset' parser option should be processed before other options break; } case CurlOption::PARSER_RESPONSE_CHARSET:{ // 'response-charset' parser option options().response_charset=&pa_charsets.get(v.as_string()); break; } } if(res != CURLE_OK) throw Exception("curl", 0, "failed to set option '%s': %s", key.cstr(), f_curl_easy_strerror(res)); } static void _curl_options(Request& r, MethodParams& params){ if(curl_options==0) curl_options=new CurlOptionHash(); if(HashStringValue* options_hash=params.as_hash(0)){ if(Value* value=options_hash->get("charset")){ // charset should be handled first as params may require transcode Value &v=r.process(*value); options().charset=&pa_charsets.get(v.as_string()); } options_hash->for_each(curl_setopt, r); } } #define CURL_GETINFO(arg) \ if((res=f_curl_easy_getinfo(curl(), info->id, &arg)) != CURLE_OK){ \ if (fail_on_error) \ throw Exception("curl", 0, "failed to get %s info: %s", key.cstr(), f_curl_easy_strerror(res)); \ return 0; \ } static Value *curl_getinfo(const String::Body &key, CurlInfo *info, bool fail_on_error=false) { CURLcode res; switch (info->type){ case CurlInfo::CURL_STRING:{ char *str=0; CURL_GETINFO(str); return new VString(str ? *new String(pa_strdup(str), String::L_TAINTED) : String::Empty); } case CurlInfo::CURL_INT:{ long l=0; CURL_GETINFO(l); return new VInt(l); } case CurlInfo::CURL_DOUBLE:{ double d=0; CURL_GETINFO(d); return new VDouble(d); } case CurlInfo::CURL_HTTP_VERSION:{ long l=0; CURL_GETINFO(l); return new VString(*new String(curl_http_version_name(l), String::L_TAINTED)); } } return VVoid::get(); } static void _curl_info(Request& r, MethodParams& params){ if(curl_infos==0) curl_infos=new CurlInfoHash(); if(params.count()==1){ const String &name=params.as_string(0, "name must be string"); CurlInfo *info=curl_infos->get(name); if(info==0) throw Exception("curl", 0, "called with invalid parameter '%s'", name.cstr()); r.write(*curl_getinfo(name, info, true)); } else { VHash& result=*new VHash; for(CurlInfoHash::Iterator i(*curl_infos); i; i.next() ){ Value *value=curl_getinfo(i.key(), i.value()); if(value) result.get_hash()->put(i.key(), value); } r.write(result); } } class Curl_buffer{ public: char *buf; size_t length; size_t buf_size; HTTP_Headers& headers; Curl_buffer(HTTP_Headers& aheaders) : buf((char *)pa_malloc_atomic(MAX_STRING)), length(0), buf_size(MAX_STRING-1), headers(aheaders){} void resize(size_t size){ buf_size=size; buf=(char *)pa_realloc(buf, size+1); } }; static int curl_writer(char *data, size_t size, size_t nmemb, Curl_buffer *result){ if(result == 0) return 0; size=size*nmemb; if(size>0){ size_t buf_required = result->length + size; if(buf_required > result->buf_size) result->resize(buf_required <= result->headers.content_length ? (size_t)result->headers.content_length : result->buf_size*2 + size); memcpy(result->buf+result->length, data, size); result->length += size; } return size; } static int curl_header(char *data, size_t size, size_t nmemb, HTTP_Headers *result){ if(result == 0) return 0; size=size*nmemb; if(size>0){ char *header=pa_strdup(data, size); if(!pa_strncasecmp(header, "HTTP/") && !strchr(header, ':')){ // response code, clearing possible headers from previous requests result->clear(); } else { result->add_header(header); if(result->content_length>pa_file_size_limit && !options().no_body) return 0; } } return size; } #define CURL_SETOPT(option, arg, message) \ if( (res=f_curl_easy_setopt(curl(), option, arg)) != CURLE_OK){ \ throw Exception("curl", 0, "failed to set " message ": %s", f_curl_easy_strerror(res)); \ } static void _curl_load_action(Request& r, MethodParams& params){ if(params.count()==1) _curl_options(r, params); CURLcode res; // we need a container for headers as VFile fields can be put only after VFile.set HTTP_Headers response; CURL_SETOPT(CURLOPT_HEADERFUNCTION, curl_header, "curl header function"); CURL_SETOPT(CURLOPT_WRITEHEADER, &response, "curl header buffer"); Curl_buffer body(response); CURL_SETOPT(CURLOPT_WRITEFUNCTION, curl_writer, "curl writer function"); CURL_SETOPT(CURLOPT_WRITEDATA, &body, "curl write buffer"); if(options().is_post && !options().has_content_length){ // libcurl bug walkaround. Prior to 7.38 (Debian Jessie) curl passed Content-length: -1 // after that no Content-length header is passed, that hangs request to nginx. CURL_SETOPT(CURLOPT_POSTFIELDSIZE, 0, "post content-length"); } ALTER_EXCEPTION_SOURCE(res=f_curl_easy_perform(curl()), new String(options().url)); if(res != CURLE_OK){ const char *ex_type = 0; switch(res){ case CURLE_OPERATION_TIMEDOUT: ex_type = "curl.timeout"; break; case CURLE_COULDNT_RESOLVE_HOST: ex_type = "curl.host"; break; case CURLE_COULDNT_CONNECT: ex_type = "curl.connect"; break; case CURLE_HTTP_RETURNED_ERROR: ex_type = "curl.status"; break; case CURLE_SSL_CONNECT_ERROR: case CURLE_SSL_CERTPROBLEM: case CURLE_SSL_CIPHER: case CURLE_SSL_CACERT: case CURLE_SSL_ENGINE_INITFAILED: ex_type = "curl.ssl"; break; case CURLE_WRITE_ERROR: check_file_size(response.content_length, new String(options().url)); break; default: break; } throw Exception( PA_DEFAULT(ex_type, "curl.fail"), new String(options().url), "%s", f_curl_easy_strerror(res)); } // assure trailing zero body.buf[body.length]=0; VFile& result=*new VFile; Charset *asked_charset = options().response_charset; if (!asked_charset && !response.content_type.is_empty()) asked_charset=detect_charset(response.content_type.cstr()); if(options().is_text) asked_charset=pa_charsets.checkBOM(body.buf, body.length, asked_charset); if (!asked_charset) asked_charset = options().charset; if(options().is_text && asked_charset != 0){ String::C c=Charset::transcode(String::C(body.buf, body.length), *asked_charset, r.charsets.source()); body.buf=(char *)c.str; body.length=c.length; } const String *content_type = PA_DEFAULT(options().content_type, response.content_type.is_empty() ? 0 : new String(response.content_type, String::L_TAINTED)); const String *filename = PA_DEFAULT(options().filename, new String(options().url)); result.set(true/*tainted*/, options().is_text, body.buf, body.length, filename, content_type ? new VString(*content_type) : 0, &r); long http_status = 0; if(f_curl_easy_getinfo(curl(), CURLINFO_RESPONSE_CODE, &http_status) == CURLE_OK){ result.fields().put("status", new VInt(http_status)); } VHash* vtables=new VHash; result.fields().put("tables", vtables); for(Array_iterator i(response.headers); i; ){ HTTP_Headers::Header header=i.next(); if(asked_charset) header.transcode(*asked_charset, r.charsets.source()); String &header_value=*new String(header.value, String::L_TAINTED); tables_update(vtables->hash(), header.name, header_value); result.fields().put(header.name, new VString(header_value)); } // filling $.cookies if(Value *vcookies=vtables->hash().get("SET-COOKIE")) result.fields().put(HTTP_COOKIES_NAME, new VTable(parse_cookies(r, vcookies->get_table()))); r.write(result); } static void _curl_load(Request& r, MethodParams& params){ fcurl ? _curl_load_action(r, params) : temp_curl(_curl_load_action, r, params); } // constructor MCurl::MCurl(): Methoded("curl") { add_native_method("session", Method::CT_STATIC, _curl_session, 1, 1); add_native_method("version", Method::CT_STATIC, _curl_version, 0, 0); add_native_method("options", Method::CT_STATIC, _curl_options, 1, 1); add_native_method("info", Method::CT_STATIC, _curl_info, 0, 1); add_native_method("load", Method::CT_STATIC, _curl_load, 0, 1); } parser-3.5.1/src/classes/file.C0000644000076400007640000011545514732404263013234 00000000000000/** @file Parser: @b file parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_base64.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_table.h" #include "pa_vint.h" #include "pa_exec.h" #include "pa_vdate.h" #include "pa_dir.h" #include "pa_vtable.h" #include "pa_varray.h" #include "pa_charset.h" #include "pa_charsets.h" #include "pa_sql_connection.h" #include "pa_md5.h" #include "pa_vregex.h" #include "pa_version.h" volatile const char * IDENT_FILE_C="$Id: file.C,v 1.295 2024/12/23 18:30:55 moko Exp $"; // defines #define STDIN_EXEC_PARAM_NAME "stdin" #define CHARSET_EXEC_PARAM_NAME "charset" #define NAME_NAME "name" #define KEEP_EMPTY_DIRS_NAME "keep-empty-dirs" #define SUPPRESS_EXCEPTION_NAME "exception" // externs extern String sql_limit_name; extern String sql_offset_name; // helpers class File_list_table_template_columns: public ArrayString { public: File_list_table_template_columns() { *this+=new String("name"); *this+=new String("dir"); *this+=new String("size"); *this+=new String("cdate"); *this+=new String("mdate"); *this+=new String("adate"); } }; static Table &file_list_table_template(){ static Table *singleton=NULL; if(!singleton) singleton=new Table(new File_list_table_template_columns); return *singleton; } // class class MFile: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VFile(); } public: MFile(); }; // global variable DECLARE_CLASS_VAR(file, new MFile); // consts /// from apache-1.3|src|support|suexec.c static const char* suexec_safe_env_lst[]={ "AUTH_TYPE", "CONTENT_LENGTH", "CONTENT_TYPE", "DATE_GMT", "DATE_LOCAL", "DOCUMENT_NAME", "DOCUMENT_PATH_INFO", "DOCUMENT_ROOT", "DOCUMENT_URI", "FILEPATH_INFO", "GATEWAY_INTERFACE", "LAST_MODIFIED", "PATH_INFO", "PATH_TRANSLATED", "QUERY_STRING", "QUERY_STRING_UNESCAPED", "REMOTE_ADDR", "REMOTE_HOST", "REMOTE_IDENT", "REMOTE_PORT", "REMOTE_USER", "REDIRECT_QUERY_STRING", "REDIRECT_STATUS", "REDIRECT_URL", "REQUEST_METHOD", "REQUEST_URI", "SCRIPT_FILENAME", "SCRIPT_NAME", "SCRIPT_URI", "SCRIPT_URL", "SERVER_ADMIN", "SERVER_NAME", "SERVER_ADDR", "SERVER_PORT", "SERVER_PROTOCOL", "SERVER_SOFTWARE", "UNIQUE_ID", "USER_NAME", "TZ", NULL }; // statics static const String::Body size_name("size"); static const String::Body adate_name("adate"); static const String::Body mdate_name("mdate"); static const String::Body cdate_name("cdate"); // methods static void _save(Request& r, MethodParams& params) { bool is_text=VFile::is_text_mode(params.as_string(0, MODE_MUST_BE_STRING)); const String& file_name=params.as_file_name(1); Charset* asked_charset=0; if(params.count()>2) if(HashStringValue* options=params.as_hash(2)){ int valid_options=0; if(Value* vcharset_name=options->get(PA_CHARSET_NAME)){ asked_charset=&pa_charsets.get(vcharset_name->as_string()); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } // save GET_SELF(r, VFile).save(r.charsets, r.full_disk_path(file_name), is_text, asked_charset); } static void _delete(Request& r, MethodParams& params) { const String& file_name=params.as_file_name(0); bool keep_empty_dirs=false; bool fail_on_problem=true; if(params.count()>1) if(HashStringValue* options=params.as_hash(1)){ int valid_options=0; if(Value* vkeep_empty_dirs=options->get(KEEP_EMPTY_DIRS_NAME)){ keep_empty_dirs=r.process(*vkeep_empty_dirs).as_bool(); valid_options++; } if(Value* vsuppress_exception=options->get(SUPPRESS_EXCEPTION_NAME)){ fail_on_problem=r.process(*vsuppress_exception).as_bool(); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } // unlink file_delete(r.full_disk_path(file_name), fail_on_problem, keep_empty_dirs); } static void _move(Request& r, MethodParams& params) { Value& vfrom_file_name=params.as_no_junction(0, "from file name must not be code"); Value& vto_file_name=params.as_no_junction(1, "to file name must not be code"); bool keep_empty_dirs=false; if(params.count()>2) if(HashStringValue* options=params.as_hash(2)){ int valid_options=0; if(Value* vkeep_empty_dirs=options->get(KEEP_EMPTY_DIRS_NAME)){ keep_empty_dirs=r.process(*vkeep_empty_dirs).as_bool(); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } // move file_move( r.full_disk_path(vfrom_file_name.as_string()), r.full_disk_path(vto_file_name.as_string()), keep_empty_dirs); } static void copy_process_source(struct stat&, int from_file, const String&, void *context) { int& to_file=*static_cast(context); int nCount=0; do { unsigned char buffer[FILE_BUFFER_SIZE]; nCount = file_block_read(from_file, buffer, sizeof(buffer)); int written=write(to_file, buffer, nCount); if( written < 0 ) throw Exception("file.write", 0, "write failed: %s (%d)", strerror(errno), errno); } while(nCount > 0); } static void copy_open_target(int f, void *from_spec) { String& file_spec=*static_cast(from_spec); file_read_action_under_lock(file_spec, "copy", copy_process_source, &f); } static void _copy(Request& r, MethodParams& params) { Value& vfrom_file_name=params.as_no_junction(0, "from file name must not be code"); Value& vto_file_name=params.as_no_junction(1, "to file name must not be code"); bool append=false; if(params.count()>2) if(HashStringValue* options=params.as_hash(2)){ int valid_options=0; if(Value* vappend=options->get("append")){ append=r.process(*vappend).as_bool(); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } String from_spec = r.full_disk_path(vfrom_file_name.as_string()); const String& to_spec = r.full_disk_path(vto_file_name.as_string()); file_write_action_under_lock( to_spec, "copy", copy_open_target, &from_spec, false /*as text*/, append); } static void _load_pass_param( HashStringValue::key_type key, HashStringValue::value_type value, HashStringValue *dest) { dest->put(key, value); } static void _load(Request& r, MethodParams& params) { bool as_text=VFile::is_text_mode(params.as_string(0, MODE_MUST_BE_STRING)); const String& lfile_name=r.full_disk_path(params.as_file_name(1)); size_t param_index=params.count()-1; Value* param_value=param_index>1?¶ms.as_no_junction(param_index, "file name or options must not be code"):0; HashStringValue* options=0; const String* user_file_name=0; if(param_value){ options=param_value->get_hash(); if(options || param_index>2) param_index--; if(param_index>1){ const String& luser_file_name=params.as_string(param_index, FILE_NAME_MUST_BE_STRING); if(!luser_file_name.is_empty()) user_file_name=&luser_file_name; } } if(!user_file_name) user_file_name=&lfile_name; File_read_result file=file_load(r, lfile_name, as_text, options, true); Value* vcontent_type=0; if(file.headers){ if(Value* remote_content_type=file.headers->get(HTTP_CONTENT_TYPE_UPPER)) vcontent_type=new VString(*new String(remote_content_type->as_string().cstr())); } VFile& self=GET_SELF(r, VFile); self.set(true/*tainted*/, as_text, file.str, file.length, user_file_name, vcontent_type, &r); if(file.headers){ file.headers->for_each(_load_pass_param, &self.fields()); } else { uint64_t size; time_t atime, mtime, ctime; file_stat(lfile_name, size, atime, mtime, ctime); HashStringValue& ff=self.fields(); ff.put(adate_name, new VDate((pa_time_t)atime)); ff.put(mdate_name, new VDate((pa_time_t)mtime)); ff.put(cdate_name, new VDate((pa_time_t)ctime)); } } static void _create(Request& r, MethodParams& params) { const String* mode=0; const String* file_name=0; bool is_text=true; // new format: ^file::create[string-or-file-content[;$.mode[text|binary] $.name[...] $.content-type[...] $.charset[...] ]] size_t content_index=0; size_t options_index=1; bool extended_options=true; if(params.count()>=3){ // old format: ^file::create[text|binary;file-name;string-or-file-content[;options]] mode=¶ms.as_string(0, MODE_MUST_BE_STRING); is_text=VFile::is_text_mode(*mode); file_name=¶ms.as_string(1, FILE_NAME_MUST_BE_STRING); content_index=2; options_index=3; extended_options=false; } VString* vcontent_type=0; Charset* to_charset=0; Charset* from_charset=0; if(params.count()>options_index) if(HashStringValue* options=params.as_hash(options_index)) { int valid_options=0; if(extended_options) { if(Value* vmode=options->get(MODE_NAME)) { mode=&vmode->as_string(); is_text=VFile::is_text_mode(*mode); valid_options++; } if(Value* vfile_name=options->get(NAME_NAME)) { file_name=&vfile_name->as_string(); valid_options++; } } if(Value* vcharset_name=options->get("to-charset")) { to_charset=&pa_charsets.get(vcharset_name->as_string()); valid_options++; } if(Value* vcharset_name=options->get("from-charset")) { from_charset=&pa_charsets.get(vcharset_name->as_string()); valid_options++; } if(Value* vcharset_name=options->get(PA_CHARSET_NAME)) { if(to_charset) throw Exception(PARSER_RUNTIME, 0, "'charset' option cannot be used together with 'to-charset' option"); to_charset=&pa_charsets.get(vcharset_name->as_string()); valid_options++; } if(Value* value=options->get(CONTENT_TYPE_NAME)) { vcontent_type=new VString(value->as_string()); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } Value& vcontent=params.as_no_junction(content_index, "content must be string or file"); VFile& self=GET_SELF(r, VFile); if(const String* content_str=vcontent.get_string()){ String::Body body=content_str->cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets); // explode content, honor tainting changes self.set(true/*tainted*/, is_text, body.cstrm(), body.length(), file_name, vcontent_type, &r); } else { VFile& fcontent=*vcontent.as_vfile(); // can't be null if(mode){ self.set(fcontent, &is_text, file_name, vcontent_type, &r); if(is_text && !fcontent.is_text_mode()) from_charset=self.detect_binary_charset(from_charset); } else { self.set(fcontent, 0, file_name, vcontent_type, &r); is_text=fcontent.is_text_mode(); } } if(to_charset || from_charset) if(is_text) self.transcode(from_charset ? *from_charset : r.charsets.source(), to_charset ? *to_charset : r.charsets.source()); else throw Exception(PARSER_RUNTIME, 0, "charset options cannot be used with binary content"); } static void _stat(Request& r, MethodParams& params) { const String& lfile_name=params.as_file_name(0); uint64_t size; time_t atime, mtime, ctime; file_stat(r.full_disk_path(lfile_name), size, atime, mtime, ctime); VFile& self=GET_SELF(r, VFile); self.set_binary(true/*tainted*/, 0 /*no bytes*/, 0 /*fake size*/, &lfile_name, 0, &r); HashStringValue& ff=self.fields(); ff.put(size_name, new VDouble((double)size) /*real size*/); ff.put(adate_name, new VDate((pa_time_t)atime)); ff.put(mdate_name, new VDate((pa_time_t)mtime)); ff.put(cdate_name, new VDate((pa_time_t)ctime)); } static bool is_safe_env_key(const char* key) { for(const char* validator=key; *validator; validator++) { char c=*validator; if(!( (c>='A' && c<='Z') || (c>='0' && c<='9') || (c=='_' || c=='-') )) return false; } #ifdef PA_SAFE_MODE if(strncasecmp(key, "HTTP_", 5)==0) return true; if(strncasecmp(key, "CGI_", 4)==0) return true; for(int i=0; suexec_safe_env_lst[i]; i++) { if(strcasecmp(key, suexec_safe_env_lst[i])==0) return true; } return false; #else return true; #endif } #ifndef DOXYGEN struct Append_env_pair_info { Request_charsets* charsets; HashStringString* env; Value* vstdin; }; #endif static void append_env_pair( HashStringValue::key_type akey, HashStringValue::value_type avalue, Append_env_pair_info *info) { if(akey==STDIN_EXEC_PARAM_NAME) { info->vstdin=avalue; } else if(akey==CHARSET_EXEC_PARAM_NAME) { // ignore, already processed } else { if(!is_safe_env_key(akey.cstr())) throw Exception(PARSER_RUNTIME, new String(akey, String::L_TAINTED), "not safe environment variable"); info->env->put(akey, avalue->as_string().cstr_to_string_body_untaint(String::L_AS_IS, 0, info->charsets)); } } #ifndef DOXYGEN struct Pass_cgi_header_attribute_info { Charset* charset; HashStringValue* fields; Value* content_type; }; #endif static void pass_cgi_header_attribute( ArrayString::element_type astring, Pass_cgi_header_attribute_info* info) { size_t colon_pos=astring->pos(':'); if(colon_pos!=STRING_NOT_FOUND) { const String& key=astring->mid(0, colon_pos).change_case( *info->charset, String::CC_UPPER); Value* value=new VString(astring->mid(colon_pos+1, astring->length()).trim()); info->fields->put(key, value); if(key==HTTP_CONTENT_TYPE_UPPER) info->content_type=value; } } static void append_to_argv(Request& r, ArrayString& argv, const String* str){ argv+=new String(str->cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets), String::L_AS_IS); } /// @todo fix `` in perl - they produced flipping consoles and no output to perl static void _exec_cgi(Request& r, MethodParams& params, bool cgi) { bool is_text=true; size_t param_index=0; const String& mode=params.as_string(0, "mode must be string"); if(VFile::is_valid_mode(mode)) { is_text=VFile::is_text_mode(mode); param_index++; } if(param_index>=params.count()) throw Exception(PARSER_RUNTIME, 0, FILE_NAME_MUST_BE_SPECIFIED); const String& script_name=r.full_disk_path(params.as_file_name(param_index++)); HashStringString env; #define ECSTR(name, value_cstr) if(value_cstr) env.put(#name, value_cstr); // passing environment for(SAPI::Env::Iterator i(r.sapi_info); i; i.next() ) env.put(i.key(), i.value() ); // const ECSTR(GATEWAY_INTERFACE, "CGI/1.1"); ECSTR(PARSER_VERSION, PARSER_VERSION); // from Request.info ECSTR(DOCUMENT_ROOT, r.request_info.document_root); ECSTR(PATH_TRANSLATED, r.request_info.path_translated); ECSTR(REQUEST_METHOD, r.request_info.method); ECSTR(QUERY_STRING, r.request_info.query_string); ECSTR(REQUEST_URI, r.request_info.uri); ECSTR(CONTENT_TYPE, r.request_info.content_type); ECSTR(CONTENT_LENGTH, pa_uitoa(r.request_info.content_length)); // SCRIPT_* env.put("SCRIPT_NAME", script_name); // environment & stdin from param bool in_is_text_mode=true; String::C in; Charset *charset=0; // default script works raw_in 'source' charset = no transcoding needed if(param_index < params.count()) { if(HashStringValue* user_env=params.as_hash(param_index++, "env")) { // $.charset [previewing to handle URI pieces] if(Value* vcharset=user_env->get(CHARSET_EXEC_PARAM_NAME)) charset=&pa_charsets.get(vcharset->as_string()); // $.others Append_env_pair_info info={&r.charsets, &env, 0}; { // influence tainting // main target -- $.QUERY_STRING -- URLencoding of tainted pieces to String::L_URI lang Temp_client_charset temp(r.charsets, charset? *charset: r.charsets.source()); user_env->for_each(append_env_pair, &info); } // $.stdin if(info.vstdin) { if(const String* sstdin=info.vstdin->get_string()) { // untaint stdin in = String::C(sstdin->cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets)); } else if(VFile* vfile=dynamic_cast(info.vstdin)){ in = String::C((const char* )vfile->value_ptr(), vfile->value_size()); in_is_text_mode = vfile->is_text_mode(); } else throw Exception(PARSER_RUNTIME, 0, STDIN_EXEC_PARAM_NAME " parameter must be string or file"); } } } // argv from params ArrayString argv; if(param_index < params.count()) { // influence tainting Temp_client_charset temp(r.charsets, charset? *charset: r.charsets.source()); for(size_t i=param_index; icount(); j++) append_to_argv(r, argv, table->get(j)->get(0)); } else if(VArray* array=dynamic_cast(¶m)){ for(ArrayValue::Iterator i(array->array()); i; i.next()){ if(i.value()){ const String *string=i.value()->get_string(); if(!string) i.value()->bark("array element is '%s', it does not have string value"); append_to_argv(r, argv, string); } } } else { throw Exception(PARSER_RUNTIME, 0, "param must be string or table or array of strings"); } } // remove trailing empty arguments for backward compatibility for(ArrayString::ReverseIterator i(argv); i;){ if(i.prev()->is_empty()){ // here for correct i.index() argv.remove(i.index()); } else { break; } } } // transcode if necessary if(charset) { Charset::transcode(env, r.charsets.source(), *charset); Charset::transcode(argv, r.charsets.source(), *charset); if(in_is_text_mode) in=Charset::transcode(in, r.charsets.source(), *charset); } // @todo // ifdef WIN32 do OEM->ANSI transcode on some(.cmd?) programs to // match silent conversion in OS // exec! PA_exec_result execution=pa_exec(false/*forced_allow*/, script_name, &env, argv, in); File_read_result *file_out=&execution.out; String *real_err=&execution.err; // transcode err if necessary (@todo: need fix line breaks in err as well ) if(charset) real_err=&Charset::transcode(*real_err, *charset, r.charsets.source()); if(file_out->length && is_text){ fix_line_breaks(file_out->str, file_out->length); // treat output as string String *real_out = new String(file_out->str); // transcode out if necessary if(charset) real_out=&Charset::transcode(*real_out, *charset, r.charsets.source()); // FIXME: unsafe cast file_out->str=const_cast(real_out->cstr()); // hacking a little file_out->length = real_out->length(); } VFile& self=GET_SELF(r, VFile); if(cgi) { // ^file::cgi const char* eol_marker=0; size_t eol_marker_size; // construct with 'out' body and header size_t dos_pos=(file_out->length)?strpos(file_out->str, "\r\n\r\n"):STRING_NOT_FOUND; size_t unix_pos=(file_out->length)?strpos(file_out->str, "\n\n"):STRING_NOT_FOUND; bool unix_header_break; switch((dos_pos!=STRING_NOT_FOUND?10:00) + (unix_pos!=STRING_NOT_FOUND?01:00)) { case 10: // dos unix_header_break=false; break; case 01: // unix unix_header_break=true; break; case 11: // dos & unix unix_header_break=unix_poslength, (file_out->length) ? (file_out->str) : "", real_err->length(), real_err->cstr()); break; //never reached } size_t header_break_pos; if(unix_header_break) { header_break_pos=unix_pos; eol_marker="\n"; eol_marker_size=1; } else { header_break_pos=dos_pos; eol_marker="\r\n"; eol_marker_size=2; } file_out->str[header_break_pos] = 0; String *header=new String(file_out->str); unsigned long headersize = header_break_pos+eol_marker_size*2; file_out->str += headersize; file_out->length -= headersize; // $body self.set(false/*not tainted*/, is_text, file_out->str, file_out->length); // $fields << header if(header) { ArrayString rows; header->split(rows, 0, eol_marker); Pass_cgi_header_attribute_info info={0, 0, 0}; info.charset=&r.charsets.source(); info.fields=&self.fields(); rows.for_each(pass_cgi_header_attribute, &info); if(info.content_type) self.fields().put(content_type_name, info.content_type); } } else { // ^file::exec // $body self.set(false/*not tainted*/, is_text, file_out->str ? file_out->str : pa_strdup("") /*to distinguish from stat-ed file*/, file_out->length); } // $status self.fields().put(file_status_name, new VInt(execution.status)); // $stderr if(!real_err->is_empty()) self.fields().put("stderr", new VString(*real_err)); } static void _exec(Request& r, MethodParams& params) { _exec_cgi(r, params, false); } static void _cgi(Request& r, MethodParams& params) { _exec_cgi(r, params, true); } static void _list(Request& r, MethodParams& params) { Value& relative_path=params.as_no_junction(0, "path must not be code"); bool stat=false; VRegex* vregex=0; VRegexCleaner vrcleaner; if(params.count()>1){ Value& voption=params.as_no_junction(1, "option must not be code"); if(voption.is_defined()) { Value* vfilter=0; if(HashStringValue* options=voption.get_hash()) { int valid_options=0; if(Value* vstat=options->get("stat")) { stat=r.process(*vstat).as_bool(); valid_options++; } if(Value* value=options->get("filter")) { vfilter=value; valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } else { vfilter=&voption; } if(vfilter) { if(VRegex* value=dynamic_cast(vfilter)) { vregex=value; } else if(vfilter->is_string()) { if(!vfilter->get_string()->trim().is_empty()) { vregex=new VRegex(r.charsets.source(), &vfilter->as_string(), 0/*options*/); vregex->study(); vrcleaner.vregex=vregex; } } else { throw Exception(PARSER_RUNTIME, 0, "filter must be regex or string"); } } } } const char* absolute_path_cstr=r.full_disk_path(relative_path.as_string()).taint_cstr(String::L_FILE_SPEC); Table::Action_options table_options; Table& table=*new Table(file_list_table_template(), table_options); const int ovector_size=(1/*match*/)*3; int ovector[ovector_size]; LOAD_DIR(absolute_path_cstr, const char* file_name_cstr=ffblk.name(); size_t file_name_size=strlen(file_name_cstr); if(!vregex || vregex->exec(file_name_cstr, file_name_size, ovector, ovector_size)>=0) { Table::element_type row(new ArrayString); *row+=new String(pa_strdup(file_name_cstr, file_name_size), String::L_TAINTED); *row+=new String(ffblk.is_dir(stat) ? "1" : "0", String::L_CLEAN); if(stat) { *row+=VDouble(ffblk.size()).get_string(); *row+=new String(pa_uitoa(ffblk.c_timestamp()), String::L_CLEAN); *row+=new String(pa_uitoa(ffblk.m_timestamp()), String::L_CLEAN); *row+=new String(pa_uitoa(ffblk.a_timestamp()), String::L_CLEAN); } table+=row; } ); // write out result r.write(*new VTable(&table)); } #ifndef DOXYGEN struct Lock_execute_body_info { Request* r; Value* body_code; }; #endif static void lock_execute_body(int , void *ainfo) { Lock_execute_body_info& info=*static_cast(ainfo); // execute body info.r->write(info.r->process(*info.body_code)); } static void _lock(Request& r, MethodParams& params) { const String& file_spec=r.full_disk_path(params.as_file_name(0)); Lock_execute_body_info info={ &r, ¶ms.as_junction(1, "body must be code") }; file_write_action_under_lock( file_spec, "lock", lock_execute_body, &info); } static size_t afterlastslash(const String& str) { size_t pos=str.strrpbrk("/\\"); return pos!=STRING_NOT_FOUND?pos+1:0; } static size_t afterlastslash(const String& str, size_t right) { size_t pos=str.strrpbrk("/\\", 0, right); return pos!=STRING_NOT_FOUND?pos+1:0; } static void _find(Request& r, MethodParams& params) { const String& file_name=params.as_string(0, FILE_NAME_MUST_BE_STRING); Value* not_found_code=(params.count()==2)?¶ms.as_junction(1, "not-found param must be code"):0; const String* file_spec; if(file_name.first_char()=='/') file_spec=&file_name; else file_spec=&r.relative(r.request_info.uri, file_name); // easy way if(file_exist(r.full_disk_path(*file_spec))) { r.write(*file_spec); return; } // monkey way size_t last_slash=file_spec->strrpbrk("/\\"); const String& dirname=file_spec->mid(0, last_slash!=STRING_NOT_FOUND?last_slash:0); const String& basename=file_spec->mid(last_slash!=STRING_NOT_FOUND?last_slash+1:0, file_spec->length()); size_t rpos=dirname.is_empty()?0:dirname.length()-1; while((rpos=dirname.rskipchars("/\\", 0, rpos))!=STRING_NOT_FOUND){ size_t slash=dirname.strrpbrk("/\\", 0, rpos); if(slash==STRING_NOT_FOUND) break; String test_name; test_name << dirname.mid(0, slash+1); test_name << basename; if(file_exist(r.full_disk_path(test_name))) { r.write(test_name); return; } rpos=slash; } // no way, not found if(not_found_code) r.write(r.process(*not_found_code)); } static void _dirname(Request& r, MethodParams& params) { const String& file_spec=params.as_file_spec(0); // works as *nix dirname // empty > . // / > / // /a > / // /a/ > / // /a/some.tar.gz > /a // /a/b/ > /a // /a///b/ > /a // /a/b/// > /a // file > . if(file_spec.is_empty()) { r.write(String(".")); return; } size_t p; size_t slash; if((p=file_spec.rskipchars("/\\"))==STRING_NOT_FOUND) r.write(String("/")); else { if((slash=file_spec.strrpbrk("/\\", 0, p))!=STRING_NOT_FOUND) { if((p=file_spec.rskipchars("/\\", 0, slash))==STRING_NOT_FOUND) p=slash; r.write(file_spec.mid(0, p+1)); return; } r.write(String(".")); } } static void _basename(Request& r, MethodParams& params) { const String& file_spec=params.as_file_spec(0); // works as *nix basename // empty > . // / > / // /a > a // /a/ > a // /a/some.tar.gz > some.tar.gz // /a/b/ > b // /a///b/ > b // /a/b/// > b // file > file if(file_spec.is_empty()) { r.write(String(".")); return; } size_t p=file_spec.rskipchars("/\\"); if(p==STRING_NOT_FOUND) r.write(String("/")); else r.write(file_spec.mid(afterlastslash(file_spec, p), p+1)); } static void _justname(Request& r, MethodParams& params) { const String& file_spec=params.as_file_spec(0); // /a/some.tar.gz > some.tar // /a/b.c/ > empty // /a/b.c > b size_t pos=afterlastslash(file_spec); size_t dotpos=file_spec.strrpbrk(".", pos); r.write(file_spec.mid(pos, dotpos!=STRING_NOT_FOUND?dotpos:file_spec.length())); } static void _justext(Request& r, MethodParams& params) { const String& file_spec=params.as_file_spec(0); // /a/some.tar.gz > gz // /a/b.c/ > empty size_t pos=afterlastslash(file_spec); size_t dotpos=file_spec.strrpbrk(".", pos); if(dotpos!=STRING_NOT_FOUND) r.write(file_spec.mid(dotpos+1, file_spec.length())); } static void _fullpath(Request& r, MethodParams& params) { const String& file_spec=params.as_file_spec(0); const String* result; if(file_spec.first_char()=='/') result=&file_spec; else { // /some/page.html: ^file:fullpath[a.gif] => /some/a.gif const String& full_disk_path=r.full_disk_path(file_spec); size_t document_root_length=strlen(r.request_info.document_root); if(document_root_length>0) { char last_char=r.request_info.document_root[document_root_length-1]; if(last_char == '/' || last_char == '\\') --document_root_length; } result=&full_disk_path.mid(document_root_length, full_disk_path.length()); } r.write(*result); } static void _sql_string(Request& r, MethodParams&) { VFile& self=GET_SELF(r, VFile); const char *quoted=r.connection()->quote(self.value_ptr(), self.value_size()); r.write(*new String(quoted)); } #ifndef DOXYGEN class File_sql_event_handlers: public SQL_Driver_query_event_handlers { int got_columns; int got_cells; bool got_row; public: String::C value; const String* user_file_name; const String* user_content_type; public: File_sql_event_handlers(): got_columns(0), got_cells(0), got_row(false), user_file_name(0), user_content_type(0) {} bool add_column(SQL_Error& error, const char* /*str*/, size_t /*length*/) { if(got_columns++==3) { error=SQL_Error("result must contain no more than 3 columns"); return true; } return false; } bool before_rows(SQL_Error& /*error*/ ) { /* ignore */ return false; } bool add_row(SQL_Error& error) { if(got_row) { error=SQL_Error("result must contain no more than 1 row"); return true; } got_row=true; return false; } bool add_row_cell(SQL_Error& error, const char* str, size_t length) { try { switch(got_cells++) { case 0: value=String::C(str, length); break; case 1: if(!user_file_name) // user not specified? user_file_name=new String(str, String::L_TAINTED); break; case 2: if(!user_content_type) // user not specified? user_content_type=new String(str, String::L_TAINTED); break; default: error=SQL_Error("result must contain no more than 1 row and 3 columns"); return true; } return false; } catch(...) { error=SQL_Error("exception occurred in File_sql_event_handlers::add_row_cell"); return true; } } }; #endif static void _sql(Request& r, MethodParams& params) { Value& statement=params.as_junction(0, "statement must be code"); const String& statement_string=r.process_to_string(statement); const char* statement_cstr=statement_string.untaint_cstr(String::L_SQL, r.connection()); File_sql_event_handlers handlers; ulong limit=SQL_NO_LIMIT; ulong offset=0; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "sql options")) { int valid_options=0; if(Value* vfilename=options->get(NAME_NAME)) { valid_options++; handlers.user_file_name=&vfilename->as_string(); } if(Value* vcontent_type=options->get(CONTENT_TYPE_NAME)) { valid_options++; handlers.user_content_type=&vcontent_type->as_string(); } if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; limit=(ulong)r.process(*vlimit).as_double(); } if(Value* voffset=options->get(sql_offset_name)) { valid_options++; offset=(ulong)r.process(*voffset).as_double(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } r.connection()->query(statement_cstr, 0, 0, offset, limit, handlers, statement_string); if(!handlers.value.str) throw Exception(PARSER_RUNTIME, 0, "produced no result"); VFile& self=GET_SELF(r, VFile); self.set_binary(true/*tainted*/, handlers.value.str, handlers.value.length, handlers.user_file_name , handlers.user_content_type ? new VString(*handlers.user_content_type) : 0 , &r); } extern Base64Options base64_encode_options(Request& r, HashStringValue* options); Base64Options base64_decode_options(Request& r, HashStringValue* options, VString** vcontent_type) { Base64Options result; if(options) { int valid_options=0; for(HashStringValue::Iterator i(*options); i; i.next() ) { String::Body key=i.key(); Value* value=i.value(); if(key == "pad") { result.pad=r.process(*value).as_bool(); valid_options++; } else if(key == "strict") { result.strict=r.process(*value).as_bool(); valid_options++; } else if(key == CONTENT_TYPE_NAME) { *vcontent_type=new VString(value->as_string()); valid_options++; } else if(key == "url-safe") { if(r.process(*value).as_bool()) result.set_url_safe_abc(); valid_options++; } } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } return result; } static void _base64(Request& r, MethodParams& params) { bool dynamic=!(&r.get_self() == file_class); if(dynamic) { VFile& self=GET_SELF(r, VFile); if(params.count()>1 || params.count()==1 && params[0].is_string()) { // decode: // ^file::base64[encoded] // backward // ^file::base64[mode;user-file-name;encoded[;$.content-type[...] $.strict(true|false)]] bool is_text=false; const String* user_file_name=0; VString* vcontent_type=0; Base64Options options; size_t param_index=0; if(params.count() > 1) { if(params.count() < 3) throw Exception(PARSER_RUNTIME, 0, "constructor cannot have less than 3 parameters (has %d parameters)", params.count()); // actually it accepts 1 parameter (backward) is_text=VFile::is_text_mode(params.as_string(0, MODE_MUST_BE_STRING)); user_file_name=¶ms.as_string(1, FILE_NAME_MUST_BE_STRING); if(params.count() == 4) options=base64_decode_options(r, params.as_hash(3), &vcontent_type); param_index=2; } const char* encoded=params.as_string(param_index, PARAMETER_MUST_BE_STRING).cstr(); char* decoded=0; size_t length=pa_base64_decode(encoded, strlen(encoded), decoded, options); self.set(true/*tainted*/, is_text, decoded, length, user_file_name, vcontent_type, &r); } else { // encode: ^f.base64[options] Base64Options options = base64_encode_options(r, params.count() > 0 ? params.as_hash(0) : NULL); const char* encoded=pa_base64_encode(self.value_ptr(), self.value_size(), options); r.write(*new String(encoded, String::L_TAINTED /*once ?param=base64(something) was needed**/ )); } } else { // encode: ^file:base64[filespec[;options]] if(params.count() > 2) throw Exception(PARSER_RUNTIME, 0, "accepts maximum 2 parameter(s) (has %d parameters)", params.count()); const String& file_spec = params.as_file_name(0); File_read_result data = file_read_binary(r.full_disk_path(file_spec), true /*fail on problem*/); Base64Options options = base64_encode_options(r, params.count() > 1 ? params.as_hash(1) : NULL); const char* encoded = pa_base64_encode(data.str, data.length, options); r.write(*new String(encoded, String::L_TAINTED /*once ?param=base64(something) was needed*/ )); } } static void _crc32(Request& r, MethodParams& params) { uint crc32 = 0; if(&r.get_self() == file_class) { // ^file:crc32[file-name] if(params.count()) { const String& file_spec=params.as_file_name(0); crc32=pa_crc32(r.full_disk_path(file_spec)); } else { throw Exception(PARSER_RUNTIME, 0, FILE_NAME_MUST_BE_SPECIFIED); } } else { // ^file.crc32[] VFile& self=GET_SELF(r, VFile); crc32=pa_crc32(self.value_ptr(), self.value_size()); } r.write(*new VDouble(crc32)); } static void file_md5_file_action(struct stat& finfo, int f, const String&, void *context) { PA_MD5_CTX& md5context=*static_cast(context); if(finfo.st_size) { int nCount=0; do { unsigned char buffer[FILE_BUFFER_SIZE]; nCount = file_block_read(f, buffer, sizeof(buffer)); if ( nCount ){ pa_MD5Update(&md5context, (const unsigned char*)buffer, nCount); } } while(nCount > 0); } } const char* pa_md5(const String& file_spec) { PA_MD5_CTX context; unsigned char digest[16]; pa_MD5Init(&context); file_read_action_under_lock(file_spec, "md5", file_md5_file_action, &context); pa_MD5Final(digest, &context); return hex_string(digest, sizeof(digest), false); } const char* pa_md5(const char *in, size_t in_size) { PA_MD5_CTX context; unsigned char digest[16]; pa_MD5Init(&context); pa_MD5Update(&context, (const unsigned char*)in, in_size); pa_MD5Final(digest, &context); return hex_string(digest, sizeof(digest), false); } static void _md5(Request& r, MethodParams& params) { const char* md5; if(&r.get_self() == file_class) { // ^file:md5[file-name] if(params.count()) { const String& file_spec=params.as_file_name(0); md5=pa_md5(r.full_disk_path(file_spec)); } else { throw Exception(PARSER_RUNTIME, 0, FILE_NAME_MUST_BE_SPECIFIED); } } else { // ^file.md5[] VFile& self=GET_SELF(r, VFile); md5=pa_md5(self.value_ptr(), self.value_size()); } r.write(*new String(md5)); } // constructor MFile::MFile(): Methoded("file") { // ^file::create[text|binary;file-name;string-or-file[;options hash]] // ^file::create[string-or-file[;options hash]] add_native_method("create", Method::CT_DYNAMIC, _create, 1, 4); // ^file.save[mode;file-name] // ^file.save[mode;file-name;$.charset[...]] add_native_method("save", Method::CT_DYNAMIC, _save, 2, 3); // ^file:delete[file-name] // ^file:delete[file-name;$.keep-empty-dir(true)$.exception(false)] add_native_method("delete", Method::CT_STATIC, _delete, 1, 2); // ^file:move[from-file-name;to-file-name] // ^file:move[from-file-name;to-file-name;$.keep-empty-dir(true)] add_native_method("move", Method::CT_STATIC, _move, 2, 3); // ^file::load[mode;disk-name] // ^file::load[mode;disk-name;user-name] // ^file::load[mode;disk-name;user-name;options hash] // ^file::load[mode;disk-name;options hash] add_native_method("load", Method::CT_DYNAMIC, _load, 2, 4); // ^file::stat[disk-name] add_native_method("stat", Method::CT_DYNAMIC, _stat, 1, 1); // ^file::cgi[mode;file-name] // ^file::cgi[mode;file-name;env hash] // ^file::cgi[mode;file-name;env hash;1cmd;2line;3ar;4g;5s] add_native_method("cgi", Method::CT_DYNAMIC, _cgi, 1, 3+50); // ^file::exec[mode;file-name] // ^file::exec[mode;file-name;env hash] // ^file::exec[mode;file-name;env hash;1cmd;2line;3ar;4g;5s] add_native_method("exec", Method::CT_DYNAMIC, _exec, 1, 3+50); // ^file:list[path] // ^file:list[path][regexp] // ^file:list[path][$.filter[regexp] $.stat(true)] add_native_method("list", Method::CT_STATIC, _list, 1, 2); // ^file:lock[path]{code} add_native_method("lock", Method::CT_STATIC, _lock, 2, 2); // ^file:find[file-name] // ^file:find[file-name]{when-not-found} add_native_method("find", Method::CT_STATIC, _find, 1, 2); // ^file:dirname[/a/some.tar.gz]=/a // ^file:dirname[/a/b/]=/a add_native_method("dirname", Method::CT_STATIC, _dirname, 1, 1); // ^file:basename[/a/some.tar.gz]=some.tar.gz add_native_method("basename", Method::CT_STATIC, _basename, 1, 1); // ^file:justname[/a/some.tar.gz]=some.tar add_native_method("justname", Method::CT_STATIC, _justname, 1, 1); // ^file:justext[/a/some.tar.gz]=gz add_native_method("justext", Method::CT_STATIC, _justext, 1, 1); // /some/page.html: ^file:fullpath[a.gif] => /some/a.gif add_native_method("fullpath", Method::CT_STATIC, _fullpath, 1, 1); // ^file.sql-string[] add_native_method("sql-string", Method::CT_DYNAMIC, _sql_string, 0, 0); // ^file::sql{} // ^file::sql{}[options hash] add_native_method("sql", Method::CT_DYNAMIC, _sql, 1, 2); // encode: // ^file.base64[] // ^file:base64[file-name] // decode: // ^file::base64[encoded] // backward // ^file::base64[mode;user-file-name;encoded] // ^file::base64[mode;user-file-name;encoded;$.content-type[...]] add_native_method("base64", Method::CT_ANY, _base64, 0, 4); // ^file.crc32[] // ^file:crc32[file-name] add_native_method("crc32", Method::CT_ANY, _crc32, 0, 1); // ^file.md5[] // ^file:md5[file-name] add_native_method("md5", Method::CT_ANY, _md5, 0, 1); // ^file:copy[from-file-name;to-file-name] // ^file:copy[from-file-name;to-file-name;$.append(false)] add_native_method("copy", Method::CT_STATIC, _copy, 2, 3); } parser-3.5.1/src/classes/array.C0000644000076400007640000007655514722363521013442 00000000000000/** @file Parser: @b array parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_charsets.h" #include "pa_varray.h" #include "pa_vvoid.h" #include "pa_sql_connection.h" #include "pa_vtable.h" #include "pa_vbool.h" #include "pa_vmethod_frame.h" volatile const char * IDENT_ARRAY_C="$Id: array.C,v 1.37 2024/11/29 16:09:53 moko Exp $"; // class class MArray: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VArray; } public: MArray(); }; // global variable DECLARE_CLASS_VAR(array, new MArray); const char* const PARAM_ARRAY_OR_HASH = "param must be array or hash"; const char* const PARAM_INDEX = "index must be integer"; // methods static void _copy_or_add(Request& r, MethodParams& params) { if(params.count()) { Value& vsrc=params.as_no_junction(0, PARAM_ARRAY_OR_HASH); VArray& self=GET_SELF(r, VArray); ArrayValue& self_array=self.array(); if(VArray* src=dynamic_cast(&vsrc)) { if(src==&self) return; if(self_array.count()){ for(ArrayValue::Iterator i(src->array()); i; i.next()){ if(i.value()) self_array.put(i.index(), i.value()); } } else { self_array.copy(src->array()); return; } } else { HashStringValue* src_hash=vsrc.as_hash("param must be array or"); if(!src_hash) return; for(HashStringValue::Iterator i(*src_hash); i; i.next()){ self_array.put(VArray::index(i.key()), i.value()); } } self_array.invalidate(); } } static ArrayValue::Action_options get_action_options(Request& r, MethodParams& params, size_t options_index) { ArrayValue::Action_options result; if(params.count() <= options_index) return result; HashStringValue* options=params.as_hash(options_index); if(!options) return result; result.defined=true; int valid_options=0; if(Value* voffset=options->get(sql_offset_name)) { valid_options++; int offset=r.process(*voffset).as_int(); result.offset=offset < 0 ? 0 : offset; } if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; int limit=r.process(*vlimit).as_int(); result.limit=limit < 0 ? 0: limit; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); return result; } static void _join(Request& r, MethodParams& params) { Value& vsrc=params.as_no_junction(0, PARAM_ARRAY_OR_HASH); ArrayValue::Action_options o=get_action_options(r, params, 1); VArray& self=GET_SELF(r, VArray); ArrayValue& self_array=self.array(); if(VArray* src=dynamic_cast(&vsrc)) { if(src==&self) throw Exception(PARSER_RUNTIME, 0, "source and destination are the same array"); if(o.defined){ for(ArrayValue::Iterator i(src->array()); i; i.next()){ if(i.value()){ if(o.offset > 0){ o.offset--; continue; } if(o.limit-- == 0) break; self_array+=i.value(); } } } else { for(ArrayValue::Iterator i(src->array()); i; i.next()){ if(i.value()) self_array+=i.value(); } } } else { HashStringValue* src_hash=vsrc.as_hash("param must be array or"); if(!src_hash) return; if(o.defined){ for(HashStringValue::Iterator i(*src_hash); i; i.next()){ if(o.offset > 0){ o.offset--; continue; } if(o.limit-- == 0) break; self_array+=i.value(); } } else { for(HashStringValue::Iterator i(*src_hash); i; i.next()){ self_array+=i.value(); } } } self_array.invalidate(); } #ifndef DOXYGEN #define STRING(str) ((str) ? *new String(str, String::L_TAINTED /* no length as 0x00 can be inside */) : String::Empty) class SparseArray_sql_event_handlers: public SQL_Driver_query_event_handlers { bool distinct; ArrayValue& result; Value* row_value; int column_index; ArrayString* columns; bool one_bool_column; Table2hash_value_type value_type; int columns_count; public: Table* empty; public: SparseArray_sql_event_handlers(bool adistinct, ArrayValue& aresult, Table2hash_value_type avalue_type): distinct(adistinct), result(aresult), row_value(0), column_index(0), columns(new ArrayString), one_bool_column(false), value_type(avalue_type), empty(0) { } bool add_column(SQL_Error& error, const char* str, size_t ) { try { if(columns_count){ // another query in multi_statements mode columns=new ArrayString; columns_count=0; } *columns+=&STRING(str); return false; } catch(...) { error=SQL_Error("exception occurred in Hash_sql_event_handlers::add_column"); return true; } } bool before_rows(SQL_Error& error) { columns_count=columns->count(); if(columns_count<1) { error=SQL_Error("no columns"); return true; } if(columns_count==1) { one_bool_column=true; } else { switch(value_type){ case C_STRING: { if(columns_count>2){ error=SQL_Error("only 2 columns allowed for $.type[string] and $.sparse(true)"); return true; } break; } case C_TABLE: { // create empty table which we'll copy later empty=new Table(columns); break; } } } return false; } bool add_row(SQL_Error& /*error*/) { column_index=0; return false; } bool add_row_cell(SQL_Error& error, const char *str, size_t ) { try { if(column_index==columns_count){ // should never happen, buggy driver case error=SQL_Error("columns index exceed the columns count"); return true; } bool duplicate=false; if(one_bool_column) { size_t index=str ? pa_atoui(str) : 0; duplicate=result.put_dont_replace(index, &VBool::get(true)); // put. existed? } else if(column_index==0) { size_t index=str ? pa_atoui(str) : 0; switch(value_type){ case C_HASH: { VHash* row_vhash=new VHash; row_value=row_vhash; duplicate=result.put_dont_replace(index, row_vhash); // put. existed? break; } case C_STRING: { VString* row_vstring=new VString(); row_value=row_vstring; duplicate=result.put_dont_replace(index, row_vstring); // put. existed? break; } case C_TABLE: { VTable* vtable=(VTable*)result.get(index); if(vtable) { // table with this key exist? if(!distinct) { duplicate=true; break; } } else { // no? creating table of same structure as source Table::Action_options table_options(0, 0); vtable=new VTable(new Table(*empty, table_options/*no rows, just structure*/)); result.put(index, vtable); // put } ArrayString* row=new ArrayString(columns_count); *row+=&STRING(str); *vtable->get_table()+=row; row_value=(Value*)row; break; } } } else { const String& cell=STRING(str); switch(value_type) { case C_HASH: { row_value->get_hash()->put(*columns->get(column_index), new VString(cell)); break; } case C_STRING: { VString* row_string=(VString*)row_value; row_string->set_string(cell); break; } case C_TABLE: { ArrayString* row=(ArrayString*)row_value; *row+=&cell; break; } } } if(duplicate & !distinct) { error=SQL_Error("duplicate key"); return true; } column_index++; return false; } catch(const Exception& e) { error=SQL_Error(e.type(), e.comment()); return true; } catch(...) { error=SQL_Error("exception occurred in Hash_sql_event_handlers::add_row_cell"); return true; } } }; class Array_sql_event_handlers: public SQL_Driver_query_event_handlers { ArrayValue& result; Value* row_value; int column_index; ArrayString* columns; Table2hash_value_type value_type; int columns_count; public: Table* empty; public: Array_sql_event_handlers(ArrayValue& aresult, Table2hash_value_type avalue_type): result(aresult), row_value(0), column_index(0), columns(new ArrayString), value_type(avalue_type), empty(0) { } bool add_column(SQL_Error& error, const char* str, size_t ) { try { if(columns_count){ // another query in multi_statements mode columns=new ArrayString; columns_count=0; } *columns+=&STRING(str); return false; } catch(...) { error=SQL_Error("exception occurred in Hash_sql_event_handlers::add_column"); return true; } } bool before_rows(SQL_Error& error) { columns_count=columns->count(); if(columns_count<1) { error=SQL_Error("no columns"); return true; } switch(value_type){ case C_STRING: { if(columns_count>1){ error=SQL_Error("only one column allowed for $.type[string]"); return true; } break; } case C_TABLE: { // create empty table which we'll copy later empty=new Table(columns); break; } } return false; } bool add_row(SQL_Error& /*error*/) { column_index=0; return false; } bool add_row_cell(SQL_Error& error, const char *str, size_t ) { try { if(column_index==columns_count){ // should never happen, buggy driver case error=SQL_Error("columns index exceed the columns count"); return true; } if(column_index==0) { switch(value_type){ case C_HASH: { VHash* row_vhash=new VHash; row_value=row_vhash; result+=row_vhash; break; } case C_STRING: { VString* row_vstring=new VString(); row_value=row_vstring; result+=row_vstring; break; } case C_TABLE: { // creating table of same structure as source Table::Action_options table_options(0, 0); VTable* vtable=new VTable(new Table(*empty, table_options/*no rows, just structure*/)); ArrayString* row=new ArrayString(columns_count); *vtable->get_table()+=row; row_value=(Value*)row; result+=vtable; break; } } } const String& cell=STRING(str); switch(value_type) { case C_HASH: { row_value->get_hash()->put(*columns->get(column_index), new VString(cell)); break; } case C_STRING: { VString* row_string=(VString*)row_value; row_string->set_string(cell); break; } case C_TABLE: { ArrayString* row=(ArrayString*)row_value; *row+=&cell; break; } } column_index++; return false; } catch(const Exception& e) { error=SQL_Error(e.type(), e.comment()); return true; } catch(...) { error=SQL_Error("exception occurred in Hash_sql_event_handlers::add_row_cell"); return true; } } }; #endif extern Table2hash_value_type get_value_type(Value& vvalue_type); extern int marshal_binds(HashStringValue& hash, SQL_Driver::Placeholder*& placeholders); extern void unmarshal_bind_updates(HashStringValue& hash, int placeholder_count, SQL_Driver::Placeholder* placeholders); static void _sql(Request& r, MethodParams& params) { Value& statement=params.as_junction(0, "statement must be code"); HashStringValue* bind=0; ulong limit=SQL_NO_LIMIT; ulong offset=0; bool distinct=false; bool sparse=false; Table2hash_value_type value_type=C_HASH; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "sql options")) { int valid_options=0; bool distinct_specified=false; for(HashStringValue::Iterator i(*options); i; i.next() ){ String::Body key=i.key(); Value* value=i.value(); if(key == sql_bind_name) { bind=value->get_hash(); valid_options++; } else if(key == sql_limit_name) { limit=(ulong)r.process(*value).as_double(); valid_options++; } else if(key == sql_offset_name) { offset=(ulong)r.process(*value).as_double(); valid_options++; } else if (key == sql_distinct_name) { distinct=r.process(*value).as_bool(); distinct_specified=true; valid_options++; } else if (key == sql_value_type_name) { value_type=get_value_type(r.process(*value)); valid_options++; } else if (key == "sparse") { sparse=r.process(*value).as_bool(); valid_options++; } } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); if(distinct_specified && !sparse) throw Exception(PARSER_RUNTIME, 0, "'distinct' option can only be used when $.sparse(true) is specified"); } SQL_Driver::Placeholder* placeholders=0; uint placeholders_count=0; if(bind) placeholders_count=marshal_binds(*bind, placeholders); const String& statement_string=r.process_to_string(statement); const char* statement_cstr=statement_string.untaint_cstr(String::L_SQL, r.connection()); VArray& self=GET_SELF(r, VArray); ArrayValue& array=self.array(); if(array.count()){ array.clear(); array.invalidate(); // just in case if called as method } if(sparse){ SparseArray_sql_event_handlers handlers(distinct, array, value_type); r.connection()->query(statement_cstr, placeholders_count, placeholders, offset, limit, handlers, statement_string); } else { Array_sql_event_handlers handlers(array, value_type); r.connection()->query(statement_cstr, placeholders_count, placeholders, offset, limit, handlers, statement_string); } array.confirm_all_used(); if(bind) unmarshal_bind_updates(*bind, placeholders_count, placeholders); } static void mid(Request& r, size_t offset=0, size_t limit=ARRAY_OPTION_LIMIT_ALL) { ArrayValue& array=GET_SELF(r, VArray).array(); if(limit>0){ VArray *result=new VArray; ArrayValue& result_array=result->array(); for(ArrayValue::Iterator i(array); i; i.next()){ if(i.value()){ if(offset > 0){ offset--; continue; } if(limit-- == 0) break; result_array+=i.value(); } } result_array.confirm_all_used(); r.write(*result); } else { r.write(*new VArray); } } static void _left(Request& r, MethodParams& params) { int sn=params.as_int(0, "n must be int", r); mid(r, 0, sn < 0 ? 0 : sn); } static void _right(Request& r, MethodParams& params) { int sn=params.as_int(0, "n must be int", r); if(sn>0){ size_t used=GET_SELF(r, VArray).array().used(); if((size_t)sn=0", begin); if(params.count()>1) { int n=params.as_int(1, "n must be int", r); if(n<0) throw Exception(PARSER_RUNTIME, 0, "n(%d) must be >=0", n); mid(r, begin, n); } else { mid(r, begin); } } static void _keys(Request& r, MethodParams& params) { const String* keys_column_name; if(params.count()>0) keys_column_name=¶ms.as_string(0, COLUMN_NAME_MUST_BE_STRING); else keys_column_name=new String("key"); Table::columns_type columns(new ArrayString(1)); *columns+=keys_column_name; Table* table=new Table(columns); ArrayValue& array=GET_SELF(r, VArray).array(); for(ArrayValue::Iterator i(array); i; i.next()){ if(i.value()){ Table::element_type row(new ArrayString(1)); *row+=new String(i.key(), String::L_TAINTED); *table+=row; } } r.write(*new VTable(table)); } static void _count(Request& r, MethodParams& params) { ArrayValue& array=GET_SELF(r, VArray).array(); if(params.count()>0){ const String& what=params.as_string(0, PARAMETER_MUST_BE_STRING); if(!what.is_empty()){ if(what != "all") throw Exception(PARSER_RUNTIME, &what, "param must be empty or 'all'"); return r.write(*new VInt(array.count())); } } r.write(*new VInt(array.used())); } static void _create_or_append_or_push(Request& r, MethodParams& params) { ArrayValue& array=GET_SELF(r, VArray).array(); int count=params.count(); if(array.count()){ for(int i=0; i0) { if(params[0].is_string()) { array.clear(VArray::index(*params[0].get_string())); } else { array.clear(VArray::index(params.as_int(0, PARAM_INDEX, r))); } } else array.clear(); array.invalidate(); } static void _remove(Request& r, MethodParams& params) { ArrayValue& array=GET_SELF(r, VArray).array(); array.remove(VArray::index(params.as_int(0, PARAM_INDEX, r))); array.invalidate(); } static void _pop(Request& r, MethodParams&) { ArrayValue& array=GET_SELF(r, VArray).array(); Value *result=array.pop(); if(result){ r.write(*result); array.change_used(-1); } else { r.write(*VVoid::get()); } } static void _contains(Request& r, MethodParams& params) { VArray& self=GET_SELF(r, VArray); bool result=self.contains(params[0].is_string() ? VArray::index(*params[0].get_string()) : VArray::index(params.as_int(0, PARAM_INDEX, r))); r.write(VBool::get(result)); } static void _for(Request& r, MethodParams& params) { InCycle temp(r); const String* key_var_name=¶ms.as_string(0, "key-var name must be string"); const String* value_var_name=¶ms.as_string(1, "value-var name must be string"); Value* body_code=¶ms.as_junction(2, "body must be code"); Value* delim_maybe_code=params.count()>3 ? ¶ms[3] : 0; Value& caller=*r.get_method_frame()->caller(); if(key_var_name->is_empty()) key_var_name=0; if(value_var_name->is_empty()) value_var_name=0; ArrayValue& array=GET_SELF(r, VArray).array(); if(delim_maybe_code){ // delimiter set bool need_delim=false; for(ArrayValue::RobustIterator i(array); i; i.next()){ if(key_var_name){ VString* vkey=new VString(*new String(i.key(), String::L_TAINTED)); r.put_element(caller, *key_var_name, vkey); } if(value_var_name) r.put_element(caller, *value_var_name, i.value() ? i.value() : VVoid::get()); Value& sv_processed=r.process(*body_code); TempSkip4Delimiter skip(r); const String* s_processed=sv_processed.get_string(); if(s_processed && !s_processed->is_empty()) { // we have body if(need_delim) // need delim & iteration produced string? r.write(r.process(*delim_maybe_code)); else need_delim=true; } r.write(sv_processed); if(skip.check_break()) break; } } else { for(ArrayValue::RobustIterator i(array); i; i.next()){ if(key_var_name){ VString* vkey=new VString(*new String(i.key(), String::L_TAINTED)); r.put_element(caller, *key_var_name, vkey); } if(value_var_name) r.put_element(caller, *value_var_name, i.value() ? i.value() : VVoid::get()); r.process_write(*body_code); if(r.check_skip_break()) break; } } } static void _foreach(Request& r, MethodParams& params) { InCycle temp(r); const String* key_var_name=¶ms.as_string(0, "key-var name must be string"); const String* value_var_name=¶ms.as_string(1, "value-var name must be string"); Value* body_code=¶ms.as_junction(2, "body must be code"); Value* delim_maybe_code=params.count()>3 ? ¶ms[3] : 0; Value& caller=*r.get_method_frame()->caller(); if(key_var_name->is_empty()) key_var_name=0; if(value_var_name->is_empty()) value_var_name=0; ArrayValue& array=GET_SELF(r, VArray).array(); if(delim_maybe_code){ // delimiter set bool need_delim=false; for(ArrayValue::RobustIterator i(array); i; i.next()){ if(i.value()){ if(key_var_name){ VString* vkey=new VString(*new String(i.key(), String::L_TAINTED)); r.put_element(caller, *key_var_name, vkey); } if(value_var_name) r.put_element(caller, *value_var_name, i.value()); Value& sv_processed=r.process(*body_code); TempSkip4Delimiter skip(r); const String* s_processed=sv_processed.get_string(); if(s_processed && !s_processed->is_empty()) { // we have body if(need_delim) // need delim & iteration produced string? r.write(r.process(*delim_maybe_code)); else need_delim=true; } r.write(sv_processed); if(skip.check_break()) break; } } } else { for(ArrayValue::RobustIterator i(array); i; i.next()){ if(i.value()){ if(key_var_name){ VString* vkey=new VString(*new String(i.key(), String::L_TAINTED)); r.put_element(caller, *key_var_name, vkey); } if(value_var_name) r.put_element(caller, *value_var_name, i.value()); r.process_write(*body_code); if(r.check_skip_break()) break; } } } } #ifndef DOXYGEN struct Array_seq_item : public PA_Allocated { Value *array_data; union { const char *c_str; double d; } value; }; #endif static int sort_cmp_string(const void *a, const void *b) { return strcmp( static_cast(a)->value.c_str, static_cast(b)->value.c_str ); } static int sort_cmp_double(const void *a, const void *b) { double va=static_cast(a)->value.d; double vb=static_cast(b)->value.d; if(vavb) return +1; else return 0; } static void _sort(Request& r, MethodParams& params){ const String& key_var_name=params.as_string(0, "key-var name must be string"); const String& value_var_name=params.as_string(1, "value-var name must be string"); Value& key_maker=params.as_junction(2, "key-maker must be code"); bool reverse=params.count()>3 && params.as_no_junction(3, "order must not be code").as_string()=="desc"; // default=asc const String* key_var=key_var_name.is_empty()? 0 : &key_var_name; const String* value_var=value_var_name.is_empty()? 0 : &value_var_name; VMethodFrame* context=r.get_method_frame()->caller(); VArray& self=GET_SELF(r, VArray); ArrayValue& array=self.array(); int count=array.used(); // not array.count() Array_seq_item* seq=new Array_seq_item[count]; int pos=0; bool key_values_are_strings=true; for(ArrayValue::RobustIterator i(array); i; i.next() ){ if(i.value()){ if(key_var) r.put_element(*context, *key_var, new VString(*new String(i.key(), String::L_TAINTED))); if(value_var) r.put_element(*context, *value_var, i.value()); Value& value=r.process(key_maker); if(pos==0) // determining key values type by first one key_values_are_strings=value.is_string(); seq[pos].array_data=i.value(); if(key_values_are_strings) seq[pos++].value.c_str=value.as_string().cstr(); else seq[pos++].value.d=value.as_expr_result().as_double(); } } // @todo: handle this elsewhere if(r.charsets.source().NAME()=="KOI8-R" && key_values_are_strings) for(pos=0; pos=0; pos--) array+=seq[pos].array_data; else for(pos=0; pos 1) { const String& stype=params.as_string(1, "type must be string"); if(stype == "key") result_type=AtResultTypeKey; else if(stype == "hash") result_type=AtResultTypeHash; else if(stype != "value") throw Exception(PARSER_RUNTIME, &stype, "type must be 'key', 'value' or 'hash'"); } int pos=params.as_index(0, count, r); if(count && pos >= 0 && (size_t)pos < count){ if(count == array.count()){ l1: switch(result_type) { case AtResultTypeKey: r.write(*new VString(*new String(pa_uitoa(pos), String::L_TAINTED))); break; case AtResultTypeValue: r.write(*array.get(pos)); break; case AtResultTypeHash: r.write(SingleElementHash(pa_uitoa(pos), array.get(pos))); break; } } else if((size_t)pos == count-1){ pos=array.count()-1; goto l1; } else { for(ArrayValue::Iterator i(array); i; i.next() ){ if(i.value() && !(pos--)){ switch(result_type) { case AtResultTypeKey: r.write(*new VString(*new String(i.key(), String::L_TAINTED))); break; case AtResultTypeValue: r.write(*i.value()); break; case AtResultTypeHash: r.write(SingleElementHash(i.key(), i.value())); break; } break; } } } } } static void _set(Request& r, MethodParams& params) { ArrayValue& array=GET_SELF(r, VArray).array(); size_t count=array.used(); // not array.count() int pos=params.as_index(0, count, r); if(count && pos >= 0 && (size_t)pos < count){ if(count == array.count()){ array.put(pos, &r.process(params[1])); return; } else if((size_t)pos == count-1){ array.put(array.count()-1, &r.process(params[1])); return; } else { for(ArrayValue::Iterator i(array); i; i.next() ){ if(i.value() && !(pos--)){ array.put(i.index(), &r.process(params[1])); return; } } } } if(count) throw Exception(PARSER_RUNTIME, 0, "index '%d' is out of range 0..%d", pos, count-1); throw Exception(PARSER_RUNTIME, 0, "index '%d' is out of range: array is empty", pos); } extern String table_reverse_name; static void _select(Request& r, MethodParams& params) { InCycle temp(r); const String* key_var_name=¶ms.as_string(0, "key-var name must be string"); const String* value_var_name=¶ms.as_string(1, "value-var name must be string"); Value& vcondition=params.as_expression(2, "condition must be number, bool or expression"); if(key_var_name->is_empty()) key_var_name=0; if(value_var_name->is_empty()) value_var_name=0; ArrayValue& source_array=GET_SELF(r, VArray).array(); Value& caller=*r.get_method_frame()->caller(); int limit=source_array.count(); bool reverse=false; if(params.count()>3) if(HashStringValue* options=params.as_hash(3)) { int valid_options=0; if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; limit=r.process(*vlimit).as_int(); } if(Value* vreverse=options->get(table_reverse_name)) { valid_options++; reverse=r.process(*vreverse).as_bool(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } VArray *result=new VArray; ArrayValue& result_array=result->array(); if(limit>0){ if(reverse){ for(ArrayValue::ReverseIterator i(source_array); i; ){ if(Value *value=i.prev()){ // here for correct i.key() if(key_var_name) r.put_element(caller, *key_var_name, new VString(*new String(i.key(), String::L_TAINTED))); if(value_var_name) r.put_element(caller, *value_var_name, value); bool condition=r.process(vcondition).as_bool(); if(r.check_skip_break()) break; if(condition){ result_array+=value; if(!--limit) break; } } } } else { for(ArrayValue::RobustIterator i(source_array); i; i.next() ){ if(Value *value=i.value()){ if(key_var_name) r.put_element(caller, *key_var_name, new VString(*new String(i.key(), String::L_TAINTED))); if(value_var_name) r.put_element(caller, *value_var_name, value); bool condition=r.process(vcondition).as_bool(); if(r.check_skip_break()) break; if(condition){ result_array+=value; if(!--limit) break; } } } } } result_array.confirm_all_used(); r.write(*result); } static void _reverse(Request& r, MethodParams&) { ArrayValue& source_array=GET_SELF(r, VArray).array(); VArray& result=*new VArray(source_array.count()); ArrayValue& result_array=result.array(); for(ArrayValue::ReverseIterator i(source_array); i; ){ result_array+=i.prev(); } r.write(result); } static void _compact(Request& r, MethodParams& params) { bool compact_undef=false; if(params.count()>0){ const String& what=params.as_string(0, PARAMETER_MUST_BE_STRING); if(!what.is_empty()){ if(what != "undef") throw Exception(PARSER_RUNTIME, &what, "param must be empty or 'undef'"); compact_undef=true; } } ArrayValue& array=GET_SELF(r, VArray).array(); array.compact(compact_undef); array.confirm_all_used(); } // constructor MArray::MArray(): Methoded(VARRAY_TYPE) { // ^array::copy[[copy_from]] add_native_method("copy", Method::CT_DYNAMIC, _copy_or_add, 0, 1); // ^array.add[add_from] add_native_method("add", Method::CT_DYNAMIC, _copy_or_add, 1, 1); // ^array.join[join_from[;options]] add_native_method("join", Method::CT_DYNAMIC, _join, 1, 2); // ^array::create[value[;value...]] add_native_method("create", Method::CT_DYNAMIC, _create_or_append_or_push, 0, 10000); // ^array.append[value[;value...]] add_native_method("append", Method::CT_DYNAMIC, _create_or_append_or_push, 1, 10000); // ^array.push[value[;value...]] add_native_method("push", Method::CT_DYNAMIC, _create_or_append_or_push, 1, 10000); // ^array.insert(index)[value[;value...]] add_native_method("insert", Method::CT_DYNAMIC, _insert, 2, 10000); // ^array.left(n) add_native_method("left", Method::CT_DYNAMIC, _left, 1, 1); // ^array.right(n) add_native_method("right", Method::CT_DYNAMIC, _right, 1, 1); // ^array.mid(p) // ^array.mid(p;n) add_native_method("mid", Method::CT_DYNAMIC, _mid, 1, 2); // ^array.delete(index) or ^array.delete[index] add_native_method("delete", Method::CT_DYNAMIC, _delete, 0, 1); // ^array.remove(index) add_native_method("remove", Method::CT_DYNAMIC, _remove, 1, 1); // ^array.pop[] add_native_method("pop", Method::CT_DYNAMIC, _pop, 0, 0); // ^array.contains(index) ^array.contains[index] add_native_method("contains", Method::CT_DYNAMIC, _contains, 1, 1); // ^array::sql[query][options array] add_native_method("sql", Method::CT_DYNAMIC, _sql, 1, 2); // ^array._keys[[column name]] add_native_method("_keys", Method::CT_DYNAMIC, _keys, 0, 1); // ^array._count[[all]] add_native_method("_count", Method::CT_DYNAMIC, _count, 0, 1); // ^array.for[index;value]{code}[delim] add_native_method("for", Method::CT_DYNAMIC, _for, 3, 3+1); // ^array.foreach[index;value]{code}[delim] add_native_method("foreach", Method::CT_DYNAMIC, _foreach, 3, 3+1); // ^array.sort[index;value]{string-key-maker}[[asc|desc]] // ^array.sort[index;value](numeric-key-maker)[[asc|desc]] add_native_method("sort", Method::CT_DYNAMIC, _sort, 3, 4); // ^array.select[index;value](bool-condition)[options hash] add_native_method("select", Method::CT_DYNAMIC, _select, 3, 4); // ^array.reverse[] add_native_method("reverse", Method::CT_DYNAMIC, _reverse, 0, 0); // ^array.compact[[undef]] add_native_method("compact", Method::CT_DYNAMIC, _compact, 0, 1); // ^array._at[first|last[;'key'|'value'|'hash']] // ^array._at([-+]index)[['key'|'value'|'hash']] add_native_method("_at", Method::CT_DYNAMIC, _at, 1, 2); // ^array.set[first|last;value] // ^array.set([-+]index)[value] add_native_method("set", Method::CT_DYNAMIC, _set, 2, 2); #ifdef FEATURE_GET_ELEMENT4CALL // aliases without "_" add_native_method("keys", Method::CT_DYNAMIC, _keys, 0, 1); add_native_method("count", Method::CT_DYNAMIC, _count, 0, 1); add_native_method("at", Method::CT_DYNAMIC, _at, 1, 2); #endif } parser-3.5.1/src/classes/double.C0000644000076400007640000000740514712042465013562 00000000000000/** @file Parser: @b double parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vdouble.h" #include "pa_vint.h" #include "pa_vbool.h" volatile const char * IDENT_DOUBLE_C="$Id: double.C,v 1.77 2024/11/04 03:53:25 moko Exp $" IDENT_PA_VDOUBLE_H; // externs void _string_format(Request& r, MethodParams&); // class class MDouble: public Methoded { public: MDouble(); }; // global variable DECLARE_CLASS_VAR(double, new MDouble); // methods static void _int(Request& r, MethodParams&) { VDouble& vdouble=GET_SELF(r, VDouble); r.write(*new VInt(vdouble.as_int())); } static void _double(Request& r, MethodParams&) { VDouble& vdouble=GET_SELF(r, VDouble); r.write(*new VDouble(vdouble.as_double())); } static void _bool(Request& r, MethodParams&) { VDouble& vdouble=GET_SELF(r, VDouble); r.write(VBool::get(vdouble.as_bool())); } typedef void (*vdouble_op_func_ptr)(VDouble& vdouble, double param); static void __inc(VDouble& vdouble, double param) { vdouble.inc(param); } static void __dec(VDouble& vdouble, double param) { vdouble.inc(-param); } static void __mul(VDouble& vdouble, double param) { vdouble.mul(param); } static void __div(VDouble& vdouble, double param) { vdouble.div(param); } static void __mod(VDouble& vdouble, double param) { vdouble.mod(param); } static void vdouble_op(Request& r, MethodParams& params, vdouble_op_func_ptr func) { VDouble& vdouble=GET_SELF(r, VDouble); double param=params.count() ? params.as_double(0, "param must be double", r) : 1/*used in inc/dec*/; (*func)(vdouble, param); } static void _inc(Request& r, MethodParams& params) { vdouble_op(r, params, &__inc); } static void _dec(Request& r, MethodParams& params) { vdouble_op(r, params, &__dec); } static void _mul(Request& r, MethodParams& params) { vdouble_op(r, params, &__mul); } static void _div(Request& r, MethodParams& params) { vdouble_op(r, params, &__div); } static void _mod(Request& r, MethodParams& params) { vdouble_op(r, params, &__mod); } // from string.C extern const String* sql_result_string(Request& r, MethodParams& params, Value*& default_code); static void _sql(Request& r, MethodParams& params) { double val; Value* default_code; if(const String* string=sql_result_string(r, params, default_code)) val=string->as_double(); else if(default_code) val=r.process(*default_code).as_double(); else { throw Exception(PARSER_RUNTIME, 0, "produced no result, but no default option specified"); } r.write(*new VDouble(val)); } // constructor MDouble::MDouble(): Methoded("double") { // ^double.int[] // ^double.int[default for ^string.int compatibility] add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1); // ^double.double[] // ^double.double[default for ^string.double compatibility] add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); // ^double.bool[] // ^double.bool[default for ^string.bool compatibility] add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); // ^double.inc[] // ^double.inc[offset] add_native_method("inc", Method::CT_DYNAMIC, _inc, 0, 1); // ^double.dec[] // ^double.dec[offset] add_native_method("dec", Method::CT_DYNAMIC, _dec, 0, 1); // ^double.mul[k] add_native_method("mul", Method::CT_DYNAMIC, _mul, 1, 1); // ^double.div[d] add_native_method("div", Method::CT_DYNAMIC, _div, 1, 1); // ^double.mod[offset] add_native_method("mod", Method::CT_DYNAMIC, _mod, 1, 1); // ^double.format{format} add_native_method("format", Method::CT_DYNAMIC, _string_format, 1, 1); // ^sql[query] // ^sql[query][$.limit(1) $.offset(2) $.default(0.0)] add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); } parser-3.5.1/src/classes/op.C0000644000076400007640000007277414740300505012732 00000000000000/** @file Parser: parser @b operators. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_common.h" #include "pa_os.h" #include "pa_request.h" #include "pa_vint.h" #include "pa_sql_connection.h" #include "pa_vdate.h" #include "pa_vmethod_frame.h" #include "pa_vclass.h" #include "pa_charset.h" #ifdef HAVE_SYSLOG #include "syslog.h" #endif volatile const char * IDENT_OP_C="$Id: op.C,v 1.274 2025/01/10 20:16:33 moko Exp $"; // defines #define CASE_DEFAULT_VALUE "DEFAULT" // class class VClassMAIN: public VClass { public: VClassMAIN(); }; // defines for statics #define SWITCH_DATA_NAME "SWITCH-DATA" #define CACHE_DATA_NAME "CACHE-DATA" #define EXCEPTION_VAR_NAME "exception" // statics //^switch ^case static const String switch_data_name(SWITCH_DATA_NAME); //^cache static const String cache_data_name(CACHE_DATA_NAME); static const String exception_var_name(EXCEPTION_VAR_NAME); // local defines #define CACHE_EXCEPTION_HANDLED_CACHE_NAME "cache" // helpers class Untaint_lang_name2enum: public HashString { public: Untaint_lang_name2enum() { #define ULN(name, LANG) put(name, (value_type)(String::L_##LANG)); ULN("clean", CLEAN); ULN("as-is", AS_IS); ULN("optimized-as-is", AS_IS|String::L_OPTIMIZE_BIT); ULN("file-spec", FILE_SPEC); ULN("http-header", HTTP_HEADER); ULN("mail-header", MAIL_HEADER); ULN("uri", URI); ULN("sql", SQL); ULN("js", JS); ULN("xml", XML); ULN("optimized-xml", XML|String::L_OPTIMIZE_BIT); ULN("html", HTML); ULN("optimized-html", HTML|String::L_OPTIMIZE_BIT); ULN("regex", REGEX); ULN("parser-code", PARSER_CODE); ULN("json", JSON); #undef ULN } static Untaint_lang_name2enum &instance(){ static Untaint_lang_name2enum *singleton=NULL; if(!singleton) singleton=new Untaint_lang_name2enum; return *singleton; } }; // methods static void _if(Request& r, MethodParams& params) { size_t max_param=params.count()-1; size_t i=0; do { bool condition=params.as_bool(i, "condition must be expression", r); if(condition) { r.process_write(params[i+1]); return; } i+=2; } while (i < max_param); if(i == max_param) r.process_write(params[i]); } String::Language get_untaint_lang(const String& lang_name){ String::Language lang=Untaint_lang_name2enum::instance().get(lang_name); if(!lang) throw Exception(PARSER_RUNTIME, &lang_name, "invalid taint language"); return lang; } static void _untaint(Request& r, MethodParams& params) { String::Language lang; if(params.count()==1) lang=String::L_AS_IS; // mark as simply 'as-is'. useful in html from sql else lang=get_untaint_lang(params.as_string(0, "lang must be string")); Value& vbody=params.as_junction(params.count()-1, "body must be code"); Value& result=r.process(vbody); if(const String* string=result.get_string()){ String &untainted=*new String(); string->append_to(untainted, lang); // mark all tainted to specified language r.write(untainted); } else r.write(result); // this is not normal, just backward compatibility } static void _taint(Request& r, MethodParams& params) { String::Language lang; if(params.count()==1) lang=String::L_TAINTED; // mark as simply 'tainted'. useful in table:create else lang=get_untaint_lang(params.as_string(0, "lang must be string")); { Value& vbody=params.as_no_junction(params.count()-1, "body must not be code"); String result(vbody.as_string(), lang); // force result language to specified r.write(result); } } static void _apply_taint(Request& r, MethodParams& params) { String::Language lang=params.count()==1 ? String::L_AS_IS : get_untaint_lang(params.as_string(0, "lang must be string")); const String &sbody=params.as_string(params.count()-1, "body must be string"); String::Body result_body=sbody.cstr_to_string_body_untaint(lang, r.connection(false), &r.charsets); r.write(*new String(result_body, String::L_AS_IS)); } static void _process(Request& r, MethodParams& params) { Method* main_method; size_t index=0; Value* target_self; Value& maybe_target_self=params[index]; if(maybe_target_self.get_string() || maybe_target_self.get_junction()) target_self=&r.get_method_frame()->caller()->self(); else { target_self=&maybe_target_self; if(params.count()==1) throw Exception(PARSER_RUNTIME, 0, "no body specified"); index++; } { VStateless_class *target_class=target_self->get_class(); if(!target_class) throw Exception(PARSER_RUNTIME, 0, "no target class"); // temporary zero @main so to maybe-replace it in processed code Temp_method temp_method_main(*target_class, main_method_name, 0); const String* main_alias=0; const String* file_alias=0; int line_no_alias_offset=0; bool allow_class_replace=false; size_t options_index=index+1; if(options_indexas_string(); } else if(key == "file") { valid_options++; file_alias=&value->as_string(); } else if(key == "lineno") { valid_options++; line_no_alias_offset=value->as_int(); } else if(key == "replace") { valid_options++; allow_class_replace=r.process(*value).as_bool(); } } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } uint processe_file_no=file_alias ? r.register_file(r.full_disk_path(*file_alias)) : pseudo_file_no__process; // process...{string} Value& vjunction=params.as_junction(index, "body must be code"); // evaluate source to process const String& source=r.process_to_string(vjunction); Temp_class_replace class_replace(r, allow_class_replace); r.use_buf(*target_class, source.untaint_cstr(String::L_PARSER_CODE, r.connection(false)), main_alias, processe_file_no, line_no_alias_offset); // main_method main_method=target_class->get_method(main_method_name); } // after restoring current-request-lang // maybe-execute @main[] if(main_method) { METHOD_FRAME_ACTION(*main_method, r.get_method_frame()->caller(), *target_self, { frame.empty_params(); r.call(frame); r.write(frame.result()); }); } } static void _rem(Request&, MethodParams& params) { params.as_junction(0, "body must be code"); } static void _while(Request& r, MethodParams& params) { InCycle temp(r); Value& vcondition=params.as_expression(0, "condition must be number, bool or expression"); Value& body_code=params.as_junction(1, "body must be code"); Value* delim_maybe_code=params.count()>2?¶ms[2]:0; // while... int endless_loop_count=0; if(delim_maybe_code){ // delimiter set bool need_delim=false; while(true) { if(++endless_loop_count>=pa_loop_limit) // endless loop? throw Exception(PARSER_RUNTIME, 0, "endless loop detected"); if(!r.process(vcondition).as_bool()) break; Value& sv_processed=r.process(body_code); TempSkip4Delimiter skip(r); const String* s_processed=sv_processed.get_string(); if(s_processed && !s_processed->is_empty()) { // we have body if(need_delim) // need delim & iteration produced string? r.write(r.process(*delim_maybe_code)); else need_delim=true; } r.write(sv_processed); if(skip.check_break()) break; } } else { while(true) { if(++endless_loop_count>=pa_loop_limit) // endless loop? throw Exception(PARSER_RUNTIME, 0, "endless loop detected"); if(!r.process(vcondition).as_bool()) break; r.process_write(body_code); if(r.check_skip_break()) break; } } } static void _use(Request& r, MethodParams& params) { const String& file_name=params.as_file_name(0); const String* use_origin=0; bool allow_class_replace=false; bool load_auto_p=false; if(params.count()==2) if(HashStringValue* options=params.as_hash(1)) { int valid_options=0; for(HashStringValue::Iterator i(*options); i; i.next() ){ String::Body key=i.key(); Value* value=i.value(); if(key == "origin") { valid_options++; use_origin=&value->as_string(); } if(key == "replace") { valid_options++; allow_class_replace=r.process(*value).as_bool(); } if(key == "main") { valid_options++; load_auto_p=r.process(*value).as_bool(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } } if(!use_origin) if(VMethodFrame* caller=r.get_method_frame()->caller()) use_origin=r.get_method_filespec(&caller->method); Temp_class_replace class_replace(r, allow_class_replace); r.use_file(file_name, use_origin, load_auto_p); } static void set_skip(Request& r, Request::Skip askip) { if(!r.get_in_cycle()) throw Exception(askip==Request::SKIP_BREAK ? "parser.break" : "parser.continue", 0, "without cycle"); r.set_skip(askip); } static void _break(Request& r, MethodParams& params) { if(!params.count() || params.as_bool(0, "condition must be expression", r)) set_skip(r, Request::SKIP_BREAK); } static void _continue(Request& r, MethodParams& params) { if(!params.count() || params.as_bool(0, "condition must be expression", r)) set_skip(r, Request::SKIP_CONTINUE); } static void _return(Request& r, MethodParams& params) { VMethodFrame& caller=*r.get_method_frame()->caller(); if(params.count()) r.put_element(caller, Symbols::RESULT_SYMBOL, &r.process(params[0])); r.set_skip_return(caller); } static void _for(Request& r, MethodParams& params) { InCycle temp(r); const String& var_name=params.as_string(0, "var name must be string"); int from=params.as_int(1, "from must be int", r); int to=params.as_int(2, "to must be int", r); Value& body_code=params.as_junction(3, "body must be code"); Value* delim_maybe_code=params.count()>4?¶ms[4]:0; if(to-from>=pa_loop_limit) // too long loop? throw Exception(PARSER_RUNTIME, 0, "endless loop detected"); VInt* vint=new VInt(0); VMethodFrame& caller=*r.get_method_frame()->caller(); r.put_element(caller, var_name, vint); if(delim_maybe_code){ // delimiter set bool need_delim=false; for(int i=from; i<=to; i++) { vint->set_int(i); Value& sv_processed=r.process(body_code); TempSkip4Delimiter skip(r); const String* s_processed=sv_processed.get_string(); if(s_processed && !s_processed->is_empty()) { // we have body if(need_delim) // need delim & iteration produced string? r.write(r.process(*delim_maybe_code)); else need_delim=true; } r.write(sv_processed); if(skip.check_break()) break; } } else { for(int i=from; i<=to; i++) { vint->set_int(i); r.process_write(body_code); if(r.check_skip_break()) break; } } } static void _eval(Request& r, MethodParams& params) { Value& expr=params.as_junction(0, "need expression"); // evaluate expresion Value& value_result=r.process(expr).as_expr_result(); if(params.count()>1) { const String& fmt=params.as_string(1, "fmt must be string").trim(); if(fmt.is_empty()){ r.write(value_result); } else { r.write(String(format_double(value_result.as_double(), fmt.cstrm()))); } } else r.write(value_result); } static void _connect(Request& r, MethodParams& params) { Value& url=params.as_no_junction(0, "url must not be code"); Value& body_code=params.as_junction(1, "body must be code"); Table* protocol2driver_and_client=0; if(Value* sql=r.main_class.get_element(String(MAIN_SQL_NAME))) { if(Value* element=sql->get_element(String(MAIN_SQL_DRIVERS_NAME))) { protocol2driver_and_client=element->get_table(); } } // connect SQL_Connection* connection=SQL_driver_manager->get_connection(url.as_string(), protocol2driver_and_client, r.charsets.source().NAME().cstr(), r.request_info.document_root); Temp_connection temp_connection(r, connection); // execute body try { r.process_write(body_code); connection->commit(); connection->close(); } catch(...) { // process problem connection->rollback(); connection->close(); rethrow; } } #ifndef DOXYGEN class Switch_data: public PA_Object { public: Request& r; const String* searching_string; double searching_double; bool searching_bool; Value* found; Value* _default; public: Switch_data(Request& ar, Value& asearching): r(ar) { if(asearching.is_string() || asearching.is_void()){ searching_string=&asearching.as_string(); searching_double=0; searching_bool=false; } else { searching_string=0; searching_double=asearching.as_double(); searching_bool=asearching.is_bool(); } } }; #endif static void _switch(Request& r, MethodParams& params) { Switch_data* data=new Switch_data(r, r.process(params[0])); Temp_hash_value, void*> switch_data_setter(&r.classes_conf, switch_data_name, data); Value& cases_code=params.as_junction(1, "switch cases must be code"); // execution of found ^case[...]{code} must be in context of ^switch[...]{code} // because of stacked WWrapper used there as wcontext r.process(cases_code); if(Value* selected_code=data->found? data->found: data->_default) r.process_write(*selected_code); } static void _case(Request& r, MethodParams& params) { Switch_data* data=static_cast(r.classes_conf.get(switch_data_name)); if(!data) throw Exception(PARSER_RUNTIME, 0, "without switch"); if(data->found) // matches already was found return; int count=params.count(); Value* code=¶ms.as_expression(--count, "case result must be code"); #ifdef USE_DESTRUCTORS Junction *j=code->get_junction(); if (j){ code=new VJunction(j->self,j->method,j->method_frame,j->rcontext,j->wcontext,j->code); if (j->wcontext) j->wcontext->attach_junction((VJunction *)code); } #endif for(int i=0; i_default=code; continue; } bool matches; if(data->searching_string) matches=(*data->searching_string) == value.as_string(); else if(data->searching_bool || value.is_bool()) matches=(data->searching_double != 0) == value.as_bool(); else matches=data->searching_double == value.as_double(); if(matches){ data->found=code; break; } } } #ifndef DOXYGEN struct Try_catch_result { ValueRef processed_code; const String* exception_should_be_handled; Try_catch_result(): exception_should_be_handled(0) {} }; /// Auto-object used for temporary changing Request::skip. class Temp_skip { Request& frequest; Request::Skip saved_skip; public: Temp_skip(Request& arequest) : frequest(arequest), saved_skip(arequest.get_skip()) { arequest.set_skip(Request::SKIP_NOTHING); } ~Temp_skip() { if(frequest.get_skip() == Request::SKIP_NOTHING) frequest.set_skip(saved_skip); } }; #endif /// used by ^try and ^cache, @returns $exception.handled[string] if any template static Try_catch_result try_catch(Request& r, Value& body_code(Request&, I), I info, Value* catch_code, bool could_be_handled_by_caller=false) { Try_catch_result result; // minor bug: context not restored if only finally code is present, see #1062 if(!catch_code) { result.processed_code=body_code(r, info); return result; } // taking snapshot of try-context Request_context_saver try_context(r); try { result.processed_code=body_code(r, info); } catch(const Exception& e) { Request_context_saver throw_context(r); // remembering exception stack trace Request::Exception_details details=r.get_details(e); try_context.restore(); // restoring try-context for code after try and catch-code { Temp_value_element temp(r, *catch_code->get_junction()->method_frame, exception_var_name, &details.vhash); Temp_skip temp_skip(r); result.processed_code=r.process(*catch_code); } // retriving $exception.handled Value* vhandled=details.vhash.hash().get(exception_handled_part_name); bool bhandled=false; if(vhandled) { if(vhandled->is_string()) { // not simple $exception.handled(1/0)? if(bhandled=could_be_handled_by_caller) { // and we can possibly handle it result.exception_should_be_handled=vhandled->get_string(); // considering 'recovered' and let the caller recover } } else bhandled=vhandled->as_bool(); } if(!bhandled){ throw_context.restore(); // restoring exception stack trace creared by try_context.restore() rethrow; } } return result; } static Value& process_try_body_code(Request& r, Value* body_code) { return r.process(*body_code); } // cache-- // consts const int DATA_STRING_SERIALIZED_VERSION=0x0006; // helper types #ifndef DOXYGEN struct Data_string_serialized_prolog { int version; time_t expires; }; #endif void cache_delete(const String& file_spec) { file_delete(file_spec, false/*fail_on_problem*/); } #ifndef DOXYGEN struct Cache_scope { public: time_t expires; const String* body_from_disk; }; struct Locked_process_and_cache_put_action_info { Request *r; Cache_scope *scope; Value* body_code; Value* catch_code; const String* processed_code; }; #endif static Value& process_cache_body_code(Request& r, Value* body_code) { return r.process(*body_code); } /* @todo maybe network order worth spending some effort? don't bothering myself with network byte order, am not planning to be able to move resulting file across platforms */ static void locked_process_and_cache_put_action(int f, void *context) { Locked_process_and_cache_put_action_info& info= *static_cast(context); const String* body_from_disk=info.scope->body_from_disk; // body->process Try_catch_result result=try_catch(*info.r, process_cache_body_code, info.body_code, info.catch_code, body_from_disk!=0 /*we have something old=we can handle=recover later*/); if(result.exception_should_be_handled) { if(*result.exception_should_be_handled==CACHE_EXCEPTION_HANDLED_CACHE_NAME) { assert(body_from_disk); info.processed_code=body_from_disk; } else throw Exception(PARSER_RUNTIME, result.exception_should_be_handled, "$" EXCEPTION_VAR_NAME "." EXCEPTION_HANDLED_PART_NAME " value must be " "either boolean or string '" CACHE_EXCEPTION_HANDLED_CACHE_NAME "'"); } else info.processed_code=&((Value &)result.processed_code).as_string(); // expiration time not spoiled by ^cache(0) or something? if(info.scope->expires > time(0)) { // string -serialize> buffer String::Cm serialized=info.processed_code->serialize( sizeof(Data_string_serialized_prolog)); Data_string_serialized_prolog& prolog= *reinterpret_cast(serialized.str); prolog.version=DATA_STRING_SERIALIZED_VERSION; prolog.expires=info.scope->expires; // buffer -write> file if(write(f, serialized.str, serialized.length)<0) throw Exception("file.write", 0, "write failed: %s (%d)", strerror(errno), errno); } else // expired! info.scope->expires=0; // flag it so that could be easily checked by caller } const String* locked_process_and_cache_put(Request& r, Value& body_code, Value* catch_code, Cache_scope& scope, const String& file_spec) { Locked_process_and_cache_put_action_info info={&r, &scope, &body_code, catch_code, 0}; const String* result=file_write_action_under_lock( file_spec, "cache_put", locked_process_and_cache_put_action, &info, false/*as_text*/, false/*do_append*/, false/*block == don't wait till other thread release lock*/, false/*dun throw exception if lock failed*/) ? info.processed_code: 0; time_t now=time(0); if(scope.expires<=now) cache_delete(file_spec); return result; } #ifndef DOXYGEN struct Cache_get_result { const String* body; bool expired; }; #endif static Cache_get_result cache_get(const String& file_spec, time_t now) { Cache_get_result result={0, false}; File_read_result file=file_read_binary(file_spec, false /*fail_on_read_problem*/); if(file.success && file.length /*ignore reads which are empty due to non-unary open+lockEX conflict with lockSH*/) { Data_string_serialized_prolog& prolog = *reinterpret_cast(file.str); String* body=new String; if(file.length>=sizeof(Data_string_serialized_prolog) && prolog.version==DATA_STRING_SERIALIZED_VERSION) { if(body->deserialize(sizeof(Data_string_serialized_prolog), file.str, file.length)) { result.body=body; result.expired=prolog.expires <= now; } } } return result; } static time_t as_expires(Request& r, MethodParams& params, int index, time_t now) { time_t result; if(VDate* vdate=dynamic_cast(¶ms[index])) result=(time_t)vdate->get_time(); else result=now+(time_t)params.as_double(index, "lifespan must be date or number", r); return result; } static const String& as_file_spec(Request& r, MethodParams& params, int index) { return r.full_disk_path(params.as_string(index, "filespec must be string")); } static void _cache(Request& r, MethodParams& params) { if(params.count()==0) { // ^cache[] -- return current expiration time Cache_scope* scope=static_cast(r.classes_conf.get(cache_data_name)); if(!scope) throw Exception(PARSER_RUNTIME, 0, "expire-time get without cache"); r.write(*new VDate((pa_time_t)scope->expires)); return; } time_t now=time(0); if(params.count()==1) { // ^cache[filename] ^cache(seconds) ^cache[expires date] if(params[0].is_string()) { // filename? cache_delete(as_file_spec(r, params, 0)); return; } // secods|expires date Cache_scope* scope=static_cast(r.classes_conf.get(cache_data_name)); if(!scope) throw Exception(PARSER_RUNTIME, 0, "expire-time reducing instruction without cache"); time_t expires=as_expires(r, params, 0, now); if(expires < scope->expires) scope->expires=expires; return; } else if(params.count()<3) throw Exception(PARSER_RUNTIME, 0, "invalid number of parameters"); // file_spec, expires, body code const String& file_spec=as_file_spec(r, params, 0); Cache_scope scope={as_expires(r, params, 1, now), 0}; Temp_hash_value, void*> cache_scope_setter(&r.classes_conf, cache_data_name, &scope); Value& body_code=params.as_junction(2, "body_code must be code"); Value* catch_code=0; if(params.count()>3) catch_code=¶ms.as_junction(3, "catch_code must be code"); if(scope.expires>now) { Cache_get_result cached=cache_get(file_spec, now); if(cached.body) { // have cached copy if(cached.expired) { scope.body_from_disk=cached.body; // storing for user to retrive it with ^cache[] } else { // and it's not expired yet write it out r.write(*cached.body); // happy with it return; } } // no cached info or it's already expired // trying to process it under lock and store result in file const String* processed_body=locked_process_and_cache_put(r, body_code, catch_code, scope, file_spec); if(processed_body){ // write it out r.write(*processed_body); // happy with it return; } else { // we fail while get exclusive lock. nvm, we just execute body_code a bit later } } else { // instructed not to cache; forget cached copy cache_delete(file_spec); } // process without caching if(catch_code){ Try_catch_result result=try_catch(r, process_try_body_code, &body_code, catch_code); r.write(result.processed_code); } else { r.write(r.process_to_string(body_code)); } } static void _try_operator(Request& r, MethodParams& params) { Value& body_code=params.as_junction(0, "body_code must be code"); Value& catch_code=params.as_junction(1, "catch_code must be code"); Value* finally_code=(params.count()==3) ? ¶ms.as_junction(2, "finally_code must be code") : 0; Try_catch_result result; try{ // process try and catch code result=try_catch(r, process_try_body_code, &body_code, &catch_code); } catch(...){ // process finally code but ignore the result if(finally_code){ Temp_skip temp(r); /* Value &finally_result= */ r.process(*finally_code); } rethrow; } // process finally code if(finally_code){ Temp_skip temp(r); Value& finally_result=r.process(*finally_code); // no exception in try/catch or finally, writing processed body_code or catch_code r.write(result.processed_code); // write out processed finally code r.write(finally_result); } else { // no exception in try/catch, writing processed body_code or catch_code r.write(result.processed_code); } } static void _throw_operator(Request&, MethodParams& params) { if(params.count()==1 && !params[0].is_string()) { if(HashStringValue *hash=params[0].get_hash()) { const char* type=0; if(Value* value=hash->get(exception_type_part_name)) type=value->as_string().cstr(); const String* source=0; if(Value* value=hash->get(exception_source_part_name)) source=&value->as_string(); const char* comment=0; if(Value* value=hash->get(exception_comment_part_name)) comment=value->as_string().cstr(); throw Exception(type, source, "%s", comment); // to avoid MAX_STRING limit } else throw Exception(PARSER_RUNTIME, 0, "one-param version has hash or string param"); } else { const char* type=params.as_string(0, "type must be string").cstr(); const String* source=params.count()>1 ? ¶ms.as_string(1, "source must be string") : 0; const char* comment=params.count()>2 ? params.as_string(2, "comment must be string").cstr() : 0; throw Exception(type, source, "%s", comment); // to avoid MAX_STRING limit } } static void _sleep_operator(Request& r, MethodParams& params) { double seconds=params.as_double(0, "seconds must be double", r); if(seconds>0) pa_sleep((int)trunc(seconds), (int)trunc((seconds-trunc(seconds))*1000000)); } #ifdef HAVE_SYSLOG static int log_level(const String &name){ if(name.is_empty()) return LOG_INFO; const char *sname = str_upper(name.cstr()); if(!strcmp(sname,"INFO")) return LOG_INFO; if(!strcmp(sname,"WARNING")) return LOG_WARNING; if(!strcmp(sname,"ERROR")) return LOG_ERR; if(!strcmp(sname,"DEBUG")) return LOG_DEBUG; throw Exception("syslog", &name, "invalid log level value"); } #endif static void _syslog_operator(Request& r, MethodParams& params) { const char* ident=params.as_string(0, "ident must be string").cstr(); const char* message=params.as_string(1, "message must be string").cstr(); #ifdef HAVE_SYSLOG int level=params.count()>2 ? log_level(params.as_string(2, "level must be string")) : LOG_INFO; openlog(*ident ? ident : "parser3", LOG_PID, LOG_USER); syslog(level, "%s", message); closelog(); #else SAPI::log(r.sapi_info, "syslog: %s", message); #endif } #if defined(WIN32) && defined(_DEBUG) && !defined(_WIN64) # define PA_BPT static void _bpt(Request&, MethodParams&) { _asm int 3; } #endif // constructor VClassMAIN::VClassMAIN(): VClass(MAIN_CLASS_NAME) { #ifdef PA_BPT // ^bpt[] add_native_method("bpt", Method::CT_ANY, _bpt, 0, 0); #endif // ^if(condition){code-when-true} // ^if(condition){code-when-true}{code-when-false} // ^if(condition){code-when-true} (another condition){code-when-true} ... {code-when-false} add_native_method("if", Method::CT_ANY, _if, 2, 10000, Method::CO_WITHOUT_FRAME); // ^untaint[as-is|uri|sql|js|html|html-typo|regex|parser-code]{code} add_native_method("untaint", Method::CT_ANY, _untaint, 1, 2, Method::CO_WITHOUT_FRAME); // ^taint[as-is|uri|sql|js|html|html-typo|regex|parser-code]{code} add_native_method("taint", Method::CT_ANY, _taint, 1, 2, Method::CO_WITHOUT_FRAME); // ^apply-taint[untaint lang][string] add_native_method("apply-taint", Method::CT_ANY, _apply_taint, 1, 2, Method::CO_WITHOUT_FRAME); // ^process{code} // ^process[context]{code}[options hash] add_native_method("process", Method::CT_ANY, _process, 1, 3); // ^rem{code} add_native_method("rem", Method::CT_ANY, _rem, 1, 10000, Method::CO_WITHOUT_FRAME); // ^while(condition){code} add_native_method("while", Method::CT_ANY, _while, 2, 3, Method::CO_WITHOUT_FRAME); // ^use[file[;options hash]] add_native_method("use", Method::CT_ANY, _use, 1, 2); // ^break[] // ^break(condition) add_native_method("break", Method::CT_ANY, _break, 0, 1, Method::CO_WITHOUT_FRAME); // ^continue[] // ^continue(condition) add_native_method("continue", Method::CT_ANY, _continue, 0, 1, Method::CO_WITHOUT_FRAME); // ^return[] // ^return[result] add_native_method("return", Method::CT_ANY, _return, 0, 1); // ^for[i](from-number;to-number-inclusive){code}[delim] add_native_method("for", Method::CT_ANY, _for, 3+1, 3+1+1); // ^eval(expr) // ^eval(expr)[format] add_native_method("eval", Method::CT_ANY, _eval, 1, 2, Method::CO_WITHOUT_FRAME); // ^connect[protocol://user:pass@host[:port]/database]{code with ^sql-s} add_native_method("connect", Method::CT_ANY, _connect, 2, 2); // ^cache[file_spec](time){code}[{catch code}] time=0 no cache // ^cache[file_spec] delete cache // ^cache[] get current expiration time add_native_method("cache", Method::CT_ANY, _cache, 0, 4); // switch // ^switch[value]{cases} add_native_method("switch", Method::CT_ANY, _switch, 2, 2, Method::CO_WITHOUT_FRAME); // ^case[value]{code} add_native_method("case", Method::CT_ANY, _case, 2, 10000, Method::CO_WITHOUT_FRAME); // try-catch // ^try{code}{catch code} add_native_method("try", Method::CT_ANY, _try_operator, 2, 3, Method::CO_WITHOUT_FRAME); // ^throw[$exception hash] // ^throw[type;source;comment] add_native_method("throw", Method::CT_ANY, _throw_operator, 1, 3); add_native_method("sleep", Method::CT_ANY, _sleep_operator, 1, 1); // ^syslog[ident;message[;info|warning|error|debug]] add_native_method("syslog", Method::CT_ANY, _syslog_operator, 2, 3); } // constructor & configurator VStateless_class& VClassMAIN_create() { return *new VClassMAIN; } parser-3.5.1/src/classes/classes.C0000644000076400007640000000411414714317332013737 00000000000000/** @file Parser: @b Methoded and Methoded_array classes. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_request.h" volatile const char * IDENT_CLASSES_C="$Id: classes.C,v 1.36 2024/11/11 06:06:18 moko Exp $" IDENT_CLASSES_H; // Methoded void Methoded::register_directly_used(Request& r) { if(used_directly()) r.put_class(this); // prevent system classes from modification [calling set_method] // ^process[$string:CLASS]{@method} prohibited from now on... this->lock(); } // Methoded_array // global variable Methoded_array& methoded_array() { static Methoded_array* result=0; if(!result) result=new Methoded_array; return *result; } // methods Methoded_array::Methoded_array() { ADD_CLASS_VAR(array) ADD_CLASS_VAR(bool) ADD_CLASS_VAR(curl) ADD_CLASS_VAR(date) ADD_CLASS_VAR(double) ADD_CLASS_VAR(file) ADD_CLASS_VAR(form) ADD_CLASS_VAR(hash) ADD_CLASS_VAR(hashfile) ADD_CLASS_VAR(image) ADD_CLASS_VAR(inet) ADD_CLASS_VAR(int) ADD_CLASS_VAR(json) ADD_CLASS_VAR(mail) ADD_CLASS_VAR(math) ADD_CLASS_VAR(memcached) ADD_CLASS_VAR(memory) ADD_CLASS_VAR(reflection) ADD_CLASS_VAR(regex) ADD_CLASS_VAR(response) ADD_CLASS_VAR(string) ADD_CLASS_VAR(table) ADD_CLASS_VAR(void) // should be after string for set_base #ifdef XML ADD_CLASS_VAR(xnode) ADD_CLASS_VAR(xdoc) // should be after xnode for set_base #endif } static void configure_admin_one(Methoded_array::element_type methoded, Request *r) { methoded->configure_admin(*r); } void Methoded_array::configure_admin(Request& r) { for_each(configure_admin_one, &r); } static void configure_user_one(Methoded_array::element_type methoded, Request *r) { methoded->configure_user(*r); } void Methoded_array::configure_user(Request& r) { for_each(configure_user_one, &r); } static void register_one(Methoded_array::element_type methoded, Request *r) { methoded->register_directly_used(*r); } void Methoded_array::register_directly_used(Request& r) { for_each(register_one, &r); } parser-3.5.1/src/classes/void.C0000644000076400007640000000475614712042465013257 00000000000000/** @file Parser: @b VOID parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vvoid.h" #include "pa_sql_connection.h" volatile const char * IDENT_VOID_C="$Id: void.C,v 1.60 2024/11/04 03:53:25 moko Exp $"; // class class MVoid: public Methoded { public: MVoid(); }; // void is inherited from string, thus global variable declared in string.C // methods #ifndef DOXYGEN class Void_sql_event_handlers: public SQL_Driver_query_event_handlers { public: bool add_column(SQL_Error& /*error*/, const char* /*str*/, size_t /*length*/) { /* ignore */ return false; } bool before_rows(SQL_Error& error) { // there are some result rows, which is wrong error=SQL_Error("must return nothing"); return true; } bool add_row(SQL_Error& /*error*/) { /* never */ return false; } bool add_row_cell(SQL_Error& /*error*/, const char* /*str*/, size_t /*length*/) { /* never */ return false; } }; #endif extern int marshal_binds(HashStringValue& hash, SQL_Driver::Placeholder*& placeholders); extern void unmarshal_bind_updates(HashStringValue& hash, int placeholder_count, SQL_Driver::Placeholder* placeholders); static void _sql(Request& r, MethodParams& params) { Value& statement=params.as_junction(0, "statement must be code"); HashStringValue* bind=0; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "sql options")) { int valid_options=0; if(Value* vbind=options->get(sql_bind_name)) { valid_options++; bind=vbind->get_hash(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } SQL_Driver::Placeholder* placeholders=0; uint placeholders_count=0; if(bind) placeholders_count=marshal_binds(*bind, placeholders); const String& statement_string=r.process_to_string(statement); const char* statement_cstr=statement_string.untaint_cstr(String::L_SQL, r.connection()); Void_sql_event_handlers handlers; r.connection()->query(statement_cstr, placeholders_count, placeholders, 0, SQL_NO_LIMIT, handlers, statement_string); if(bind) unmarshal_bind_updates(*bind, placeholders_count, placeholders); } // constructor MVoid::MVoid(): Methoded("void") { set_base(string_class); // ^void:sql{query} add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); // all other methods are inherinted from empty string } parser-3.5.1/src/classes/bool.C0000644000076400007640000000262514712042465013242 00000000000000/** @file Parser: @b int parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vdouble.h" #include "pa_vint.h" #include "pa_vbool.h" volatile const char * IDENT_BOOL_C="$Id: bool.C,v 1.13 2024/11/04 03:53:25 moko Exp $" IDENT_PA_VBOOL_H; // externs void _string_format(Request& r, MethodParams&); // class class MBool: public Methoded { public: MBool(); }; // global variable DECLARE_CLASS_VAR(bool, new MBool); // methods static void _int(Request& r, MethodParams&) { VBool& vbool=GET_SELF(r, VBool); r.write(*new VInt(vbool.as_bool())); } static void _double(Request& r, MethodParams&) { VBool& vbool=GET_SELF(r, VBool); r.write(*new VDouble(vbool.as_bool())); } static void _bool(Request& r, MethodParams&) { r.write(GET_SELF(r, VBool)); } // constructor MBool::MBool(): Methoded("bool") { // ^bool.int[] // ^bool.int[default for ^string.int compatibility] add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1); // ^bool.double[] // ^bool.double[default for ^string.double compatibility] add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); // ^bool.bool[] // ^bool.bool[default for ^string.bool compatibility] add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); } parser-3.5.1/src/classes/Makefile.in0000644000076400007640000005735114740273415014260 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/classes ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libclasses_la_LIBADD = am__objects_1 = array.lo bool.lo curl.lo date.lo double.lo file.lo \ form.lo hash.lo hashfile.lo image.lo inet.lo int.lo json.lo \ mail.lo math.lo memcached.lo memory.lo op.lo reflection.lo \ regex.lo response.lo string.lo table.lo void.lo xnode.lo \ xdoc.lo am_libclasses_la_OBJECTS = $(am__objects_1) classes.lo libclasses_la_OBJECTS = $(am_libclasses_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/array.Plo ./$(DEPDIR)/bool.Plo \ ./$(DEPDIR)/classes.Plo ./$(DEPDIR)/curl.Plo \ ./$(DEPDIR)/date.Plo ./$(DEPDIR)/double.Plo \ ./$(DEPDIR)/file.Plo ./$(DEPDIR)/form.Plo ./$(DEPDIR)/hash.Plo \ ./$(DEPDIR)/hashfile.Plo ./$(DEPDIR)/image.Plo \ ./$(DEPDIR)/inet.Plo ./$(DEPDIR)/int.Plo ./$(DEPDIR)/json.Plo \ ./$(DEPDIR)/mail.Plo ./$(DEPDIR)/math.Plo \ ./$(DEPDIR)/memcached.Plo ./$(DEPDIR)/memory.Plo \ ./$(DEPDIR)/op.Plo ./$(DEPDIR)/reflection.Plo \ ./$(DEPDIR)/regex.Plo ./$(DEPDIR)/response.Plo \ ./$(DEPDIR)/string.Plo ./$(DEPDIR)/table.Plo \ ./$(DEPDIR)/void.Plo ./$(DEPDIR)/xdoc.Plo \ ./$(DEPDIR)/xnode.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libclasses_la_SOURCES) DIST_SOURCES = $(libclasses_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I../types -I../sql -I../lib/gd -I../lib/sdbm/pa-include -Igd $(INCLTDL) @PCRE_INCLUDES@ @XML_INCLUDES@ -I../lib/md5 -I../lib/smtp -I../lib/json -I../lib/memcached -I../lib/curl CLASSES_SOURCE_FILES = array.C bool.C curl.C date.C double.C file.C form.C hash.C hashfile.C image.C inet.C int.C json.C mail.C math.C memcached.C memory.C op.C reflection.C regex.C response.C string.C table.C void.C xnode.C xdoc.C noinst_HEADERS = classes.h xnode.h noinst_LTLIBRARIES = libclasses.la libclasses_la_SOURCES = $(CLASSES_SOURCE_FILES) classes.C EXTRA_DIST = classes.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/classes/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/classes/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libclasses.la: $(libclasses_la_OBJECTS) $(libclasses_la_DEPENDENCIES) $(EXTRA_libclasses_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libclasses_la_OBJECTS) $(libclasses_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/classes.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/date.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/double.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/form.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashfile.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/int.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/json.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mail.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memcached.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reflection.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/response.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/void.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdoc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xnode.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .C.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/array.Plo -rm -f ./$(DEPDIR)/bool.Plo -rm -f ./$(DEPDIR)/classes.Plo -rm -f ./$(DEPDIR)/curl.Plo -rm -f ./$(DEPDIR)/date.Plo -rm -f ./$(DEPDIR)/double.Plo -rm -f ./$(DEPDIR)/file.Plo -rm -f ./$(DEPDIR)/form.Plo -rm -f ./$(DEPDIR)/hash.Plo -rm -f ./$(DEPDIR)/hashfile.Plo -rm -f ./$(DEPDIR)/image.Plo -rm -f ./$(DEPDIR)/inet.Plo -rm -f ./$(DEPDIR)/int.Plo -rm -f ./$(DEPDIR)/json.Plo -rm -f ./$(DEPDIR)/mail.Plo -rm -f ./$(DEPDIR)/math.Plo -rm -f ./$(DEPDIR)/memcached.Plo -rm -f ./$(DEPDIR)/memory.Plo -rm -f ./$(DEPDIR)/op.Plo -rm -f ./$(DEPDIR)/reflection.Plo -rm -f ./$(DEPDIR)/regex.Plo -rm -f ./$(DEPDIR)/response.Plo -rm -f ./$(DEPDIR)/string.Plo -rm -f ./$(DEPDIR)/table.Plo -rm -f ./$(DEPDIR)/void.Plo -rm -f ./$(DEPDIR)/xdoc.Plo -rm -f ./$(DEPDIR)/xnode.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/array.Plo -rm -f ./$(DEPDIR)/bool.Plo -rm -f ./$(DEPDIR)/classes.Plo -rm -f ./$(DEPDIR)/curl.Plo -rm -f ./$(DEPDIR)/date.Plo -rm -f ./$(DEPDIR)/double.Plo -rm -f ./$(DEPDIR)/file.Plo -rm -f ./$(DEPDIR)/form.Plo -rm -f ./$(DEPDIR)/hash.Plo -rm -f ./$(DEPDIR)/hashfile.Plo -rm -f ./$(DEPDIR)/image.Plo -rm -f ./$(DEPDIR)/inet.Plo -rm -f ./$(DEPDIR)/int.Plo -rm -f ./$(DEPDIR)/json.Plo -rm -f ./$(DEPDIR)/mail.Plo -rm -f ./$(DEPDIR)/math.Plo -rm -f ./$(DEPDIR)/memcached.Plo -rm -f ./$(DEPDIR)/memory.Plo -rm -f ./$(DEPDIR)/op.Plo -rm -f ./$(DEPDIR)/reflection.Plo -rm -f ./$(DEPDIR)/regex.Plo -rm -f ./$(DEPDIR)/response.Plo -rm -f ./$(DEPDIR)/string.Plo -rm -f ./$(DEPDIR)/table.Plo -rm -f ./$(DEPDIR)/void.Plo -rm -f ./$(DEPDIR)/xdoc.Plo -rm -f ./$(DEPDIR)/xnode.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/classes/response.C0000644000076400007640000000151714712042465014144 00000000000000/** @file Parser: @b response parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vresponse.h" volatile const char * IDENT_RESPONSE_C="$Id: response.C,v 1.35 2024/11/04 03:53:25 moko Exp $"; // class class MResponse: public Methoded { public: MResponse(); public: // Methoded bool used_directly() { return false; } }; // global variable DECLARE_CLASS_VAR(response, new MResponse); // methods static void _clear(Request& r, MethodParams&) { GET_SELF(r, VResponse).fields().clear(); } // constructor MResponse::MResponse(): Methoded("response") { // ^clear[] add_native_method("clear", Method::CT_STATIC, _clear, 0, 0); } parser-3.5.1/src/classes/string.C0000644000076400007640000006655514726174500013632 00000000000000/** @file Parser: @b string parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_base64.h" #include "pa_request.h" #include "pa_vdouble.h" #include "pa_vint.h" #include "pa_vtable.h" #include "pa_vbool.h" #include "pa_string.h" #include "pa_varray.h" #include "pa_sql_connection.h" #include "pa_dictionary.h" #include "pa_vmethod_frame.h" #include "pa_vregex.h" #include "pa_charsets.h" volatile const char * IDENT_STRING_C="$Id: string.C,v 1.262 2024/12/11 02:30:24 moko Exp $"; // class class MString: public Methoded { public: MString(); }; // global variable DECLARE_CLASS_VAR(string, new MString); // void class, inherited from string and thus should be inited afterwards class MVoid: public Methoded { public: MVoid(); }; // void global variable should be after string global variable DECLARE_CLASS_VAR(void, new MVoid); // defines for statics #define MATCH_VAR_NAME "match" #define TRIM_START_OPTION "left" #define TRIM_END_OPTION "right" #define TRIM_BOTH_OPTION "both" #define MODE_APPEND "append" #define UNESCAPE_MODE_JS "js" #define UNESCAPE_MODE_URI "uri" // statics static const String match_var_name(MATCH_VAR_NAME); // methods static void _length(Request& r, MethodParams&) { double result=GET_SELF(r, VString).string().length(r.charsets.source()); r.write(*new VDouble(result)); } static void _int(Request& r, MethodParams& params) { const String& self_string=GET_SELF(r, VString).string(); int converted; if(self_string.is_empty()) { if(params.count()>0) converted=params.as_int(0, "default must be int", r); // (default) else throw Exception(PARSER_RUNTIME, 0, "unable to convert empty string without default specified"); } else { try { converted=self_string.as_int(); } catch(...) { // convert problem if(params.count()>0) converted=params.as_int(0, "default must be int", r); // (default) else rethrow; // we have a problem when no default } } r.write(*new VInt(converted)); } static void _double(Request& r, MethodParams& params) { const String& self_string=GET_SELF(r, VString).string(); if(self_string.is_empty()) { if(params.count()>0) r.write(*new VDouble(params.as_double(0, "default must be double", r))); // (default) else throw Exception(PARSER_RUNTIME, 0, "unable to convert empty string without default specified"); } else { try { r.write(*new VDouble(self_string.as_double())); } catch(...) { // convert problem if(params.count()>0) r.write(*new VDouble(params.as_double(0, "default must be double", r))); // (default) else rethrow; // we have a problem when no default } } } static void _bool(Request& r, MethodParams& params) { const String& self_string=GET_SELF(r, VString).string(); bool converted; const char *str=self_string.cstr(); if(self_string.is_empty()) { if(params.count()>0) converted=params.as_bool(0, "default must be bool", r); // (default) else throw Exception(PARSER_RUNTIME, 0, "unable to convert empty string without default specified"); } else if( (str[0]=='T' || str[0]=='t') && (str[1]=='R' || str[1]=='r') && (str[2]=='U' || str[2]=='u') && (str[3]=='E' || str[3]=='e') && str[4]==0 ) { // "true" converted=true; } else if( (str[0]=='F' || str[0]=='f') && (str[1]=='A' || str[1]=='a') && (str[2]=='L' || str[2]=='l') && (str[3]=='S' || str[3]=='s') && (str[4]=='E' || str[4]=='e') && str[5]==0 ) { // "false" converted=false; } else { try { converted=self_string.as_bool(); } catch(...) { // convert problem if(params.count()>0) converted=params.as_bool(0, "default must be bool", r); // (default) else rethrow; // we have a problem when no default } } r.write(VBool::get(converted)); } /*not static*/void _string_format(Request& r, MethodParams& params) { Value& fmt_maybe_code=params[0]; // for some time due to stupid {} in original design const String& fmt=r.process_to_string(fmt_maybe_code); const char* buf=format_double(r.get_self().as_double(), fmt.trim().cstrm()); r.write(String(buf)); } static void _left(Request& r, MethodParams& params) { int sn=params.as_int(0, "n must be int", r); const String& string=GET_SELF(r, VString).string(); r.write(sn<0 ? string : string.mid(r.charsets.source(), 0, sn)); } static void _right(Request& r, MethodParams& params) { int sn=params.as_int(0, "n must be int", r); if(sn>0){ size_t n=sn; const String& string=GET_SELF(r, VString).string(); size_t length=string.length(r.charsets.source()); r.write(n=0", begin); size_t end; size_t length=0; if(params.count()>1) { int n=params.as_int(1, "n must be int", r); if(n<0) throw Exception(PARSER_RUNTIME, 0, "n(%d) must be >=0", n); end=begin+n; } else { length=string.length(r.charsets.source()); end=length; } r.write(string.mid(r.charsets.source(), begin, end, length)); } static void _pos(Request& r, MethodParams& params) { Value& substr=params.as_no_junction(0, "substr must not be code"); const String& string=GET_SELF(r, VString).string(); int offset=0; if(params.count()>1){ offset=params.as_int(1, "n must be int", r); if(offset<0) throw Exception(PARSER_RUNTIME, 0, "n(%d) must be >=0", offset); } r.write(*new VInt((int)string.pos(r.charsets.source(), substr.as_string(), offset))); } struct Split_action_info { const String& src; ArrayString &result; Split_action_info(const String& s, ArrayString& r) : src(s), result(r) {} }; static void split_action(Table& , ArrayString* row, int prestart, int prefinish, int poststart, int postfinish, void *info) { Split_action_info& ai=*static_cast(info); if(row) { // begin&middle // piece from last match['prestart'] to beginning of this match['prefinish'] ai.result += &ai.src.mid(prestart, prefinish); } else // end if(poststart != postfinish) ai.result += &ai.src.mid(poststart, postfinish); } static void split_list(Value& delim_value, const String& string, ArrayString& result) { if(VRegex *vregex=dynamic_cast(&delim_value)){ vregex->study(); int matches_count=0; Split_action_info ai(string, result); string.match(vregex, split_action, &ai, matches_count); } else string.split(result, 0, delim_value.as_string()); } #define SPLIT_LEFT 0x0001 #define SPLIT_RIGHT 0x0010 #define SPLIT_HORIZONTAL 0x0100 #define SPLIT_VERTICAL 0x1000 #define SPLIT_ARRAY 0x10000 static int split_options(const String* options) { struct Split_option { const char* keyL; const char* keyU; int setBit; int checkBit; } split_option[]={ {"l", "L", SPLIT_LEFT, SPLIT_RIGHT}, // 0xAVHRL {"r", "R", SPLIT_RIGHT, SPLIT_LEFT}, {"h", "H", SPLIT_HORIZONTAL, SPLIT_VERTICAL | SPLIT_ARRAY}, {"v", "V", SPLIT_VERTICAL, SPLIT_HORIZONTAL | SPLIT_ARRAY}, {"a", "A", SPLIT_ARRAY, SPLIT_VERTICAL | SPLIT_HORIZONTAL}, {0, 0, 0, 0} }; int result=0; if(options) { for(Split_option *o=split_option; o->keyL; o++) if(options->pos(o->keyL)!=STRING_NOT_FOUND || (o->keyU && options->pos(o->keyU)!=STRING_NOT_FOUND)) { if(result & o->checkBit) throw Exception(PARSER_RUNTIME, options, "conflicting split options"); result |= o->setBit; } } return result; } static Table& split_vertical(ArrayString& pieces, bool right, const String* column_name) { Table::columns_type columns(new ArrayString); *columns+=column_name; Table& table=*new Table(columns, pieces.count()); if(right) { // right for(int i=pieces.count(); --i>=0; ) { Table::element_type row(new ArrayString); *row+=pieces[i]; table+=row; } } else { // left for(ArrayString::Iterator i(pieces); i; ) { Table::element_type row(new ArrayString); *row+=i.next(); table+=row; } } return table; } static Table& split_horizontal(ArrayString& pieces, bool right) { Table& table=*new Table(Table::columns_type(0) /* nameless */); Table::element_type row(new ArrayString(pieces.count())); if(right) { // right for(int i=pieces.count(); --i>=0; ) *row+=pieces[i]; } else { // left for(ArrayString::Iterator i(pieces); i; ) *row+=i.next(); } table+=row; return table; } static VArray& split_array(ArrayString& pieces, bool right) { VArray& result=*new VArray(pieces.count()); ArrayValue &array=result.array(); if(right) { // right for(int i=pieces.count(); --i>=0; ) array+=new VString(*pieces[i]); } else { // left for(ArrayString::Iterator i(pieces); i; ) array+=new VString(*i.next()); } return result; } static void split_with_options(Request& r, MethodParams& params, int bits) { const String& string=GET_SELF(r, VString).string(); size_t params_count=params.count(); ArrayString pieces; split_list(params.as_no_junction(0, "delimiter must not be code"), string, pieces); if(!bits) { const String* options=0; if(params_count>1) options=¶ms.as_string(1, OPTIONS_MUST_NOT_BE_CODE); bits=split_options(options); } bool right=(bits & SPLIT_RIGHT) != 0; bool horizontal=(bits & SPLIT_HORIZONTAL) !=0; bool array=(bits & SPLIT_ARRAY) !=0; const String* column_name=0; if(params_count>2){ column_name=¶ms.as_string(2, COLUMN_NAME_MUST_BE_STRING); if (horizontal && !column_name->is_empty()) throw Exception(PARSER_RUNTIME, column_name, "column name cannot be specified when splitting into a table horizontal row"); if (array && !column_name->is_empty()) throw Exception(PARSER_RUNTIME, column_name, "column name cannot be specified when splitting into an array"); } if(array){ r.write(split_array(pieces, right)); } else { if(!column_name || column_name->is_empty()) column_name=new String("piece"); Table& table=horizontal ? split_horizontal(pieces, right) : split_vertical(pieces, right, column_name); r.write(*new VTable(&table)); } } static void _split(Request& r, MethodParams& params) { split_with_options(r, params, 0 /* maybe-determine from param #2 */); } static void _lsplit(Request& r, MethodParams& params) { split_with_options(r, params, SPLIT_LEFT); } static void _rsplit(Request& r, MethodParams& params) { split_with_options(r, params, SPLIT_RIGHT); } static void search_action(Table& table, Table::element_type row, int, int, int, int, void *) { if(row) table+=row; } #ifndef DOXYGEN struct Replace_action_info { Request* request; const String* src; String* dest; VTable* vtable; Value* replacement_code; }; #endif /// @todo they can do $global[$result] there, getting pointer to later-invalid local var, kill this static void replace_action(Table& table, ArrayString* row, int prestart, int prefinish, int poststart, int postfinish, void *info) { Replace_action_info& ai=*static_cast(info); if(row) { // begin&middle // piece from last match['prestart'] to beginning of this match['prefinish'] if(prestart!=prefinish) *ai.dest << ai.src->mid(prestart, prefinish);//ai.dest->APPEND_CONST("-"); // store found parts in one-record VTable if(table.count()) // middle table.put(0, row); else // begin table+=row; { // execute 'replacement_code' in 'table' context if(ai.replacement_code){ ai.vtable->set_table(table); *ai.dest << ai.request->process_to_string(*ai.replacement_code); } } } else // end *ai.dest << ai.src->mid(poststart, postfinish); } static void _match(Request& r, MethodParams& params) { size_t params_count=params.count(); Value& regexp=params.as_no_junction(0, "regexp must not be code"); Value* options=(params_count>1)?¶ms.as_no_junction(1, OPTIONS_MUST_NOT_BE_CODE):0; VRegex* vregex=dynamic_cast(®exp); VRegexCleaner vrcleaner; if(vregex){ if(options && options->is_defined()) throw Exception(PARSER_RUNTIME, 0, "you cannot specify regex-object and options together"); } else { vregex=new VRegex(r.charsets.source(), ®exp.as_string(), (options) ? (&options->as_string()) : 0); vregex->study(); vrcleaner.vregex=vregex; } const String& src=GET_SELF(r, VString).string(); int matches_count=0; if(params_count<3) { // search Table* table=src.match(vregex, search_action, 0, matches_count); if(table){ r.write(*new VTable(table)); } else { r.write(*new VInt(matches_count)); } } else { // replace Value* replacement_code=0; bool is_junction=false; Value* replacement=¶ms[2]; if(replacement->get_junction()){ replacement_code=replacement; is_junction=true; } else if(replacement->is_string()){ if(replacement->is_defined()) replacement_code=replacement; } else if(!replacement->is_void()) throw Exception(PARSER_RUNTIME, 0, "replacement option should be junction or string"); Value* default_code=(params_count==4) ? ¶ms.as_junction(3, "default value must be code") : 0; String result; VTable* vtable=new VTable; Replace_action_info info={ &r, &src, &result, vtable, replacement_code }; if(is_junction){ Temp_value_element temp(r, *replacement_code->get_junction()->method_frame, match_var_name, vtable); src.match(vregex, replace_action, &info, matches_count); } else { src.match(vregex, replace_action, &info, matches_count); } if(!matches_count && default_code) r.process_write(*default_code); else r.write(result); } } static void change_case(Request& r, MethodParams&, String::Change_case_kind kind) { const String& src=GET_SELF(r, VString).string(); r.write(src.change_case(r.charsets.source(), kind)); } static void _upper(Request& r, MethodParams& params) { change_case(r, params, String::CC_UPPER); } static void _lower(Request& r, MethodParams& params) { change_case(r, params, String::CC_LOWER); } #ifndef DOXYGEN class String_sql_event_handlers: public SQL_Driver_query_event_handlers { bool got_column; public: bool got_cell; const String* result; public: String_sql_event_handlers(): got_column(false), got_cell(false), result(&String::Empty) {} bool add_column(SQL_Error& error, const char* /*str*/, size_t /*length*/) { if(got_column) { error=SQL_Error("result must contain exactly one column"); return true; } got_column=true; return false; } bool before_rows(SQL_Error& /*error*/ ) { /* ignore */ return false; } bool add_row(SQL_Error& /*error*/) { /* ignore */ return false; } bool add_row_cell(SQL_Error& error, const char* str, size_t) { if(got_cell) { error=SQL_Error("result must contain no more than one row"); return true; } try { got_cell=true; result=new String(str, String::L_TAINTED /* no length as 0x00 can be inside */ ); return false; } catch(...) { error=SQL_Error("exception occurred in String_sql_event_handlers::add_row_cell"); return true; } } }; #endif extern int marshal_binds(HashStringValue& hash, SQL_Driver::Placeholder*& placeholders); extern void unmarshal_bind_updates(HashStringValue& hash, int placeholder_count, SQL_Driver::Placeholder* placeholders); const String* sql_result_string(Request& r, MethodParams& params, Value*& default_code) { Value& statement=params.as_junction(0, "statement must be code"); HashStringValue* bind=0; ulong limit=SQL_NO_LIMIT; ulong offset=0; default_code=0; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "sql options")) { int valid_options=0; if(Value* vbind=options->get(sql_bind_name)) { valid_options++; bind=vbind->get_hash(); } if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; limit=(ulong)r.process(*vlimit).as_double(); } if(Value* voffset=options->get(sql_offset_name)) { valid_options++; offset=(ulong)r.process(*voffset).as_double(); } if((default_code=options->get(sql_default_name))) { valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } SQL_Driver::Placeholder* placeholders=0; uint placeholders_count=0; if(bind) placeholders_count=marshal_binds(*bind, placeholders); const String& statement_string=r.process_to_string(statement); const char* statement_cstr=statement_string.untaint_cstr(String::L_SQL, r.connection()); String_sql_event_handlers handlers; r.connection()->query(statement_cstr, placeholders_count, placeholders, offset, limit, handlers, statement_string); if(bind) unmarshal_bind_updates(*bind, placeholders_count, placeholders); if(!handlers.got_cell) return 0; // no lines, caller should return second param[default value] return handlers.result; } static void _sql(Request& r, MethodParams& params) { Value* default_code; const String* string=sql_result_string(r, params, default_code); if(!string) { if(default_code) { string=&r.process_to_string(*default_code); } else throw Exception(PARSER_RUNTIME, 0, "produced no result, but no default option specified"); } r.write(*string); } static void _replace(Request& r, MethodParams& params) { const String& src=GET_SELF(r, VString).string(); if(params.count()==1) { // ^string.replace[table] if(Table* table=params.as_table(0, "param")){ Dictionary dict(*table); r.write(src.replace(dict)); } else r.write(src); } else { // ^string.replace[from-string;to-string] Dictionary dict(params.as_string(0, "from must be string"), params.as_string(1, "to must be string")); r.write(src.replace(dict)); } } static void _save(Request& r, MethodParams& params) { bool do_append=false; Charset* asked_charset=0; size_t file_name_index=0; if(params.count()>1) { if(HashStringValue* options=params.as_no_junction(1, "second parameter should be string or hash").get_hash()){ // ^file.save[filespec;$.charset[] $.append(true)] int valid_options=0; if(Value* vcharset_name=options->get(PA_CHARSET_NAME)){ asked_charset=&pa_charsets.get(vcharset_name->as_string()); valid_options++; } if(Value* vappend=options->get(MODE_APPEND)){ do_append=vappend->as_bool(); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } else { // ^file.save[append;filespec] const String& mode=params.as_string(0, "mode must be string"); if(mode==MODE_APPEND){ do_append=true; file_name_index++; } else throw Exception(PARSER_RUNTIME, &mode, "unknown mode, must be 'append'"); } } const String& file_name=params.as_file_name(file_name_index); const String& src=GET_SELF(r, VString).string(); String::Body sbody=src.cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets); // write file_write(r.charsets, r.full_disk_path(file_name), sbody.cstr(), sbody.length(), true, do_append, asked_charset); } static void _normalize(Request& r, MethodParams&) { const String& src=GET_SELF(r, VString).string(); r.write(src); } static void _trim(Request& r, MethodParams& params) { const String& src=GET_SELF(r, VString).string(); String::Trim_kind kind=String::TRIM_BOTH; size_t params_count=params.count(); const char* chars=0; if(params_count>0) { const String& skind=params.as_string(0, "'where' must be string"); if(!skind.is_empty()) { if(skind==TRIM_BOTH_OPTION) kind=String::TRIM_BOTH; else if(skind==TRIM_START_OPTION || skind=="start") kind=String::TRIM_START; else if(skind==TRIM_END_OPTION || skind=="end") kind=String::TRIM_END; else if(params_count==1) chars=skind.cstr(); else throw Exception(PARSER_RUNTIME, &skind, "'kind' must be one of " TRIM_START_OPTION ", " TRIM_BOTH_OPTION ", " TRIM_END_OPTION); } if(params_count>1) { const String& schars=params.as_string(1, "'chars' must be string"); if(!schars.is_empty()) chars=schars.cstr(); } } r.write(src.trim(kind, chars, &r.charsets.source())); } Base64Options base64_encode_options(Request& r, HashStringValue* options) { Base64Options result; if(options) { int valid_options=0; for(HashStringValue::Iterator i(*options); i; i.next()) { String::Body key=i.key(); Value* value=i.value(); if(key == "pad") { result.pad=r.process(*value).as_bool(); valid_options++; } else if(key == "wrap") { result.wrap=r.process(*value).as_bool(); valid_options++; } else if(key == "url-safe") { if(r.process(*value).as_bool()) result.set_url_safe_abc(); valid_options++; } } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } return result; } Base64Options base64_decode_options(Request& r, HashStringValue* options) { Base64Options result; if(options) { int valid_options=0; for(HashStringValue::Iterator i(*options); i; i.next() ) { String::Body key=i.key(); Value* value=i.value(); if(key == "pad") { result.pad=r.process(*value).as_bool(); valid_options++; } else if(key == "strict") { result.strict=r.process(*value).as_bool(); valid_options++; } else if(key == "url-safe") { if(r.process(*value).as_bool()) result.set_url_safe_abc(); valid_options++; } } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } return result; } static void _base64(Request& r, MethodParams& params) { if(&r.get_self() == string_class) { // decode: ^string:base64[encoded[;options]] const char* cstr=params.count() ? params.as_string(0, PARAMETER_MUST_BE_STRING).cstr() : ""; Base64Options options = base64_decode_options(r, params.count() > 1 ? params.as_hash(1) : NULL); char* decoded=0; size_t length=pa_base64_decode(cstr, strlen(cstr), decoded, options); if(decoded && length){ if(memchr(decoded, 0, length)) throw Exception(PARSER_RUNTIME, 0, "Invalid \\x00 character found while decoding to string. Decode to file instead."); fix_line_breaks(decoded, length); if(length) r.write(*new String(decoded, String::L_TAINTED)); } } else { // encode: ^str.base64[options] VString& self=GET_SELF(r, VString); const char* cstr=self.string().cstr(); Base64Options options = base64_encode_options(r, params.count() ? params.as_hash(0) : NULL); const char* encoded=pa_base64_encode(cstr, strlen(cstr), options); r.write(*new String(encoded, String::L_TAINTED /*once ?param=base64(something) was needed*/ )); } } static void _idna(Request& r, MethodParams& params) { if(&r.get_self() == string_class) { // decode: ^string:idna[encoded] const char* cstr=params.count() ? params.as_string(0, PARAMETER_MUST_BE_STRING).cstr() : ""; r.write(*new String(pa_idna_decode(cstr, r.charsets.source()), String::L_TAINTED)); } else { // encode: ^str.idna[] VString& self=GET_SELF(r, VString); const char* cstr=self.string().cstr(); r.write(*new String(pa_idna_encode(cstr, r.charsets.source()), String::L_TAINTED)); } } static void _js_escape(Request& r, MethodParams&){ const String& src=GET_SELF(r, VString).string(); r.write(src.escape(r.charsets.source())); } static void _js_unescape(Request& r, MethodParams& params){ const String& src=params.as_string(0, PARAMETER_MUST_BE_STRING); if(const char* result=unescape_chars(src.cstr(), src.length(), &r.charsets.source(), true)) r.write(*new String(result, String::L_TAINTED)); } static void _unescape(Request& r, MethodParams& params){ const String& mode=params.as_string(0, MODE_MUST_BE_STRING); const String& src=params.as_string(1, PARAMETER_MUST_BE_STRING); Charset* from_charset=&r.charsets.client(); if(params.count() > 2) if(HashStringValue* options=params.as_hash(2)) { int valid_options=0; if(Value* vcharset_name=options->get(PA_CHARSET_NAME)){ from_charset=&pa_charsets.get(vcharset_name->as_string()); valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } bool mode_js; if(mode==UNESCAPE_MODE_JS){ mode_js=true; } else if(mode==UNESCAPE_MODE_URI){ mode_js=false; } else { throw Exception(PARSER_RUNTIME, &mode, "is an invalid mode, must be either '" UNESCAPE_MODE_JS "' or '" UNESCAPE_MODE_URI "'"); } const char* unescaped=unescape_chars(src.cstr(), src.length(), from_charset, mode_js); if(*unescaped){ const String* result=new String(Charset::transcode(unescaped, *from_charset, r.charsets.source()), String::L_TAINTED); r.write(*result); } } static void _contains(Request& r, MethodParams& params) { // empty or whitespace string is hash compatible GET_SELF(r, VString).get_element(params.as_string(0, "key must be string")); // ignoring result as it allways null r.write(VBool::get(false)); } // constructor MString::MString(): Methoded("string") { // ^string.length[] add_native_method("length", Method::CT_DYNAMIC, _length, 0, 0); // ^string.int[] // ^string.int(default) add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1); // ^string.double[] // ^string.double(default) add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); // ^void.bool[] // ^void.bool(default) add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); // ^string.format[format] add_native_method("format", Method::CT_DYNAMIC, _string_format, 1, 1); // ^string.left(n) add_native_method("left", Method::CT_DYNAMIC, _left, 1, 1); // ^string.right(n) add_native_method("right", Method::CT_DYNAMIC, _right, 1, 1); // ^string.mid(p) // ^string.mid(p;n) add_native_method("mid", Method::CT_DYNAMIC, _mid, 1, 2); // ^string.pos[substr] // ^string.pos[substr](n) add_native_method("pos", Method::CT_DYNAMIC, _pos, 1, 2); // ^string.split[delim] // ^string.split[delim][options] // ^string.split[delim][options][column name] add_native_method("split", Method::CT_DYNAMIC, _split, 1, 3); // old names for backward compatibility // ^string.lsplit[delim] add_native_method("lsplit", Method::CT_DYNAMIC, _lsplit, 1, 1); // ^string.rsplit[delim] add_native_method("rsplit", Method::CT_DYNAMIC, _rsplit, 1, 1); // ^string.match[regexp][options] // ^string.match[regexp][options]{replacement-code} // ^string.match[regexp][options]{replacement-code}{code-if-nothing-is-found} add_native_method("match", Method::CT_DYNAMIC, _match, 1, 4); // ^string.upper[] add_native_method("upper", Method::CT_DYNAMIC, _upper, 0, 0); // ^string.lower[] add_native_method("lower", Method::CT_DYNAMIC, _lower, 0, 0); // ^string:sql{query} // ^string:sql{query}[options hash] add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); // ^string.replace[table] add_native_method("replace", Method::CT_DYNAMIC, _replace, 1, 2); // ^string.save[append][file] // ^string.save[file] // ^string.save[file][$.append(true) $.charset[...]] add_native_method("save", Method::CT_DYNAMIC, _save, 1, 2); // ^string.normalize[] add_native_method("normalize", Method::CT_DYNAMIC, _normalize, 0, 0); // ^string.trim[[start|both|end][;chars]] add_native_method("trim", Method::CT_DYNAMIC, _trim, 0, 2); // ^string.base64[] << encode // ^string:base64[encoded string] << decode add_native_method("base64", Method::CT_ANY, _base64, 0, 2); // ^string.idna[] << encode // ^string:idna[encoded string] << decode add_native_method("idna", Method::CT_ANY, _idna, 0, 1); // ^string.js-escape[] add_native_method("js-escape", Method::CT_DYNAMIC, _js_escape, 0, 0); // ^string:js-unescape[escaped%uXXXXstring] add_native_method("js-unescape", Method::CT_STATIC, _js_unescape, 1, 1); // ^string:unescape[js|uri;escaped;$.charset[...]] add_native_method("unescape", Method::CT_STATIC, _unescape, 2, 3); // ^string.contains[key] for hash compatibility add_native_method("contains", Method::CT_DYNAMIC, _contains, 1, 1); } parser-3.5.1/src/classes/xnode.h0000644000076400007640000000274314712042465013472 00000000000000/** @file Parser: @b dnode methods class - MDnode class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef XNODE_H #define XNODE_H #define IDENT_XNODE_H "$Id: xnode.h,v 1.37 2024/11/04 03:53:25 moko Exp $" class MXnode: public Methoded { public: // Value /// MXnode: +$const Value* get_element(const String& aname) { // $method if(Value* result=Methoded::get_element(aname)) return result; // $const if(Value* result=consts.get(aname)) return result; return 0; } public: // VStateless_class Value* create_new_value(Pool&) { throw Exception(PARSER_RUNTIME, 0, "no constructors available, use CreateXXX DOM methods to create nodes instead"); } public: MXnode(const char* aname=0); public: // Methoded bool used_directly() { return true; } private: HashStringValue consts; }; xmlNode& as_node(MethodParams& params, int index, const char* msg); xmlChar* as_xmlchar(Request& r, MethodParams& params, int index, const char* msg); xmlChar* as_xmlqname(Request& r, MethodParams& params, int index, const char* msg=0); xmlChar* as_xmlncname(Request& r, MethodParams& params, int index, const char* msg=0); xmlChar* as_xmlname(Request& r, MethodParams& params, int index, const char* msg=0); xmlChar* as_xmlnsuri(Request& r, MethodParams& params, int index); xmlNs& pa_xmlMapNs(xmlDoc& doc, const xmlChar* href, const xmlChar* prefix); #endif parser-3.5.1/src/classes/image.C0000644000076400007640000014277014726202557013404 00000000000000/** @file Parser: @b image parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ /* jpegsize: gets the width and height (in pixels) of a jpeg file Andrew Tong, werdna@ugcs.caltech.edu February 14, 1995 modified slightly by alex@ed.ac.uk and further still by rjray@uswest.com optimization and general re-write from tmetro@vl.com from perl by paf@design.ru */ #include "pa_config_includes.h" #include "gif.h" #include "pa_vmethod_frame.h" #include "pa_common.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_vimage.h" #include "pa_vdate.h" #include "pa_table.h" #include "pa_charsets.h" volatile const char * IDENT_IMAGE_C="$Id: image.C,v 1.195 2024/12/11 03:22:23 moko Exp $"; // defines static const String spacebar_width_name("space"); static const String monospace_width_name("width"); static const String letter_spacing_name("spacing"); // class class MImage: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VImage(); } public: MImage(); }; // globals DECLARE_CLASS_VAR(image, new MImage); // helpers #define EXIF_TAG(tag, name) put(tag, #name); /// value of exif tag -> it's value class EXIF_tag_value2name: public Hash { public: EXIF_tag_value2name() { // image JPEG Exif // Tags used by IFD0 (main image) EXIF_TAG(0x010e, ImageDescription); EXIF_TAG(0x010f, Make); EXIF_TAG(0x0110, Model); EXIF_TAG(0x0112, Orientation); EXIF_TAG(0x011a, XResolution); EXIF_TAG(0x011b, YResolution); EXIF_TAG(0x0128, ResolutionUnit); EXIF_TAG(0x0131, Software); EXIF_TAG(0x0132, DateTime); EXIF_TAG(0x013e, WhitePoint); EXIF_TAG(0x013f, PrimaryChromaticities); EXIF_TAG(0x0211, YCbCrCoefficients); EXIF_TAG(0x0213, YCbCrPositioning); EXIF_TAG(0x0214, ReferenceBlackWhite); EXIF_TAG(0x8298, Copyright); EXIF_TAG(0x8769, ExifOffset); // Tags used by Exif SubIFD EXIF_TAG(0x829a, ExposureTime); EXIF_TAG(0x829d, FNumber); EXIF_TAG(0x8822, ExposureProgram); EXIF_TAG(0x8827, ISOSpeedRatings); EXIF_TAG(0x9000, ExifVersion); EXIF_TAG(0x9003, DateTimeOriginal); EXIF_TAG(0x9004, DateTimeDigitized); EXIF_TAG(0x9101, ComponentsConfiguration); EXIF_TAG(0x9102, CompressedBitsPerPixel); EXIF_TAG(0x9201, ShutterSpeedValue); EXIF_TAG(0x9202, ApertureValue); EXIF_TAG(0x9203, BrightnessValue); EXIF_TAG(0x9204, ExposureBiasValue); EXIF_TAG(0x9205, MaxApertureValue); EXIF_TAG(0x9206, SubjectDistance); EXIF_TAG(0x9207, MeteringMode); EXIF_TAG(0x9208, LightSource); EXIF_TAG(0x9209, Flash); EXIF_TAG(0x920a, FocalLength); EXIF_TAG(0x927c, MakerNote); EXIF_TAG(0x9286, UserComment); EXIF_TAG(0x9290, SubsecTime); EXIF_TAG(0x9291, SubsecTimeOriginal); EXIF_TAG(0x9292, SubsecTimeDigitized); EXIF_TAG(0xa000, FlashPixVersion); EXIF_TAG(0xa001, ColorSpace); EXIF_TAG(0xa002, ExifImageWidth); EXIF_TAG(0xa003, ExifImageHeight); EXIF_TAG(0xa004, RelatedSoundFile); EXIF_TAG(0xa005, ExifInteroperabilityOffset); EXIF_TAG(0xa20e, FocalPlaneXResolution); EXIF_TAG(0xa20f, FocalPlaneYResolution); EXIF_TAG(0xa210, FocalPlaneResolutionUnit); EXIF_TAG(0xa215, ExposureIndex); EXIF_TAG(0xa217, SensingMethod); EXIF_TAG(0xa300, FileSource); EXIF_TAG(0xa301, SceneType); EXIF_TAG(0xa302, CFAPattern); // Misc Tags EXIF_TAG(0x00fe, NewSubfileType); EXIF_TAG(0x00ff, SubfileType); EXIF_TAG(0x012d, TransferFunction); EXIF_TAG(0x013b, Artist); EXIF_TAG(0x013d, Predictor); EXIF_TAG(0x0142, TileWidth); EXIF_TAG(0x0143, TileLength); EXIF_TAG(0x0144, TileOffsets); EXIF_TAG(0x0145, TileByteCounts); EXIF_TAG(0x014a, SubIFDs); EXIF_TAG(0x015b, JPEGTables); EXIF_TAG(0x828d, CFARepeatPatternDim); EXIF_TAG(0x828e, CFAPattern); EXIF_TAG(0x828f, BatteryLevel); EXIF_TAG(0x83bb, IPTC/NAA); EXIF_TAG(0x8773, InterColorProfile); EXIF_TAG(0x8824, SpectralSensitivity); //EXIF_TAG(0x8825, GPSInfo); EXIF_TAG(0x8828, OECF); EXIF_TAG(0x8829, Interlace); EXIF_TAG(0x882a, TimeZoneOffset); EXIF_TAG(0x882b, SelfTimerMode); EXIF_TAG(0x920b, FlashEnergy); EXIF_TAG(0x920c, SpatialFrequencyResponse); EXIF_TAG(0x920d, Noise); EXIF_TAG(0x9211, ImageNumber); EXIF_TAG(0x9212, SecurityClassification); EXIF_TAG(0x9213, ImageHistory); EXIF_TAG(0x9214, SubjectLocation); EXIF_TAG(0x9215, ExposureIndex); EXIF_TAG(0x9216, TIFF/EPStandardID); EXIF_TAG(0xa20b, FlashEnergy); EXIF_TAG(0xa20c, SpatialFrequencyResponse); EXIF_TAG(0xa214, SubjectLocation); // additional things added by misha@ EXIF_TAG(0x0100, ImageWidth); EXIF_TAG(0x0101, ImageLength); EXIF_TAG(0x0102, BitsPerSample); EXIF_TAG(0x0103, Compression); EXIF_TAG(0x0106, PhotometricInterpretation); EXIF_TAG(0x010a, FillOrder); EXIF_TAG(0x010d, DocumentName); EXIF_TAG(0x0111, StripOffsets); EXIF_TAG(0x0115, SamplesPerPixel); EXIF_TAG(0x0116, RowsPerStrip); EXIF_TAG(0x0117, StripByteCounts); EXIF_TAG(0x011c, PlanarConfiguration); EXIF_TAG(0x0156, TransferRange); EXIF_TAG(0x0200, JPEGProc); EXIF_TAG(0x0201, JPEGInterchangeFormat); EXIF_TAG(0x0202, JPEGInterchangeFormatLength); EXIF_TAG(0x0212, YCbCrSubSampling); EXIF_TAG(0xa401, CustomRendered); EXIF_TAG(0xa402, ExposureMode); EXIF_TAG(0xa403, WhiteBalance); EXIF_TAG(0xa404, DigitalZoomRatio); EXIF_TAG(0xa405, FocalLengthIn35mmFilm); EXIF_TAG(0xa406, SceneCaptureType); EXIF_TAG(0xa407, GainControl); EXIF_TAG(0xa408, Contrast); EXIF_TAG(0xa409, Saturation); EXIF_TAG(0xa40a, Sharpness); EXIF_TAG(0xa40b, DeviceSettingDescription); EXIF_TAG(0xa40c, SubjectDistanceRange); EXIF_TAG(0xa420, ImageUniqueID); // other tags EXIF_TAG(0xa430, CameraOwnerName); EXIF_TAG(0xa431, BodySerialNumber); EXIF_TAG(0xa432, LensSpecification); EXIF_TAG(0xa433, LensManufactor); EXIF_TAG(0xa434, LensModel); EXIF_TAG(0xa435, LensSerialNumber); } static EXIF_tag_value2name &instance(){ static EXIF_tag_value2name *singleton=NULL; if(!singleton) singleton=new EXIF_tag_value2name; return *singleton; } }; class EXIF_gps_tag_value2name: public Hash { public: EXIF_gps_tag_value2name() { EXIF_TAG(0x0, GPSVersionID); EXIF_TAG(0x1, GPSLatitudeRef); EXIF_TAG(0x2, GPSLatitude); EXIF_TAG(0x3, GPSLongitudeRef); EXIF_TAG(0x4, GPSLongitude); EXIF_TAG(0x5, GPSAltitudeRef); EXIF_TAG(0x6, GPSAltitude); EXIF_TAG(0x7, GPSTimeStamp); EXIF_TAG(0x8, GPSSatellites); EXIF_TAG(0x9, GPSStatus); EXIF_TAG(0xA, GPSMeasureMode); EXIF_TAG(0xB, GPSDOP); EXIF_TAG(0xC, GPSSpeedRef); EXIF_TAG(0xD, GPSSpeed); EXIF_TAG(0xE, GPSTrackRef); EXIF_TAG(0xF, GPSTrack); EXIF_TAG(0x10, GPSImgDirectionRef); EXIF_TAG(0x11, GPSImgDirection); EXIF_TAG(0x12, GPSMapDatum); EXIF_TAG(0x13, GPSDestLatitudeRef); EXIF_TAG(0x14, GPSDestLatitude); EXIF_TAG(0x15, GPSDestLongitudeRef); EXIF_TAG(0x16, GPSDestLongitude); EXIF_TAG(0x17, GPSDestBearingRef); EXIF_TAG(0x18, GPSDestBearing); EXIF_TAG(0x19, GPSDestDistanceRef); EXIF_TAG(0x1A, GPSDestDistance); EXIF_TAG(0x1B, GPSProcessingMethod); EXIF_TAG(0x1C, GPSAreaInformation); EXIF_TAG(0x1D, GPSDateStamp); EXIF_TAG(0x1E, GPSDifferential); } static EXIF_gps_tag_value2name &instance(){ static EXIF_gps_tag_value2name *singleton=NULL; if(!singleton) singleton=new EXIF_gps_tag_value2name; return *singleton; } }; ///*********************************************** support functions class Measure_reader { public: virtual size_t read(const char* &buf, size_t limit)=0; virtual void seek(uint64_t value)=0; virtual uint64_t tell()=0; virtual uint64_t length()=0; }; class Measure_file_reader: public Measure_reader { const String& file_name; int f; public: Measure_file_reader(int af, const String& afile_name): file_name(afile_name), f(af) { } override size_t read(const char* &abuf, size_t limit) { if(limit==0) return 0; char* lbuf=new(PointerFreeGC) char[limit]; ssize_t read_size=::read(f, lbuf, limit); abuf=lbuf; if(read_size<0) throw Exception(0, &file_name, "measure read failed: %s (%d)", strerror(errno), errno); return read_size; } override void seek(uint64_t value) { if(pa_lseek(f, value, SEEK_SET)<0) throw Exception(IMAGE_FORMAT, &file_name, "seek to %.15g failed: %s (%d)", (double)value, strerror(errno), errno); } override uint64_t tell() { return pa_lseek(f, 0, SEEK_CUR); } override uint64_t length() { return pa_lseek(f, 0, SEEK_END); } }; class Measure_buf_reader: public Measure_reader { const char* buf; size_t size; const String& file_name; size_t offset; public: Measure_buf_reader(const char* abuf, size_t asize, const String& afile_name): buf(abuf), size(asize), file_name(afile_name), offset(0) { } override size_t read(const char* &abuf, size_t limit) { size_t to_read=min(limit, size-offset); abuf=buf+offset; offset+=to_read; return to_read; } override void seek(uint64_t value) { if(value>(uint64_t)size) throw Exception(IMAGE_FORMAT, &file_name, "seek to %.15g failed: out of buffer (%.15g)", value, size); offset=(size_t)value; } override uint64_t tell() { return offset; } override uint64_t length() { return size; } }; struct Measure_info { ushort width; ushort height; Value** exif; Value** xmp; Charset* xmp_charset; bool video; }; inline ushort x_endian_to_ushort(uchar b0, uchar b1) { return (ushort)((b1<<8) + b0); } inline uint x_endian_to_uint(uchar b0, uchar b1, uchar b2, uchar b3) { return (uint)(((((b3<<8) + b2)<<8)+b1)<<8)+b0; } inline ushort endian_to_ushort(bool is_big, const uchar *b/* [2] */) { return is_big ? x_endian_to_ushort(b[1], b[0]) : x_endian_to_ushort(b[0], b[1]); } inline uint endian_to_uint(bool is_big, const uchar *b /* [4] */) { return is_big ? x_endian_to_uint(b[3], b[2], b[1], b[0]) : x_endian_to_uint(b[0], b[1], b[2], b[3]); } ///*********************************************** JPEG struct JPG_Segment_head { uchar marker; uchar code; uchar length[2]; }; /// JPEG frame header struct JPG_Size_segment_body { char data; //< data precision of bits/sample uchar height[2]; //< image height uchar width[2]; //< image width char numComponents; //< number of color components }; /// JPEG Exif TIFF Header struct JPG_Exif_TIFF_header { char byte_align_identifier[2]; uchar signature[2]; // always 000A [or 0A00] uchar first_IFD_offset[4]; // Usually the first IFD starts immediately next to TIFF header, so this offset has value '0x00000008'. }; // JPEG Exif IFD start struct JPG_Exif_IFD_begin { uchar directory_entry_count[2]; // the number of directory entry contains in this IFD }; // TTTT ffff NNNNNNNN DDDDDDDD struct JPG_Exif_IFD_entry { uchar tag[2]; // Tag number, this shows a kind of data uchar format[2]; // data format uchar components_count[4]; // number of components uchar value_or_offset_to_it[4]; // data value or offset to data value }; #define JPG_IFD_TAG_EXIF_OFFSET 0x8769 #define JPG_IFD_TAG_EXIF_GPS_OFFSET 0x8825 #define JPEG_EXIF_DATE_CHARS 20 static Value* parse_IFD_entry_formatted_one_value(bool is_big, ushort format, size_t component_size, const uchar *value) { switch(format) { case 1: // unsigned byte return new VInt((uchar)value[0]); case 3: // unsigned short return new VInt(endian_to_ushort(is_big, value)); case 4: // unsigned long // 'double' because parser's Int is signed return new VDouble(endian_to_uint(is_big, value)); case 5: // unsigned rational { uint numerator=endian_to_uint(is_big, value); value+=component_size/2; uint denominator=endian_to_uint(is_big, value); if(!denominator) return 0; return new VDouble(((double)numerator)/denominator); } case 6: // signed byte return new VInt((signed char)value[0]); case 8: // signed short return new VInt((signed short)endian_to_ushort(is_big, value)); case 9: // signed long return new VInt((signed int)endian_to_uint(is_big, value)); case 10: // signed rational { signed int numerator=(signed int)endian_to_uint(is_big, value); value+=component_size/2; uint denominator=endian_to_uint(is_big, value); if(!denominator) return 0; return new VDouble(numerator/denominator); } /* case 11: // single float @todo case 12: // double float @todo */ }; return 0; } // date.C tm cstr_to_time_t(char *, const char **); static Value* parse_IFD_entry_formatted_value(bool is_big, ushort format, size_t component_size, uint components_count, const uchar *value) { if(format==2) { // ascii string, exception: the only type with varying size const char* cstr=(const char* )value; size_t length=components_count; // Data format is "YYYY:MM:DD HH:MM:SS"+0x00, total 20bytes if(length==JPEG_EXIF_DATE_CHARS && isdigit((unsigned char)cstr[0]) && cstr[length-1]==0) { try { tm tmIn=cstr_to_time_t(pa_strdup(cstr), 0); return new VDate(tmIn); } catch(...) { /*ignore bad date times*/ } } return new VString(*new String(cstr, String::L_TAINTED)); } if(components_count==1) return parse_IFD_entry_formatted_one_value(is_big, format, component_size, value); VHash* result=new VHash; HashStringValue& hash=result->hash(); for(uint i=0; i=sizeof(format2component_size)/sizeof(format2component_size[0])) return 0; // format out of range, ignoring size_t component_size=format2component_size[format]; if(component_size==0) return 0; // undefined format // You can get the total data byte length by multiplies // a 'bytes/components' value (see above chart) by number of components stored 'NNNNNNNN' area uint components_count=endian_to_uint(is_big, entry.components_count); uint value_size=component_size*components_count; // If its size is over 4bytes, 'DDDDDDDD' contains the offset to data stored address Value* result; if(value_size<=4) result=parse_IFD_entry_formatted_value(is_big, format, component_size, components_count, entry.value_or_offset_to_it); else { uint64_t remembered=reader.tell(); { reader.seek(tiff_base+endian_to_uint(is_big, entry.value_or_offset_to_it)); const char* value; if(reader.read(value, value_size)directory_entry_count); for(int i=0; ibyte_align_identifier[0]=='M'; // [M]otorola vs [I]ntel uint first_IFD_offset=endian_to_uint(is_big, head->first_IFD_offset); reader.seek(tiff_base+first_IFD_offset); VHash* vhash=new VHash; // IFD parse_IFD(vhash->hash(), is_big, reader, tiff_base); return vhash; } static Value* parse_xmp(Measure_reader& reader, ushort xmp_length, Measure_info &info) { const char* buf; if(reader.read(buf, xmp_length)marker!=MARKER) throw Exception(IMAGE_FORMAT, &origin_string, "not JPEG file - marker not found"); ushort segment_length=endian_to_ushort(true, head->length); switch(head->code) { // http://dev.exiv2.org/projects/exiv2/wiki/The_Metadata_in_JPEG_files case CODE_APP1: { const size_t EXIF_SIG_LEN=6; // Exif\0\0 const size_t XMP_SIG_LEN=29; // http://ns.adobe.com/xap/1.0/\0 if(segment_lengthwidth); info.height=endian_to_ushort(true, body->height); } return; }; reader.seek(segment_base + segment_length); } throw Exception(IMAGE_FORMAT, &origin_string, "broken JPEG file - size frame not found"); } ///*********************************************** TIFF static bool parse_tiff_IFD(bool is_big, Measure_reader& reader, Measure_info &info) { const char* buf; if(reader.read(buf, sizeof(JPG_Exif_IFD_begin))directory_entry_count); for(int i=0; itag); if(entry_tag == 256 || entry_tag == 257){ ushort entry_format=endian_to_ushort(is_big, entry->format); if(entry_format != 3 && entry_format != 4 || endian_to_uint(is_big, entry->components_count) != 1) return false; uint value = (entry_format == 3) ? endian_to_ushort(is_big, entry->value_or_offset_to_it) : endian_to_uint(is_big, entry->value_or_offset_to_it); (entry_tag == 256) ? info.width=(short)value : info.height=(short)value; if(info.width && info.height) return true; } } return false; // then goes: LLLLLLLL Offset to next IFD [not going there] } static void measure_tiff(const String& origin_string, Measure_reader& reader, Measure_info &info) { const char* buf; if(reader.read(buf, sizeof(JPG_Exif_TIFF_header))byte_align_identifier, "II", 2)!=0 && strncmp(head->byte_align_identifier, "MM", 2)!=0) throw Exception(IMAGE_FORMAT, &origin_string, "not TIFF file - wrong signature"); bool is_big=head->byte_align_identifier[0]=='M'; // [M]otorola vs [I]ntel if(endian_to_ushort(is_big, head->signature) != 42) throw Exception(IMAGE_FORMAT, &origin_string, "not TIFF file - wrong signature"); reader.seek(endian_to_uint(is_big, head->first_IFD_offset)); if(!parse_tiff_IFD(is_big, reader, info)) throw Exception(IMAGE_FORMAT, &origin_string, "broken TIFF file - size field entry not found"); } ///*********************************************** GIF struct GIF_Header { char signature[3]; // 'GIF' char version[3]; uchar width[2]; uchar height[2]; char dif; char fonColor; char nulls; }; static void measure_gif(const String& origin_string, Measure_reader& reader, ushort& width, ushort& height) { const char* buf; const size_t head_size=sizeof(GIF_Header); if(reader.read(buf, head_size)signature, "GIF", 3)!=0) throw Exception(IMAGE_FORMAT, &origin_string, "not GIF file - wrong signature"); width=endian_to_ushort(false, head->width); height=endian_to_ushort(false, head->height); } ///*********************************************** PNG struct PNG_Header { char dummy[12]; char signature[4]; //< must be "IHDR" uchar high_width[2]; //< image width high bytes [we ignore for now] uchar width[2]; //< image width low bytes uchar high_height[2]; //< image height high bytes [we ignore for now] uchar height[4]; //< image height }; static void measure_png(const String& origin_string, Measure_reader& reader, ushort& width, ushort& height) { const char* buf; const size_t head_size=sizeof(PNG_Header); if(reader.read(buf, head_size)signature, "IHDR", 4)!=0) throw Exception(IMAGE_FORMAT, &origin_string, "not PNG file - wrong signature"); width=endian_to_ushort(true, head->width); height=endian_to_ushort(true, head->height); } ///*********************************************** BMP struct BMP_Header { char signature[2]; // 'BM' uchar file_size[4]; uchar reserved[4]; uchar bitmap_offset[4]; uchar header_size[4]; uchar width[2]; uchar high_width[2]; //< image width high bytes [we ignore for now] uchar height[2]; uchar high_height[2]; //< image height high bytes [we ignore for now] }; static void measure_bmp(const String& origin_string, Measure_reader& reader, ushort& width, ushort& height) { const char* buf; const size_t head_size=sizeof(BMP_Header); if(reader.read(buf, head_size)signature, "BM", 2)!=0) throw Exception(IMAGE_FORMAT, &origin_string, "not BMP file - wrong signature"); if((uint)reader.length() != endian_to_uint(false, head->file_size)) throw Exception(IMAGE_FORMAT, &origin_string, "not BMP file - length header and file size do not match"); width=endian_to_ushort(false, head->width); height=endian_to_ushort(false, head->height); } ///*********************************************** WEBP struct WEBP_Header { char signature_riff[4]; // 'RIFF' uchar file_size[4]; char signature[4]; // 'WEBP' char format[4]; // 'VP8 ' or 'VP8L' or 'VP8X' }; struct WEBP_VP8_Chunk { uchar size[4]; char tag[3]; uchar signature[3]; // 0x9D 0x01 0x2A uchar width[2]; // 14 bits each uchar height[2]; // 14 bits each }; struct WEBP_VP8L_Chunk { uchar size[4]; char signature; // 0x2F uchar width_height[4]; // 14 bits each }; struct WEBP_X_Chunk { uchar size[4]; char reserved[4]; uchar width[3]; uchar height[3]; }; static void measure_webp(const String& origin_string, Measure_reader& reader, ushort& width, ushort& height) { const char* buf; if(reader.read(buf, sizeof(WEBP_Header))signature_riff, "RIFF", 4)!=0 || strncmp(head->signature, "WEBP", 4)!=0) throw Exception(IMAGE_FORMAT, &origin_string, "not WEBP file - wrong signature"); if(strncmp(head->format, "VP8 ", 4)==0){ if(reader.read(buf, sizeof(WEBP_VP8_Chunk))signature[0] != 0x9D || chunk->signature[1] != 0x01 || chunk->signature[2] != 0x2A) throw Exception(IMAGE_FORMAT, &origin_string, "broken WEBP file - wrong VP8 chunk signature"); width=endian_to_ushort(false, chunk->width) & 0x3FFF; height=endian_to_ushort(false, chunk->height) & 0x3FFF; } else if(strncmp(head->format, "VP8L", 4)==0){ if(reader.read(buf, sizeof(WEBP_VP8L_Chunk))signature != 0x2F) throw Exception(IMAGE_FORMAT, &origin_string, "broken WEBP file - wrong VP8L chunk signature"); uint wh=endian_to_uint(false, chunk->width_height); width=(wh & 0x3FFF) + 1; height=((wh >> 14) & 0x3FFF) + 1; } else if (strncmp(head->format, "VP8X", 4)==0){ if(reader.read(buf, sizeof(WEBP_X_Chunk))width) + 1; // we ignore third byte to simplify code height=endian_to_ushort(false, chunk->height) + 1; // we ignore third byte to simplify code } else throw Exception(IMAGE_FORMAT, &origin_string, "broken WEBP file - invalid chunk signature"); } ///*********************************************** MP4 struct MP4_Header { uchar size[4]; char signature[4]; // 'ftyp' in first chunk }; struct MP4_ExtSize { uchar high[4]; uchar low[4]; }; struct MP4_Tkhd { uchar width[4]; uchar height[4]; }; static bool measure_mp4(const String& origin_string, Measure_reader& reader, ushort& width, ushort& height, uint64_t anext, const char* lastTkhd=NULL) { for(bool first=anext==0;;){ const char* buf; uint64_t next=reader.tell(); if(reader.read(buf, sizeof(MP4_Header))size); if(size==1){ if(reader.read(buf, sizeof(MP4_ExtSize))high) << 32) + endian_to_uint(true, ext_size->low); } next+=size; if(first){ if(strncmp(head->signature, "ftyp", 4)!=0) throw Exception(IMAGE_FORMAT, &origin_string, "not MP4 file - wrong signature"); first=false; anext=reader.length(); // to avoid reading beyond EOF } else if(strncmp(head->signature, "moov", 4)==0 || strncmp(head->signature, "mdia", 4)==0 || strncmp(head->signature, "trak", 4)==0) { if(measure_mp4(origin_string, reader, width, height, next, lastTkhd)) return true; } else if(strncmp(head->signature, "tkhd", 4)==0) { if(size>8){ reader.seek(next-8); if(reader.read(lastTkhd, sizeof(MP4_Tkhd))signature, "hdlr", 4)==0) { if(size>12){ const char* hdlr; if(reader.read(hdlr, 12)<12) throw Exception(IMAGE_FORMAT, &origin_string, "broken MP4 file - bad hdlr chunk"); if(lastTkhd && strncmp(hdlr+8, "vide", 4)==0) { MP4_Tkhd *tkhd=(MP4_Tkhd *)lastTkhd; width=endian_to_ushort(true, tkhd->width); height=endian_to_ushort(true, tkhd->height); return true; } } } if(anext && next>=anext) break; reader.seek(next); } return false; } static void measure_mp4(const String& origin_string, Measure_reader& reader, ushort& width, ushort& height) { if(!measure_mp4(origin_string, reader, width, height, 0)) throw Exception(IMAGE_FORMAT, &origin_string, "unsupported MP4 file - size not found"); } ///*********************************************** measure center static void measure(const String& file_name, Measure_reader& reader, Measure_info &info) { const char* file_name_cstr=file_name.taint_cstr(String::L_FILE_SPEC); if(const char* cext=strrchr(file_name_cstr, '.')) { cext++; if(strcasecmp(cext, "GIF")==0) measure_gif(file_name, reader, info.width, info.height); else if(strcasecmp(cext, "JPG")==0 || strcasecmp(cext, "JPEG")==0) measure_jpeg(file_name, reader, info); else if(strcasecmp(cext, "PNG")==0) measure_png(file_name, reader, info.width, info.height); else if(strcasecmp(cext, "BMP")==0) measure_bmp(file_name, reader, info.width, info.height); else if(strcasecmp(cext, "WEBP")==0) measure_webp(file_name, reader, info.width, info.height); else if(strcasecmp(cext, "TIF")==0 || strcasecmp(cext, "TIFF")==0) measure_tiff(file_name, reader, info); else if(strcasecmp(cext, "MP4")==0 || strcasecmp(cext, "MOV")==0) if(info.video) measure_mp4(file_name, reader, info.width, info.height); else throw Exception(IMAGE_FORMAT, &file_name, "handling disabled for file name extension '%s'", cext); else throw Exception(IMAGE_FORMAT, &file_name, "unhandled file name extension '%s'", cext); } else throw Exception(IMAGE_FORMAT, &file_name, "cannot determine file type - no file name extension"); } // methods static void file_measure_action(struct stat& /*finfo*/, int f, const String& file_spec, void *context) { Measure_file_reader reader(f, file_spec); measure(file_spec, reader, *static_cast(context)); } static void _measure(Request& r, MethodParams& params) { Value& data=params.as_no_junction(0, "data must not be code"); Value* exif=0; Value* xmp=0; Measure_info info={ 0, 0, 0, 0, &pa_UTF8_charset, false }; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "methods options")) { int valid_options=0; for(HashStringValue::Iterator i(*options); i; i.next() ){ String::Body key=i.key(); Value* value=i.value(); if(key == "exif") { if(r.process(*value).as_bool()) info.exif=&exif; valid_options++; } if(key == "xmp") { if(r.process(*value).as_bool()) info.xmp=&xmp; valid_options++; } if(key == "xmp-charset") { info.xmp_charset=&pa_charsets.get(value->as_string()); valid_options++; } if(key == "video") { info.video=r.process(*value).as_bool(); valid_options++; } } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } const String* file_name; if(file_name=data.get_string()) { file_read_action_under_lock(r.full_disk_path(*file_name), "measure", file_measure_action, &info); } else { VFile* vfile=data.as_vfile(); file_name=&vfile->fields().get(name_name)->as_string(); Measure_buf_reader reader(vfile->value_ptr(), vfile->value_size(), *file_name); measure(*file_name, reader, info); } GET_SELF(r, VImage).set(file_name, info.width, info.height, 0, exif, xmp); } static void append_attrib_pair(String &tag, String::Body key, Value* value){ // skip border attribute with empty value if(key=="border" && !value->is_defined()) return; // src="a.gif" width="123" ismap[=-1] tag << " " << key; if(value->is_string() || value->as_int()>=0) tag << "=\"" << value->as_string() << "\""; } static void _html(Request& r, MethodParams& params) { String tag; tag << "get(key)) continue; // allow only html attributes (to exclude exif, line-*) if(key=="src" || key=="width" || key=="height" || key=="border") append_attrib_pair(tag, key, i.value()); } tag << " />"; r.write(tag); } /// @test wrap FILE to auto-object static gdImage* load(Request& r, const String& file_name){ const char* file_name_cstr=r.full_disk_path(file_name).taint_cstr(String::L_FILE_SPEC); if(FILE *f=pa_fopen(file_name_cstr, "rb")) { gdImage* image=new gdImage; bool ok=image->CreateFromGif(f); fclose(f); if(!ok) throw Exception(IMAGE_FORMAT, &file_name, "is not in GIF format"); return image; } else { throw Exception("file.missing", 0, "cannot open '%s'", file_name_cstr); } } static void _load(Request& r, MethodParams& params) { const String& file_name=params.as_file_name(0); gdImage* image=load(r, file_name); GET_SELF(r, VImage).set(&file_name, image->SX(), image->SY(), image); } static void _create(Request& r, MethodParams& params) { int width=params.as_int(0, "width must be int", r); int height=params.as_int(1, "height must be int", r); int bgcolor_value=0xffFFff; if(params.count()>2) bgcolor_value=params.as_int(2, "color must be int", r); gdImage* image=new gdImage; image->Create(width, height); image->FilledRectangle(0, 0, width-1, height-1, image->Color(bgcolor_value)); GET_SELF(r, VImage).set(0, width, height, image); } static void _gif(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); const String *file_name=params.count()>0?¶ms.as_string(0, FILE_NAME_MUST_BE_STRING):0; gdBuf buf=image.Gif(); VFile& vfile=*new VFile; vfile.set_binary(false/*not tainted*/, (const char *)buf.ptr, buf.size, file_name, new VString(*new String("image/gif"))); r.write(vfile); } static void _line(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.Line( params.as_int(0, "x0 must be int", r), params.as_int(1, "y0 must be int", r), params.as_int(2, "x1 must be int", r), params.as_int(3, "y1 must be int", r), image.Color(params.as_int(4, "color must be int", r))); } static void _fill(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.Fill( params.as_int(0, "x must be int", r), params.as_int(1, "y must be int", r), image.Color(params.as_int(2, "color must be int", r))); } static void _rectangle(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.Rectangle( params.as_int(0, "x0 must be int", r), params.as_int(1, "y0 must be int", r), params.as_int(2, "x1 must be int", r), params.as_int(3, "y1 must be int", r), image.Color(params.as_int(4, "color must be int", r))); } static void _bar(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.FilledRectangle( params.as_int(0, "x0 must be int", r), params.as_int(1, "y0 must be int", r), params.as_int(2, "x1 must be int", r), params.as_int(3, "y1 must be int", r), image.Color(params.as_int(4, "color must be int", r))); } #ifndef DOXYGEN static void add_point(Table::element_type row, gdImage::Point **p) { if(row->count()!=2) throw Exception(0, 0, "coordinates table must contain two columns: x and y values"); (**p).x=row->get(0)->as_int(); (**p).y=row->get(1)->as_int(); (*p)++; } #endif #ifndef DOXYGEN static void add_point(int x, int y, gdImage::Point **p) { (**p).x=x; (**p).y=y; (*p)++; } #endif static void _replace(Request& r, MethodParams& params) { int src_color=params.as_int(0, "src color must be int", r); int dest_color=params.as_int(1, "dest color must be int", r); gdImage& image=GET_SELF(r, VImage).image(); gdImage::Point* all_p=0; size_t count=0; if(params.count() == 3){ if(Table* table=params.as_table(2, "coordinates")){ count=table->count(); all_p=new(PointerFreeGC) gdImage::Point[count]; gdImage::Point* add_p=all_p; table->for_each(add_point, &add_p); } } else { int max_x=image.SX()-1; int max_y=image.SY()-1; if(max_x > 0 && max_y > 0){ count=4; all_p=new(PointerFreeGC) gdImage::Point[count]; gdImage::Point* add_p=all_p; add_point(0, 0, &add_p); add_point(max_x, 0, &add_p); add_point(max_x, max_y, &add_p); add_point(0, max_y, &add_p); } } if(count) image.FilledPolygonReplaceColor(all_p, count, image.Color(src_color), image.Color(dest_color)); } static void _polyline(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); if(Table* table=params.as_table(1, "coordinates")){ gdImage::Point* all_p=new(PointerFreeGC) gdImage::Point[table->count()]; gdImage::Point *add_p=all_p; table->for_each(add_point, &add_p); image.Polygon(all_p, table->count(), image.Color(params.as_int(0, "color must be int", r)), false/*not closed*/); } } static void _polygon(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); if(Table* table=(Table*)params.as_table(1, "coordinates")){ gdImage::Point* all_p=new(PointerFreeGC) gdImage::Point[table->count()]; gdImage::Point *add_p=all_p; table->for_each(add_point, &add_p); image.Polygon(all_p, table->count(), image.Color(params.as_int(0, "color must be int", r))); } } static void _polybar(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); if(Table* table=(Table*)params.as_table(1, "coordinates")){ gdImage::Point* all_p=new(PointerFreeGC) gdImage::Point[table->count()]; gdImage::Point *add_p=all_p; table->for_each(add_point, &add_p); image.FilledPolygon(all_p, table->count(), image.Color(params.as_int(0, "color must be int", r))); } } // font #define Y(y)(y+index*height) // Font class Font::Font(Charset& asource_charset, const String& aalphabet, gdImage* aifont, int aheight, int amonospace, int aspacebarspace, int aletterspacing): letterspacing(aletterspacing), height(aheight), monospace(amonospace), spacebarspace(aspacebarspace), ifont(aifont), alphabet(aalphabet), fsource_charset(asource_charset){ if(fsource_charset.isUTF8()){ size_t index=0; for(UTF8_string_iterator i(alphabet); i.has_next(); ) fletter2index.put_dont_replace(i.next(), index++); } } /* ******************************** char ********************************** */ size_t Font::index_of(char ch) { if(ch==' ') return STRING_NOT_FOUND; return alphabet.pos(ch); } size_t Font::index_of(XMLCh ch) { if(ch==' ') return STRING_NOT_FOUND; return fletter2index.get(ch); } int Font::index_width(size_t index) { if(index==STRING_NOT_FOUND) return spacebarspace; int tr=ifont->GetTransparent(); for(int x=ifont->SX()-1; x>=0; x--) { for(int y=0; yGetPixel(x, Y(y))!=tr) return x+1; } return 0; } void Font::index_display(gdImage& image, int x, int y, size_t index){ if(index!=STRING_NOT_FOUND) ifont->Copy(image, x, y, 0, Y(0), index_width(index), height); } /* ******************************** string ********************************** */ int Font::step_width(int index) { return letterspacing + (monospace ? monospace : index_width(index)); } // counts trailing letter_spacing, consider this OK. useful for contiuations int Font::string_width(const String& s){ const char* cstr=s.cstr(); int result=0; if(fsource_charset.isUTF8()){ for(UTF8_string_iterator i(s); i.has_next(); ) result+=step_width(index_of(i.next())); } else { for(const char* current=cstr; *current; current++) result+=step_width(index_of(*current)); } return result; } void Font::string_display(gdImage& image, int x, int y, const String& s){ const char* cstr=s.cstr(); if(fsource_charset.isUTF8()){ for(UTF8_string_iterator i(s); i.has_next(); ){ size_t index=index_of(i.next()); index_display(image, x, y, index); x+=step_width(index); } } else { for(const char* current=cstr; *current; current++) { size_t index=index_of(*current); index_display(image, x, y, index); x+=step_width(index); } } } // static void _font(Request& r, MethodParams& params) { const String& alphabet=params.as_string(0, "alphabet must be string"); size_t alphabet_length=alphabet.length(r.charsets.source()); if(!alphabet_length) throw Exception(PARSER_RUNTIME, 0, "alphabet must not be empty"); gdImage* image=load(r, params.as_file_name(1)); int spacebar_width=image->SX(); int monospace_width=0; // proportional int letter_spacing=1; if(params.count()>2){ if(HashStringValue* options=params[2].get_hash()){ // third option is hash if(params.count()>3) throw Exception(PARSER_RUNTIME, 0, "too many params were specified"); int valid_options=0; if(Value* vspacebar_width=options->get(spacebar_width_name)){ valid_options++; spacebar_width=r.process(*vspacebar_width).as_int(); } if(Value* vmonospace_width=options->get(monospace_width_name)){ valid_options++; monospace_width=r.process(*vmonospace_width).as_int(); if(!monospace_width) monospace_width=image->SX(); } if(Value* vletter_spacing=options->get(letter_spacing_name)){ valid_options++; letter_spacing=r.process(*vletter_spacing).as_int(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } else { // backward spacebar_width=params.as_int(2, "param must be int or hash", r); if(params.count()>3) { monospace_width=params.as_int(3, "monospace_width must be int", r); if(!monospace_width) monospace_width=image->SX(); } } } if(int remainder=image->SY() % alphabet_length) throw Exception(PARSER_RUNTIME, 0, "font-file height(%d) not divisable by alphabet size(%d), remainder=%d", image->SY(), alphabet_length, remainder); GET_SELF(r, VImage).set_font(new Font(r.charsets.source(), alphabet, image, image->SY() / alphabet_length, monospace_width, spacebar_width, letter_spacing)); } static void _text(Request& r, MethodParams& params) { int x=params.as_int(0, "x must be int", r); int y=params.as_int(1, "y must be int", r); const String& s=params.as_string(2, "text must be string"); VImage& vimage=GET_SELF(r, VImage); vimage.font().string_display(vimage.image(), x, y, s); } static void _length(Request& r, MethodParams& params) { const String& s=params.as_string(0, "text must be string"); VImage& vimage=GET_SELF(r, VImage); r.write(*new VInt(vimage.font().string_width(s))); } static void _arc(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.Arc( params.as_int(0, "center_x must be int", r), params.as_int(1, "center_y must be int", r), params.as_int(2, "width must be int", r), params.as_int(3, "height must be int", r), params.as_int(4, "start degrees must be int", r), params.as_int(5, "end degrees must be int", r), image.Color(params.as_int(6, "cx must be int", r))); } static void _sector(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); image.Sector( params.as_int(0, "center_x must be int", r), params.as_int(1, "center_y must be int", r), params.as_int(2, "width must be int", r), params.as_int(3, "height must be int", r), params.as_int(4, "start degrees must be int", r), params.as_int(5, "end degrees must be int", r), image.Color(params.as_int(6, "color must be int", r))); } static void _circle(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); int size=params.as_int(2, "radius must be int", r)*2; image.Arc( params.as_int(0, "center_x must be int", r), params.as_int(1, "center_y must be int", r), size, //w size, //h 0, //s 360, //e image.Color(params.as_int(3, "color must be int", r))); } gdImage& as_image(MethodParams& params, int index, const char* msg) { Value& value=params.as_no_junction(index, msg); if(VImage* vimage=dynamic_cast(&value)) { return vimage->image(); } else throw Exception(PARSER_RUNTIME, 0, msg); } static void _copy(Request& r, MethodParams& params) { gdImage& dest=GET_SELF(r, VImage).image(); gdImage& src=as_image(params, 0, "src must be image"); int sx=params.as_int(1, "src_x must be int", r); int sy=params.as_int(2, "src_y must be int", r); int sw=params.as_int(3, "src_w must be int", r); int sh=params.as_int(4, "src_h must be int", r); int dx=params.as_int(5, "dest_x must be int", r); int dy=params.as_int(6, "dest_y must be int", r); if(params.count()>1+2+2+2) { int dw=params.as_int(1+2+2+2, "dest_w must be int", r); int dh=(int)(params.count()>1+2+2+2+1? params.as_int(1+2+2+2+1, "dest_h must be int", r):sh*(((double)dw)/((double)sw))); int tolerance=params.count()>1+2+2+2+2? params.as_int(1+2+2+2+2, "tolerance must be int", r):150; src.CopyResampled(dest, dx, dy, sx, sy, dw, dh, sw, sh, tolerance); } else src.Copy(dest, dx, dy, sx, sy, sw, sh); } static void _pixel(Request& r, MethodParams& params) { gdImage& image=GET_SELF(r, VImage).image(); int x=params.as_int(0, "x must be int", r); int y=params.as_int(1, "y must be int", r); if(params.count()>2) { image.SetPixel(x, y, image.Color(params.as_int(2, "color must be int", r))); } else r.write(*new VInt(image.DecodeColor(image.GetPixel(x, y)))); } // constructor MImage::MImage(): Methoded("image") { // ^image:measure[DATA] // ^image:measure[DATA; $.exif(false) $.xmp(false) $.xmp-charset[UTF-8] ] add_native_method("measure", Method::CT_DYNAMIC, _measure, 1, 2); // ^image.html[] // ^image.html[hash] add_native_method("html", Method::CT_DYNAMIC, _html, 0, 1); // ^image.load[background.gif] add_native_method("load", Method::CT_DYNAMIC, _load, 1, 1); // ^image.create[width;height] bgcolor=white // ^image.create[width;height;bgcolor] add_native_method("create", Method::CT_DYNAMIC, _create, 2, 3); // ^image.gif[] add_native_method("gif", Method::CT_DYNAMIC, _gif, 0, 1); // ^image.line(x0;y0;x1;y1;color) add_native_method("line", Method::CT_DYNAMIC, _line, 5, 5); // ^image.fill(x;y;color) add_native_method("fill", Method::CT_DYNAMIC, _fill, 3, 3); // ^image.rectangle(x0;y0;x1;y1;color) add_native_method("rectangle", Method::CT_DYNAMIC, _rectangle, 5, 5); // ^image.bar(x0;y0;x1;y1;color) add_native_method("bar", Method::CT_DYNAMIC, _bar, 5, 5); // ^image.replace(color-source;color-dest)[table x:y] // ^image.replace(color-source;color-dest) add_native_method("replace", Method::CT_DYNAMIC, _replace, 2, 3); // ^image.polyline(color)[table x:y] add_native_method("polyline", Method::CT_DYNAMIC, _polyline, 2, 2); // ^image.polygon(color)[table x:y] add_native_method("polygon", Method::CT_DYNAMIC, _polygon, 2, 2); // ^image.polybar(color)[table x:y] add_native_method("polybar", Method::CT_DYNAMIC, _polybar, 2, 2); // ^image.font[alPHAbet;font-file-name.gif] // ^image.font[alPHAbet;font-file-name.gif](spacebar_width) // ^image.font[alPHAbet;font-file-name.gif](spacebar_width;letter_width) // ^image.font[alPHAbet;font-file-name.gif][$.space-width(.) $.letter-width(.) $.letter-space(.)] add_native_method("font", Method::CT_DYNAMIC, _font, 2, 4); // ^image.text(x;y)[text] add_native_method("text", Method::CT_DYNAMIC, _text, 3, 3); // ^image.length[text] add_native_method("length", Method::CT_DYNAMIC, _length, 1, 1); // ^image.arc(center x;center y;width;height;start in degrees;end in degrees;color) add_native_method("arc", Method::CT_DYNAMIC, _arc, 7, 7); // ^image.sector(center x;center y;width;height;start in degrees;end in degrees;color) add_native_method("sector", Method::CT_DYNAMIC, _sector, 7, 7); // ^image.circle(center x;center y;r;color) add_native_method("circle", Method::CT_DYNAMIC, _circle, 4, 4); // ^image.copy[source](src x;src y;src w;src h;dst x;dst y[;dest w[;dest h[;tolerance]]]) add_native_method("copy", Method::CT_DYNAMIC, _copy, 1+2+2+2, (1+2+2+2)+2+1); // ^image.pixel(x;y)[(color)] add_native_method("pixel", Method::CT_DYNAMIC, _pixel, 2, 3); } parser-3.5.1/src/classes/Makefile.am0000644000076400007640000000110614714314503014225 00000000000000AM_CPPFLAGS = -I../types -I../sql -I../lib/gd -I../lib/sdbm/pa-include -Igd $(INCLTDL) @PCRE_INCLUDES@ @XML_INCLUDES@ -I../lib/md5 -I../lib/smtp -I../lib/json -I../lib/memcached -I../lib/curl CLASSES_SOURCE_FILES = array.C bool.C curl.C date.C double.C file.C form.C hash.C hashfile.C image.C inet.C int.C json.C mail.C math.C memcached.C memory.C op.C reflection.C regex.C response.C string.C table.C void.C xnode.C xdoc.C noinst_HEADERS = classes.h xnode.h noinst_LTLIBRARIES = libclasses.la libclasses_la_SOURCES = $(CLASSES_SOURCE_FILES) classes.C EXTRA_DIST = classes.vcproj parser-3.5.1/src/classes/regex.C0000644000076400007640000000320614712042465013415 00000000000000/** @file Parser: @b int parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vint.h" #include "pa_vregex.h" volatile const char * IDENT_REGEX_C="$Id: regex.C,v 1.18 2024/11/04 03:53:25 moko Exp $"; // class class MRegex: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VRegex(); } public: MRegex(); }; // global variable DECLARE_CLASS_VAR(regex, new MRegex); // methods static void _create(Request& r, MethodParams& params) { VRegex& vregex=GET_SELF(r, VRegex); if(VRegex* aregex = dynamic_cast(¶ms[0])){ vregex.set(*aregex); } else { const String& pattern=params.as_string(0, "regexp must not be code"); vregex.set(r.charsets.source(), &pattern, params.count()>1 ? ¶ms.as_string(1, OPTIONS_MUST_NOT_BE_CODE) : 0); } vregex.compile(); vregex.study(); } static void _size(Request& r, MethodParams&) { VRegex& vregex=GET_SELF(r, VRegex); r.write(*new VInt(vregex.get_info_size())); } static void _study_size(Request& r, MethodParams&) { VRegex& vregex=GET_SELF(r, VRegex); r.write(*new VInt(vregex.get_study_size())); } // constructor MRegex::MRegex(): Methoded("regex") { // ^regex::create[string|regex[;options]] add_native_method("create", Method::CT_DYNAMIC, _create, 1, 2); // ^regex.info_size[] add_native_method("size", Method::CT_DYNAMIC, _size, 0, 0); // ^regex.study_size[] add_native_method("study_size", Method::CT_DYNAMIC, _study_size, 0, 0); } parser-3.5.1/src/classes/classes.vcproj0000644000076400007640000001310514714315222015054 00000000000000 parser-3.5.1/src/classes/memcached.C0000644000076400007640000000661514712042465014220 00000000000000/** @file Parser: memcached class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Ivan Poluyanov Artem Stepanov */ #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vstring.h" #include "pa_vtable.h" #include "pa_vbool.h" #include "pa_vmemcached.h" volatile const char * IDENT_MEMCACHED_C="$Id: memcached.C,v 1.19 2024/11/04 03:53:25 moko Exp $"; class MMemcached: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VMemcached(); } public: MMemcached(); }; DECLARE_CLASS_VAR(memcached, new MMemcached); static void _open(Request& r, MethodParams& params) { VMemcached& self=GET_SELF(r, VMemcached); Value& param_value=params.as_no_junction(0, PARAM_MUST_NOT_BE_CODE); time_t ttl=params.count()>1 ? params.as_int(1, "default expiration must be int", r) : 0; if(HashStringValue* options=param_value.get_hash()){ bool connect=true; String result; for(HashStringValue::Iterator i(*options); i; i.next()){ if(i.key() == "skip-connect"){ connect=!i.value()->as_bool(); } else if(Value *b=dynamic_cast(i.value())){ if(b->as_bool()) result << (result.is_empty() ? "--" : " --") << i.key(); } else { const String& value=i.value()->as_string(); if(!value.is_empty()) result << (result.is_empty() ? "--" : " --") << i.key() << "=" << value; } } self.open(result, ttl, connect); } else { const String& connect_string=params.as_string(0, "param must be connection string or options hash"); self.open_parse(connect_string, ttl); } } static void _clear(Request& r, MethodParams& params) { VMemcached& self=GET_SELF(r, VMemcached); time_t ttl=(params.count()>0) ? params.as_int(0, "expiration must be int", r) : 0; self.flush(ttl); } static void _mget(Request& r, MethodParams& params) { VMemcached& self=GET_SELF(r, VMemcached); Value& param=params.as_no_junction(0, PARAM_MUST_NOT_BE_CODE); if(param.is_string()){ ArrayString keys(params.count()); for(size_t i=0; icount()); for(size_t i=0; icount(); i++) { keys+=table->get(i)->get(0); } r.write(self.mget(keys)); } } static void _add(Request& r, MethodParams& params) { VMemcached& self=GET_SELF(r, VMemcached); const String& key=params.as_string(0, "key must be string"); r.write(VBool::get(self.add(key, ¶ms.as_no_junction(1, PARAM_MUST_NOT_BE_CODE)))); } static void _delete(Request& r, MethodParams& params) { VMemcached& self=GET_SELF(r, VMemcached); const String& key=params.as_string(0, "key must be string"); self.remove(key); } static void _release(Request& r, MethodParams&) { VMemcached& self=GET_SELF(r, VMemcached); self.quit(); } MMemcached::MMemcached() : Methoded("memcached") { add_native_method("open", Method::CT_DYNAMIC, _open, 1, 2); add_native_method("clear", Method::CT_DYNAMIC, _clear, 0, 1); add_native_method("mget", Method::CT_DYNAMIC, _mget, 1, 1000); add_native_method("add", Method::CT_DYNAMIC, _add, 2, 2); add_native_method("delete", Method::CT_DYNAMIC, _delete, 1, 1); add_native_method("release", Method::CT_DYNAMIC, _release, 0, 0); } parser-3.5.1/src/classes/date.C0000644000076400007640000004141514732404263013224 00000000000000/** @file Parser: @b date parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vdouble.h" #include "pa_vdate.h" #include "pa_vtable.h" #include "pa_vbool.h" volatile const char * IDENT_DATE_C="$Id: date.C,v 1.121 2024/12/23 16:59:17 moko Exp $" IDENT_PA_VDATE_H; // class class MDate: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VDate(0); } public: MDate(); }; // global variable DECLARE_CLASS_VAR(date, new MDate); // helpers class Date_calendar_table_template_columns: public ArrayString { public: Date_calendar_table_template_columns(): ArrayString(6+2) { for(int i=0; i<=6; i++) *this+=new String(i, "%d"); // .i column name *this+=new String("week"); *this+=new String("year"); } }; static Table &date_calendar_table_template(){ static Table *singleton=NULL; if(!singleton) singleton=new Table(new Date_calendar_table_template_columns); return *singleton; } // methods static void _now(Request& r, MethodParams& params) { VDate& vdate=GET_SELF(r, VDate); pa_time_t t=(pa_time_t)time(0); if(params.count()==1) // ^now(offset) t+=(pa_time_t)round(params.as_double(0, "offset must be double", r)*SECS_PER_DAY); vdate.set_time(t); } static void _today(Request& r, MethodParams& params) { VDate& vdate=GET_SELF(r, VDate); time_t t=time(0); tm today=*localtime(&t); if (params.count() == 1) // ^today(offset) today.tm_mday += params.as_int(0, "offset must be int", r); today.tm_hour=0; today.tm_min=0; today.tm_sec=0; vdate.set_tm(today); } int to_year(int iyear) { if(iyear<0 || iyear>9999) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "year '%d' is out of range 0..9999", iyear); return iyear-1900; } static int to_month(int imonth) { return max(1, min(imonth, 12)) -1; } static const char *skip_number_throw(char *string, char c, const char *valid){ if(!valid[0]) throw Exception("date.format", 0, "invalid character '%c' after number in '%s'", c, string); if(!strcmp(valid, "+-Z")) throw Exception("date.format", 0, "invalid timezone character '%c' after number in '%s'", c, string); throw Exception("date.format", 0, "number delimiter '%c'%s expected, but found '%c' in date '%s'", valid[0], valid[strlen(valid)-1] == 'Z' ? " or timezone":"", c, string); } static char *skip_number(char* string, const char *valid_delim, char *delim) { if(string) { char *str=string; // skipping whitespace while(isspace(str[0])) str++; // skipping +- if(str[0]=='-' || str[0]=='+') str++; // at least one digit should be present if(!str[0]) throw Exception("date.format", 0, "number expected in date '%s'", string); if(!isdigit(str[0])) throw Exception("date.format", 0, "'%c' must be number in date '%s'", str[0], string); str++; // skipping digits while(isdigit(str[0])) str++; // skipping trailing whitespace if(!strchr(valid_delim, ' ')) while(isspace(str[0])) str++; // delimiter check if(char c=str[0]){ if(!strchr(valid_delim, c)) skip_number_throw(string, c, valid_delim); if(delim) *delim=c; str[0]=0; return str+1; } } if(delim) *delim=0; return 0; } static char *skip_number(char** string_ref, const char *valid_delim, char *delim=0) { char *result=*string_ref; *string_ref=skip_number(*string_ref, valid_delim, delim); return result; } static char *skip_writespace(char* str) { if(str){ while(isspace(str[0])) str++; return str[0] ? str : 0; } return 0; } static char *numeric_tz(char prefix, char* tz) { // preparing POSIX TZ format char *buf=new(PointerFreeGC) char[4+5+1/*zero-teminator*/]; strcpy(buf, prefix=='+' ? "SUB-":"SUB+"); char *cur=buf+4; // hours if(!isdigit(*(cur++)=*(tz++))) return 0; if(isdigit(tz[0])) *(cur++)=*(tz++); if(tz[0] == ':'){ // HH:mm format *(cur++)=*(tz++); if(!isdigit(*(cur++)=*(tz++))) return 0; if(isdigit(tz[0])) *(cur++)=*(tz++); } else if(isdigit(tz[0])){ // HHmm format *(cur++)=':'; if(!isdigit(*(cur++)=*(tz++)) || !isdigit(*(cur++)=*(tz++))) return 0; } // nothing more if(skip_writespace(tz)) return 0; *cur=0; return buf; } // SQL 2002-04-25 18:14:00 // ISO 2002-04-25T18:14:00.45+01:00 // TIME 18:14:00 // ':' DELIMITED 2002:04:25 [+maybe time] // not static, used in image.C tm cstr_to_time_t(char *cstr, const char **tzOut) { if( !cstr || !*cstr ) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "empty string is not valid datetime"); if(tzOut) *tzOut=0; tm tmIn; memset(&tmIn, 0, sizeof(tmIn)); tmIn.tm_isdst=-1; char delim; char *cur=cstr; const char *year, *month, *mday; const char *hour, *min, *sec; PA_UNUSED const char *msec; year=skip_number(&cur, "-:", &delim); if(delim != ':' || delim == ':' && strlen(year) >=4 ){ // year present month=skip_number(&cur, delim == ':' ? ":" : "-"); mday=skip_number(&cur, tzOut ? " \tT":" \t", &delim); if(delim != 'T'){ // SQL date format cur=skip_writespace(cur); hour=skip_number(&cur, ":"); min=skip_number(&cur, ":"); sec=skip_number(&cur, "."); msec=skip_number(&cur, ""); } else { // ISO date format hour=skip_number(&cur, ":"); min=skip_number(&cur, ":+-Z", &delim); sec=delim==':' ? skip_number(&cur, ".+-Z", &delim) : 0; msec=delim=='.' ? skip_number(&cur, "+-Z", &delim) : 0; // timezone specification check const char *tz = delim == 'Z' ? (skip_writespace(cur) ? 0 : "UTC") : (cur ? numeric_tz(delim, cur) : 0); if(!tz){ if(!delim) throw Exception("date.format", 0, "empty timezone"); throw Exception("date.format", 0, "invalid timezone '%c%s'", delim, cur ? cur : ""); } *tzOut=tz; } tmIn.tm_year=to_year(pa_atoi(year)); tmIn.tm_mon=month?pa_atoi(month)-1:0; tmIn.tm_mday=mday?pa_atoi(mday):1; } else { // time only hour=year; min=skip_number(&cur, ":"); sec=skip_number(&cur, "."); msec=skip_number(&cur, ""); time_t t=time(0); tm *tmNow=localtime(&t); tmIn.tm_year=tmNow->tm_year; tmIn.tm_mon=tmNow->tm_mon; tmIn.tm_mday=tmNow->tm_mday; } tmIn.tm_hour=pa_atoi(hour); tmIn.tm_min=pa_atoi(min); tmIn.tm_sec=pa_atoi(sec); //tmIn.tm_[msec<cstrm(), &tz); if(tz) vdate.set_tz(tz); vdate.set_tm(tmIn); } else { // ^create(float days) or ^create[date object] if(VDate* adate=dynamic_cast(¶ms[0])) vdate.set_tz(adate->get_tz()); vdate.set_time(round(params.as_double(0, "float days must be double", r)*SECS_PER_DAY)); } } else { // ^create(y;m;d[;h[;m[;s[;TZ]]]]) tm tmIn; memset(&tmIn, 0, sizeof(tmIn)); tmIn.tm_isdst=-1; tmIn.tm_year=to_year(params.as_int(0, "year must be int", r)); tmIn.tm_mon=params.as_int(1, "month must be int", r)-1; tmIn.tm_mday=params.count()>2?params.as_int(2, "mday must be int", r):1; if(params.count()>3) tmIn.tm_hour=params.as_int(3, "hour must be int", r); if(params.count()>4) tmIn.tm_min=params.as_int(4, "minutes must be int", r); if(params.count()>5) tmIn.tm_sec=params.as_int(5, "seconds must be int", r); if(params.count()>6) vdate.set_tz(params.as_string(6, "TZ must be string").cstr()); vdate.set_tm(tmIn); }; } static void _sql_string(Request& r, MethodParams& params) { VDate& vdate=GET_SELF(r, VDate); VDate::sql_string_type format = VDate::sql_string_datetime; if(params.count() > 0) { const String& what=params.as_string(0, "'type' must be string"); if(what.is_empty() || what == "datetime") format = VDate::sql_string_datetime; else if(what == "date") format=VDate::sql_string_date; else if(what == "time") format=VDate::sql_string_time; else throw Exception(PARSER_RUNTIME, &what, "'type' must be 'date', 'time' or 'datetime'"); } r.write(*vdate.get_sql_string(format)); } static void _gmt_string(Request& r, MethodParams&) { VDate& vdate=GET_SELF(r, VDate); r.write(*vdate.get_gmt_string()); } static void _iso_string(Request& r, MethodParams& params) { VDate& vdate=GET_SELF(r, VDate); VDate::iso_string_type format=VDate::iso_string_default; if(params.count()>0) if(HashStringValue* options=params.as_hash(0)){ int valid_options=0; if(Value* vshow_ms=options->get("ms")){ if(r.process(*vshow_ms).as_bool()) format=VDate::iso_string_type(format|VDate::iso_string_ms); valid_options++; } if(Value* vshow_colon=options->get("colon")){ if(!r.process(*vshow_colon).as_bool()) format=VDate::iso_string_type(format|VDate::iso_string_no_colon); valid_options++; } if(Value* vshow_z=options->get("z")){ if(!r.process(*vshow_z).as_bool()) format=VDate::iso_string_type(format|VDate::iso_string_no_z); valid_options++; } if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } r.write(*vdate.get_iso_string(format)); } static void _roll(Request& r, MethodParams& params) { const String& what=params.as_string(0, "'what' must be string"); int oyear=0; int omonth=0; int oday=0; int *offset; if(what=="year") offset=&oyear; else if(what=="month") offset=&omonth; else if(what=="day") offset=&oday; else if(what=="TZ") { const String& argument_tz=params.as_string(1, "'TZ' must be string"); if(&r.get_self() == date_class){ VDate::set_default_tz(argument_tz.cstr()); } else { VDate& vdate=GET_SELF(r, VDate); vdate.set_tz(argument_tz.cstr()); vdate.set_time(vdate.get_time()); } return; } else throw Exception(PARSER_RUNTIME, &what, "must be year|month|day|TZ"); if(&r.get_self() == date_class) throw Exception(PARSER_RUNTIME, &what, "must be TZ to be called statically"); VDate& vdate=GET_SELF(r, VDate); *offset=params.as_int(1, "offset must be int", r); tm tmIn=vdate.get_tm(); tm tmSaved=tmIn; int adjust_day=0; while(true) { tmIn.tm_year+=oyear; tmIn.tm_mon+=omonth; tmIn.tm_mday+=oday+adjust_day; tmIn.tm_hour=24/2; tmIn.tm_min=0; tmIn.tm_sec=0; int saved_day=tmIn.tm_mday; vdate.set_tm(tmIn); /* normalize */ if(oday==0 && tmIn.tm_mday!=saved_day /* but it changed */ ) { if(adjust_day <= -3 /* 31->28 max, so never, but... */ ) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "bad resulting time (day hole still with %d day adjustment)", adjust_day ); tmIn=tmSaved; // restoring --adjust_day; //retrying with prev day } else break; } tmIn.tm_hour=tmSaved.tm_hour; tmIn.tm_min=tmSaved.tm_min; tmIn.tm_sec=tmSaved.tm_sec; tmIn.tm_isdst=-1; vdate.set_tm(tmIn); } static Table& fill_month_days(Request& r, MethodParams& params, bool rus){ Table::Action_options table_options; Table& result=*new Table(date_calendar_table_template(), table_options); tm tmIn; memset(&tmIn, 0, sizeof(tmIn)); tmIn.tm_year=to_year(params.as_int(1, "year must be int", r)); tmIn.tm_mon=to_month(params.as_int(2, "month must be int", r)); tmIn.tm_mday=1; VDate t(tmIn); /* normalize */ int weekDay1=tmIn.tm_wday; if(rus) weekDay1=weekDay1?weekDay1-1:6; //sunday last int monthDays=VDate::getMonthDays(tmIn.tm_year, tmIn.tm_mon); for(int _day=1-weekDay1; _day<=monthDays;) { Table::element_type row(new ArrayString(7)); // calculating year week no [1..54] int weekyear=0; // surely would be assigned to, but to calm down compiler int weekno=0; // same // 0..6 week days-cells fill with month days for(int wday=0; wday<7; wday++, _day++) { *row+=(_day>=1 && _day<=monthDays)?new String(_day, "%02d"):new String(); if(wday==(rus?3:4)/*thursday*/) { tm tms; memset(&tms, 0, sizeof(tms)); tms.tm_mday=_day; tms.tm_mon=tmIn.tm_mon; tms.tm_year=tmIn.tm_year; VDate ts(tms); /*normalize*/ weekyear=tms.tm_year+1900; weekno=VDate::CalcWeek(tms).week; } } // appending week no *row+=new String(weekno, "%02d"); // appending week year *row+=new String(weekyear, "%04d"); result+=row; } return result; } static Table& fill_week_days(Request& r, MethodParams& params, bool rus){ Table::columns_type columns(new ArrayString(4)); *columns+=new String("year"); *columns+=new String("month"); *columns+=new String("day"); *columns+=new String("weekday"); Table& result=*new Table(columns); tm tmIn; memset(&tmIn, 0, sizeof(tmIn)); tmIn.tm_year=to_year(params.as_int(1, "year must be int", r)); tmIn.tm_mon=to_month(params.as_int(2, "month must be int", r)); tmIn.tm_mday=params.as_int(3, "day must be int", r); tmIn.tm_hour=18; VDate t(tmIn); /* normalize */ int baseWeekDay=tmIn.tm_wday; if(rus) baseWeekDay=baseWeekDay?baseWeekDay-1:6; //sunday last t.set_time(t.get_time()-baseWeekDay*SECS_PER_DAY); for(int curWeekDay=0; curWeekDay<7; curWeekDay++, t.set_time(t.get_time()+SECS_PER_DAY)) { Table::element_type row(new ArrayString(4)); tm tmOut=t.get_tm(); *row+=new String(1900+tmOut.tm_year, "%04d"); *row+=new String(1+tmOut.tm_mon, "%02d"); *row+=new String(tmOut.tm_mday, "%02d"); *row+=new String(tmOut.tm_wday, "%02d"); result+=row; } return result; } static void _calendar(Request& r, MethodParams& params) { const String& what=params.as_string(0, "format must be string"); bool rus=false; if(what=="rus") rus=true; else if(what=="eng") rus=false; else throw Exception(PARSER_RUNTIME, &what, "must be rus|eng"); Table* table; if(params.count()==1+2) table=&fill_month_days(r, params, rus); else // 1+3 table=&fill_week_days(r, params, rus); r.write(*new VTable(table)); } static void _unix_timestamp(Request& r, MethodParams& params) { VDate& vdate=GET_SELF(r, VDate); if(params.count()==0) { // ^date.unix-timestamp[] r.write(*new VDouble((double)vdate.get_time())); } else { if(vdate.get_time()) throw Exception(PARSER_RUNTIME, 0, "date object already constructed"); // ^unix-timestamp(time_t) vdate.set_time(params.as_double(0, "Unix timestamp must be number", r)); } } static void _last_day(Request& r, MethodParams& params) { tm tmIn; if(&r.get_self() == date_class) { if(params.count() != 2) throw Exception(PARSER_RUNTIME, 0, "year and month must be defined"); // ^date:lastday(year;month) tmIn.tm_year=to_year(params.as_int(0, "year must be int", r)); tmIn.tm_mon=to_month(params.as_int(1, "month must be int", r)); } else { if(params.count() != 0) throw Exception(PARSER_RUNTIME, 0, "year and month must not be defined"); // ^date.lastday[] tmIn=GET_SELF(r, VDate).get_tm(); } r.write(*new VInt(VDate::getMonthDays(tmIn.tm_year, tmIn.tm_mon))); } static void _int(Request& r, MethodParams&) { VDate& vdate=GET_SELF(r, VDate); r.write(*new VInt(vdate.as_int())); } static void _double(Request& r, MethodParams&) { VDate& vdate=GET_SELF(r, VDate); r.write(*new VDouble(vdate.as_double())); } static void _bool(Request& r, MethodParams&) { VDate& vdate=GET_SELF(r, VDate); r.write(VBool::get(vdate.as_bool())); } // constructor MDate::MDate(): Methoded("date") { // ^date::now[] // ^date::now(offset float days) add_native_method("now", Method::CT_DYNAMIC, _now, 0, 1); // ^date::today[] // ^date::today(offset int days) add_native_method("today", Method::CT_DYNAMIC, _today, 0, 1); // ^date::create(float days) // ^date::create[date] // ^date::create(year;month;day[;hour[;minute[;sec[;TZ]]]]) // ^date::create[yyyy-mm-dd[ hh:mm:ss]] // ^date::create[hh:mm:ss] add_native_method("create", Method::CT_DYNAMIC, _create, 1, 7); // old name for compatibility with <= v1.17 2002/2/18 12:13:42 paf add_native_method("set", Method::CT_DYNAMIC, _create, 1, 7); // ^date.sql-string[] add_native_method("sql-string", Method::CT_DYNAMIC, _sql_string, 0, 1); // ^date.gmt-string[] add_native_method("gmt-string", Method::CT_DYNAMIC, _gmt_string, 0, 0); // ^date.iso-string[$.colon(true) $.z(true) $.ms(false)] add_native_method("iso-string", Method::CT_DYNAMIC, _iso_string, 0, 1); // ^date:lastday(year;month) // ^date.lastday[] add_native_method("last-day", Method::CT_ANY, _last_day, 0, 2); // ^date.roll[year|month|day](+/- 1) add_native_method("roll", Method::CT_ANY, _roll, 2, 2); // ^date:calendar[rus|eng](year;month) = table // ^date:calendar[rus|eng](year;month;day) = table add_native_method("calendar", Method::CT_STATIC, _calendar, 3, 4); // ^date.unix-timestamp[] // ^date::unix-timestamp(timestamp) add_native_method("unix-timestamp", Method::CT_DYNAMIC, _unix_timestamp, 0, 1); // date.int[default for ^string.int compatibility] add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1); // ^date.double[default for ^string.double compatibility] add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); // ^date.bool[default for ^string.bool compatibility] add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); } parser-3.5.1/src/classes/math.C0000644000076400007640000005607714724670007013254 00000000000000/** @file Parser: @b math parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian portions from gen_uuid.c, Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o. */ #include "pa_vmethod_frame.h" #include "pa_common.h" #include "pa_base64.h" #include "pa_vint.h" #include "pa_vmath.h" #include "pa_vfile.h" #include "pa_request.h" #include "pa_md5.h" #include "pa_sha2.h" #include "pa_random.h" #ifdef HAVE_CRYPT extern "C" char *crypt(const char* , const char* ); #endif volatile const char * IDENT_MATH_C="$Id: math.C,v 1.109 2024/12/06 21:43:35 moko Exp $"; // defines #define MAX_SALT 8 // class class MMath: public Methoded { public: // Methoded bool used_directly() { return false; } public: MMath(); }; // global variables DECLARE_CLASS_VAR(math, new MMath); // methods static void _random(Request& r, MethodParams& params) { double top=params.as_double(0, "range must be expression", r); if(top<1 || top>INT_MAX) throw Exception(PARSER_RUNTIME, 0, "top(%.15g) must be [1..%u]", top, INT_MAX); r.write(*new VInt(_random(uint(top)))); } typedef double(*math1_func_ptr)(double); static double frac(double param) { return param-trunc(param); } static double degrees(double param) { return param /PI *180; } static double radians(double param) { return param /180 *PI; } static void math1(Request& r, MethodParams& params, math1_func_ptr func) { double param=params.as_double(0, "parameter must be expression", r); double result=func(param); r.write(*new VDouble(result)); } #define MATH1(name) \ static void _##name(Request& r, MethodParams& params) {\ math1(r, params, &name);\ } #define MATH1P(name_parser, name_c) \ static void _##name_parser(Request& r, MethodParams& params) {\ math1(r, params, &name_c);\ } MATH1(round) MATH1(floor) MATH1P(ceiling, ceil) MATH1(trunc) MATH1(frac) MATH1P(abs, fabs) MATH1(sign) MATH1(exp) MATH1(log) MATH1(log10) MATH1(sin) MATH1(asin) MATH1(cos) MATH1(acos) MATH1(tan) MATH1(atan) MATH1(degrees) MATH1(radians) MATH1(sqrt) typedef double (*math2_func_ptr)(double, double); static void math2(Request& r, MethodParams& params, math2_func_ptr func) { double a=params.as_double(0, "parameter must be expression", r); double b=params.as_double(1, "parameter must be expression", r); double result=func(a, b); r.write(*new VDouble(result)); } #define MATH2(name) \ static void _##name(Request& r, MethodParams& params) {\ math2(r, params, &name);\ } MATH2(pow) MATH2(atan2) inline bool is_salt_body_char(unsigned char c) { return pa_isalnum(c) || c == '.' || c=='/'; } static size_t calc_prefix_size(const char* salt) { if(strlen(salt)) { if(!is_salt_body_char((unsigned char)salt[0])) { // $... {... const char* cur=salt+1; // skip while(is_salt_body_char((unsigned char)*cur++)) // ...$ ...} ; return cur-salt; } else return 0; } else return 0; } static void _crypt(Request& r, MethodParams& params) { const char* password=params.as_string(0, "password must be string").cstr(); const char* maybe_bodyless_salt=params.as_string(1, "salt must be string").cstr(); size_t prefix_size=calc_prefix_size(maybe_bodyless_salt); const char* normal_salt; char normalize_buf[MAX_STRING]; if(prefix_size==strlen(maybe_bodyless_salt)) { // bodyless? pa_strncpy(normalize_buf, maybe_bodyless_salt, MAX_STRING-MAX_SALT); char *cur=normalize_buf+strlen(normalize_buf); // sould add up MAX_SALT random chars static unsigned char itoa64[] = /* 0 ... 63 => ASCII - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; for(int i=0; i> (32-(bits)))) void SHA1ProcessMessageBlock(SHA1Context *); void SHA1PadMessage(SHA1Context *); void SHA1Reset(SHA1Context *context) { context->Length_Low = context->Length_High = context->Message_Block_Index = 0; context->Message_Digest[0] = 0x67452301; context->Message_Digest[1] = 0xEFCDAB89; context->Message_Digest[2] = 0x98BADCFE; context->Message_Digest[3] = 0x10325476; context->Message_Digest[4] = 0xC3D2E1F0; context->Computed = context->Corrupted = 0; } int SHA1Result(SHA1Context *context) { if (context->Corrupted) return 0; if (!context->Computed) { SHA1PadMessage(context); context->Computed = 1; } return 1; } void SHA1Input(SHA1Context *context, const unsigned char *message_array, unsigned length) { if (!length) return; if (context->Computed || context->Corrupted) { context->Corrupted = 1; return; } while(length-- && !context->Corrupted) { context->Message_Block[context->Message_Block_Index++] = (*message_array & 0xFF); context->Length_Low += 8; context->Length_Low &= 0xFFFFFFFF; if (!context->Length_Low && !(context->Length_High=((1+context->Length_High)&0xFFFFFFFF))) context->Corrupted = 1; // too long message if (context->Message_Block_Index == 64) SHA1ProcessMessageBlock(context); message_array++; } } void SHA1ProcessMessageBlock(SHA1Context *context) { const unsigned K[] = {0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6 }; int t; unsigned temp, W[80], buf[5]; unsigned &A=buf[0], &B=buf[1], &C=buf[2], &D=buf[3], &E=buf[4]; for(t = 0; t < 16; t++) W[t] = (((unsigned) context->Message_Block[t * 4]) << 24) | (((unsigned) context->Message_Block[t * 4 + 1]) << 16) | (((unsigned) context->Message_Block[t * 4 + 2]) << 8) | ((unsigned) context->Message_Block[t * 4 + 3]); for(t = 16; t < 80; t++) W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]); memcpy (buf, context->Message_Digest, sizeof(buf)); for(t = 0; t < 20; t++) { temp = (SHA1CircularShift(5,A) + ((B & C) | ((~B) & D)) + E + W[t] + K[0]) & 0xFFFFFFFF; E = D; D = C; C = SHA1CircularShift(30,B); B = A; A = temp; } for(t = 20; t < 40; t++) { temp = (SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1]) & 0xFFFFFFFF; E = D; D = C; C = SHA1CircularShift(30,B); B = A; A = temp; } for(t = 40; t < 60; t++) { temp = (SHA1CircularShift(5,A) + ((B & C) | (B & D) | (C & D)) + E + W[t] + K[2]) & 0xFFFFFFFF; E = D; D = C; C = SHA1CircularShift(30,B); B = A; A = temp; } for(t = 60; t < 80; t++) { temp = (SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3]) & 0xFFFFFFFF; E = D; D = C; C = SHA1CircularShift(30,B); B = A; A = temp; } for (t = 0; t < 5; t++) context->Message_Digest[t] = (context->Message_Digest[t] + buf[t]) & 0xFFFFFFFF; context->Message_Block_Index = 0; } void SHA1PadMessage(SHA1Context *context) { context->Message_Block[context->Message_Block_Index++] = 0x80; if (context->Message_Block_Index > 56) { //was 55, one shift while(context->Message_Block_Index < 64) context->Message_Block[context->Message_Block_Index++] = 0; SHA1ProcessMessageBlock(context); while(context->Message_Block_Index < 56) context->Message_Block[context->Message_Block_Index++] = 0; } else while(context->Message_Block_Index < 56) context->Message_Block[context->Message_Block_Index++] = 0; context->Message_Block[56] = (context->Length_High >> 24) & 0xFF; context->Message_Block[57] = (context->Length_High >> 16) & 0xFF; context->Message_Block[58] = (context->Length_High >> 8) & 0xFF; context->Message_Block[59] = (context->Length_High) & 0xFF; context->Message_Block[60] = (context->Length_Low >> 24) & 0xFF; context->Message_Block[61] = (context->Length_Low >> 16) & 0xFF; context->Message_Block[62] = (context->Length_Low >> 8) & 0xFF; context->Message_Block[63] = (context->Length_Low) & 0xFF; SHA1ProcessMessageBlock(context); } #ifdef PA_BIG_ENDIAN #define SWAP(n) (n) #else #define SWAP(n) (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) #endif void SHA1ReadDigest(void *buf, SHA1Context *c) { if(!SHA1Result(c)) throw Exception (PARSER_RUNTIME, 0, "Cannot compute SHA1"); ((uint32_t *)buf)[0] = SWAP(c->Message_Digest[0]); ((uint32_t *)buf)[1] = SWAP(c->Message_Digest[1]); ((uint32_t *)buf)[2] = SWAP(c->Message_Digest[2]); ((uint32_t *)buf)[3] = SWAP(c->Message_Digest[3]); ((uint32_t *)buf)[4] = SWAP(c->Message_Digest[4]); } static void _sha1(Request& r, MethodParams& params) { const char *string = params.as_string(0, PARAMETER_MUST_BE_STRING).cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets).cstr(); SHA1Context c; unsigned char digest[20]; SHA1Reset (&c); SHA1Input (&c, (const unsigned char*)string, strlen(string)); SHA1ReadDigest(digest, &c); r.write(*new String(hex_string(digest, sizeof(digest), false))); } String::C getData(Value& vdata, Request& r){ if(const String* sdata=vdata.get_string()){ String::Body body=sdata->cstr_to_string_body_untaint(String::L_AS_IS, r.connection(false), &r.charsets); // explode content, honor tainting changes return String::C(body.cstr(), body.length()); } else { VFile *file=vdata.as_vfile(); return String::C(file->value_ptr(),file->value_size()); } } void memxor(char *dest, const char *src, size_t n){ for (;n>0;n--) *dest++ ^= *src++; } #define IPAD 0x36 #define OPAD 0x5c #define HMAC(key,keylen,init,update,final,blocklen,digestlen){ \ unsigned char tempdigest[digestlen], keydigest[digestlen]; \ /* Reduce the key's size, so that it becomes <= blocklen bytes. */ \ if (keylen > blocklen){ \ init(&c); \ update(&c,(const unsigned char*)key, keylen); \ final(keydigest, &c); \ key = (char *)keydigest; \ keylen = digestlen; \ } \ /* Compute TEMP from KEY and STRING. */ \ char block[blocklen]; \ memset (block, IPAD, blocklen); \ memxor (block, key, keylen); \ init(&c); \ update(&c, (const unsigned char*)block, blocklen); \ update(&c, (const unsigned char*)data.str, data.length); \ final(tempdigest, &c); \ /* Compute result from KEY and TEMP. */ \ memset (block, OPAD, blocklen); \ memxor (block, key, keylen); \ init(&c); \ update(&c, (const unsigned char*)block, blocklen); \ update(&c, (const unsigned char*)tempdigest, digestlen); \ } static void _digest(Request& r, MethodParams& params) { const String &smethod = params.as_string(0, PARAMETER_MUST_BE_STRING); String::C data=getData(params.as_no_junction(1, "parameter must be string or file"), r); enum Method { M_MD5, M_SHA1, M_SHA256, M_SHA512 } method; if (smethod == "md5") method = M_MD5; else if (smethod == "sha1" ) method = M_SHA1; else if (smethod == "sha256" ) method = M_SHA256; else if (smethod == "sha512" ) method = M_SHA512; else throw Exception(PARSER_RUNTIME, &smethod, "must be 'md5' or 'sha1' or 'sha256' or 'sha512'"); const char *hmac=0; size_t hmac_len=0; enum Format { F_HEX, F_BASE64, F_FILE } format = F_HEX; if(params.count() == 3) if(HashStringValue* options=params.as_hash(2)) { int valid_options=0; if(Value* value=options->get("hmac")) { if(VFile* vfile=dynamic_cast(value)){ hmac=(const char* )vfile->value_ptr(); hmac_len=vfile->value_size(); } else { hmac=value->as_string().cstr(); hmac_len=strlen(hmac); } valid_options++; } if(Value* value=options->get("format")) { const String& sformat=value->as_string(); if (sformat == "hex") format = F_HEX; else if (sformat == "base64" ) format = F_BASE64; else if (sformat == "file" ) format = F_FILE; else throw Exception(PARSER_RUNTIME, &sformat, "must be 'hex' or 'base64'"); valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } String::C digest; if(method == M_MD5){ PA_MD5_CTX c; if(hmac){ HMAC(hmac, hmac_len, pa_MD5Init, pa_MD5Update, pa_MD5Final, 64, 16); } else { pa_MD5Init(&c); pa_MD5Update(&c, (const unsigned char*)data.str, data.length); } char *str=(char *)pa_malloc(16); pa_MD5Final((unsigned char *)str, &c); digest = String::C(str, 16); } if(method == M_SHA1){ SHA1Context c; if(hmac){ HMAC(hmac, hmac_len, SHA1Reset, SHA1Input, SHA1ReadDigest, 64, 20); } else { SHA1Reset(&c); SHA1Input(&c, (const unsigned char*)data.str, data.length); } char *str=(char *)pa_malloc(20); SHA1ReadDigest(str, &c); digest = String::C(str, 20); } if(method == M_SHA256){ SHA256_CTX c; if(hmac){ HMAC(hmac, hmac_len, pa_SHA256_Init, pa_SHA256_Update, pa_SHA256_Final, 64, SHA256_DIGEST_LENGTH); } else { pa_SHA256_Init(&c); pa_SHA256_Update(&c, (const unsigned char*)data.str, data.length); } char *str=(char *)pa_malloc(SHA256_DIGEST_LENGTH); pa_SHA256_Final((unsigned char *)str, &c); digest = String::C(str, SHA256_DIGEST_LENGTH); } if(method == M_SHA512){ SHA512_CTX c; if(hmac){ HMAC(hmac, hmac_len, pa_SHA512_Init, pa_SHA512_Update, pa_SHA512_Final, 128, SHA512_DIGEST_LENGTH); } else { pa_SHA512_Init(&c); pa_SHA512_Update(&c, (const unsigned char*)data.str, data.length); } char *str=(char *)pa_malloc(SHA512_DIGEST_LENGTH); pa_SHA512_Final((unsigned char *)str, &c); digest = String::C(str, SHA512_DIGEST_LENGTH); } if(format == F_HEX){ r.write(*new String(hex_string((unsigned char *)digest.str, digest.length, false))); } if(format == F_BASE64){ r.write(*new String(pa_base64_encode(digest.str, digest.length, Base64Options(false /*no wrap*/)))); } if(format == F_FILE){ VFile& result=*new VFile; result.set_binary(true, digest.str, digest.length); r.write(result); } } static void _uuid(Request& r, MethodParams& params) { bool lower=false; bool solid=false; if (params.count() == 1) if (HashStringValue* options = params.as_hash(0)) { int valid_options = 0; if (Value* vlower = options->get("lower")) { lower = r.process(*vlower).as_bool(); valid_options++; } if (Value* vsolid = options->get("solid")) { solid = r.process(*vsolid).as_bool(); valid_options++; } if (valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } r.write(*new String(get_uuid_cstr(lower, solid))); } static void _uuid7(Request& r, MethodParams& params) { bool lower=false; bool solid=false; if (params.count() == 1) if (HashStringValue* options = params.as_hash(0)) { int valid_options = 0; if (Value* vlower = options->get("lower")) { lower = r.process(*vlower).as_bool(); valid_options++; } if (Value* vsolid = options->get("solid")) { solid = r.process(*vsolid).as_bool(); valid_options++; } if (valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } r.write(*new String(get_uuid7_cstr(lower, solid))); } static void _uid64(Request& r, MethodParams& params) { bool lower = false; if (params.count() == 1) if (HashStringValue* options = params.as_hash(0)) { int valid_options = 0; if (Value* vlower = options->get("lower")) { lower = r.process(*vlower).as_bool(); valid_options++; } if (valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } unsigned char id[64/8]; random(&id, sizeof(id)); r.write(*new String(hex_string(id, sizeof(id), !lower))); } static void _crc32(Request& r, MethodParams& params) { const char *string=params.as_string(0, PARAMETER_MUST_BE_STRING).cstr(); r.write(*new VDouble((uint)pa_crc32(string, strlen(string)))); } static const char* abc_hex = "0123456789ABCDEF"; static unsigned char hex_lookup[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0,10,11,12,13,14,15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,10,11,12,13,14,15, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static unsigned char abc_lookup[256] = {}; static unsigned char abc_256_lookup[256] = {}; inline unsigned char *init_abc_256() { if(!abc_256_lookup[255]) for(int i=0; i<256; i++) abc_256_lookup[i] = (unsigned char)i; return abc_256_lookup; } static void _convert(Request& r, MethodParams& params) { String::C data=getData(params.as_no_junction(0, "parameter must be string or file"), r); bool abc_mode = true; unsigned char *lookup; const char *abc_from; int base_from; if(params[1].is_string()) { abc_from = params[1].get_string()->cstr(); base_from = strlen(abc_from); if(base_from < 2) throw Exception(PARSER_RUNTIME, 0, "alphabet 'from' must contain at least 2 characters"); lookup = abc_lookup; memset(abc_lookup,0,sizeof(abc_lookup)); for(int i=0; i 16 && base_from != 256) throw Exception(PARSER_RUNTIME, 0, "base 'from' must be an integer from 2 to 16 or 256"); if (base_from == 256) { abc_from = ""; lookup = init_abc_256(); } else { abc_mode = false; abc_from = abc_hex; lookup = hex_lookup; } } const char *abc_to; int base_to; if(params[2].is_string()) { abc_to=params[2].get_string()->cstr(); base_to=strlen(abc_to); if(base_to < 2) throw Exception(PARSER_RUNTIME, 0, "alphabet 'to' must contain at least 2 characters"); } else { base_to=params.as_int(2, "base 'to' must be integer or string", r); if(base_to < 2 || base_to > 16 && base_to != 256) throw Exception(PARSER_RUNTIME, 0, "base 'to' must be an integer from 2 to 16 or 256"); if (base_to == 256) { abc_to = (char *)init_abc_256(); } else { abc_to = abc_hex; } } VFile* result_file = 0; if(params.count() == 4) if(HashStringValue* options=params.as_hash(3)) { int valid_options=0; if(Value* value=options->get("format")) { const String& sformat=value->as_string(); if (sformat == "file" ) result_file = new VFile; else if (sformat != "string") throw Exception(PARSER_RUNTIME, &sformat, "must be 'string' or 'file'"); valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } bool negative=false; // converting digits to their numeric values unsigned char *src=(unsigned char *)pa_strdup(data.str, data.length); const unsigned char *src_end = src + data.length; unsigned char *c; if(abc_mode){ for(c=src;c=base_from) { for(unsigned char *s=c;s remainders((size_t)round(data.length * log((double)base_from) / log((double)base_to)) + 1); do { int carry = 0; unsigned char *dst = src; for (c=src; c= base_to) { *(dst++) = (unsigned char)(carry / base_to); carry %= base_to; } else if (dst > src) { *(dst++) = 0; } } src_end = dst; remainders += abc_to[carry]; } while (src_end > src); // result processing size_t result_length = negative + remainders.count(); char *result_str = (char *)pa_malloc_atomic(result_length+1); if(negative) result_str[0] = '-'; for(size_t i=0; iset(true /*tainted*/, 0 /*binary*/, result_str, result_length, 0, 0, &r); r.write(*result_file); } else { if(memchr(result_str, 0, result_length)) throw Exception(PARSER_RUNTIME, 0, "Invalid \\x00 character found while converting to string. Convert to file instead."); fix_line_breaks(result_str, result_length); if(result_length) r.write(*new String(result_str, String::L_TAINTED)); } } // constructor MMath::MMath(): Methoded("math") { // ^FUNC(expr) #define ADDN(name, N) \ add_native_method(#name, Method::CT_STATIC, _##name, N, N) #define ADD1(name) ADDN(name, 1) ADD1(round); ADD1(floor); ADD1(ceiling); ADD1(trunc); ADD1(frac); ADD1(abs); ADD1(sign); ADD1(exp); ADD1(log); ADD1(log10); ADD1(sin); ADD1(asin); ADD1(cos); ADD1(acos); ADD1(tan); ADD1(atan); ADDN(atan2, 2); ADD1(degrees); ADD1(radians); ADD1(sqrt); ADD1(random); // ^math:pow(x;y) ADDN(pow, 2); // ^math:crypt[password;salt] ADDN(crypt, 2); // ^math:md5[string] ADD1(md5); // ^math:sha1[string] ADD1(sha1); // ^math:digest[method;string|file;options] add_native_method("digest", Method::CT_STATIC, _digest, 2, 3); // ^math:crc32[string] ADD1(crc32); // ^math:uuid[] // ^math:uuid[options hash] add_native_method("uuid", Method::CT_STATIC, _uuid, 0, 1); // ^math:uuid7[] // ^math:uuid7[options hash] add_native_method("uuid7", Method::CT_STATIC, _uuid7, 0, 1); // ^math:uid64[] // ^math:uid64[options hash] add_native_method("uid64", Method::CT_STATIC, _uid64, 0, 1); // ^math:convert[number|file](base-from)|[abc_from](base-to)|[abc_to][options] add_native_method("convert", Method::CT_STATIC, _convert, 3, 4); } parser-3.5.1/src/classes/table.C0000644000076400007640000014161514727647133013412 00000000000000/** @file Parser: @b table parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #if (!defined(NO_STRINGSTREAM) && !defined(FREEBSD4) && !defined(PA_DEBUG_DISABLE_GC)) #include #include "../lib/gc/include/gc_allocator.h" #define USE_STRINGSTREAM #endif #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_common.h" #include "pa_request.h" #include "pa_charsets.h" #include "pa_vtable.h" #include "pa_vint.h" #include "pa_sql_connection.h" #include "pa_vbool.h" #include "pa_array.h" #include "pa_varray.h" volatile const char * IDENT_TABLE_C="$Id: table.C,v 1.379 2024/12/15 21:47:07 moko Exp $"; // class class MTable: public Methoded { public: // VStateless_class Value* create_new_value(Pool&) { return new VTable(); } public: MTable(); }; // global variable DECLARE_CLASS_VAR(table, new MTable); // globals #define TABLE_REVERSE_NAME "reverse" String table_reverse_name(TABLE_REVERSE_NAME); // methods static Table::Action_options get_action_options(Request& r, MethodParams& params, size_t options_index, const Table& source) { Table::Action_options result; if(params.count() <= options_index) return result; HashStringValue* options=params.as_hash(options_index); if(!options) return result; result.defined=true; bool defined_offset=false; int valid_options=0; if(Value* voffset=options->get(sql_offset_name)) { valid_options++; defined_offset=true; if(voffset->is_string()) { const String& soffset=*voffset->get_string(); if(soffset == "cur") result.offset=source.current(); else throw Exception(PARSER_RUNTIME, &soffset, "must be 'cur' string or expression"); } else { int offset=r.process(*voffset).as_int(); result.offset=offset < 0 ? 0 : offset; } } if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; int limit=r.process(*vlimit).as_int(); result.limit=limit < 0 ? 0: limit; } if(Value *vreverse=(Value *)options->get(table_reverse_name)) { valid_options++; result.reverse=r.process(*vreverse).as_bool(); if(result.reverse && !defined_offset) result.offset=source.count()-1; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); return result; } struct TableControlChars { char separator; const String* sseparator; char encloser; const String* sencloser; char separators[3]; TableControlChars(): separator('\t'), sseparator(new String("\t")), encloser(0), sencloser(0) { strcpy(separators,"\t\n"); } int load( HashStringValue& options ) { int result=0; if(Value* vseparator=options.get(PA_COLUMN_SEPARATOR_NAME)) { sseparator=&vseparator->as_string(); if(sseparator->length()!=1) throw Exception(PARSER_RUNTIME, sseparator, "separator must be one byte character"); separator=sseparator->first_char(); separators[0]=separator; result++; } if(Value* vencloser=options.get(PA_COLUMN_ENCLOSER_NAME)) { sencloser=&vencloser->as_string(); if(sencloser->is_empty()){ encloser=0; } else { if(sencloser->length()!=1) throw Exception(PARSER_RUNTIME, sencloser, "encloser must be empty or one byte character"); encloser=sencloser->first_char(); } result++; } return result; } }; struct lsplit_sresult { String* piece; char delim; lsplit_sresult() : piece(0), delim(0){} operator bool() { return piece!=0; } void append(String *str){ if(piece) *piece << *str; else piece = str; } }; class StringSplitHelper : public String { public: char* base; StringSplitHelper(String astring) : String(astring), base(cstrm()) {} bool check_lang(const char *pos){ return langs.check_lang(L_AS_IS, pos-base, 1); } String *extract(char *pos){ String *result=new String; if(size_t len=strlen(pos)){ // first: their langs result->langs.append(result->body, langs, pos-base, len); // next: letters themselves result->body=Body(pos); } return result; } }; inline lsplit_sresult lsplit(char* *string_ref, const char* delims, StringSplitHelper& helper) { lsplit_sresult result; if(char *pos=*string_ref) { while(pos=strpbrk(pos, delims)) { if(helper.check_lang(pos)){ result.delim=*pos; *pos=0; result.piece=helper.extract(*string_ref); *string_ref=pos+1; return result; } pos++; } result.piece=helper.extract(*string_ref); *string_ref=0; } return result; } static lsplit_sresult lsplit(char** string_ref, const char* delims, char encloser, StringSplitHelper& helper) { lsplit_sresult result; if(char *pos=*string_ref) { if(encloser && *pos==encloser && helper.check_lang(pos)) { *string_ref=++pos; // we are enclosed, searching for second encloser while(1) { if(pos=strchr(pos, encloser)){ if(helper.check_lang(pos)){ *(pos++)=0; result.append(helper.extract(*string_ref)); if(*pos==encloser && helper.check_lang(pos)){ // double-encloser stands for encloser *string_ref=pos; } else { *string_ref=pos; break; } } pos++; } else { result.append(helper.extract(*string_ref)); *string_ref=0; return result; } } // we are no longer enclosed, searching for delimiter while(pos=strpbrk(pos, delims)) { if(helper.check_lang(pos)){ result.delim=*pos; if(pos>*string_ref){ *pos=0; result.append(helper.extract(*string_ref)); } *string_ref=pos+1; return result; } pos++; } result.append(helper.extract(*string_ref)); *string_ref=0; } else return lsplit(string_ref, delims, helper); } return result; } static void skip_clean_empty_lines(char** data_ref, StringSplitHelper& helper) { if(*data_ref) { while(**data_ref == '\n' && helper.check_lang(*data_ref)) (*data_ref)++; } } static void _create(Request& r, MethodParams& params) { // clone/copy part? if(Table *source=params[0].get_table()) { Table::Action_options o=get_action_options(r, params, 1, *source); if(params.count()>2) throw Exception(PARSER_RUNTIME, 0, "too many parameters"); GET_SELF(r, VTable).set_table(*new Table(*source, o)); return; } size_t data_param_index=0; bool nameless=false; if(params.count()>1) { if(params[0].is_string()){ // can be nameless only const String& snameless=params.as_string(0, "called with more than 1 param, first param may be only string 'nameless' or junction"); if(snameless!="nameless") throw Exception(PARSER_RUNTIME, &snameless, "table::create called with more than 1 param, first param may be only 'nameless'"); nameless=true; data_param_index++; } } HashStringValue *options=0; TableControlChars control_chars; size_t options_param_index=data_param_index+1; if( options_param_indexcount()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } // data StringSplitHelper sdata(r.process_to_string(params.as_junction(data_param_index, "body must be table or code"))); char *data=sdata.base; // parse columns Table::columns_type columns; if(nameless) { columns=0; // nameless } else { columns=new ArrayString; while( lsplit_sresult sr=lsplit(&data, control_chars.separators, control_chars.encloser, sdata) ) { *columns+=sr.piece; if(sr.delim=='\n') break; } } Table& table=*new Table(columns); int columns_count=columns ? columns->count(): 0; // parse cells Table::element_type row(new ArrayString(columns_count)); skip_clean_empty_lines(&data, sdata); while( lsplit_sresult sr=lsplit(&data, control_chars.separators, control_chars.encloser, sdata) ) { if(sr.piece->is_empty() && !sr.delim && !row->count()) // append last empty column [if without \n] break; *row+=sr.piece; if(sr.delim=='\n') { table+=row; row=new ArrayString(columns_count); skip_clean_empty_lines(&data, sdata); } } // last line [if without \n] if(row->count()) table+=row; // replace any previous table value GET_SELF(r, VTable).set_table(table); } struct lsplit_result { char* piece; char delim; lsplit_result(char *apiece=0) : piece(apiece), delim(0){} operator bool() { return piece!=0; } }; inline lsplit_result lsplit(char* *string_ref, const char* delims) { lsplit_result result(*string_ref); if(result.piece) { if(char* v=strpbrk(result.piece, delims)) { result.delim=*v; *v=0; *string_ref=v+1; return result; } *string_ref=0; } return result; } static lsplit_result lsplit(char** string_ref, const char* delims, char encloser) { lsplit_result result(*string_ref); if(result.piece) { if(encloser && *result.piece==encloser) { result.piece++; char c; char *read; char *write; write=read=result.piece; // we are enclosed, searching for second encloser while(c=*read++) { if(c==encloser) { if(*read==encloser) // double-encloser stands for encloser read++; else break; // note: skipping encloser } *write++=c; } // we are no longer enclosed, searching for delimiter while(c=*read++) { if(c==delims[0] || c==delims[1]) { result.delim=c; break; } else *write++=c; } *write=0; // terminate *string_ref=c ? read : 0; return result; } else return lsplit(string_ref, delims); } return result; } static void skip_empty_and_comment_lines( char** data_ref ) { while(*data_ref) { if(**data_ref == '\n'){ (*data_ref)++; } else { if(**data_ref == '#' ) /*nowhere=*/getrow(data_ref); else break; } } } static void skip_empty_lines( char** data_ref ) { if(*data_ref) { while(**data_ref == '\n') (*data_ref)++; } } typedef void (*Skip_lines_action)(char** data_ref); static void _load(Request& r, MethodParams& params) { const String& first_param=params.as_file_name(0); int filename_param_index=0; bool nameless=first_param=="nameless"; if(nameless) filename_param_index++; size_t options_param_index=filename_param_index+1; HashStringValue *options=0; TableControlChars control_chars; if(options_param_indexcount(): 0; // parse cells Table::element_type row(new ArrayString(columns_count)); skip_lines_action(&data); while( lsplit_result sr=lsplit(&data, control_chars.separators, control_chars.encloser) ) { if(!*sr.piece && !sr.delim && !row->count()) // append last empty column [if without \n] break; *row+=new String(sr.piece, String::L_TAINTED); if(sr.delim=='\n') { table+=row; row=new ArrayString(columns_count); skip_lines_action(&data); } } // last line [if without \n] if(row->count()) table+=row; // replace any previous table value GET_SELF(r, VTable).set_table(table); } #ifdef USE_STRINGSTREAM typedef std::basic_stringstream, gc_allocator > pa_stringstream; typedef std::basic_string, gc_allocator > pa_string; static void enclose( pa_stringstream& to, const String* from, char encloser ) { if(from){ to<pos( encloser, pos_after ))!=STRING_NOT_FOUND; pos_after=pos_before) { pos_before++; // including first encloser (and skipping it for next pos) to<mid(pos_after, pos_before).cstr(); to<length(); if(pos_aftermid(pos_after, from_length).cstr(); to< i(*table.columns()); i; ) { enclose( result, i.next(), control_chars.encloser ); if(i) result< i(*table.columns()); i; ) { result<cstr(); if(i) result<count():0) for(int column=0; column i(table); if(control_chars.encloser){ while(i) { for(Array_iterator c(*i.next()); c; ) { enclose( result, c.next(), control_chars.encloser ); if(c) result< c(*i.next()); c; ) { result<cstr(); if(c) result<pos( encloser, pos_after ))!=STRING_NOT_FOUND; pos_after=pos_before) { pos_before++; // including first encloser (and skipping it for next pos) to<mid(pos_after, pos_before); to<<*sencloser; // doubling encloser } // last piece size_t from_length=from->length(); if(pos_aftermid(pos_after, from_length); to<<*sencloser; } else { to<<*sencloser<<*sencloser; } } static void table_to_csv(String& result, Table& table, TableControlChars& control_chars, bool output_column_names) { if(output_column_names) { if(table.columns()) { // named table if(control_chars.encloser) { for(Array_iterator i(*table.columns()); i; ) { enclose( result, i.next(), control_chars.encloser, control_chars.sencloser ); if(i) result<<*control_chars.sseparator; } } else { for(Array_iterator i(*table.columns()); i; ) { result<<*i.next(); if(i) result<<*control_chars.sseparator; } } } else { // nameless table [we were asked to output column names] if(int lsize=table.count()?table[0]->count():0) for(int column=0; column i(table); if(control_chars.encloser){ while(i) { for(Array_iterator c(*i.next()); c; ) { enclose( result, c.next(), control_chars.encloser, control_chars.sencloser ); if(c) result<<*control_chars.sseparator; } result.append_know_length("\n", 1, String::L_CLEAN); } } else { while(i) { for(Array_iterator c(*i.next()); c; ) { result<<*c.next(); if(c) result<<*control_chars.sseparator; } result.append_know_length("\n", 1, String::L_CLEAN); } } } #endif // don't use stringstream static void _save(Request& r, MethodParams& params) { const String& first_arg=params.as_string(0, PARAMETER_MUST_BE_STRING); size_t param_index=1; bool do_append=false; bool output_column_names=true; // mode? if(first_arg=="append") do_append=true; else if(first_arg=="nameless") output_column_names=false; else --param_index; const String& file_name=params.as_file_name(param_index++); String file_spec=r.full_disk_path(file_name); if(do_append && file_exist(file_spec)) output_column_names=false; TableControlChars control_chars; if(param_indexcount()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } if(param_index0 && params[0].is_string()) { if(params.as_string(0, PARAM_MUST_NOT_BE_CODE)=="nameless") { output_column_names=false; param_index++; } else { throw Exception(PARSER_RUNTIME, 0, "bad mode (must be nameless)"); } } TableControlChars control_chars; if(param_indexcount()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } Table& table=GET_SELF(r, VTable).table(); #ifdef USE_STRINGSTREAM pa_stringstream ost(std::stringstream::out); table_to_csv(ost, table, control_chars, output_column_names); r.write(*new VString(*new String(pa_strdup(ost.str().c_str()), String::L_CLEAN))); #else String sdata; table_to_csv(sdata, table, control_chars, output_column_names); r.write(*new VString(*new String(sdata.cstr(), String::L_CLEAN))); #endif } static void _count(Request& r, MethodParams& params) { Table& table=GET_SELF(r, VTable).table(); size_t result=0; if(params.count()) { const String& param=params.as_string(0, PARAMETER_MUST_BE_STRING); if(param == "columns") result = table.columns() ? table.columns()->count() : table.max_cells(); else if(param == "cells") result = table.count() ? table[table.current()]->count() : 0; else if(param == "rows") // synonim for ^table.count[] result = table.count(); else throw Exception(PARSER_RUNTIME, ¶m, "parameter must be 'columns', 'cells' and 'rows' only"); } else result = table.count(); r.write(*new VInt(result)); } static void _line(Request& r, MethodParams&) { int result=1+GET_SELF(r, VTable).table().current(); r.write(*new VInt(result)); } static void _offset(Request& r, MethodParams& params) { Table& table=GET_SELF(r, VTable).table(); if(params.count()) { bool absolute=false; if(params.count()>1) { const String& whence=params.as_string(0, "whence must be string"); if(whence=="cur") absolute=false; else if(whence=="set") absolute=true; else throw Exception(PARSER_RUNTIME, &whence, "is an invalid whence, valid are 'cur' or 'set'"); } int offset=params.as_int(params.count()-1, "offset must be expression", r); table.offset(absolute, offset); } else r.write(*new VInt(table.current())); } static void _menu(Request& r, MethodParams& params) { InCycle temp(r); Value& body_code=params.as_junction(0, "body must be code"); Value* delim_maybe_code=params.count()>1?¶ms[1]:0; Table& table=GET_SELF(r, VTable).table(); Temp_current tc(table); if(delim_maybe_code) { // delimiter set bool need_delim=false; for(size_t row=0; rowis_empty()) { // we have body if(need_delim) // need delim & iteration produced string? r.write(r.process(*delim_maybe_code)); else need_delim=true; } r.write(sv_processed); if(skip.check_break()) break; } } else { for(size_t row=0; row* value_fields; Value* value_code; HashStringValue* hash; Table2hash_distint distinct; size_t row; Table2hash_value_type value_type; }; #endif static void table_row_to_hash(Table::element_type row, Row_info *info) { const String* key; if(info->key_code) { info->table->set_current(info->row++); // change context row Value& sv_processed=info->r->process(*info->key_code); key=&sv_processed.as_string(); } else { key=info->key_field < row->count() ? row->get(info->key_field) : 0; } if(!key) return; // ignore rows without key [too-short-record_array if-indexed] bool exist=false; switch(info->value_type) { case C_STRING: { if(info->value_fields->count()){ size_t index=info->value_fields->get(0); exist=info->hash->put_dont_replace(*key, (index < row->count()) ? new VString(*row->get(index)) : VString::empty()); } else { exist=info->hash->put_dont_replace(*key, VString::empty()); } break; } case C_HASH: { VHash* vhash=new VHash; HashStringValue& hash=vhash->hash(); Table::columns_type columns=info->table->columns(); if(info->value_fields){ // selected fields (can be empty) for(Array_iterator i(*info->value_fields); i; ) { size_t value_field=i.next(); if(value_fieldcount()) hash.put(columns ? *columns->get(value_field) : String(pa_uitoa(value_field)), new VString(*row->get(value_field))); } } else { // all fields for(size_t index=0; indexcount(); index++) { hash.put(columns && index < columns->count() ? *columns->get(index) : String(pa_uitoa(index)), new VString(*row->get(index))); } } exist=info->hash->put_dont_replace(*key, vhash); break; } case C_TABLE: { VTable* vtable=(VTable*)info->hash->get(*key); // table exist? Table* table; if(vtable) { if(info->distinct==D_ILLEGAL) { exist=true; break; } table=vtable->get_table(); } else { // no? creating table of same structure as source Table::Action_options table_options(0, 0); table=new Table(*info->table, table_options/*no rows, just structure*/); info->hash->put(*key, new VTable(table)); } Table::element_type row_copy(new ArrayString(row->count())); row_copy->append(*row); *table+=row_copy; break; } case C_CODE: { if(!info->key_code) info->table->set_current(info->row++); // change context row exist=info->hash->put_dont_replace(*key, &info->r->process(*info->value_code)); break; } } if(exist && info->distinct==D_ILLEGAL) throw Exception(PARSER_RUNTIME, key, "duplicate key"); } Table2hash_value_type get_value_type(Value& vvalue_type){ if(vvalue_type.is_string()) { const String& svalue_type=*vvalue_type.get_string(); if(svalue_type == "table"){ return C_TABLE; } else if (svalue_type == "string") { return C_STRING; } else if (svalue_type == "hash") { return C_HASH; } else { throw Exception(PARSER_RUNTIME, &svalue_type, "must be 'hash', 'table' or 'string'"); } } else { throw Exception(PARSER_RUNTIME, 0, "'type' must be string"); } } static Table2hash_distint get_distinct(Value& vdistinct, Table2hash_value_type& value_type){ if(vdistinct.is_string()) { const String& sdistinct=*vdistinct.get_string(); if(sdistinct!="tables") throw Exception(PARSER_RUNTIME, &sdistinct, "must be 'tables' or true/false"); value_type=C_TABLE; return D_FIRST; } return vdistinct.as_bool() ? D_FIRST : D_ILLEGAL; } static void _hash(Request& r, MethodParams& params) { Table& self_table=GET_SELF(r, VTable).table(); VHash& result=*new VHash; Table2hash_distint distinct=D_ILLEGAL; Table2hash_value_type value_type=C_HASH; int param_index=params.count()-1; if(param_index>0) { if(params[1].get_junction()) value_type=C_CODE; if(HashStringValue* options=params[param_index].get_hash()){ // can't use .as_hash because the 2nd param could be table so .as_hash throws an error --param_index; int valid_options=0; if(Value* vdistinct_code=options->get(sql_distinct_name)) { // $.distinct ? valid_options++; distinct=get_distinct(r.process(*vdistinct_code), value_type); } if(Value* vvalue_type_code=options->get(sql_value_type_name)) { // $.type ? if(value_type==C_TABLE) // $.distinct[tables] already was specified throw Exception(PARSER_RUNTIME, 0, "you can't specify $.distinct[tables] and $.type[] together"); if(value_type==C_CODE) throw Exception(PARSER_RUNTIME, 0, "you can't specify $.type[] if value is code"); valid_options++; value_type=get_value_type(r.process(*vvalue_type_code)); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } } if(param_index==2) // options were specified but not as hash throw Exception(PARSER_RUNTIME, 0, "options must be hash"); bool value_all=false; Array value_fields; Value* value_code=0; if(param_index==0){ // list of columns wasn't specified if(value_type==C_STRING) throw Exception(PARSER_RUNTIME, 0, "you must specify one value field with option $.type[string]"); value_all=true; // all columns, including key } else { // list of columns or code was specified if(value_type==C_TABLE) throw Exception(PARSER_RUNTIME, 0, "you can't specify value field(s) with option $.distinct[tables] or $.type[tables]"); Value& value_fields_param=params[1]; if(value_fields_param.get_junction()){ // code specified value_code=&value_fields_param; } else if(value_fields_param.is_string()) { // one column as string was specified const String &field_name=*value_fields_param.get_string(); if(!field_name.is_empty()) value_fields+=self_table.column_name2index(field_name, true); } else if(Table* value_fields_table=value_fields_param.get_table()) { // list of columns were specified in table for(Array_iterator i(*value_fields_table); i; ) { const String& value_field_name =*i.next()->get(0); value_fields +=self_table.column_name2index(value_field_name, true); } } else throw Exception(PARSER_RUNTIME, 0, "value field(s) must be string or table or code"); if(value_type==C_STRING && value_fields.count()>1) throw Exception(PARSER_RUNTIME, 0, "you can't specify more than one value field with option $.type[string]"); } Value* key_param=¶ms[0]; Row_info info={ &r, &self_table, /*key_code=*/key_param->get_junction() ? key_param : 0, /*key_field=*/0/*filled below*/, value_all ? NULL : &value_fields, value_code, &result.hash(), distinct, /*row=*/0, value_type }; info.key_field=(info.key_code ? -1 : self_table.column_name2index(key_param->as_string(), true)); Temp_current tc(self_table); for(Table::RobustIterator i(self_table); i; i.next()) { table_row_to_hash(i.value(), &info); } result.extract_default(); r.write(result); } static void _array(Request& r, MethodParams& params) { Table& table=GET_SELF(r, VTable).table(); VArray& result=*new VArray; ArrayValue& array=result.array(); Table2hash_value_type value_type=C_HASH; Array value_fields; Value* value_code=0; if(params.count()>0) { if(params[0].get_junction()){ value_type=C_CODE; value_code=¶ms[0]; } else if(params[0].is_string()) { const String &field_name=*params[0].get_string(); if(!field_name.is_empty()){ value_type=C_STRING; value_fields+=table.column_name2index(field_name, true); } } else { throw Exception(PARSER_RUNTIME, 0, "value field must be string or code or empty"); } } Temp_current tc(table); for(Table::RobustIterator i(table); i; i.next()) { switch(value_type) { case C_STRING: { size_t index=value_fields.get(0); Table::element_type row=i.value(); array+=(index < row->count() ? new VString(*row->get(index)) : VString::empty()); break; } case C_HASH: { VHash* vhash=new VHash; HashStringValue& hash=vhash->hash(); Table::element_type row=i.value(); Table::columns_type columns=table.columns(); for(size_t index=0; indexcount(); index++) { hash.put(columns && index < columns->count() ? *columns->get(index) : String(pa_uitoa(index)), new VString(*row->get(index))); } array+=vhash; break; } case C_CODE: { table.set_current(i.index()); array+=&r.process(*value_code); break; } } } r.write(result); } static void _cells(Request& r, MethodParams& params) { Table& self_table=GET_SELF(r, VTable).table(); size_t row_size=self_table[self_table.current()]->count(); // number of columns in current row if(params.count()){ int limit=params.as_int(params.count()-1, "limit must be expression", r); if(limit<0) limit=0; if((size_t)limit(a)->value.c_str, static_cast(b)->value.c_str ); } static int sort_cmp_double(const void *a, const void *b) { double va=static_cast(a)->value.d; double vb=static_cast(b)->value.d; if(vavb) return +1; else return 0; } static void _sort(Request& r, MethodParams& params) { Value& key_maker=params.as_junction(0, "key-maker must be code"); bool reverse=params.count()>1 /*..[desc|asc|]*/ && params.as_no_junction(1, "order must not be code").as_string()=="desc"; // default=asc Table& old_table=GET_SELF(r, VTable).table(); Table& new_table=*new Table(old_table.columns()); Table_seq_item* seq=new Table_seq_item[old_table.count()]; int i; // calculate key values bool key_values_are_strings=true; int old_count=old_table.count(); for(i=0; ir->process(*info->expression_code).as_bool(); } static bool _locate_expression(Table& table, Request& r, MethodParams& params) { Value& expression_code=params.as_junction(0, "must be expression"); Table::Action_options o=get_action_options(r, params, 1, table); if(params.count()>2) throw Exception(PARSER_RUNTIME, 0, "locate by expression only has parameters: expression and, maybe, options"); Expression_is_true_info info={&r, &expression_code}; return table.table_first_that(expression_is_true, &info, o); } static bool _locate_name_value(Table& table, Request& r, MethodParams& params) { const String& name=params.as_string(0, "column name must be string"); const String& value=params.as_string(1, VALUE_MUST_BE_STRING); Table::Action_options o=get_action_options(r, params, 2, table); return table.locate(name, value, o); } static void _locate(Request& r, MethodParams& params) { Table& table=GET_SELF(r, VTable).table(); bool result=params[0].get_junction() || (params.count() == 1) ? _locate_expression(table, r, params) : _locate_name_value(table, r, params); r.write(VBool::get(result)); } static void _flip(Request& r, MethodParams&) { Table& old_table=GET_SELF(r, VTable).table(); Table& new_table=*new Table(0); if(size_t old_count=old_table.count()) if(size_t old_cols=old_table.columns()?old_table.columns()->count():old_table.max_cells()) for(size_t column=0; columncount()?old_row->get(column):new String; } new_table+=new_row; } r.write(*new VTable(&new_table)); } static void _foreach(Request& r, MethodParams& params) { InCycle temp(r); const String* rownum_var_name=¶ms.as_string(0, "rownum-var name must be string"); const String* value_var_name=¶ms.as_string(1, "value-var name must be string"); Value& body_code=params.as_junction(2, "body must be code"); Value* delim_maybe_code=params.count()>3?¶ms[3]:0; Table& table=GET_SELF(r, VTable).table(); Temp_current tc(table); rownum_var_name=rownum_var_name->is_empty()? 0 : rownum_var_name; value_var_name=value_var_name->is_empty()? 0 : value_var_name; Value* var_context=r.get_method_frame()->caller(); if(delim_maybe_code) { // delimiter set bool need_delim=false; for(size_t row=0; rowis_empty()) { // we have body if(need_delim) // need delim & iteration produced string? r.write(r.process(*delim_maybe_code)); else need_delim=true; } r.write(sv_processed); if(skip.check_break()) break; } } else { for(size_t row=0; rowput_element(String(aname, String::L_CLEAN), avalue); // new not required } inline Table::element_type row_from_string(Request& r, Value ¶m){ if(!param.is_string() && !param.get_junction()) throw Exception(PARSER_RUNTIME, 0, "row must be string, code or hash"); const String& string=r.process_to_string(param); // parse cells Table::element_type row=new ArrayString; string.split(*row, 0, "\t", String::L_AS_IS); return row; } static void _append(Request& r, MethodParams& params) { VTable vtable=GET_SELF(r, VTable); Table& table=vtable.table(); HashStringValue* hash=params[0].get_hash(); if(hash){ Temp_current tc(table); table+=new ArrayString(); table.set_current(table.count()-1); hash->for_each(update_cell, &vtable); } else { table+=row_from_string(r, params[0]); } } static void _insert(Request& r, MethodParams& params) { VTable vtable=GET_SELF(r, VTable); Table& table=vtable.table(); HashStringValue* hash=params[0].get_hash(); if(hash){ table.insert(table.current(), new ArrayString()); hash->for_each(update_cell, &vtable); } else { table.insert(table.current(), row_from_string(r, params[0])); } } static void _delete(Request& r, MethodParams&) { Table& table=GET_SELF(r, VTable).table(); table.remove_current(); } static void join_named_row(Table& src, Table* dest) { Table::columns_type dest_columns=dest->columns(); size_t dest_columns_count=dest_columns->count(); Table::element_type dest_row(new ArrayString(dest_columns_count)); for(size_t dest_column=0; dest_columnget(dest_column)); *dest_row+=src_item?src_item:new String; } *dest+=dest_row; } static void join_nameless_row(Table& src, Table* dest) { *dest+=src[src.current()]; } static void _join(Request& r, MethodParams& params) { if(Table* src=params.as_table(0, "source")){ Table::Action_options o=get_action_options(r, params, 1, *src); Table& dest=GET_SELF(r, VTable).table(); if(src == &dest) throw Exception(PARSER_RUNTIME, 0, "source and destination are same table"); if(dest.columns()) // dest is named src->table_for_each(join_named_row, &dest, o); else // dest is nameless src->table_for_each(join_nameless_row, &dest, o); } } #ifndef DOXYGEN class Table_sql_event_handlers: public SQL_Driver_query_event_handlers { ArrayString& columns; int columns_count; ArrayString* row; public: Table* table; public: Table_sql_event_handlers() : columns(*new ArrayString), row(0), table(0) { } bool add_column(SQL_Error& error, const char *str, size_t ) { try { columns+=new String(str, String::L_TAINTED /* no length as 0x00 can be inside */); return false; } catch(...) { error=SQL_Error("exception occurred in Table_sql_event_handlers::add_column"); return true; } } bool before_rows(SQL_Error& error) { if(table) { error=SQL_Error("result must contain exactly one table"); return true; } try { table=new Table(&columns); columns_count=columns.count(); return false; } catch(...) { error=SQL_Error("exception occurred in Table_sql_event_handlers::before_rows"); return true; } } bool add_row(SQL_Error& error) { try { *table+=row=new ArrayString(columns_count); return false; } catch(...) { error=SQL_Error("exception occurred in Table_sql_event_handlers::add_row"); return true; } } bool add_row_cell(SQL_Error& error, const char* str, size_t ) { try { *row+=str?new String(str, String::L_TAINTED /* no length as 0x00 can be inside */):&String::Empty; return false; } catch(...) { error=SQL_Error("exception occurred in Table_sql_event_handlers::add_row_cell"); return true; } } }; #endif static void marshal_bind( HashStringValue::key_type aname, HashStringValue::value_type avalue, SQL_Driver::Placeholder** pptr) { SQL_Driver::Placeholder& ph=**pptr; ph.name=aname.cstr(); ph.value=avalue->as_string().untaint_cstr(String::L_AS_IS); ph.is_null=avalue->get_class()==void_class; ph.were_updated=false; (*pptr)++; } // not static, used elsewhere int marshal_binds(HashStringValue& hash, SQL_Driver::Placeholder*& placeholders) { int hash_count=hash.count(); placeholders=new(PointerGC) SQL_Driver::Placeholder[hash_count]; SQL_Driver::Placeholder* ptr=placeholders; hash.for_each(marshal_bind, &ptr); return hash_count; } // not static, used elsewhere void unmarshal_bind_updates(HashStringValue& hash, int placeholder_count, SQL_Driver::Placeholder* placeholders) { SQL_Driver::Placeholder* ph=placeholders; for(int i=0; iwere_updated) { Value* value; if(ph->is_null) value=VVoid::get(); else value=new VString(*new String(ph->value, String::L_TAINTED)); hash.put(ph->name, value); } } static void _sql(Request& r, MethodParams& params) { Value& statement=params.as_junction(0, "statement must be code"); HashStringValue* bind=0; ulong limit=SQL_NO_LIMIT; ulong offset=0; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "sql options")) { int valid_options=0; if(Value* vbind=options->get(sql_bind_name)) { valid_options++; bind=vbind->get_hash(); } if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; limit=(ulong)r.process(*vlimit).as_double(); } if(Value* voffset=options->get(sql_offset_name)) { valid_options++; offset=(ulong)r.process(*voffset).as_double(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } SQL_Driver::Placeholder* placeholders=0; uint placeholders_count=0; if(bind) placeholders_count=marshal_binds(*bind, placeholders); const String& statement_string=r.process_to_string(statement); const char* statement_cstr=statement_string.untaint_cstr(String::L_SQL, r.connection()); Table_sql_event_handlers handlers; r.connection()->query( statement_cstr, placeholders_count, placeholders, offset, limit, handlers, statement_string); if(bind) unmarshal_bind_updates(*bind, placeholders_count, placeholders); Table& result= handlers.table?*handlers.table: // query resulted in table? return it *new Table(Table::columns_type(0)); // query returned no table, fake it // replace any previous table value GET_SELF(r, VTable).set_table(result); } static void _columns(Request& r, MethodParams& params) { const String* column_column_name; if(params.count()>0) column_column_name=¶ms.as_string(0, COLUMN_NAME_MUST_BE_STRING); else column_column_name=new String("column"); Table::columns_type result_columns(new ArrayString); *result_columns+=column_column_name; Table& result_table=*new Table(result_columns); Table& source_table=GET_SELF(r, VTable).table(); if(Table::columns_type source_columns=source_table.columns()) { for(Array_iterator i(*source_columns); i; ) { Table::element_type result_row(new ArrayString); *result_row+=i.next(); result_table+=result_row; } } r.write(*new VTable(&result_table)); } static void _select(Request& r, MethodParams& params) { InCycle temp(r); Value& vcondition=params.as_expression(0, "condition must be number, bool or expression"); Table& source_table=GET_SELF(r, VTable).table(); int limit=source_table.count(); int offset=0; bool reverse=false; if(params.count()>1) if(HashStringValue* options=params.as_hash(1)) { int valid_options=0; if(Value* vlimit=options->get(sql_limit_name)) { valid_options++; limit=r.process(*vlimit).as_int(); } if(Value* voffset=options->get(sql_offset_name)) { valid_options++; offset=r.process(*voffset).as_int(); } if(Value* vreverse=options->get(table_reverse_name)) { valid_options++; reverse=r.process(*vreverse).as_bool(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } Table& result_table=*new Table(source_table.columns()); size_t size=source_table.count(); if(offset<0) offset+=size; if(size && limit>0 && offset>=0 && (size_t)offset (size_t)offset && source_table.valid(row)) // ...condition is true, adding to the result result_table+=source_table[row]; if(row==0) break; } } else { for(size_t row=0; row < size && result_table.count() < (size_t)limit; row++) { source_table.set_current(row); bool condition=r.process(vcondition).as_bool(); if(r.check_skip_break()) break; if(condition && ++appended > (size_t)offset && source_table.valid(row)) // ...condition is true, adding to the result result_table+=source_table[row]; } } } r.write(*new VTable(&result_table)); } static void _rename(Request& r, MethodParams& params) { const String* name_from=NULL; const String* name_to=NULL; HashStringValue* names=NULL; if(params.count()>1){ name_from=¶ms.as_string(0, COLUMN_NAME_MUST_BE_STRING); name_to=¶ms.as_string(1, COLUMN_NAME_MUST_BE_STRING); } else names=params.as_hash(0); Table& table=GET_SELF(r, VTable).table(); if(Table::columns_type columns=table.columns()) { if(names){ for(size_t i=0; icount(); i++) { const String *column = columns->get(i); if(Value* vto=names->get(*column)){ if(const String *sto=vto->get_string()) columns->put(i, sto); else throw Exception(PARSER_RUNTIME, column, COLUMN_NAME_MUST_BE_STRING); } } } else if(name_from){ for(size_t i=0; icount(); i++) { const String *column = columns->get(i); if(*column == *name_from) columns->put(i, name_to); } } table.column_names_init(); } else throw Exception(PARSER_RUNTIME, 0, "columns renaming is not supported for nameless tables"); } // constructor MTable::MTable(): Methoded("table") { // ^table::create{data} // ^table::create[nameless]{data} // ^table::create[table] add_native_method("create", Method::CT_DYNAMIC, _create, 1, 3); // old name for compatibility with <= v 1.141 2002/01/25 11:33:45 paf add_native_method("set", Method::CT_DYNAMIC, _create, 1, 3); // ^table::load[file] // ^table::load[nameless;file] add_native_method("load", Method::CT_DYNAMIC, _load, 1, 3); // ^table.save[file] // ^table.save[nameless;file] add_native_method("save", Method::CT_DYNAMIC, _save, 1, 3); // add_native_method("save_old", Method::CT_DYNAMIC, _save_old, 1, 3); // ^table.csv-string[] // ^table.csv-string[nameless] // ^table.csv-string[nameless;$.encloser["] $.separator[,]] add_native_method("csv-string", Method::CT_DYNAMIC, _csv_string, 0, 2); // ^table.count[] // ^table.count[rows] // ^table.count[columns] // ^table.count[cells] add_native_method("count", Method::CT_DYNAMIC, _count, 0, 1); // ^table.line[] add_native_method("line", Method::CT_DYNAMIC, _line, 0, 0); // ^table.offset[] // ^table.offset(offset) // ^table.offset[cur|set](offset) add_native_method("offset", Method::CT_DYNAMIC, _offset, 0, 2); // ^table.menu{code} // ^table.menu{code}[delim] add_native_method("menu", Method::CT_DYNAMIC, _menu, 1, 2); // ^table.hash[key field name] // ^table.hash[key field name][value field name(s) string/table] add_native_method("hash", Method::CT_DYNAMIC, _hash, 1, 3); // ^table.array[] // ^table.array[string] // ^table.array{code} add_native_method("array", Method::CT_DYNAMIC, _array, 0, 1); // ^table.cells[] // ^table.cells(limit) add_native_method("cells", Method::CT_DYNAMIC, _cells, 0, 1); // ^table.sort{string-key-maker} ^table.sort{string-key-maker}[desc|asc] // ^table.sort(numeric-key-maker) ^table.sort(numeric-key-maker)[desc|asc] add_native_method("sort", Method::CT_DYNAMIC, _sort, 1, 2); // ^table.locate[field;value] add_native_method("locate", Method::CT_DYNAMIC, _locate, 1, 3); // ^table.flip[] add_native_method("flip", Method::CT_DYNAMIC, _flip, 0, 0); // ^table.foreach[row-num;value]{code} // ^table.foreach[row-num;value]{code}[delim] add_native_method("foreach", Method::CT_DYNAMIC, _foreach, 3, 4); // ^table.append{row{tab}data} add_native_method("append", Method::CT_DYNAMIC, _append, 1, 1); // ^table.insert{row{tab}data} before current row add_native_method("insert", Method::CT_DYNAMIC, _insert, 1, 1); // ^table.delete[] current row add_native_method("delete", Method::CT_DYNAMIC, _delete, 0, 0); // ^table.join[table][$.limit(10) $.offset(1) $.offset[cur] ] add_native_method("join", Method::CT_DYNAMIC, _join, 1, 2); // ^table::sql[query] // ^table::sql[query][$.limit(1) $.offset(2)] add_native_method("sql", Method::CT_DYNAMIC, _sql, 1, 2); // ^table.columns[[column name]] add_native_method("columns", Method::CT_DYNAMIC, _columns, 0, 1); // ^table.select(expression) = table add_native_method("select", Method::CT_DYNAMIC, _select, 1, 2); // ^table.rename[column name from;column name to] // ^table.rename[ $.[column name from][column name to] ... ] add_native_method("rename", Method::CT_DYNAMIC, _rename, 1, 2); } parser-3.5.1/src/classes/memory.C0000644000076400007640000000231014712042465013606 00000000000000/** @file Parser: @b memory parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_common.h" #include "pa_vmemory.h" #include "pa_request.h" #include "pa_vmethod_frame.h" volatile const char * IDENT_MEMORY_C="$Id: memory.C,v 1.21 2024/11/04 03:53:25 moko Exp $" IDENT_PA_VMEMORY_H; class MMemory: public Methoded { public: MMemory(); public: // Methoded bool used_directly() { return false; } }; // global variables DECLARE_CLASS_VAR(memory, new MMemory); static void _compact(Request& r, MethodParams&) { r.wipe_unused_execution_stack(); pa_gc_collect(true); } static void _auto_compact(Request& r, MethodParams& params) { int divisor = params.as_int(0, "frequency must be int", r); if(divisor<0 || divisor>5) throw Exception(PARSER_RUNTIME, 0, "frequency '%d' is out of range 0..5", divisor); pa_gc_set_free_space_divisor(divisor); } // constructor MMemory::MMemory(): Methoded("memory") { // ^compact[] add_native_method("compact", Method::CT_STATIC, _compact, 0, 0); // ^auto-compact(N) add_native_method("auto-compact", Method::CT_STATIC, _auto_compact, 1, 1); } parser-3.5.1/src/classes/form.C0000644000076400007640000000422414712042465013247 00000000000000/** @file Parser: @b form parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vform.h" volatile const char * IDENT_FORM_C="$Id: form.C,v 1.52 2024/11/04 03:53:25 moko Exp $"; /// $LIMITS.max_post_size default 10M const size_t MAX_POST_SIZE_DEFAULT=10*0x400*0x400; // class class MForm : public Methoded { public: // Methoded bool used_directly() { return false; } void configure_admin(Request& r); public: MForm(): Methoded("form") {} }; // global variable DECLARE_CLASS_VAR(form, new MForm); // defines for statics #define LIMITS_NAME "LIMITS" #define MAX_POST_SIZE_NAME "post_max_size" // statics static const String max_post_size_name(MAX_POST_SIZE_NAME); static const String limits_name(LIMITS_NAME); // methods // constructor & configurator void MForm::configure_admin(Request& r) { Value* limits=r.main_class.get_element(limits_name); if(r.request_info.can_have_body()){ // $limits.max_post_size default 10M Value* element=limits ? limits->get_element(max_post_size_name) : 0; size_t value=element ? (size_t)element->as_double() : 0; size_t max_post_size=value ? value : MAX_POST_SIZE_DEFAULT; if(r.request_info.content_length>max_post_size) throw Exception(PARSER_RUNTIME, 0, "posted content_length(%u) > $" LIMITS_NAME "." MAX_POST_SIZE_NAME "(%u)", r.request_info.content_length, max_post_size); // read POST data if(r.request_info.content_length) { char *post_data=new(PointerFreeGC) char[r.request_info.content_length+1/*terminating zero*/]; size_t post_size=SAPI::read_post(r.sapi_info, post_data, r.request_info.content_length); post_data[post_size]=0; // terminating zero r.request_info.post_data=post_data; r.request_info.post_size=post_size; } else { r.request_info.post_data=0; r.request_info.post_size=0; } if(r.request_info.post_size!=r.request_info.content_length) throw Exception(0, 0, "post_size(%u) != content_length(%u)", r.request_info.post_size, r.request_info.content_length); } } parser-3.5.1/src/classes/xnode.C0000644000076400007640000007030114712042465013420 00000000000000/** @file Parser: @b dom parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #ifdef XML #include "pa_vmethod_frame.h" #include "pa_charset.h" #include "pa_request.h" #include "pa_vxnode.h" #include "pa_vxdoc.h" #include "pa_vvoid.h" #include "pa_xml_exception.h" #include "pa_vbool.h" #include "xnode.h" #include "libxml/xpath.h" #include "libxml/xpathInternals.h" volatile const char * IDENT_XNODE_C="$Id: xnode.C,v 1.101 2024/11/04 03:53:25 moko Exp $" IDENT_XNODE_H; // classes class xmlXPathObject_auto_ptr { public: explicit xmlXPathObject_auto_ptr(xmlXPathObject *_APtr = 0) : _Owns(_APtr != 0), _Ptr(_APtr) {} xmlXPathObject_auto_ptr(const xmlXPathObject_auto_ptr& _Y) : _Owns(_Y._Owns), _Ptr(_Y.release()) {} xmlXPathObject_auto_ptr& operator=(const xmlXPathObject_auto_ptr& _Y) {if (this != &_Y) {if (_Ptr != _Y.get()) {if (_Owns && _Ptr) xmlXPathFreeObject(_Ptr); _Owns = _Y._Owns; } else if (_Y._Owns) _Owns = true; _Ptr = _Y.release(); } return (*this); } ~xmlXPathObject_auto_ptr() {if (_Owns && _Ptr) xmlXPathFreeObject(_Ptr); } xmlXPathObject& operator*() const {return (*get()); } xmlXPathObject *operator->() const {return (get()); } xmlXPathObject *get() const {return (_Ptr); } xmlXPathObject *release() const {((xmlXPathObject_auto_ptr *)this)->_Owns = false; return (_Ptr); } private: bool _Owns; xmlXPathObject *_Ptr; }; class xmlXPathContext_auto_ptr { public: explicit xmlXPathContext_auto_ptr(xmlXPathContext *_APtr = 0) : _Owns(_APtr != 0), _Ptr(_APtr) {} xmlXPathContext_auto_ptr(const xmlXPathContext_auto_ptr& _Y) : _Owns(_Y._Owns), _Ptr(_Y.release()) {} xmlXPathContext_auto_ptr& operator=(const xmlXPathContext_auto_ptr& _Y) {if (this != &_Y) {if (_Ptr != _Y.get()) {if (_Owns && _Ptr) xmlXPathFreeContext(_Ptr); _Owns = _Y._Owns; } else if (_Y._Owns) _Owns = true; _Ptr = _Y.release(); } return (*this); } ~xmlXPathContext_auto_ptr() {if (_Owns && _Ptr) xmlXPathFreeContext(_Ptr); } xmlXPathContext& operator*() const {return (*get()); } xmlXPathContext *operator->() const {return (get()); } xmlXPathContext *get() const {return (_Ptr); } xmlXPathContext *release() const {((xmlXPathContext_auto_ptr *)this)->_Owns = false; return (_Ptr); } private: bool _Owns; xmlXPathContext *_Ptr; }; // helpers xmlNode& as_node(MethodParams& params, int index, const char* msg) { Value& value=params.as_no_junction(index, msg); if(VXnode* vxnode=dynamic_cast(&value)) return vxnode->get_xmlnode(); else throw Exception(PARSER_RUNTIME, 0, msg); } xmlChar* as_xmlchar(Request& r, MethodParams& params, int index, const char* msg) { return r.transcode(params.as_string(index, msg)); } xmlChar* as_xmlqname(Request& r, MethodParams& params, int index, const char* msg) { xmlChar* qname=r.transcode(params.as_string(index, msg ? msg : XML_QUALIFIED_NAME_MUST_BE_STRING)); if(xmlValidateQName(qname, 0)) throw XmlException(0, XML_INVALID_QUALIFIED_NAME, qname); return qname; } xmlChar* as_xmlncname(Request& r, MethodParams& params, int index, const char* msg) { xmlChar* ncname=r.transcode(params.as_string(index, msg ? msg : XML_NC_NAME_MUST_BE_STRING)); if(xmlValidateNCName(ncname, 0)) throw XmlException(0, XML_INVALID_NC_NAME, ncname); return ncname; } xmlChar* as_xmlname(Request& r, MethodParams& params, int index, const char* msg) { xmlChar* localName=r.transcode(params.as_string(index, msg ? msg : XML_LOCAL_NAME_MUST_BE_STRING)); if(xmlValidateName(localName, 0)) throw XmlException(0, XML_INVALID_LOCAL_NAME, localName); return localName; } xmlChar* as_xmlnsuri(Request& r, MethodParams& params, int index) { return r.transcode(params.as_string(index, XML_NAMESPACEURI_MUST_BE_STRING)); } xmlAttr& as_attr(MethodParams& params, int index, const char* msg) { xmlNode& xmlnode=as_node(params, index, msg); if(xmlnode.type!=XML_ATTRIBUTE_NODE) throw Exception(PARSER_RUNTIME, 0, msg); return *(xmlAttr*)&xmlnode; } static void writeNode(Request& r, VXdoc& xdoc, xmlNode* node) { if(!node|| xmlHaveGenericErrors()) throw XmlException(0, r); // OOM, bad name, things like that // write out result r.write(xdoc.wrap(*node)); } static xmlNode* pa_getAttributeNodeNS(xmlNode& selfNode, const xmlChar* localName, const xmlChar* namespaceURI) { for(xmlNode* currentNode=(xmlNode*)selfNode.properties; currentNode; currentNode=currentNode->next) { if(!namespaceURI || (currentNode->ns && xmlStrEqual(currentNode->ns->href, namespaceURI)) ) if(!localName || xmlStrEqual(currentNode->name, localName)) return currentNode; } return 0; } xmlNs& pa_xmlMapNs(xmlDoc& doc, const xmlChar *href, const xmlChar *prefix) { assert(href); // prefix can be null xmlNs *cur=doc.oldNs; while (cur != NULL && ((cur->prefix == NULL && prefix != NULL) || (cur->prefix != NULL && prefix == NULL) || !xmlStrEqual (cur->prefix, prefix)) && !xmlStrEqual (cur->href, href)) cur = cur->next; if (cur == NULL) { cur = xmlNewNs (NULL, href, prefix); if(!cur || xmlHaveGenericErrors()) throw XmlException(); cur->next = doc.oldNs; doc.oldNs = cur; } return *cur; } /// @todo: , parent! static void pa_addAttributeNode(xmlNode& selfNode, xmlAttr& attrNode) { if(attrNode.type!=XML_ATTRIBUTE_NODE) throw Exception(PARSER_RUNTIME, 0, "must be ATTRIBUTE_NODE"); /* * Add it at the end to preserve parsing order ... */ if (selfNode.properties == NULL) { selfNode.properties = &attrNode; } else { xmlAttrPtr prev = selfNode.properties; while (prev->next != NULL) prev = prev->next; prev->next = &attrNode; attrNode.prev = prev; } if (xmlIsID(selfNode.doc, &selfNode, &attrNode) == 1) xmlAddID(NULL, selfNode.doc, xmlNodeGetContent((xmlNode*)&attrNode), &attrNode); } static const xmlChar * pa_xmlGetNsURI(xmlNode *node) { if (node == NULL || node->ns == NULL) return NULL; return node->ns->href; } #ifndef DOXYGEN struct AccumulateFoundInfo { HashStringValue* hash; VXdoc* vdoc; int index; }; #endif static void AccumulateFound(xmlNode& node, AccumulateFoundInfo* info) { info->hash->put( pa_uitoa(info->index++), &info->vdoc->wrap(node)); } template static void pa_xmlNamedPreorderTraversal ( xmlNode *root, xmlChar *tagURI, xmlChar *tagName, void callback(xmlNode& node, I info), I info) { for(xmlNode *iter=root->children; iter; iter = iter->next) { if(iter->type == XML_ELEMENT_NODE && (xmlStrEqual(iter->name, tagName) || xmlStrEqual(tagName, (const xmlChar*)"*"))) { if(tagURI != NULL && (xmlStrEqual(pa_xmlGetNsURI(iter), tagURI) || xmlStrEqual(tagURI, (const xmlChar*)"*"))) callback(*iter, info); else if(tagURI == NULL) callback(*iter, info); } pa_xmlNamedPreorderTraversal(iter, tagURI, tagName, callback, info); } return; } // methods // DOM1 node // Node insertBefore(in Node newChild,in Node refChild) raises(DOMException); static void _insertBefore(Request& r, MethodParams& params) { xmlNode& newChild=as_node(params, 0, "newChild must be node"); xmlNode& refChild=as_node(params, 1, "refChild must be node"); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); //xmlNode& selfNode=vnode.get_xmlnode(); xmlNode* retNode=xmlAddPrevSibling(&refChild, &newChild); // write out result writeNode(r, vxdoc, retNode); } // Node replaceChild(in Node newChild,in Node oldChild) raises(DOMException); static void _replaceChild(Request& r, MethodParams& params) { xmlNode& newChild=as_node(params, 0, "newChild must be node"); xmlNode& oldChild=as_node(params, 1, "oldChild must be node"); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vxdoc.get_xmldoc(); xmlNode& selfNode=vnode.get_xmlnode(); if(newChild.doc!=&xmldoc) throw Exception("xml.dom", 0, "WRONG_DOCUMENT_ERR"); if(oldChild.doc!=&xmldoc) throw Exception("xml.dom", 0, "WRONG_DOCUMENT_ERR"); if(oldChild.parent!=&selfNode) throw Exception("xml.dom", 0, "NOT_FOUND_ERR"); xmlNode* refChild=oldChild.next; xmlUnlinkNode(&oldChild); xmlNode* retNode; if(refChild) retNode=xmlAddPrevSibling(refChild, &newChild); else retNode=xmlAddChild(&selfNode, &newChild); // write out result writeNode(r, vxdoc, retNode); } // Node removeChild(in Node oldChild) raises(DOMException); static void _removeChild(Request& r, MethodParams& params) { xmlNode& oldChild=as_node(params, 0, "refChild must be node"); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vxdoc.get_xmldoc(); // xmlNode& selfNode=vnode.get_xmlnode(); if(oldChild.doc!=&xmldoc) throw Exception("xml.dom", 0, "WRONG_DOCUMENT_ERR"); xmlUnlinkNode(&oldChild); // write out result writeNode(r, vxdoc, &oldChild); } // Node appendChild(in Node newChild) raises(DOMException); static void _appendChild(Request& r, MethodParams& params) { xmlNode& newChild=as_node(params, 0, "newChild must be node"); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& selfNode=vnode.get_xmlnode(); xmlNode* retNode=xmlAddChild(&selfNode, &newChild); // write out result writeNode(r, vxdoc, retNode); } // boolean hasChildNodes(); static void _hasChildNodes(Request& r, MethodParams&) { VXnode& vnode=GET_SELF(r, VXnode); xmlNode& node=vnode.get_xmlnode(); // write out result r.write(VBool::get(node.children!=0)); } // Node cloneNode(in boolean deep); static void _cloneNode(Request& r, MethodParams& params) { bool deep=params.as_bool(0, "deep must be bool", r); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& selfNode=vnode.get_xmlnode(); VXdoc& vxdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vxdoc.get_xmldoc(); xmlNode* retNode=xmlDocCopyNode(&selfNode, &xmldoc, deep?1: 0); // write out result writeNode(r, vxdoc, retNode); } // DOM1 element xmlNode& get_self_element(VXnode& vnode) { xmlNode& node=vnode.get_xmlnode(); if(node.type!=XML_ELEMENT_NODE) throw Exception(PARSER_RUNTIME, 0, "method can only be called on nodes of ELEMENT type"); return node; } // DOMString getAttribute(in DOMString name); static void _getAttribute(Request& r, MethodParams& params) { const xmlChar* name=as_xmlname(r, params, 0); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // @todo: when name="xmlns" xmlChar* attribute_value=xmlGetProp(&element, name); // write out result r.write(r.transcode(attribute_value)); } // void setAttribute(in DOMString name, in DOMString value) raises(DOMException); static void _setAttribute(Request& r, MethodParams& params) { const xmlChar* name=as_xmlname(r, params, 0); const xmlChar* attribute_value=as_xmlchar(r, params, 1, XML_VALUE_MUST_BE_STRING); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // @todo: when name="xmlns" if(!xmlSetProp(&element, name, attribute_value)) throw XmlException(0, r); } // void removeAttribute(in DOMString name) raises(DOMException); static void _removeAttribute(Request& r, MethodParams& params) { const xmlChar* name=as_xmlname(r, params, 0); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // @todo: when name="xmlns" xmlUnsetProp(&element, name); } // Attr getAttributeNode(in DOMString name); static void _getAttributeNode(Request& r, MethodParams& params) { const xmlChar* localName=as_xmlname(r, params, 0); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& element=get_self_element(vnode); if(xmlNode* retNode=pa_getAttributeNodeNS(element, localName, 0)){ // write out result writeNode(r, vxdoc, retNode); } } // Attr setAttributeNode(in Attr newAttr) raises(DOMException); // Attr setAttributeNodeNS(in Attr newAttr) raises(DOMException); static void _setAttributeNode(Request& r, MethodParams& params) { VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& element=get_self_element(vnode); xmlDoc& xmldoc=vxdoc.get_xmldoc(); xmlAttr& newAttr=as_attr(params, 0, "newAttr must be ATTRIBUTE node"); if(newAttr.doc!=&xmldoc) throw Exception("xml.dom", 0, "WRONG_DOCUMENT_ERR"); if(newAttr.parent) throw Exception("xml.dom", 0, "INUSE_ATTRIBUTE_ERR"); if(xmlNode* retNode=pa_getAttributeNodeNS(element, newAttr.name, pa_xmlGetNsURI((xmlNode*)&newAttr))) { // write out result writeNode(r, vxdoc, retNode); xmlUnlinkNode(retNode); } pa_addAttributeNode(element, newAttr); } // Attr removeAttributeNode(in Attr oldAttr) raises(DOMException); static void _removeAttributeNode(Request& r, MethodParams& params) { xmlAttr& oldAttr=as_attr(params, 0, "oldAttr must be ATTRIBUTE node"); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& element=get_self_element(vnode); if(oldAttr.parent!=&element) throw Exception("xml.dom", 0, "NOT_FOUND_ERR"); xmlUnlinkNode((xmlNode*)&oldAttr); // write out result writeNode(r, vxdoc, (xmlNode*)&oldAttr); } // NodeList getElementsByTagName(in DOMString name); // '*' means all tags static void _getElementsByTagName(Request& r, MethodParams& params) { xmlChar* tagName=as_xmlchar(r, params, 0, XML_LOCAL_NAME_MUST_BE_STRING); if(xmlValidateName(tagName, 0) != 0 && strcmp((const char*)tagName, "*") != 0) throw XmlException(0, XML_INVALID_LOCAL_NAME, tagName); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& xmlnode=vnode.get_xmlnode(); VHash& result=*new VHash; AccumulateFoundInfo info={&result.hash(), &vxdoc, 0}; pa_xmlNamedPreorderTraversal(&xmlnode, 0, tagName, AccumulateFound, &info); // write out result r.write(result); } // DOM 2 // DOMString getAttributeNS(in DOMString namespaceURI, in DOMString localName); static void _getAttributeNS(Request& r, MethodParams& params) { xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); xmlChar* localName=as_xmlname(r, params, 1); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // todo: when name="xmlns" xmlChar* attribute_value=xmlGetNsProp(&element, localName, namespaceURI); // write out result r.write(r.transcode(attribute_value)); } // void setAttributeNS(in DOMString namespaceURI, in DOMString qualifiedName, in DOMString value) raises(DOMException); static void _setAttributeNS(Request& r, MethodParams& params) { const xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); const xmlChar* qualifiedName=as_xmlqname(r, params, 1); const xmlChar* attribute_value=as_xmlchar(r, params, 2, XML_VALUE_MUST_BE_STRING); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vxdoc.get_xmldoc(); xmlChar* prefix=0; xmlChar* localName=xmlSplitQName2(qualifiedName, &prefix); // @todo: name=xmlns xmlAttr* attrNode; if(localName) { xmlNs& ns=pa_xmlMapNs(xmldoc, namespaceURI, prefix); attrNode=xmlSetNsProp(&element, &ns, localName, attribute_value); } else { attrNode=xmlSetProp(&element, qualifiedName/*unqualified, actually*/, attribute_value); } if(!attrNode) throw XmlException(0, r); } // void removeAttributeNS(in DOMString namespaceURI, in DOMString localName) raises(DOMException); static void _removeAttributeNS(Request& r, MethodParams& params) { const xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); const xmlChar* localName=as_xmlname(r, params, 1); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vxdoc.get_xmldoc(); // @todo: when name="xmlns" xmlNs& ns=pa_xmlMapNs(xmldoc, namespaceURI, 0); xmlUnsetNsProp(&element, &ns, localName); } // Attr getAttributeNodeNS(in DOMString namespaceURI, in DOMString localName); static void _getAttributeNodeNS(Request& r, MethodParams& params) { const xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); const xmlChar* localName=as_xmlname(r, params, 1); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& element=get_self_element(vnode); if(xmlNode* retNode=pa_getAttributeNodeNS(element, localName, namespaceURI)){ // write out result writeNode(r, vxdoc, retNode); } } // boolean hasAttribute(in DOMString name) raises(DOMException); static void _hasAttribute(Request& r, MethodParams& params) { const xmlChar* name=as_xmlname(r, params, 0); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // @todo: when name="xmlns" // write out result r.write(VBool::get(xmlHasProp(&element, name)!=0)); } // boolean hasAttributeNS(n DOMString namespaceURI, in DOMString localName) raises(DOMException); static void _hasAttributeNS(Request& r, MethodParams& params) { const xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); const xmlChar* localName=as_xmlname(r, params, 1); VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // write out result r.write(VBool::get(xmlHasNsProp(&element, localName, namespaceURI)!=0)); } // boolean hasAttributes static void _hasAttributes(Request& r, MethodParams&) { VXnode& vnode=GET_SELF(r, VXnode); xmlNode& element=get_self_element(vnode); // write out result r.write(VBool::get(element.properties!=0)); } // NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString localName); // '*' as namespaceURI means get all namespaces // '*' as localName means get all tags static void _getElementsByTagNameNS(Request& r, MethodParams& params) { xmlChar* namespaceURI=as_xmlchar(r, params, 0, XML_NAMESPACEURI_MUST_BE_STRING); xmlChar* localName=as_xmlchar(r, params, 1, XML_LOCAL_NAME_MUST_BE_STRING); if(xmlValidateName(localName, 0) != 0 && strcmp((const char*)localName, "*") != 0) throw XmlException(0, XML_INVALID_LOCAL_NAME, localName); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vdoc.get_xmldoc(); VHash& result=*new VHash; AccumulateFoundInfo info={&result.hash(), &vdoc, 0}; pa_xmlNamedPreorderTraversal((xmlNode*)&xmldoc, namespaceURI, localName, AccumulateFound, &info); // write out result r.write(result); } // void normalize(); static void _normalize(Request&, MethodParams&) { /*maybe someday VXnode& vnode=GET_SELF(r, VXnode); xmlNode& selfNode=vnode.get_xmlnode(); gdome_n_normalize(selfNode, &exc); if(exc) throw XmlException(0, exc); */ } #ifndef DOXYGEN struct Register_one_ns_info { Request* r; xmlXPathContextPtr ctxt; }; #endif static void register_one_ns( HashStringValue::key_type key, HashStringValue::value_type value, Register_one_ns_info* info) { if(const String* svalue=value->get_string()) xmlXPathRegisterNs(info->ctxt, info->r->transcode(key), info->r->transcode(*svalue)); else throw Exception(PARSER_RUNTIME, new String(key, String::L_TAINTED), "value is %s, must be string or number", value->type()); } static void _selectX(Request& r, MethodParams& params, void (*handler)(Request& r, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& xdoc, Value*& result)) { VXnode& vnode=GET_SELF(r, VXnode); xmlNode& xmlnode=vnode.get_xmlnode(); VXdoc& vdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vdoc.get_xmldoc(); // expression const String& expression=params.as_string(0, "expression must be string"); xmlXPathContext_auto_ptr ctxt(xmlXPathNewContext(&xmldoc)); { Register_one_ns_info info={&r, ctxt.get()}; vdoc.search_namespaces.hash().for_each(register_one_ns, &info); } ctxt->node=&xmlnode; /*error to stderr for now*/ xmlXPathObject_auto_ptr res( xmlXPathEvalExpression(r.transcode(expression), ctxt.get())); if(xmlHaveGenericErrors()) throw XmlException(0, r); Value* result=0; if(res.get()) handler(r, expression, res, vdoc, result); if(result) r.write(*result); } static void selectNodesHandler(Request&, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& xdoc, Value*& result) { VHash& vhash=*new VHash; result=&vhash; switch(res->type) { case XPATH_UNDEFINED: break; case XPATH_NODESET: if(res->nodesetval) if(int size=res->nodesetval->nodeNr) { HashStringValue& hash=vhash.hash(); for(int i=0; inodesetval->nodeTab[i])); } break; default: throw Exception(PARSER_RUNTIME, &expression, "wrong xmlXPathEvalExpression result type (%d)", res->type); break; // never } } static void selectNodeHandler(Request& r, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& xdoc, Value*& result) { switch(res->type) { case XPATH_UNDEFINED: break; case XPATH_NODESET: if(res->nodesetval && res->nodesetval->nodeNr) { // empty result strangely has NODESET res->type if(res->nodesetval->nodeNr>1) throw Exception(PARSER_RUNTIME, &expression, "resulted not in a single node (%d)", res->nodesetval->nodeNr); result=&xdoc.wrap(*res->nodesetval->nodeTab[0]); } break; case XPATH_BOOLEAN: result=&VBool::get(res->boolval!=0); break; case XPATH_NUMBER: result=new VDouble(res->floatval); break; case XPATH_STRING: result=new VString(r.transcode((xmlChar*)res->stringval)); break; default: throw Exception(PARSER_RUNTIME, &expression, "wrong xmlXPathEvalExpression result type (%d)", res->type); } } static void selectBoolHandler(Request&, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& /*xdoc*/, Value*& result) { switch(res->type) { case XPATH_BOOLEAN: result=&VBool::get(res->boolval!=0); break; case XPATH_NODESET: if(!(res->nodesetval && res->nodesetval->nodeNr)) break; // else[nodeset] fall down to default default: throw Exception(PARSER_RUNTIME, &expression, "wrong xmlXPathEvalExpression result type (%d)", res->type); break; // never } } static void selectNumberHandler(Request&, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& /*xdoc*/, Value*& result) { switch(res->type) { case XPATH_NUMBER: result=new VDouble(res->floatval); break; case XPATH_NODESET: if(!(res->nodesetval && res->nodesetval->nodeNr)) break; // else[nodeset] fall down to default default: throw Exception(PARSER_RUNTIME, &expression, "wrong xmlXPathEvalExpression result type (%d)", res->type); break; // never } } static void selectStringHandler(Request& r, const String& expression, xmlXPathObject_auto_ptr res, VXdoc& /*xdoc*/, Value*& result) { switch(res->type) { case XPATH_UNDEFINED: break; case XPATH_STRING: result=new VString(r.transcode((xmlChar*)res->stringval)); break; case XPATH_NODESET: if(!(res->nodesetval && res->nodesetval->nodeNr)) break; // else[nodeset] fall down to default default: throw Exception(PARSER_RUNTIME, &expression, "wrong xmlXPathEvalExpression result type (%d)", res->type); break; // never } } static void _select(Request& r, MethodParams& params) { _selectX(r, params, selectNodesHandler); } static void _selectSingle(Request& r, MethodParams& params) { _selectX(r, params, selectNodeHandler); } static void _selectBool(Request& r, MethodParams& params) { _selectX(r, params, selectBoolHandler); } static void _selectNumber(Request& r, MethodParams& params) { _selectX(r, params, selectNumberHandler); } static void _selectString(Request& r, MethodParams& params) { _selectX(r, params, selectStringHandler); } // constructor /// @bug one can change const and ruin other's work, we need unchangable VIntConst class MXnode::MXnode(const char* aname): Methoded(aname?aname:"xnode") { /// DOM1 node // Node insertBefore(in Node newChild,in Node refChild) raises(DOMException); add_native_method("insertBefore", Method::CT_DYNAMIC, _insertBefore, 2, 2); // Node replaceChild(in Node newChild,in Node oldChild) raises(DOMException); add_native_method("replaceChild", Method::CT_DYNAMIC, _replaceChild, 2, 2); // Node removeChild(in Node oldChild) raises(DOMException); add_native_method("removeChild", Method::CT_DYNAMIC, _removeChild, 1, 1); // Node appendChild(in Node newChild) raises(DOMException); add_native_method("appendChild", Method::CT_DYNAMIC, _appendChild, 1, 1); // boolean hasChildNodes(); add_native_method("hasChildNodes", Method::CT_DYNAMIC, _hasChildNodes, 0, 0); // Node cloneNode(in boolean deep); add_native_method("cloneNode", Method::CT_DYNAMIC, _cloneNode, 1, 1); /// DOM1 element // DOMString getAttribute(in DOMString name); add_native_method("getAttribute", Method::CT_DYNAMIC, _getAttribute, 1, 1); // void setAttribute(in DOMString name, in DOMString value) raises(DOMException); add_native_method("setAttribute", Method::CT_DYNAMIC, _setAttribute, 2, 2); // void removeAttribute(in DOMString name) raises(DOMException); add_native_method("removeAttribute", Method::CT_DYNAMIC, _removeAttribute, 1, 1); // Attr getAttributeNode(in DOMString name); add_native_method("getAttributeNode", Method::CT_DYNAMIC, _getAttributeNode, 1, 1); // Attr setAttributeNode(in Attr newAttr) raises(DOMException); add_native_method("setAttributeNode", Method::CT_DYNAMIC, _setAttributeNode, 1, 1); // Attr removeAttributeNode(in Attr oldAttr) raises(DOMException); add_native_method("removeAttributeNode", Method::CT_DYNAMIC, _removeAttributeNode, 1, 1); // NodeList getElementsByTagName(in DOMString name); add_native_method("getElementsByTagName", Method::CT_DYNAMIC, _getElementsByTagName, 1, 1); // NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString localName); add_native_method("getElementsByTagNameNS", Method::CT_DYNAMIC, _getElementsByTagNameNS, 2, 2); // void normalize(); add_native_method("normalize", Method::CT_DYNAMIC, _normalize, 0, 0); /// DOM2 element // DOMString getAttributeNS(in DOMString namespaceURI, in DOMString localName); add_native_method("getAttributeNS", Method::CT_DYNAMIC, _getAttributeNS, 2, 2); // void setAttributeNS(in DOMString namespaceURI, in DOMString qualifiedName, in DOMString value) raises(DOMException); add_native_method("setAttributeNS", Method::CT_DYNAMIC, _setAttributeNS, 3, 3); // void removeAttributeNS(in DOMString namespaceURI, in DOMString localName) raises(DOMException); add_native_method("removeAttributeNS", Method::CT_DYNAMIC, _removeAttributeNS, 2, 2); // Attr getAttributeNodeNS(in DOMString namespaceURI, in DOMString localName); add_native_method("getAttributeNodeNS", Method::CT_DYNAMIC, _getAttributeNodeNS, 2, 2); // Attr setAttributeNodeNS(in Attr newAttr) raises(DOMException); add_native_method("setAttributeNodeNS", Method::CT_DYNAMIC, _setAttributeNode, 1, 1); // boolean hasAttribute(in DOMString name) raises(DOMException); add_native_method("hasAttribute", Method::CT_DYNAMIC, _hasAttribute, 1, 1); // boolean hasAttributeNS(in DOMString namespaceURI, in DOMString localName) raises(DOMException); add_native_method("hasAttributeNS", Method::CT_DYNAMIC, _hasAttributeNS, 2, 2); // boolean hasAttributes add_native_method("hasAttributes", Method::CT_DYNAMIC, _hasAttributes, 0, 0); /// parser // ^node.select[/some/xpath/query] = hash $.#[dnode] add_native_method("select", Method::CT_DYNAMIC, _select, 1, 1); // ^node.selectSingle[/some/xpath/query] = first node [if any] add_native_method("selectSingle", Method::CT_DYNAMIC, _selectSingle, 1, 1); // ^node.selectBool[/some/xpath/query] = bool value [if any] add_native_method("selectBool", Method::CT_DYNAMIC, _selectBool, 1, 1); // ^node.selectNumber[/some/xpath/query] = double value [if any] add_native_method("selectNumber", Method::CT_DYNAMIC, _selectNumber, 1, 1); // ^node.selectString[/some/xpath/query] = strinv value [if any] add_native_method("selectString", Method::CT_DYNAMIC, _selectString, 1, 1); // consts #define CONST(name) consts.put(#name, new VInt(XML_##name)) #define CONST2(name, value) consts.put(#name, new VInt(value)) CONST(ELEMENT_NODE); CONST(ATTRIBUTE_NODE); CONST(TEXT_NODE); CONST(CDATA_SECTION_NODE); CONST2(ENTITY_REFERENCE_NODE, XML_ENTITY_REF_NODE); CONST(ENTITY_NODE); CONST2(PROCESSING_INSTRUCTION_NODE, XML_PI_NODE); CONST(COMMENT_NODE); CONST(DOCUMENT_NODE); CONST(DOCUMENT_TYPE_NODE); CONST2(DOCUMENT_FRAGMENT_NODE, XML_DOCUMENT_FRAG_NODE); CONST(NOTATION_NODE); } #endif parser-3.5.1/src/classes/mail.C0000644000076400007640000001377514712042465013241 00000000000000/** @file Parser: @b mail parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #include "pa_vmethod_frame.h" #include "pa_common.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_exec.h" #include "pa_charsets.h" #include "pa_charset.h" #include "pa_uue.h" #include "pa_vmail.h" #include "smtp.h" volatile const char * IDENT_MAIL_C="$Id: mail.C,v 1.137 2024/11/04 03:53:25 moko Exp $"; // defines #define MAIL_CLASS_NAME "mail" #define SENDMAIL_NAME "sendmail" // consts const int ATTACHMENT_WEIGHT=100; // class class MMail: public Methoded { public: // Methoded bool used_directly() { return false; } void configure_user(Request& r); public: MMail(); }; // global variable DECLARE_CLASS_VAR(mail, new MMail); // defines for statics #define MAIL_NAME "MAIL" // statics static const String mail_name(MAIL_NAME); static const String mail_sendmail_name(SENDMAIL_NAME); // helpers static void sendmail( Value* #ifndef WIN32 vmail_conf #endif , Value* smtp_server_port, const String& message, const String* from, const String* to, const String* #ifndef WIN32 options #endif ) { const char* exception_type="email.format"; if(!from) // we use in sendmail -f {from} && SMTP MAIL from: {from} throw Exception(exception_type, 0, "parameter does not specify 'from' header field"); const char* message_cstr=message.untaint_cstr(String::L_AS_IS); if(smtp_server_port) { if(!to) // we use only in SMTP RCPT to: {to} throw Exception(exception_type, 0, "parameter does not specify 'to' header field"); SMTP smtp; char* server=smtp_server_port->as_string().cstrm(); const char* port=rsplit(server, ':'); if(!port) port="25"; smtp.Send(server, port, message_cstr, from->cstrm(), to->cstrm()); return; } #ifdef WIN32 // win32 without SMTP server configured throw Exception(PARSER_RUNTIME, 0, "$" MAIN_CLASS_NAME ":" MAIL_NAME ".SMTP not defined"); #else // unix // $MAIN:MAIL.sendmail["/usr/sbin/sendmail -t -i -f postmaster"] default // $MAIN:MAIL.sendmail["/usr/lib/sendmail -t -i -f postmaster"] default String* sendmail_command=new String; if(vmail_conf) { #ifdef PA_FORCED_SENDMAIL throw Exception(PARSER_RUNTIME, 0, "Parser was configured with --with-sendmail=" PA_FORCED_SENDMAIL " key, to change sendmail you should reconfigure and recompie it"); #else if(Value* sendmail_value=vmail_conf->get_hash()->get(mail_sendmail_name)) *sendmail_command<as_string(); else throw Exception(PARSER_RUNTIME, 0, "$" MAIN_CLASS_NAME ":" MAIL_NAME "." SENDMAIL_NAME " not defined"); #endif } else { #ifdef PA_FORCED_SENDMAIL *sendmail_command<pos("postmaster"); if(at_postmaster!=STRING_NOT_FOUND) { String& reconstructed=sendmail_command->mid(0, at_postmaster); reconstructed << *from; reconstructed << sendmail_command->mid(at_postmaster+10/*postmaster*/, sendmail_command->length()); sendmail_command=&reconstructed; } // execute it ArrayString argv; const String* file_spec; size_t after_file_spec=sendmail_command->pos(' '); if(after_file_spec==STRING_NOT_FOUND || after_file_spec==0) file_spec=sendmail_command; else { file_spec=&sendmail_command->mid(0, after_file_spec); sendmail_command->split(argv, after_file_spec+1, " ", String::L_AS_IS); } if(!file_executable(*file_spec)) throw Exception("email.send", file_spec, "is not executable." #ifdef PA_FORCED_SENDMAIL " Use configure key \"--with-sendmail=appropriate sendmail command\"" #else " Set $" MAIN_CLASS_NAME ":" MAIL_NAME "." SENDMAIL_NAME " to appropriate sendmail command" #endif ); PA_exec_result exec=pa_exec( // forced_allow #ifdef PA_FORCED_SENDMAIL true #else false #endif , *file_spec, 0 /* pass env */, argv, String::C(message_cstr, strlen(message_cstr))); if(exec.status || exec.err.length()) throw Exception("email.send", 0, "'%s' reported problem: %s (%d)", file_spec->cstr(), exec.err.length() ? exec.err.cstr() : "UNKNOWN", exec.status); #endif //WIN32 } // methods static void _send(Request& r, MethodParams& params) { HashStringValue* hash=params.as_hash(0, "message"); if(!hash || !hash->count()) return; // todo@ check if enough options are specified. // now ^mail:send[^hash::create[]] and ^mail:send[$.print-debug(1)] "work". const String* soptions=0; if(Value* voptions=hash->get(MAIL_OPTIONS_NAME)) soptions=&voptions->as_string(); bool print_debug=false; if(Value* vdebug=hash->get(MAIL_DEBUG_NAME)) print_debug=vdebug->as_bool(); Value* vmail_conf=static_cast(r.classes_conf.get(mail_class->type())); Value* smtp_server_port=0; if(vmail_conf) { // $MAIN:MAIL.SMTP[mail.yourdomain.ru[:port]] smtp_server_port=vmail_conf->get_hash()->get("SMTP"); } const String* from=0; String* to=0; const String& message = GET_SELF(r, VMail).message_hash_to_string(r, hash, from, smtp_server_port ? true : false /*send by SMTP=strip to?*/, to); if(print_debug) r.write(message); else sendmail(vmail_conf, smtp_server_port, message, from, to, soptions); } // constructor & configurator MMail::MMail(): Methoded(MAIL_CLASS_NAME) { // ^mail:send{hash} add_native_method("send", Method::CT_STATIC, _send, 1, 1); } void MMail::configure_user(Request& r) { // $MAIN:MAIL[$SMTP[mail.design.ru]] if(Value* mail_element=r.main_class.get_element(mail_name)) { if(mail_element->get_hash()) r.classes_conf.put(type(), mail_element); else if( !mail_element->is_string() ) throw Exception(PARSER_RUNTIME, 0, "$" MAIL_CLASS_NAME ":" MAIL_NAME " is not hash"); } } parser-3.5.1/src/classes/inet.C0000644000076400007640000001434414732404263013247 00000000000000/** @file Parser: @b inet parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vtable.h" #ifdef _MSC_VER #include "winsock2.h" #include "ws2tcpip.h" #endif volatile const char * IDENT_INET_C="$Id: inet.C,v 1.20 2024/12/23 16:59:17 moko Exp $"; class MInet: public Methoded { public: MInet(); }; // global variables DECLARE_CLASS_VAR(inet, new MInet); static void _ntoa(Request& r, MethodParams& params){ unsigned long l=(unsigned long)trunc(params.as_double(0, "parameter must be expression", r)); static const int ip_cstr_bufsize=3*4+3+1/*zero-teminator*/+1/*for faulty snprintfs*/; char* ip_cstr=new(PointerFreeGC) char[ip_cstr_bufsize]; snprintf(ip_cstr, ip_cstr_bufsize, "%u.%u.%u.%u", (l>>24) & 0xFF, (l>>16) & 0xFF, (l>>8) & 0xFF, l & 0xFF); r.write(*new String(ip_cstr)); } static void _aton(Request& r, MethodParams& params){ const String ip=params.as_string(0, PARAMETER_MUST_BE_STRING); if(ip.is_empty()) throw Exception(PARSER_RUNTIME, 0, "IP address must not be empty."); const char* ip_cstr=ip.cstr(); ulong result=0; uint byte_value=0; uint dot_cnt=0; bool byte_start=true; bool err=false; const char* p=ip_cstr; while(char c=*p++){ int digit=(int)(c-'0'); // assume ascii if(digit>=0 && digit<=9){ byte_start=false; if((byte_value=byte_value*10+(uint)digit) > 255){ err=true; break; } } else if(c=='.'){ if(byte_start){ // two dots in row or IP started with dot err=true; break; } else { byte_start=true; dot_cnt++; result=(result << 8)+(ulong)byte_value; byte_value=0; } } else { // invalid char err=true; break; } } if(err || dot_cnt!=3 || byte_start){ throw Exception(PARSER_RUNTIME, 0, "Invalid IP address '%s' specified.", ip_cstr); } else { result=(result << 8)+(ulong)byte_value; r.write(*new VDouble(result)); } } int ipv_format(const String &value){ if(value == "4") return AF_INET; if(value == "6") return AF_INET6; if(value == "any") return AF_UNSPEC; throw Exception(PARSER_RUNTIME, &value, "ipv option value must be 4 or 6 or any"); } static void _ip2name(Request& r, MethodParams& params){ const String sip=params.as_string(0, PARAMETER_MUST_BE_STRING); if(sip.is_empty()) throw Exception(PARSER_RUNTIME, 0, "IP address must not be empty."); const char* ip_cstr=sip.cstr(); struct addrinfo hints, *info=0; memset(&hints, 0, sizeof(hints)); hints.ai_family=AF_INET; hints.ai_socktype=SOCK_STREAM; hints.ai_flags=AI_NUMERICHOST; // to disable DNS lookup if(params.count() == 2) if(HashStringValue* options=params.as_hash(1)){ int valid_options=0; if(Value* value=options->get("ipv")){ hints.ai_family=ipv_format(r.process(*value).as_string()); valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } int error=getaddrinfo(ip_cstr, 0, &hints, &info); if(error==EAI_NONAME) throw Exception(PARSER_RUNTIME, 0, "Invalid IP address '%s' specified", ip_cstr); if(error) throw Exception(PARSER_RUNTIME, 0, "Invalid IP address '%s': %s", ip_cstr, gai_strerror(error)); char hbuf[NI_MAXHOST]; error=getnameinfo(info->ai_addr, info->ai_addrlen, hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD); freeaddrinfo(info); if(!error){ r.write(*new String(pa_idna_decode(pa_strdup(hbuf), r.charsets.source()), String::L_TAINTED)); } else if(error!=EAI_NONAME){ throw Exception(PARSER_RUNTIME, 0, "Can't resolve IP address '%s': %s", ip_cstr, gai_strerror(error)); } } static void _name2ip(Request& r, MethodParams& params){ const String sname=params.as_string(0, PARAMETER_MUST_BE_STRING); if(sname.is_empty()) throw Exception(PARSER_RUNTIME, 0, "Domain name must not be empty."); const char* name_cstr=pa_idna_encode(sname.cstr(), r.charsets.source()); struct addrinfo hints, *info; memset(&hints, 0, sizeof(hints)); hints.ai_family=AF_INET; hints.ai_socktype=SOCK_STREAM; Table *table=NULL; if(params.count() == 2) if(HashStringValue* options=params.as_hash(1)){ int valid_options=0; if(Value* value=options->get("ipv")){ hints.ai_family=ipv_format(r.process(*value).as_string()); valid_options++; } if(Value* value=options->get("table")){ if(r.process(*value).as_bool()){ Table::columns_type columns(new ArrayString); static const String sip("ip"), sversion("version"); *columns+=&sip; *columns+=&sversion; table=new Table(columns); } valid_options++; } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } int error=getaddrinfo(name_cstr, NULL, &hints, &info); if(error) throw Exception(PARSER_RUNTIME, 0, "Can't resolve domain name '%s': %s", name_cstr, gai_strerror(error)); char hbuf[INET6_ADDRSTRLEN]; for(struct addrinfo *cur=info; cur; cur=cur->ai_next) { if(error=getnameinfo(cur->ai_addr, cur->ai_addrlen, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST)) throw Exception(PARSER_RUNTIME, 0, "Can't translate address: %s", gai_strerror(error)); String *saddr=new String(pa_strdup(hbuf), String::L_TAINTED); if(table){ Table::element_type row(new ArrayString()); static const String sv4("4"), sv6("6"), sunknown("unknown"); *row+=saddr; *row+=cur->ai_family == AF_INET ? &sv4 : cur->ai_family == AF_INET6 ? &sv6 : &sunknown; *table+=row; } else { r.write(*saddr); break; } } if(table) r.write(*new VTable(table)); freeaddrinfo(info); } static void _hostname(Request& r, MethodParams&){ char buf[MAX_STRING]; if(gethostname(buf, MAX_STRING)) throw Exception(PARSER_RUNTIME, 0, "Cant't get hostname"); r.write(*new String(pa_strdup(buf), String::L_TAINTED)); } // constructor MInet::MInet(): Methoded("inet") { add_native_method("ntoa", Method::CT_STATIC, _ntoa, 1, 1); add_native_method("aton", Method::CT_STATIC, _aton, 1, 1); // ^inet:ip2name[ip; $.ipv[4|6|any] ] add_native_method("ip2name", Method::CT_STATIC, _ip2name, 1, 2); // ^inet:name2ip[name; $.ipv[4|6|any] $.table(true) ] add_native_method("name2ip", Method::CT_STATIC, _name2ip, 1, 2); // ^inet:hostname[] add_native_method("hostname", Method::CT_STATIC, _hostname, 0, 0); } parser-3.5.1/src/classes/reflection.C0000644000076400007640000005635714732404263014454 00000000000000/** @file Parser: @b reflection parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vbool.h" #include "pa_varray.h" #include "pa_vobject.h" volatile const char * IDENT_REFLECTION_C="$Id: reflection.C,v 1.97 2024/12/23 16:59:17 moko Exp $"; static const String class_type_methoded("methoded"); static const String method_type_native("native"); static const String method_type_parser("parser"); static const String method_name("name"); static const String method_class_name("class"); static const String method_call_type("call_type"); static const String method_inherited("inherited"); static const String method_overridden("overridden"); static const String method_min_params("min_params"); static const String method_max_params("max_params"); static const String method_extra_param("extra_param"); static const String method_named_params("named_params"); static const String def_class("class"); // class class MReflection: public Methoded { public: MReflection(); }; // global variable DECLARE_CLASS_VAR(reflection, new MReflection); // methods const int MAX_CREATE_PARAMS = 100; static void _create(Request& r, MethodParams& params) { int params_offset; HashStringValue* params_hash=0; const String* class_name=0; const String* constructor_name=0; Value& voptions=params.as_no_junction(0, "param must not be code"); if(HashStringValue* options=voptions.get_hash()) { int valid_options=0; if(Value* vclass_name=options->get("class")) { valid_options++; class_name=&vclass_name->as_string(); } if(Value* vconstructor_name=options->get("constructor")) { valid_options++; constructor_name=&vconstructor_name->as_string(); } if(Value* vparams_hash=options->get("arguments")) { valid_options++; params_hash=vparams_hash->as_hash("arguments"); if(params.count()>1) throw Exception(PARSER_RUNTIME, 0, "arguments should not be specified as hash and as create params"); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); if(!class_name) throw Exception(PARSER_RUNTIME, 0, "class name must be specified"); if(!constructor_name) throw Exception(PARSER_RUNTIME, 0, "constructor name must be specified"); params_offset=1; } else { class_name=¶ms.as_string(0, "param must not be code"); if(params.count()==1) throw Exception(PARSER_RUNTIME, 0, "constructor name must be specified"); constructor_name=¶ms.as_string(1, "constructor name must be string"); params_offset=2; } VStateless_class& vclass=r.get_class_ref(*class_name); const Method* method=vclass.get_method(*constructor_name); if(!method) throw Exception(PARSER_RUNTIME, constructor_name, "constructor not found in class '%s'", vclass.type()); Value &object = r.construct(vclass, *method); int nparams=params_hash ? params_hash->count() : (params.count()-params_offset); if(nparams>MAX_CREATE_PARAMS) throw Exception(PARSER_RUNTIME, 0, "arguments count should not exceed %d", MAX_CREATE_PARAMS); Value* args[MAX_CREATE_PARAMS]; CONSTRUCTOR_FRAME_ACTION(*method, r.get_method_frame(), object, { if(nparams>0){ if(params_hash){ int i=0; for(HashStringValue::Iterator h(*params_hash); h; h.next()) args[i++]=h.value(); } else { for(int i=0; i::Iterator i(r.classes()); i; i.next()){ result.hash().put(i.key(), i.value()->get_methods().count()>0 ? new VString(class_type_methoded) : VVoid::get() ); } r.write(result); } static Value& get_class(Value& value){ if(VStateless_class* result=value.get_class()) return *result; else { // we can't return code junction to outside as it's stack value if(Junction *j=value.get_junction()) if(j->code) throw Exception(PARSER_RUNTIME, 0, "param must not be code junction"); // method junction return value; } } static const String& get_class_name(Value& value){ return *new String(get_class(value).type()); } static void _class(Request& r, MethodParams& params) { r.write(get_class(params[0])); } static void _class_name(Request& r, MethodParams& params) { r.write(get_class_name(params[0])); } static void _class_by_name(Request& r, MethodParams& params) { const String& class_name=params.as_string(0, "class_name must be string"); r.write(r.get_class_ref(class_name)); } static void _class_alias(Request& r, MethodParams& params) { const String& src_class_name=params.as_string(0, "source class_name must be string"); const String& new_class_name=params.as_string(1, "alias class_name must be string"); VStateless_class &src_class=r.get_class_ref(src_class_name); if(!r.add_class(new_class_name.cstr(), &src_class)) throw Exception(PARSER_RUNTIME, &new_class_name, "class is already defined"); } static void _base(Request& r, MethodParams& params) { if(VStateless_class* vclass=params[0].get_class()) if(Value* base=vclass->base()){ r.write(get_class(*base)); return; } // classes with fields only, like env & console or without base r.write_value(*VVoid::get()); } static void _base_name(Request& r, MethodParams& params) { if(VStateless_class* vclass=params[0].get_class()) if(Value* base=vclass->base()) r.write(get_class_name(*base)); } static void _def(Request& r, MethodParams& params) { const String& type=params.as_string(0, "type must be string"); if(type == def_class) { const String& name=params.as_string(1, "name must be string"); // can't use get_class because it will call @autouse[] if the class wasn't loaded r.write(VBool::get(r.classes().get(name)!=0)); } else { throw Exception(PARSER_RUNTIME, &type, "is an invalid type, must be '%s'", def_class.cstr()); } } static void _methods(Request& r, MethodParams& params) { const String& class_name=params.as_string(0, "class_name must be string"); VStateless_class& vclass=r.get_class_ref(class_name); bool reverse=true; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "methods options")) { int valid_options=0; for(HashStringValue::Iterator i(*options); i; i.next() ){ String::Body key=i.key(); Value* value=i.value(); if(key == "reverse") { reverse=r.process(*value).as_bool(); valid_options++; } } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } VHash& result=*new VHash; #ifdef HASH_ORDER if(reverse){ for(HashStringMethod::ReverseIterator i(vclass.get_methods()); i; i.prev()){ result.hash().put(i.key(), new VString(i.value()->native_code ? method_type_native : method_type_parser)); } } else { #else { #endif for(HashStringMethod::Iterator i(vclass.get_methods()); i; i.next()){ result.hash().put(i.key(), new VString(i.value()->native_code ? method_type_native : method_type_parser)); } } r.write(result); } static VJunction &method_junction(Value &self, Method &method){ if(method.native_code) throw Exception(PARSER_RUNTIME, method.name, "method must not be native"); if(!(dynamic_cast(&self) || dynamic_cast(&self))) throw Exception(PARSER_RUNTIME, 0, "self must be parser object or class"); return *method.get_vjunction(self); } static void _method(Request& r, MethodParams& params) { Value &source=params[0]; if(Junction *j=source.get_junction()){ if(Method* method=const_cast(j->method)){ Value& self=params.count()>1 ? params.as_no_junction(1, "self must be object") : r.get_method_frame()->caller()->self(); r.write(method_junction(self, *method)); return; } throw Exception(PARSER_RUNTIME, 0, "param must be method junction"); } if(params.count()==1) throw Exception(PARSER_RUNTIME, 0, "method name must be specified"); const String& name=params.as_string(1, "method name must be string"); if(VStateless_class* vclass=source.get_class()) { if(Method* method=vclass->get_method(name)){ r.write( params.count()>2 ? method_junction(params.as_no_junction(2, "self must be object"), *method) : *method->get_vjunction(source) ); return; } } r.write_value(*VVoid::get()); } static void _fields(Request& r, MethodParams& params) { Value& o=params.as_no_junction(0, "param must be object or class"); if(HashStringValue* fields=o.get_fields()) r.write(*new VHash(*fields)); else r.write(*new VHash()); } static void _fields_reference(Request& r, MethodParams& params) { Value& o=params.as_no_junction(0, "param must be object or hash"); if(HashStringValue* fields=o.get_fields_reference()) r.write(*new VHashReference(*fields)); else throw Exception(PARSER_RUNTIME, 0, "param must be object or hash"); } static void _field(Request& r, MethodParams& params) { Value& o=params.as_no_junction(0, "first param must be object or class"); const String& name=params.as_string(1, "field name must be string"); if(HashStringValue* fields=o.get_fields()) if(Value* value=fields->get(name)) r.write(*value); } static void _method_info(Request& r, MethodParams& params) { const Method* method; VHash& result=*new VHash; HashStringValue* hash=result.get_hash(); if(Junction *j=params[0].get_junction()){ if(!(method=j->method)) throw Exception(PARSER_RUNTIME, 0, "param must be class name or method junction"); hash->put(method_name, new VString(*method->name)); hash->put(method_class_name, new VString(*new String(j->self.type()))); } else { const String& class_name=params.as_string(0, "param must be class name or method junction"); VStateless_class& vclass=r.get_class_ref(class_name); if(params.count()==1) throw Exception(PARSER_RUNTIME, 0, "method name must be specified"); const String& method_name=params.as_string(1, "method name must be string"); if(!(method=vclass.get_method(method_name))) throw Exception(PARSER_RUNTIME, &method_name, "method not found in class '%s'", vclass.type()); Method* base_method; if(vclass.base() && (base_method=vclass.base()->get_method(*method->name))){ VStateless_class* c=vclass.base()->get_class(); while(c->base() && base_method==c->base()->get_method(*method->name)) c=c->base()->get_class(); hash->put((base_method==method) ? method_inherited : method_overridden, new VString(*new String(c->type()))); } } Value* call_type=0; switch(method->call_type){ case Method::CT_DYNAMIC: call_type=new VString(Symbols::DYNAMIC_SYMBOL); break; case Method::CT_STATIC: call_type=new VString(Symbols::STATIC_SYMBOL); break; case Method::CT_ANY: break; } if(call_type) hash->put(method_call_type, call_type); if(method->native_code){ // native code hash->put(method_min_params, new VInt(method->min_numbered_params_count)); hash->put(method_max_params, new VInt(method->max_numbered_params_count)); } else { // parser code const String* filespec = r.get_method_filespec(method); if( filespec ) hash->put("file", new VString(*filespec)); hash->put(method_max_params, new VInt(method->params_count + (method->named_params ? 1 : 0))); if(method->params_names) for(size_t i=0; iparams_names->count(); i++) hash->put(pa_uitoa(i), new VString(*method->params_names->get(i))); if(method->extra_params) hash->put(method_extra_param, new VString(*method->extra_params)); if(method->named_params){ size_t named_count=method->named_params->count(); VArray& named_params=*new VArray(named_count); ArrayValue &array=named_params.array(); for(size_t i=0; inamed_params)[i]; array+=new VString(fname); } hash->put(method_named_params, &named_params); } } r.write(result); } static void _filename(Request& r, MethodParams& params) { if(Junction *j=params[0].get_junction()){ if(const Method* method=j->method){ if(!method->native_code) if(const String* filespec = r.get_method_filespec(method)) r.write(*new VString(*filespec)); return; } throw Exception(PARSER_RUNTIME, 0, "param must be object, class or method junction"); } if(VClass* vclass = dynamic_cast(params[0].get_class())){ r.write(*new VString(vclass->get_filespec())); } } static void _dynamical(Request& r, MethodParams& params) { if(params.count()){ r.write(VBool::get(params[0].get_class() != ¶ms[0])); } else { VMethodFrame* caller=r.get_method_frame()->caller(); r.write(VBool::get(caller && caller->get_class() != &caller->self())); } } static void _is(Request& r, MethodParams& params) { const String& name=params.as_string(0, "element name must be string"); const String& type=params.as_string(1, "class name must be string"); Value *context=params.count()==3 ? &(params.as_no_junction(2, "context must not be code")) : r.get_method_frame()->caller(); Value *value=context ? context->get_element(name) : 0; if(value) { if(type == "code" || type == "method") { Junction *junction=value->get_junction(); r.write(VBool::get(junction && ((junction->code==0) ^ (type == "code"))) ); } else { r.write(VBool::get( value->is(type.cstr()) )); } } else r.write(VBool::get(type == "void")); } static void _copy(Request& r, MethodParams& params) { HashStringValue* src=params.as_no_junction(0, "source must not be code").get_hash(); if(src==NULL) throw Exception(PARSER_RUNTIME, 0, "source must have hash representation"); Value& dst=params.as_no_junction(1, "destination must not be code"); for(HashStringValue::Iterator i(*src); i; i.next()) r.put_element(dst, *new String(i.key(), String::L_TAINTED), i.value()); } static void _uid(Request& r, MethodParams& params) { Value& obj=params.as_no_junction(0, "object must not be code"); char local_buf[MAX_NUMBER]; int size=snprintf(local_buf, sizeof(local_buf), "%p", &obj); r.write(*new String(String::C(pa_strdup(local_buf, (size_t)size), size))); } static void _delete(Request&, MethodParams& params) { Value* v=¶ms.as_no_junction(0, "param must be object or class"); const String& key=params.as_string(1, "field name must be string"); if(VObject* o=dynamic_cast(v)){ o->get_fields()->remove(key); } else if(VClass* c=dynamic_cast(v)){ HashStringProperty &p=*c->get_properties(); if(Property* property=p.get(key)) if(property->value) p.remove(key); } } static void _mixin(Request& r, MethodParams& params) { Value& vsource=params.as_no_junction(0, "source must not be code"); Value* vtarget=0; const String *name=0; bool copy_methods=true; bool copy_fields=true; bool overwrite=false; if(params.count()>1) if(HashStringValue* options=params.as_hash(1, "mixin options")) { int valid_options=0; for(HashStringValue::Iterator i(*options); i; i.next() ){ String::Body key=i.key(); Value* value=i.value(); if(key == "to") { vtarget=value; valid_options++; } else if(key == "name") { name=&value->as_string(); valid_options++; } else if(key == "methods") { copy_methods=r.process(*value).as_bool(); valid_options++; } else if(key == "fields") { copy_fields=r.process(*value).as_bool(); valid_options++; } else if(key == "overwrite") { overwrite=r.process(*value).as_bool(); valid_options++; } } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } if(!vtarget) vtarget=&r.get_method_frame()->caller()->self(); VClass* source=dynamic_cast(vsource.get_class()); VClass* target=dynamic_cast(vtarget->get_class()); if(!source) throw Exception(PARSER_RUNTIME, 0, "source must be parser object or class"); if(!target) throw Exception(PARSER_RUNTIME, 0, "destination must be parser object or class"); if(name){ if(copy_methods) if(Method* method=source->get_method(*name)) if(overwrite || !target->get_method(*name)){ target->set_method(*name, new Method(*method)); } if(copy_fields) if(Property* property=source->get_properties()->get(*name)) if(property->value && (overwrite || !target->get_properties()->get(*name))){ target->put_element(*target, *name, property->value); } } else { if(copy_methods) for(HashStringMethod::Iterator i(source->get_methods()); i; i.next()){ if(overwrite || !target->get_method(i.key())) target->set_method(*i.value()->name, new Method(*i.value())); } if(copy_fields) for(HashStringProperty::Iterator i(*source->get_properties()); i; i.next()){ if(i.value()->value && ( overwrite || !target->get_properties()->get(i.key()) )) target->put_element(*target, *new String(i.key(), String::L_TAINTED), i.value()->value); } } } String::Language get_untaint_lang(const String& lang_name); // op.C static void _tainting(Request& r, MethodParams& params) { const String& str=params.as_string(params.count()-1, "param must be string"); String::Language lang = String::L_UNSPECIFIED; bool optimized=false; if(params.count()==2){ const String& slang=params.as_string(0, "language name must be string"); if(slang == "optimized") optimized=true; else if(slang == "tainted") lang=String::L_TAINTED; else lang=get_untaint_lang(slang); } if(!str.is_empty()){ char *visual=str.visualize_langs(); if(optimized){ for(char *c=visual; *c; c++) *c = *c<0 ? '+':'-'; } else if(lang != String::L_UNSPECIFIED){ for(char *c=visual; *c; c++) *c = *c==lang ? '+':'-'; } else { for(char *c=visual; *c; c++) *c = *c & 0x7F; } r.write(*new String(visual)); } } static void _stack(Request& r, MethodParams& params) { bool show_args=false; bool show_locals=false; int limit=1000000; int offset=0; if(params.count()>0) if(HashStringValue* options=params.as_hash(0, "stack options")) { int valid_options=0; for(HashStringValue::Iterator i(*options); i; i.next() ){ String::Body key=i.key(); Value* value=i.value(); if(key == "args") { show_args=r.process(*value).as_bool(); valid_options++; } else if(key == "locals") { show_locals=r.process(*value).as_bool(); valid_options++; } else if(key == "limit") { limit=r.process(*value).as_int(); valid_options++; } else if(key == "offset") { offset=r.process(*value).as_int(); valid_options++; } } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } limit+=offset; VHash& vresult=*new VHash; HashStringValue* result=vresult.get_hash(); int index=1; VMethodFrame* caller=r.get_method_frame()->caller(); while(caller && index <= limit){ if(index>offset){ VHash& vcurrent=*new VHash; HashStringValue* current=vcurrent.get_hash(); current->put(Symbols::SELF_SYMBOL, &caller->self()); const Method& method=caller->method; current->put(method_name, new VString(*method.name)); if(!method.native_code){ Operation::Origin origin=r.get_method_origin(&method); if(origin.file_no){ current->put("file", new VString(*r.get_used_filespec(origin.file_no))); current->put("line", new VInt(origin.line)); // no +1 as declaration before first command } if(show_args || show_locals){ VHash& vargs=*new VHash; HashStringValue* args=vargs.get_hash(); if(method.params_names){ for(size_t i=0; icount(); i++){ const String& pname=*(*method.params_names)[i]; Value* value=caller->get_element(pname); args->put(pname, value->get_junction() ? VVoid::get() : value); } } if(method.extra_params) args->put(*method.extra_params, caller->get_element(*method.extra_params)); if(show_args) current->put("args", &vargs); if(show_locals){ VHash& vlocals=*new VHash; HashStringValue* locals=vlocals.get_hash(); if(VParserMethodFrame* frame=dynamic_cast(caller)) for(HashString::Iterator h(frame->my); h; h.next()){ String::Body key=h.key(); Value* value=h.value(); if(!args->contains(key) && (key != "result")){ locals->put(key, value->get_junction() ? VVoid::get() : value); } } current->put("locals", &vlocals); } } } result->put(pa_uitoa(index), &vcurrent); } caller=caller->caller(); index++; } r.write(vresult); } // constructor MReflection::MReflection(): Methoded("reflection") { // ^reflection:create[class_name;constructor_name[;param1[;param2[;...]]]] // ^reflection:create[ $.class[name] $.constructor[name] $.arguments[ $.1[param1] $.2[param2] ...] ] add_native_method("create", Method::CT_STATIC, _create, 1, MAX_CREATE_PARAMS + 2); // ^reflection:classes[] add_native_method("classes", Method::CT_STATIC, _classes, 0, 0); // ^reflection:class[object] add_native_method("class", Method::CT_STATIC, _class, 1, 1); // ^reflection:class_name[object] add_native_method("class_name", Method::CT_STATIC, _class_name, 1, 1); // ^reflection:class_by_name[class_name] add_native_method("class_by_name", Method::CT_STATIC, _class_by_name, 1, 1); // ^reflection:class_alias[class_name;new_class_name] add_native_method("class_alias", Method::CT_STATIC, _class_alias, 2, 2); // ^reflection:base_class[object] add_native_method("base", Method::CT_STATIC, _base, 1, 1); // ^reflection:base_class_name[object] add_native_method("base_name", Method::CT_STATIC, _base_name, 1, 1); // ^reflection:def[class|...;name] add_native_method("def", Method::CT_STATIC, _def, 2, 2); // ^reflection:methods[class_name] add_native_method("methods", Method::CT_STATIC, _methods, 1, 2); // ^reflection:method[object or class;method_name[;self]] // ^reflection:method[junction[;self]] add_native_method("method", Method::CT_STATIC, _method, 1, 3); // ^reflection:method_info[class_name;method_name] // ^reflection:method_info[junction] add_native_method("method_info", Method::CT_STATIC, _method_info, 1, 2); // ^reflection:filename[object or class or method] add_native_method("filename", Method::CT_STATIC, _filename, 1, 1); // ^reflection:fields[object or class] add_native_method("fields", Method::CT_STATIC, _fields, 1, 1); // ^reflection:fields_reference[object] add_native_method("fields_reference", Method::CT_STATIC, _fields_reference, 1, 1); // ^reflection:field[object or class;field_name] add_native_method("field", Method::CT_STATIC, _field, 2, 2); // ^reflection:dynamical[[object or class, caller if absent]] add_native_method("dynamical", Method::CT_STATIC, _dynamical, 0, 1); // ^reflection:is[element_name;class_name|code|method[;context]] add_native_method("is", Method::CT_STATIC, _is, 2, 3); // ^reflection:copy[src;dst] add_native_method("copy", Method::CT_STATIC, _copy, 2, 2); // ^reflection:uid[object or class] add_native_method("uid", Method::CT_STATIC, _uid, 1, 1); // ^reflection:delete[object or class;field_name] add_native_method("delete", Method::CT_STATIC, _delete, 2, 2); // ^reflection:mixin[object or class or junction;options] add_native_method("mixin", Method::CT_STATIC, _mixin, 1, 2); // ^reflection:tainting[[language or 'tainted' or 'optimized';]string] add_native_method("tainting", Method::CT_STATIC, _tainting, 1, 2); // ^reflection:stack[options] add_native_method("stack", Method::CT_STATIC, _stack, 0, 1); } parser-3.5.1/src/classes/int.C0000644000076400007640000000707514712042465013105 00000000000000/** @file Parser: @b int parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_vmethod_frame.h" #include "pa_request.h" #include "pa_vdouble.h" #include "pa_vint.h" #include "pa_vbool.h" volatile const char * IDENT_INT_C="$Id: int.C,v 1.73 2024/11/04 03:53:25 moko Exp $" IDENT_PA_VINT_H; // externs void _string_format(Request& r, MethodParams&); // class class MInt: public Methoded { public: MInt(); }; // global variable DECLARE_CLASS_VAR(int, new MInt); // methods static void _int(Request& r, MethodParams&) { VInt& vint=GET_SELF(r, VInt); r.write(*new VInt(vint.get_int())); } static void _double(Request& r, MethodParams&) { VInt& vint=GET_SELF(r, VInt); r.write(*new VDouble(vint.as_double())); } static void _bool(Request& r, MethodParams&) { VInt& vint=GET_SELF(r, VInt); r.write(VBool::get(vint.as_bool())); } typedef void (*vint_op_func_ptr)(VInt& vint, double param); static void __inc(VInt& vint, double param) { vint.inc(clip2int(param)); } static void __dec(VInt& vint, double param) { vint.inc(clip2int(-param)); } static void __mul(VInt& vint, double param) { vint.mul(param); } static void __div(VInt& vint, double param) { vint.div(param); } static void __mod(VInt& vint, double param) { vint.mod(clip2int(param)); } static void vint_op(Request& r, MethodParams& params, vint_op_func_ptr func) { VInt& vint=GET_SELF(r, VInt); double param=params.count()?params.as_double(0, "param must be numerical", r):1; (*func)(vint, param); } static void _inc(Request& r, MethodParams& params) { vint_op(r, params, &__inc); } static void _dec(Request& r, MethodParams& params) { vint_op(r, params, &__dec); } static void _mul(Request& r, MethodParams& params) { vint_op(r, params, &__mul); } static void _div(Request& r, MethodParams& params) { vint_op(r, params, &__div); } static void _mod(Request& r, MethodParams& params) { vint_op(r, params, &__mod); } // from string.C extern const String* sql_result_string(Request& r, MethodParams& params, Value*& default_code); static void _sql(Request& r, MethodParams& params) { int val; Value* default_code=0; if(const String* string=sql_result_string(r, params, default_code)) val=string->as_int(); else if(default_code) val=r.process(*default_code).as_int(); else { throw Exception(PARSER_RUNTIME, 0, "produced no result, but no default option specified"); } r.write(*new VInt(val)); } // constructor MInt::MInt(): Methoded("int") { // ^int.int[] // ^int.int[default for ^string.int compatibility] add_native_method("int", Method::CT_DYNAMIC, _int, 0, 1); // ^int.double[] // ^int.double[default for ^string.double compatibility] add_native_method("double", Method::CT_DYNAMIC, _double, 0, 1); // ^int.bool[] // ^int.bool[default for ^string.bool compatibility] add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); // ^int.inc[] // ^int.inc[offset] add_native_method("inc", Method::CT_DYNAMIC, _inc, 0, 1); // ^int.dec[] // ^int.dec[offset] add_native_method("dec", Method::CT_DYNAMIC, _dec, 0, 1); // ^int.mul[k] add_native_method("mul", Method::CT_DYNAMIC, _mul, 1, 1); // ^int.div[d] add_native_method("div", Method::CT_DYNAMIC, _div, 1, 1); // ^int.mod[offset] add_native_method("mod", Method::CT_DYNAMIC, _mod, 1, 1); // ^int.format{format} add_native_method("format", Method::CT_DYNAMIC, _string_format, 1, 1); // ^sql[query] // ^sql[query][$.limit(1) $.offset(2) $.default(0)] add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); } parser-3.5.1/src/classes/hashfile.C0000644000076400007640000001140214724703244014065 00000000000000/** @file Parser: @b hashfile parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_request.h" #include "pa_vmethod_frame.h" #include "pa_vhashfile.h" #include "pa_vhash.h" volatile const char * IDENT_HASHFILE_C="$Id: hashfile.C,v 1.67 2024/12/06 23:20:04 moko Exp $"; // class class MHashfile : public Methoded { public: // VStateless_class Value *create_new_value(Pool& apool) { return new VHashfile(apool); } public: MHashfile(); }; // global variable DECLARE_CLASS_VAR(hashfile, new MHashfile); // defines for statics #define OPEN_DATA_NAME "HASHFILE-OPEN-DATA" // methods typedef HashString HashStringBool; static void _open(Request& r, MethodParams& params) { HashStringBool* file_list=static_cast(r.classes_conf.get(OPEN_DATA_NAME)); if(!file_list) { file_list=new HashStringBool(); r.classes_conf.put(OPEN_DATA_NAME, file_list); } const String& file_spec=r.full_disk_path(params.as_file_name(0)); if(file_list->get(file_spec)) throw Exception(PARSER_RUNTIME, 0, "this hashfile is already opened, use existing variable"); file_list->put(file_spec, true); VHashfile& self=GET_SELF(r, VHashfile); self.open(file_spec); } static void _hash(Request& r, MethodParams&) { VHashfile& self=GET_SELF(r, VHashfile); // write out result VHash& result=*new VHash(*self.get_hash()); r.write(result); } static void _delete(Request& r, MethodParams& params) { VHashfile& self=GET_SELF(r, VHashfile); if(!params.count()) { // ^hashfile.delete[] asked to delete hashfile itself self.delete_files(); return; } // key const String &key=params.as_string(0, "key must be string"); // remove self.remove(key); } static void _clear(Request& r, MethodParams&) { VHashfile& self=GET_SELF(r, VHashfile); self.delete_files(); } #ifndef DOXYGEN struct Foreach_info { Request* r; const String* key_var_name; const String* value_var_name; Value* body_code; Value* delim_maybe_code; Value* var_context; bool need_delim; }; #endif static bool one_foreach_cycle( const String::Body key, const String& value, void* ainfo) { Foreach_info& info=*static_cast(ainfo); if(info.key_var_name){ VString* vkey=new VString(*new String(key, String::L_TAINTED)); info.r->put_element(*info.var_context, *info.key_var_name, vkey); } if(info.value_var_name){ VString* vvalue=new VString(value); info.r->put_element(*info.var_context, *info.value_var_name, vvalue); } Value& sv_processed=info.r->process(*info.body_code); TempSkip4Delimiter skip(*info.r); const String* s_processed=sv_processed.get_string(); if(info.delim_maybe_code && s_processed && !s_processed->is_empty()) { // delimiter set and we have body if(info.need_delim) // need delim & iteration produced string? info.r->write(info.r->process(*info.delim_maybe_code)); else info.need_delim=true; } info.r->write(sv_processed); return skip.check_break(); } static void _foreach(Request& r, MethodParams& params) { InCycle temp(r); const String& key_var_name=params.as_string(0, "key-var name must be string"); const String& value_var_name=params.as_string(1, "value-var name must be string"); Foreach_info info={ &r, key_var_name.is_empty()? 0 : &key_var_name, value_var_name.is_empty()? 0 : &value_var_name, ¶ms.as_junction(2, "body must be code"), /*delimiter*/params.count()>3 ? ¶ms[3] : 0, /*var_context*/r.get_method_frame()->caller(), false }; VHashfile& self=GET_SELF(r, VHashfile); self.for_each(one_foreach_cycle, &info); } static bool one_cleanup_cycle(const String::Body, const String&, void*) { return false; } static void _cleanup(Request& r, MethodParams&) { VHashfile& self=GET_SELF(r, VHashfile); self.for_each(one_cleanup_cycle, 0); } static void _release(Request& r, MethodParams&) { VHashfile& self=GET_SELF(r, VHashfile); self.close(); } // constructor MHashfile::MHashfile(): Methoded("hashfile") { // ^hashfile::open[filename] add_native_method("open", Method::CT_DYNAMIC, _open, 1, 1); // ^hashfile.hash[] add_native_method("hash", Method::CT_DYNAMIC, _hash, 0, 0); // ^hashfile.delete[key] add_native_method("delete", Method::CT_DYNAMIC, _delete, 0, 1); // ^hashfile.clear[] -- for backward compatibility. use .delete[] instead. add_native_method("clear", Method::CT_DYNAMIC, _clear, 0, 0); // ^hashfile.release[] add_native_method("release", Method::CT_DYNAMIC, _release, 0, 0); // ^hashfile.cleanup[] add_native_method("cleanup", Method::CT_DYNAMIC, _cleanup, 0, 0); add_native_method("defecate", Method::CT_DYNAMIC, _cleanup, 0, 0); // ^hashfile.foreach[key;value]{code}[delim] add_native_method("foreach", Method::CT_DYNAMIC, _foreach, 2+1, 2+1+1); } parser-3.5.1/src/classes/classes.h0000644000076400007640000000365714714312740014015 00000000000000/** @file Parser: @b Methoded class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef CLASSES_H #define CLASSES_H #define IDENT_CLASSES_H "$Id: classes.h,v 1.46 2024/11/11 05:28:00 moko Exp $" // include #include "pa_vstateless_class.h" #include "pa_array.h" /** Pure virtual base for configurable Methoded descendants @see Methoded_array */ class Methoded: public VStateless_class { public: // Value override const char* type() const { return ftype; } public: // Methoded /** should Methoded_array::register_directly_used register this class in Request::classes() or not. if not - global variable with Methoded descendant is used in VStateless_class parameter */ virtual bool used_directly() { return true; } /// use this method to read parameters from root "auto.p"; access r.main_class virtual void configure_admin(Request& ) {} /// use this method to read parameters from 'MAIN' class; access r.main_class virtual void configure_user(Request& ) {} private: const char* ftype; public: // usage Methoded(const char* atype): ftype(atype){} void register_directly_used(Request& r); }; /// all Methoded registered here in autogenerated classes.C class Methoded_array: public Array { public: Methoded_array(); public: // Methoded for_each-es /// @see Methoded::configure_admin void configure_admin(Request& r); /// @see Methoded::configure_user void configure_user(Request& r); /// @see Methoded::register_directly_used void register_directly_used(Request& r); }; // globals Methoded_array& methoded_array(); // defines #define DECLARE_CLASS_VAR(name, self) \ Methoded* name##_class=NULL; \ Methoded* name##_instance(){ if(!name##_class){ name##_class=self; } return name##_class; } #define ADD_CLASS_VAR(name) \ Methoded* name##_instance(); \ *this+=name##_instance(); #endif parser-3.5.1/src/classes/xdoc.C0000644000076400007640000005537014724703244013253 00000000000000/** @file Parser: @b xdoc parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #ifdef XML #include "libxml/tree.h" #include "libxml/HTMLtree.h" #include "libxslt/xsltInternals.h" #include "libxslt/transform.h" #include "libxslt/xsltutils.h" #include "libxslt/variables.h" #include "libxslt/imports.h" #include "pa_vmethod_frame.h" #include "pa_stylesheet_manager.h" #include "pa_request.h" #include "pa_vxdoc.h" #include "pa_charset.h" #include "pa_vfile.h" #include "pa_xml_exception.h" #include "xnode.h" #include "pa_charsets.h" volatile const char * IDENT_XDOC_C="$Id: xdoc.C,v 1.206 2024/12/06 23:20:04 moko Exp $"; // defines #define XDOC_CLASS_NAME "xdoc" // class class MXdoc: public MXnode { public: // VStateless_class Value* create_new_value(Pool&) { return new VXdoc(); } public: MXdoc(); }; // global variable DECLARE_CLASS_VAR(xnode, new MXnode); // must be here as Xdoc is inherited from Xnode and should be inited before DECLARE_CLASS_VAR(xdoc, new MXdoc); // helper classes class xmlOutputBuffer_auto_ptr { public: explicit xmlOutputBuffer_auto_ptr(xmlOutputBuffer *_APtr = 0) : _Owns(_APtr != 0), _Ptr(_APtr) {} xmlOutputBuffer_auto_ptr(const xmlOutputBuffer_auto_ptr& _Y) : _Owns(_Y._Owns), _Ptr(_Y.release()) {} xmlOutputBuffer_auto_ptr& operator=(const xmlOutputBuffer_auto_ptr& _Y) {if (this != &_Y) {if (_Ptr != _Y.get()) {if (_Owns && _Ptr) xmlOutputBufferClose(_Ptr); _Owns = _Y._Owns; } else if (_Y._Owns) _Owns = true; _Ptr = _Y.release(); } return (*this); } ~xmlOutputBuffer_auto_ptr() {if (_Owns && _Ptr) xmlOutputBufferClose(_Ptr); } xmlOutputBuffer& operator*() const {return (*get()); } xmlOutputBuffer *operator->() const {return (get()); } xmlOutputBuffer *get() const {return (_Ptr); } xmlOutputBuffer *release() const {((xmlOutputBuffer_auto_ptr *)this)->_Owns = false; return (_Ptr); } private: bool _Owns; xmlOutputBuffer *_Ptr; }; class xsltTransformContext_auto_ptr { public: explicit xsltTransformContext_auto_ptr(xsltTransformContext *_APtr = 0) : _Owns(_APtr != 0), _Ptr(_APtr) {} xsltTransformContext_auto_ptr(const xsltTransformContext_auto_ptr& _Y) : _Owns(_Y._Owns), _Ptr(_Y.release()) {} xsltTransformContext_auto_ptr& operator=(const xsltTransformContext_auto_ptr& _Y) {if (this != &_Y) {if (_Ptr != _Y.get()) {if (_Owns && _Ptr) xsltFreeTransformContext(_Ptr); _Owns = _Y._Owns; } else if (_Y._Owns) _Owns = true; _Ptr = _Y.release(); } return (*this); } ~xsltTransformContext_auto_ptr() {if (_Owns && _Ptr) xsltFreeTransformContext(_Ptr); } xsltTransformContext& operator*() const {return (*get()); } xsltTransformContext *operator->() const {return (get()); } xsltTransformContext *get() const {return (_Ptr); } xsltTransformContext *release() const {((xsltTransformContext_auto_ptr *)this)->_Owns = false; return (_Ptr); } private: bool _Owns; xsltTransformContext *_Ptr; }; // methods static void writeNode(Request& r, VXdoc& xdoc, xmlNode* node) { if(!node) throw Exception(PARSER_RUNTIME, 0, "error creating node"); // OOM, bad name, things like that // write out result r.write(xdoc.wrap(*node)); } struct IdsIteratorInfo { xmlChar *elementId; xmlNode *element; }; /* switching to calling convetion of libxml */ extern "C" void idsHashScanner (void *payload, void *data, const xmlChar *name) { IdsIteratorInfo *priv = (IdsIteratorInfo *)data; if (priv->element == NULL && xmlStrEqual (name, priv->elementId)) { xmlNode* parent=((xmlID *)payload)->attr->parent; assert(parent); priv->element=parent; } } static xmlNode* pa_getElementById(xmlDoc& xmldoc, xmlChar* elementId) { xmlHashTable *ids = (xmlHashTable *)xmldoc.ids; IdsIteratorInfo iter={elementId, NULL}; xmlHashScan(ids, (xmlHashScanner)idsHashScanner, &iter); return iter.element; } /* static xmlNode * pa_importNode (xmlDoc& xmldoc, xmlNode& importedNode, bool deep) { xmlNode *result = NULL; switch (importedNode.type) { case XML_ATTRIBUTE_NODE: result = (xmlNode *)xmlCopyProp(xmldoc, (xmlAttr *)importedNode); result.parent=0; // no idea break; case XML_DOCUMENT_FRAG_NODE: case XML_ELEMENT_NODE: case XML_ENTITY_REF_NODE: case XML_PI_NODE: case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_COMMENT_NODE: result = xmlCopyNode (importedNode->n, deep); xmlSetTreeDoc (result, priv->n); break; default: *exc = GDOME_NOT_SUPPORTED_ERR; } return result; } */ // Element createElement(in DOMString tagName) raises(DOMException); static void _createElement(Request& r, MethodParams& params) { xmlChar* tagName=as_xmlname(r, params, 0, "tagName must be string"); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewDocNode(&xmldoc, NULL, tagName, NULL); writeNode(r, vdoc, node); } // Element createElementNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException); static void _createElementNS(Request& r, MethodParams& params) { xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); xmlChar* qualifiedName=as_xmlqname(r, params, 1); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlChar* prefix=0; xmlChar* localName=xmlSplitQName2(qualifiedName, &prefix); xmlNode *node; if(localName) { xmlNs& ns=pa_xmlMapNs(xmldoc, namespaceURI, prefix); node=xmlNewDocNode(&xmldoc, &ns, localName, NULL); } else node=xmlNewDocNode(&xmldoc, NULL, qualifiedName/*unqualified, actually*/, NULL); writeNode(r, vdoc, node); } // DocumentFragment createDocumentFragment() static void _createDocumentFragment(Request& r, MethodParams&) { VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewDocFragment(&xmldoc); writeNode(r, vdoc, node); } // Text createTextNode(in DOMString data); static void _createTextNode(Request& r, MethodParams& params) { xmlChar* data=as_xmlchar(r, params, 0, XML_DATA_MUST_BE_STRING); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewDocText(&xmldoc, data); writeNode(r, vdoc, node); } // Comment createComment(in DOMString data) static void _createComment(Request& r, MethodParams& params) { xmlChar* data=as_xmlchar(r, params, 0, XML_DATA_MUST_BE_STRING); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlNode *node=xmlNewComment(data); writeNode(r, vdoc, node); } // CDATASection createCDATASection(in DOMString data) raises(DOMException); static void _createCDATASection(Request& r, MethodParams& params) { xmlChar* data=as_xmlchar(r, params, 0, XML_DATA_MUST_BE_STRING); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewCDataBlock(&xmldoc, data, strlen((const char*)data)); writeNode(r, vdoc, node); } // ProcessingInstruction createProcessingInstruction(in DOMString target,in DOMString data) raises(DOMException); static void _createProcessingInstruction(Request& r, MethodParams& params) { xmlChar* target=as_xmlchar(r, params, 0, XML_DATA_MUST_BE_STRING); xmlChar* data=as_xmlchar(r, params, 1, XML_DATA_MUST_BE_STRING); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewDocPI(&xmldoc, target, data); writeNode(r, vdoc, node); } // Attr createAttribute(in DOMString name) raises(DOMException); static void _createAttribute(Request& r, MethodParams& params) { xmlChar* name=as_xmlname(r, params, 0); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=(xmlNode*)xmlNewDocProp(&xmldoc, name, 0); writeNode(r, vdoc, node); } // Attr createAttributeNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException); static void _createAttributeNS(Request& r, MethodParams& params) { xmlChar* namespaceURI=as_xmlnsuri(r, params, 0); xmlChar* qualifiedName=as_xmlqname(r, params, 1); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlChar* prefix=0; xmlChar* localName=xmlSplitQName2(qualifiedName, &prefix); xmlNode *node; if(localName) { xmlNs& ns=pa_xmlMapNs(xmldoc, namespaceURI, prefix); node=(xmlNode*)xmlNewDocProp(&xmldoc, localName, NULL); xmlSetNs(node, &ns); } else node=(xmlNode*)xmlNewDocProp(&xmldoc, qualifiedName/*unqualified, actually*/, NULL); writeNode(r, vdoc, node); } // EntityReference createEntityReference(in DOMString name) raises(DOMException); static void _createEntityReference(Request& r, MethodParams& params) { xmlChar* name=as_xmlname(r, params, 0); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewReference(&xmldoc, name); writeNode(r, vdoc, node); } static void _getElementById(Request& r, MethodParams& params) { xmlChar* elementId=as_xmlname(r, params, 0, "elementID must be string"); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); if(xmlNode *node=pa_getElementById(xmldoc, elementId)) writeNode(r, vdoc, node); } static void _importNode(Request& r, MethodParams& params) { xmlNode& importedNode=as_node(params, 0, "importedNode must be node"); bool deep=params.as_bool(1, "deep must be bool", r); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlDocCopyNode(&importedNode, &xmldoc, deep?1: 0); writeNode(r, vdoc, node); } #define XML_PARSE_OPTIONS (XML_PARSE_DTDLOAD | XML_PARSE_NOENT | XML_PARSE_HUGE) static void _create(Request& r, MethodParams& params) { Charset& source_charset=r.charsets.source(); VXdoc& vdoc=GET_SELF(r, VXdoc); Value& param=params[params.count()-1]; xmlDoc* xmldoc; bool set_encoding=false; if(param.get_junction()) { // {...} const String& xml=r.process_to_string(param); String::Body sbody=xml.cstr_to_string_body_untaint(String::L_XML, r.connection(false), &r.charsets); xmldoc=xmlReadMemory(sbody.cstr(), sbody.length(), NULL, NULL, XML_PARSE_OPTIONS); if(!xmldoc || xmlHaveGenericErrors()) throw XmlException(0, r); // must be last action in if, see after if} } else { // [localName] if(const String* value = param.get_string()){ xmlChar* localName=r.transcode(*value); if(xmlValidateNCName(localName, 0) != 0) throw XmlException(0, XML_INVALID_LOCAL_NAME, localName); xmldoc=xmlNewDoc(0); if(!xmldoc || xmlHaveGenericErrors()) throw XmlException(0, r); xmlNode* node=xmlNewChild((xmlNode*)xmldoc, NULL, localName, NULL); if(!node || xmlHaveGenericErrors()) throw XmlException(0, r); set_encoding=true; // must be last action in if, see after if} } else { VFile* vfile=param.as_vfile(); xmldoc=xmlReadMemory(vfile->value_ptr(), vfile->value_size(), NULL, NULL, XML_PARSE_OPTIONS); if(!xmldoc || xmlHaveGenericErrors()) throw XmlException(0, r); } } // must be first action after if} // replace any previous parsed source vdoc.set_xmldoc(r.charsets, *xmldoc); // URI const char* URI_cstr; if(params.count()>1) { // absolute(param) const String& URI=params.as_string(0, "URI must be string"); URI_cstr=r.full_disk_path(URI).cstr(); } else // default = disk path to requested document URI_cstr=r.request_info.path_translated; if(URI_cstr) xmldoc->URL=source_charset.transcode_buf2xchar(URI_cstr, strlen(URI_cstr)); if(set_encoding) { const char* source_charset_name=source_charset.NAME().cstr(); xmldoc->encoding=source_charset.transcode_buf2xchar(source_charset_name, strlen(source_charset_name)); } } static void _load(Request& r, MethodParams& params) { VXdoc& vdoc=GET_SELF(r, VXdoc); // filespec const String* uri=¶ms.as_string(0, "URI must be string"); const char* uri_cstr; if(uri->pos("://")==STRING_NOT_FOUND) // disk path uri_cstr=r.full_disk_path(*uri).taint_cstr(String::L_FILE_SPEC); else // xxx:// uri_cstr=uri->taint_cstr(String::L_AS_IS); // leave as-is for xmlParseFile to handle /// @todo!! add SAFE MODE!! xmlDoc* xmldoc=xmlReadFile(uri_cstr, NULL, XML_PARSE_OPTIONS); if(!xmldoc || xmlHaveGenericErrors()) throw XmlException(uri, r); // must be first action after if} // replace any previous parsed source vdoc.set_xmldoc(r.charsets, *xmldoc); } String::C xdoc2buf(Request& r, VXdoc& vdoc, XDocOutputOptions& oo, const String* file_spec, bool use_source_charset_to_render_and_client_charset_to_write_to_header=false) { Charset* render=0; Charset* header=0; if(use_source_charset_to_render_and_client_charset_to_write_to_header) { render=&r.charsets.source(); header=&r.charsets.client(); } else { header=render=&pa_charsets.get(*oo.encoding); } const char* render_encoding=render->NAME_CSTR(); const char* header_encoding=header->NAME_CSTR(); xmlCharEncodingHandler *renderer=xmlFindCharEncodingHandler(render_encoding); // UTF-8 renderer contains empty input/output converters, // which is wrong for xmlOutputBufferCreateIO // while zero renderer goes perfectly if(render->isUTF8()) renderer=0; xmlOutputBuffer_auto_ptr outputBuffer(xmlAllocOutputBuffer(renderer)); xsltStylesheet *stylesheet = xsltNewStylesheet(); if(!stylesheet) throw Exception(0, 0, "xsltNewStylesheet failed"); #define OOSTRING2STYLE(name) \ stylesheet->name=oo.name?BAD_CAST xmlMemStrdup((const char*)r.transcode(*oo.name)):0 #define OOBOOL2STYLE(name) \ if(oo.name>=0) stylesheet->name=oo.name OOSTRING2STYLE(method); OOSTRING2STYLE(encoding); OOSTRING2STYLE(mediaType); // OOSTRING2STYLE(doctypeSystem); // OOSTRING2STYLE(doctypePublic); OOBOOL2STYLE(indent); OOSTRING2STYLE(version); OOBOOL2STYLE(standalone); OOBOOL2STYLE(omitXmlDeclaration); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmldoc.encoding=BAD_CAST xmlMemStrdup(render_encoding); if(header_encoding) stylesheet->encoding=BAD_CAST xmlMemStrdup(header_encoding); if(xsltSaveResultTo(outputBuffer.get(), &xmldoc, stylesheet)<0 || xmlHaveGenericErrors()) throw XmlException(0, r); // write out result char *gnome_str; size_t gnome_length; #ifdef LIBXML2_NEW_BUFFER if(outputBuffer->conv) { gnome_length=xmlBufUse(outputBuffer->conv); gnome_str=(char *)xmlBufContent(outputBuffer->conv); } else { gnome_length=xmlOutputBufferGetSize(&(*outputBuffer)); gnome_str=(char *)xmlOutputBufferGetContent(&(*outputBuffer)); } #else if(outputBuffer->conv) { gnome_length=outputBuffer->conv->use; gnome_str=(char *)outputBuffer->conv->content; } else { gnome_length=outputBuffer->buffer->use; gnome_str=(char *)outputBuffer->buffer->content; } #endif if(file_spec){ file_write(r.charsets, *file_spec, gnome_str, gnome_length, true/*as_text*/); return String::C(); // actually, we don't need this output at all } else return String::C(gnome_length ? pa_strdup(gnome_str, gnome_length) : 0, gnome_length); } inline HashStringValue* get_options(MethodParams& params, size_t index){ return (params.count()>index) ? params.as_hash(index) : 0; } static void _file(Request& r, MethodParams& params) { VXdoc& vdoc=GET_SELF(r, VXdoc); XDocOutputOptions oo(vdoc.output_options); oo.append(r, get_options(params, 0), true/* $.name[filename] could be specified by user */); String::C buf=xdoc2buf(r, vdoc, oo, 0/*file_name. not to file, to memory*/); VFile& vfile=*new VFile; VHash& vhcontent_type=*new VHash; vhcontent_type.hash().put(value_name, new VString(*oo.mediaType)); vhcontent_type.hash().put("charset", new VString(*oo.encoding)); vfile.set_binary(false/*not tainted*/, buf.str?buf.str:""/*to distinguish from stat-ed file*/, buf.length, oo.filename, &vhcontent_type); // write out result r.write(vfile); } static void _save(Request& r, MethodParams& params) { VXdoc& vdoc=GET_SELF(r, VXdoc); const String& file_spec=r.full_disk_path(params.as_file_name(0)); XDocOutputOptions oo(vdoc.output_options); oo.append(r, get_options(params, 1)); xdoc2buf(r, vdoc, oo, &file_spec); } static void _string(Request& r, MethodParams& params) { VXdoc& vdoc=GET_SELF(r, VXdoc); XDocOutputOptions oo(vdoc.output_options); oo.append(r, get_options(params, 0)); String::C buf=xdoc2buf(r, vdoc, oo, 0/*file_name. not to file, to memory*/, true/*use source charset to render, client charset to put to header*/); // write out result r.write(String(buf, String::L_AS_IS)); } #ifndef DOXYGEN struct Add_xslt_param_info { Request* r; Array* strings; const xmlChar** current_transform_param; }; #endif static void add_xslt_param( HashStringValue::key_type attribute, HashStringValue::value_type meaning, Add_xslt_param_info* info) { xmlChar* s; *info->current_transform_param++=(s=info->r->transcode(attribute)); *info->strings+=s; *info->current_transform_param++=(s=info->r->transcode(meaning->as_string())); *info->strings+=s; } static VXdoc& _transform(Request& r, const String* stylesheet_source, VXdoc& vdoc, xsltStylesheetPtr stylesheet, const xmlChar** transform_params) { xmlDoc& xmldoc=vdoc.get_xmldoc(); xsltTransformContext_auto_ptr transformContext( xsltNewTransformContext(stylesheet, &xmldoc)); // make params literal if (transformContext->globalVars == NULL) // strangly not initialized by xsltNewTransformContext transformContext->globalVars = xmlHashCreate(20); xsltQuoteUserParams(transformContext.get(), (const char**)transform_params); // do transform xmlDoc *transformed=xsltApplyStylesheetUser( stylesheet, &xmldoc, 0/*already quoted-inserted transform_params*/, 0/*const char* output*/, 0/*FILE *profile*/, transformContext.get()); if(!transformed || xmlHaveGenericErrors()) throw XmlException(stylesheet_source, r); //gdome_xml_doc_mkref dislikes XML_HTML_DOCUMENT_NODE type, fixing transformed->type=XML_DOCUMENT_NODE; // constructing result VXdoc& result=*new VXdoc(r.charsets, *transformed); /* grabbing options */ XDocOutputOptions& oo=result.output_options; oo.method=stylesheet->method?&r.transcode(stylesheet->method):0; oo.encoding=stylesheet->encoding?&r.transcode(stylesheet->encoding):0; oo.mediaType=stylesheet->mediaType?&r.transcode(stylesheet->mediaType):0; oo.indent=stylesheet->indent; oo.version=stylesheet->version?&r.transcode(stylesheet->version):0; oo.standalone=stylesheet->standalone; oo.omitXmlDeclaration=stylesheet->omitXmlDeclaration; // return return result; } static void _transform(Request& r, MethodParams& params) { VXdoc& vdoc=GET_SELF(r, VXdoc); // params Array transform_strings; const xmlChar** transform_params=0; if(params.count()>1) if(HashStringValue* hash=params.as_hash(1, "transform options")) { transform_params=new(PointerGC) const xmlChar*[hash->count()*2+1]; Add_xslt_param_info info={ &r, &transform_strings, transform_params }; hash->for_each(add_xslt_param, &info); transform_params[hash->count()*2]=0; } VXdoc* result; if(VXdoc *vxdoc=dynamic_cast(¶ms[0])) { // stylesheet (xdoc) xmlDoc& stylesheetdoc=vxdoc->get_xmldoc(); // compile xdoc stylesheet xsltStylesheet *stylesheet=xsltParseStylesheetDoc(&stylesheetdoc); if(xmlHaveGenericErrors()) throw XmlException(0, r); if(!stylesheet) throw Exception("xml", 0, "stylesheet failed to compile"); // transform! result=&_transform(r, 0, vdoc, stylesheet, transform_params); } else { // stylesheet (file name) // extablish stylesheet connection const String& stylesheet_filespec=r.full_disk_path(params.as_string(0, "stylesheet must be file name (string) or DOM document (xdoc)")); Stylesheet_connection_ptr connection(stylesheet_manager->get_connection(stylesheet_filespec)); // load and compile file to stylesheet [or get cached if any] // transform! result=&_transform(r, &stylesheet_filespec, vdoc, connection->stylesheet(), transform_params); } // write out result r.write(*result); } // constructor /// @test how to create empty type html? MXdoc::MXdoc(): MXnode(XDOC_CLASS_NAME) { set_base(xnode_class); /// DOM1 // Element createElement(in DOMString tagName) raises(DOMException); add_native_method("createElement", Method::CT_DYNAMIC, _createElement, 1, 1); // DocumentFragment createDocumentFragment(); add_native_method("createDocumentFragment", Method::CT_DYNAMIC, _createDocumentFragment, 0, 0); // Text createTextNode(in DOMString data); add_native_method("createTextNode", Method::CT_DYNAMIC, _createTextNode, 1, 1); // Comment createComment(in DOMString data); add_native_method("createComment", Method::CT_DYNAMIC, _createComment, 1, 1); // CDATASection createCDATASection(in DOMString data) raises(DOMException); add_native_method("createCDATASection", Method::CT_DYNAMIC, _createCDATASection, 1, 1); // ProcessingInstruction createProcessingInstruction(in DOMString target, in DOMString data) raises(DOMException); add_native_method("createProcessingInstruction", Method::CT_DYNAMIC, _createProcessingInstruction, 2, 2); // Attr createAttribute(in DOMString name) raises(DOMException); add_native_method("createAttribute", Method::CT_DYNAMIC, _createAttribute, 1, 1); // EntityReference createEntityReference(in DOMString name) raises(DOMException); add_native_method("createEntityReference", Method::CT_DYNAMIC, _createEntityReference, 1, 1); /// DOM2 // ^xdoc.getElementById[elementId] add_native_method("getElementById", Method::CT_DYNAMIC, _getElementById, 1, 1); // Node (in Node importedNode, in boolean deep) raises(DOMException) add_native_method("importNode", Method::CT_DYNAMIC, _importNode, 2, 2); // Attr createAttributeNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException); add_native_method("createAttributeNS", Method::CT_DYNAMIC, _createAttributeNS, 2, 2); // Element createElementNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException); add_native_method("createElementNS", Method::CT_DYNAMIC, _createElementNS, 2, 2); /// parser // ^xdoc::create{qualifiedName} // ^xdoc::create[xml] // ^xdoc::create[URI][xml] add_native_method("create", Method::CT_DYNAMIC, _create, 1, 2); // for backward compatibility with <=v 1.82 2002/01/31 11:51:46 paf add_native_method("set", Method::CT_DYNAMIC, _create, 1, 1); // ^xdoc::load[some.xml] add_native_method("load", Method::CT_DYNAMIC, _load, 1, 1); // ^xdoc.save[some.xml] // ^xdoc.save[some.xml;options hash] add_native_method("save", Method::CT_DYNAMIC, _save, 1, 2); // ^xdoc.string[] // ^xdoc.string[options hash] add_native_method("string", Method::CT_DYNAMIC, _string, 0, 1); // ^xdoc.file[] file with "" // ^xdoc.file[options hash] file with "" add_native_method("file", Method::CT_DYNAMIC, _file, 0, 1); // ^xdoc.transform[stylesheet file_name/xdoc] // ^xdoc.transform[stylesheet file_name/xdoc;params hash] add_native_method("transform", Method::CT_DYNAMIC, _transform, 1, 2); } #endif parser-3.5.1/src/Makefile.am0000644000076400007640000000006507522215527012600 00000000000000SUBDIRS = include main sql types classes lib targets parser-3.5.1/src/types/0000755000076400007640000000000014740300546011763 500000000000000parser-3.5.1/src/types/pa_venv.h0000644000076400007640000000136314712042465013517 00000000000000/** @file Parser: @b env class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VENV_H #define PA_VENV_H #define IDENT_PA_VENV_H "$Id: pa_venv.h,v 1.46 2024/11/04 03:53:25 moko Exp $" // includes #include "pa_sapi.h" #include "pa_vstateless_class.h" /// env class class VEnv: public VStateless_class { SAPI_Info& finfo; public: // Value const char* type() const { return "env"; } // env: field Value* get_element(const String& aname); /// request: (key)=value override const VJunction* put_element(const String& name, Value* value); public: // usage VEnv(SAPI_Info& ainfo): finfo(ainfo) {} }; #endif parser-3.5.1/src/types/pa_vxdoc.h0000644000076400007640000000531714712042466013670 00000000000000/** @file Parser: @b xdoc parser class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VXDOC_H #define PA_VXDOC_H #define IDENT_PA_VXDOC_H "$Id: pa_vxdoc.h,v 1.65 2024/11/04 03:53:26 moko Exp $" #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" #include "pa_vxnode.h" #include "pa_vhash.h" // defines #define VXDOC_TYPE "xdoc" // externals extern Methoded* xdoc_class; struct XDocOutputOptions : public PA_Allocated { const String* method; /* the output method */ const String* encoding; /* encoding string */ const String* mediaType; /* media-type string */ int indent; /* should output being indented */ const String* version; /* version string */ int standalone; /* standalone = "yes" | "no" */ int omitXmlDeclaration; /* omit-xml-declaration = "yes" | "no" */ const String* filename; /* Parser3 option: filename */ XDocOutputOptions() { memset(this, 0, sizeof(*this)); indent=standalone=omitXmlDeclaration=-1; }; void append(Request& r, HashStringValue* options, bool with_filename=false); }; /// value of type 'xdoc'. implemented with libxml & co class VXdoc: public VXnode { public: // Value override const char* type() const { return VXDOC_TYPE; } override bool is(const char* atype); override VStateless_class* get_class() { return xdoc_class; } /// VXdoc: true override bool as_bool() const { return true; } /// VXdoc: true override Value& as_expr_result(); /// VFile: json-string override const String* get_json_string(Json_options& options); /// VXdoc: $method, fields override Value* get_element(const String& aname); public: // VXNode override xmlNode& get_xmlnode() { return *reinterpret_cast(&get_xmldoc()); } override VXdoc& get_vxdoc() { return *this; } public: // usage VXdoc() : VXnode(*this), fcharsets(0), fdocument(0) {} VXdoc(Request_charsets& acharsets, xmlDoc& adocument) : VXnode(*this) { set_xmldoc(acharsets, adocument); } public: // VXdoc void set_xmldoc(Request_charsets& acharsets, xmlDoc& adocument) { fcharsets=&acharsets; fdocument=&adocument; fdocument->_private=this; } xmlDoc& get_xmldoc() { if(!fdocument) throw Exception(PARSER_RUNTIME, 0, "using uninitialized xdoc object"); return *fdocument; } Request_charsets& charsets() { if(!fcharsets) throw Exception(PARSER_RUNTIME, 0, "using uninitialized xdoc object"); return *fcharsets; } VXnode& wrap(xmlNode& anode); public: VHash search_namespaces; XDocOutputOptions output_options; private: Request_charsets* fcharsets; xmlDoc* fdocument; }; #endif parser-3.5.1/src/types/pa_vjunction.h0000644000076400007640000000356514712042466014567 00000000000000/** @file Parser: @b junction class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VJUNCTION_H #define PA_VJUNCTION_H #define IDENT_PA_VJUNCTION_H "$Id: pa_vjunction.h,v 1.39 2024/11/04 03:53:26 moko Exp $" // include #include "pa_value.h" #include "pa_junction.h" #define JUNCTION_CLASS_NAME "junction" static const String junction_class_name(JUNCTION_CLASS_NAME); /// junction is method+self+context, implemented with Junction class VJunction: public Value { public: // VJunction override const char* type() const { return JUNCTION_CLASS_NAME; } /// VJunction: 0 override VStateless_class *get_class() { return 0; } /// VJunction: false override bool is_defined() const { return false; } /// VJunction: false override bool as_bool() const { return false; } /// VJunction: false override Value& as_expr_result(); /// VJunction: method, root,self,rcontext, code override Junction* get_junction() { return &fjunction; } // VJunction: CLASS, CLASS_NAME, name override Value* get_element(const String& aname); public: // usage /// Code-Junction constructor VJunction(Value& aself, const Method* amethod, VMethodFrame* amethod_frame, Value* arcontext, WContext* awcontext, ArrayOperation* acode): fjunction(aself, amethod, amethod_frame, arcontext, awcontext, acode) {} /// Method-Junction or Getter-Junction constructor VJunction(Value& aself, const Method* amethod, bool ais_getter=false, String* aauto_name=0 ): fjunction(aself, amethod, ais_getter, aauto_name) {} const Junction& junction() const { return fjunction; } inline VJunction *get(Value& aself){ return &(fjunction.self)==&aself?this:new VJunction(aself, fjunction.method); } void reattach(WContext *new_wcontext); private: Junction fjunction; }; #endif parser-3.5.1/src/types/pa_vobject.h0000644000076400007640000000556714712042466014210 00000000000000/** @file Parser: @b object class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VOBJECT_H #define PA_VOBJECT_H #define IDENT_PA_VOBJECT_H "$Id: pa_vobject.h,v 1.72 2024/11/04 03:53:26 moko Exp $" // includes #include "pa_vjunction.h" #include "pa_vclass.h" #include "pa_vstateless_object.h" #include "pa_vfile.h" // defines #define BASE_NAME "BASE" /** parser class instance, stores - class VObject::fclass; - fields VObject::ffields (dynamic, not static, which are stored in class). */ class VObject: public Value { VClass& fclass; HashStringValue ffields; enum State { IS_GETTER_ACTIVE = 0x01, IS_SETTER_ACTIVE = 0x02 }; int state; // default setter & getter state public: // Value const char* type() const { return fclass.type(); } override bool is(const char* atype); /// VObject: fclass override VStateless_class *get_class() { return &fclass; } override bool is_defined() const; override Value& as_expr_result(); override int as_int() const; override double as_double() const; override bool as_bool() const; override VFile* as_vfile(); override HashStringValue* get_hash(); override Table *get_table(); override HashStringValue* get_fields() { return &ffields; } override HashStringValue* get_fields_reference() { return &ffields; } override Value* get_element(const String& aname); override const VJunction* put_element(const String& name, Value* value); #ifdef FEATURE_GET_ELEMENT4CALL override Value* get_element4call(const String& aname); #endif override const String* get_json_string(Json_options& options); /// VObject default getter & setter support override void enable_default_getter(){ state |= IS_GETTER_ACTIVE; } override void enable_default_setter(){ if(fclass.has_default_setter()) state |= IS_SETTER_ACTIVE; } override void disable_default_getter(){ state &= ~IS_GETTER_ACTIVE; } override void disable_default_setter(){ state &= ~IS_SETTER_ACTIVE; } override bool is_enabled_default_getter(){ return (state & IS_GETTER_ACTIVE) > 0; } override bool is_enabled_default_setter(){ return (state & IS_SETTER_ACTIVE) > 0; } public: // creation VObject(VClass& aclass): fclass(aclass), state(IS_GETTER_ACTIVE){} private: Value* get_scalar_value(const char* as_something) const; }; /// Auto-objects used for temporarily disabling setter/getter class Temp_disable_default_getter { Value& fwhere; public: Temp_disable_default_getter(Value& awhere) : fwhere(awhere) { fwhere.disable_default_getter(); } ~Temp_disable_default_getter() { fwhere.enable_default_getter(); } }; class Temp_disable_default_setter { Value& fwhere; public: Temp_disable_default_setter(Value& awhere) : fwhere(awhere) { fwhere.disable_default_setter(); } ~Temp_disable_default_setter() { fwhere.enable_default_setter(); } }; #endif parser-3.5.1/src/types/pa_vimage.h0000644000076400007640000000523114712042466014010 00000000000000/** @file Parser: @b image parser type decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VIMAGE_H #define PA_VIMAGE_H #define IDENT_PA_VIMAGE_H "$Id: pa_vimage.h,v 1.63 2024/11/04 03:53:26 moko Exp $" #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" #include "pa_charset.h" // defines #define VIMAGE_TYPE "image" // forwards class gdImage; /// simple gdImage-based font storage & text output class Font: public PA_Object { public: int letterspacing; int height; ///< Font heigth int monospace; ///< Default char width int spacebarspace; ///< spacebar width gdImage* ifont; const String& alphabet; Font( Charset& acharset, const String& aalphabet, gdImage* aifont, int aheight, int amonospace, int aspacebarspace, int aletterspacing); //@{******************************** char ********************************** size_t index_of(char ch); size_t index_of(XMLCh ch); int index_width(size_t index); void index_display(gdImage& image, int x, int y, size_t index); //@} //@{******************************* string ********************************* int step_width(int index); //@} /// counts trailing letter_spacing, consider this OK. useful for contiuations int string_width(const String& s); void string_display(gdImage& image, int x, int y, const String& s); private: Charset& fsource_charset; Hash fletter2index; }; // externs extern Methoded* image_class; /** holds img attributes and [image itself] */ class VImage: public VStateless_object { public: // Value override const char* type() const { return VIMAGE_TYPE; } override VStateless_class *get_class() { return image_class; } /// VImage: true override bool as_bool() const { return true; } /// VImage: true override Value& as_expr_result(); /// VImage: method,field override Value* get_element(const String& aname); /// VImage: field override const VJunction* put_element(const String& name, Value* value); /// VImage: fields HashStringValue *get_hash() { return &ffields; } public: // usage void set(const String* src, int width, int height, gdImage* aimage, Value* aexif=0, Value* axmp=0); HashStringValue& fields() { return ffields; } public: gdImage& image() { if(!fimage) throw Exception(PARSER_RUNTIME, 0, "using uninitialized image object"); return *fimage; } void set_font(Font* afont) { ffont=afont; } Font& font() { if(!ffont) throw Exception(PARSER_RUNTIME, 0, "set the font first"); return *ffont; } private: gdImage* fimage; Font* ffont; HashStringValue ffields; }; #endif parser-3.5.1/src/types/pa_vxnode.h0000644000076400007640000000265114712042466014046 00000000000000/** @file Parser: @b xnode parser class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VXNODE_H #define PA_VXNODE_H #define IDENT_PA_VXNODE_H "$Id: pa_vxnode.h,v 1.51 2024/11/04 03:53:26 moko Exp $" #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" #include "libxml/tree.h" // defines #define VXNODE_TYPE "xnode" // externals extern Methoded* xnode_class; // forwards class VXdoc; /// value of type 'xnode'. implemented with xmlNode class VXnode: public VStateless_object { public: // Value override const char* type() const { return VXNODE_TYPE; } override VStateless_class* get_class() { return xnode_class; } /// VXnode: true override bool as_bool() const { return true; } /// VXnode: true override Value& as_expr_result(); /// VXnode: $method, fields override Value* get_element(const String& aname); /// VXnode: $nodeValue override const VJunction* put_element(const String& aname, Value* avalue); public: // usage VXnode(xmlNode& anode) : fnode(anode) {} public: // VXnode virtual xmlNode& get_xmlnode() { return fnode; } virtual VXdoc& get_vxdoc() { assert(fnode.doc); VXdoc* result=static_cast(fnode.doc->_private); assert(result); return *result; } Request_charsets& charsets(); private: xmlNode& fnode; }; #endif parser-3.5.1/src/types/pa_vint.h0000644000076400007640000000364314712042466013525 00000000000000/** @file Parser: @b int parser class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VINT_H #define PA_VINT_H #define IDENT_PA_VINT_H "$Id: pa_vint.h,v 1.61 2024/11/04 03:53:26 moko Exp $" // include #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" // defines #define VINT_TYPE "int" extern Methoded* int_class; /// value of type 'int'. implemented with @c int class VInt: public VSimple_stateless_object { public: // Value override const char* type() const { return VINT_TYPE; } override VStateless_class *get_class() { return int_class; } /// VInt: true override bool is_evaluated_expr() const { return true; } /// VInt: clone override Value& as_expr_result() { return *new VInt(finteger); } /// VInt: finteger override const String* get_string() { char local_buf[MAX_NUMBER]; size_t length=snprintf(local_buf, MAX_NUMBER, "%d", finteger); return new String(pa_strdup(local_buf, length)); } /// VInt: finteger override double as_double() const { return as_int(); } /// VInt: finteger override int as_int() const { return finteger; } /// VInt: 0 or !0 override bool as_bool() const { return finteger!=0; } /// VInt: json-string override const String* get_json_string(Json_options&) { return get_string(); } public: // usage VInt(int ainteger): finteger(ainteger) {} int get_int() { return finteger; } void set_int(int ainteger) { finteger=ainteger; } void inc(int increment) { finteger+=increment; } void mul(double k) { finteger=clip2int(finteger*k); } void div(double d) { if(d == 0) throw Exception("number.zerodivision", 0, "Division by zero"); finteger=clip2int(finteger/d); } void mod(int d) { if(d == 0) throw Exception("number.zerodivision", 0, "Modulus by zero"); finteger%=d; } private: int finteger; }; #endif parser-3.5.1/src/types/pa_vjunction.C0000644000076400007640000000234114712042466014511 00000000000000/** @file Parser: @b junction class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ // include #include "pa_vjunction.h" #include "pa_vbool.h" #include "pa_wcontext.h" #include "pa_symbols.h" volatile const char * IDENT_PA_VJUNCTION_C="$Id: pa_vjunction.C,v 1.22 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VJUNCTION_H IDENT_PA_JUNCTION_H; void VJunction::reattach(WContext *new_wcontext){ if(new_wcontext) { assert(fjunction.wcontext!=new_wcontext); fjunction.wcontext=new_wcontext; fjunction.wcontext->attach_junction(this); } else { fjunction.method_frame=0; fjunction.rcontext=0; fjunction.wcontext=0; } } override Value& VJunction::as_expr_result() { return VBool::get(false); } Value* VJunction::get_element(const String& aname) { #ifndef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL // $CLASS if(SYMBOLS_EQ(aname,CLASS_SYMBOL)) return this; // $CLASS_NAME if(SYMBOLS_EQ(aname,CLASS_NAME_SYMBOL)) return new VString(junction_class_name); #endif // $name if(SYMBOLS_EQ(aname,NAME_SYMBOL)) if(fjunction.method) return new VString(*fjunction.method->name); return Value::get_element(aname); } parser-3.5.1/src/types/pa_vrequest.h0000644000076400007640000000247214734016311014414 00000000000000/** @file Parser: @b request class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VREQUEST_H #define PA_VREQUEST_H #define IDENT_PA_VREQUEST_H "$Id: pa_vrequest.h,v 1.49 2024/12/27 22:58:39 moko Exp $" // includes #include "pa_sapi.h" #include "pa_common.h" #include "pa_vstateless_class.h" // defines #define REQUEST_ARGV_ELEMENT_NAME "argv" #define REQUEST_BODY_CHARSET_NAME "body-charset" #define REQUEST_BODY_BODY_NAME "body-file" #define POST_CHARSET_NAME "post-charset" #define POST_BODY_NAME "post-body" // forwards class Request_info; class VForm; /// request class class VRequest: public VStateless_class { Request_info& finfo; SAPI_Info& fsapi_info; Request_charsets& fcharsets; HashStringValue fargv; VForm& fform; public: // Value override const char* type() const { return "request"; } /// request: field override Value* get_element(const String& name); /// request: (key)=value override const VJunction* put_element(const String& name, Value* value); public: // usage VRequest(Request_info& ainfo, Request_charsets& acharsets, VForm& aform, SAPI_Info& asapi_info); private: HashStringValue ffields; void fill(); const char* path_from_uri(char* uri); }; #endif parser-3.5.1/src/types/pa_vstring.C0000644000076400007640000000130214712042466014162 00000000000000/** @file Parser: @b string class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vstring.h" #include "pa_vfile.h" volatile const char * IDENT_PA_VSTRING_C="$Id: pa_vstring.C,v 1.39 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VSTRING_H; VFile* VString::as_vfile(String::Language lang, const Request_charsets* charsets) { VFile& result=*new VFile; String::Body sbody=fstring->cstr_to_string_body_untaint(lang, 0, charsets); /* we are using binary to avoid ^#0D to be altered */ result.set_binary_string(false/*not tainted*/, sbody.cstr() , sbody.length()); return &result; } parser-3.5.1/src/types/pa_vhash.h0000644000076400007640000001200114712042466013642 00000000000000/** @file Parser: @b hash parser type decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VHASH_H #define PA_VHASH_H #define IDENT_PA_VHASH_H "$Id: pa_vhash.h,v 1.87 2024/11/04 03:53:26 moko Exp $" #include "classes.h" #include "pa_value.h" #include "pa_hash.h" #include "pa_vint.h" #include "pa_globals.h" #include "pa_symbols.h" // defines #define VHASH_TYPE "hash" extern Methoded* hash_class; class VHashBase: public VStateless_object { public: // value override const char* type() const { return VHASH_TYPE; } override VStateless_class *get_class() { return hash_class; } public: // usage virtual HashStringValue& hash()=0; virtual void set_default(Value* adefault)=0; virtual Value* get_default()=0; virtual void add(Value* avalue)=0; }; /// value of type 'hash', implemented with Hash class VHash: public VHashBase { public: // value /// VHash: count override int as_int() const { return fhash.count(); } override double as_double() const { return fhash.count(); } override bool is_defined() const { return fhash.count()!=0 || _default!=NULL; } override bool as_bool() const { return fhash.count()!=0; } override Value& as_expr_result() { return *new VInt(fhash.count()); } /// VHash: fhash override HashStringValue *get_hash() { return &fhash; } override HashStringValue* get_fields() { return &fhash; } override HashStringValue* get_fields_reference() { return &fhash; } /// VHash: (key)=value override Value* get_element(const String& aname) { // $element first if(Value* result=fhash.get(aname)) return result; // $fields -- pseudo field to make 'hash' more like 'table' if(SYMBOLS_EQ(aname,FIELDS_SYMBOL)) return this; #if !defined(FEATURE_GET_ELEMENT4CALL) || !defined(OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL) // $method, CLASS, CLASS_NAME if(Value* result=VStateless_object::get_element(aname)) return result; #endif // default value return get_default(); } #ifdef FEATURE_GET_ELEMENT4CALL override Value* get_element4call(const String& aname) { // $method first if(Value* result=VStateless_object::get_element(aname)) return result; // $element if(Value* result=fhash.get(aname)) return result; // default value if(Value* result=get_default()) return result; return bark("%s method not found", &aname); } #endif /// VHash: (key)=value override const VJunction* put_element(const String& aname, Value* avalue) { if(SYMBOLS_EQ(aname,_DEFAULT_SYMBOL)) set_default(avalue); else fhash.put(aname, avalue); return 0; } override VFile* as_vfile(String::Language lang, const Request_charsets *charsets=0); public: // usage VHash(): _default(0) {} VHash(const HashStringValue& source): fhash(source), _default(0) {} override HashStringValue& hash() { return fhash; } override void set_default(Value* adefault) { _default=adefault; } override Value* get_default() { return _default; } override void add(Value* avalue) { fhash.put(pa_uitoa(fhash.count()), avalue); } void extract_default(); private: HashStringValue fhash; Value* _default; }; /// value of type 'hash', implemented with Hash reference class VHashReference: public VHashBase { public: // value /// VHash: count override int as_int() const { return fhash->count(); } override double as_double() const { return fhash->count(); } override bool is_defined() const { return fhash->count()!=0; } override bool as_bool() const { return fhash->count()!=0; } override Value& as_expr_result() { return *new VInt(fhash->count()); } /// VHash: fhash override HashStringValue *get_hash() { return fhash; } override HashStringValue* get_fields() { return fhash; } override HashStringValue* get_fields_reference() { return fhash; } /// VHash: (key)=value override Value* get_element(const String& aname) { // $element first if(Value* result=fhash->get(aname)) return result; // $fields -- pseudo field to make 'hash' more like 'table' if(SYMBOLS_EQ(aname,FIELDS_SYMBOL)) return this; #if !defined(FEATURE_GET_ELEMENT4CALL) || !defined(OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL) // $method, CLASS, CLASS_NAME if(Value* result=VStateless_object::get_element(aname)) return result; #endif return 0; } #ifdef FEATURE_GET_ELEMENT4CALL override Value* get_element4call(const String& aname) { // $method first if(Value* result=VStateless_object::get_element(aname)) return result; // $element if(Value* result=fhash->get(aname)) return result; return 0; } #endif /// VHash: (key)=value override const VJunction* put_element(const String& aname, Value* avalue) { fhash->put(aname, avalue); return 0; } public: // usage VHashReference(HashStringValue& source): fhash(&source) {} override HashStringValue& hash() { return *fhash; } override void set_default(Value*) { } override Value* get_default() { return 0; } override void add(Value* avalue) { fhash->put(pa_uitoa(fhash->count()), avalue); } private: HashStringValue *fhash; }; #endif parser-3.5.1/src/types/pa_vdouble.h0000644000076400007640000000463314712042465014204 00000000000000/** @file Parser: @b double parser class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VDOUBLE_H #define PA_VDOUBLE_H #define IDENT_PA_VDOUBLE_H "$Id: pa_vdouble.h,v 1.77 2024/11/04 03:53:25 moko Exp $" // includes #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" // defines #define VDOUBLE_TYPE "double" // double validation defines #ifdef _MSC_VER #include #define pa_isnan(d) _isnan(d) #define pa_finite(d) _finite(d) #else #define pa_isnan(d) isnan(d) #ifdef HAVE_ISFINITE #define pa_finite(d) isfinite(d) #else #define pa_finite(d) finite(d) #endif #endif // externs extern Methoded* double_class; /// value of type 'double'. implemented with @c double class VDouble: public VSimple_stateless_object { public: // Value override const char* type() const { return VDOUBLE_TYPE; } override VStateless_class *get_class() { return double_class; } /// VDouble: true override bool is_evaluated_expr() const { return true; } /// VDouble: clone override Value& as_expr_result() { return *new VDouble(fdouble); } /// VDouble: fdouble override const String* get_string() { char local_buf[MAX_NUMBER]; size_t length=snprintf(local_buf, MAX_NUMBER, "%.15g", fdouble); return new String(pa_strdup(local_buf, length)); } /// VDouble: fdouble override double as_double() const { return fdouble; } /// VDouble: fdouble override int as_int() const { return get_int(); } /// VDouble: 0 or !0 override bool as_bool() const { return fdouble!=0; } /// VDouble: json-string override const String* get_json_string(Json_options&) { return get_string(); } public: // usage VDouble(double adouble): fdouble(adouble == 0 ? 0 : adouble) { if(!pa_finite(adouble)) throw Exception("number.format", 0, pa_isnan(adouble) ? "invalid number (double)" : "out of range (double)"); } int get_int() const { return clip2int(trunc(fdouble)); } double get_double() const { return fdouble; } void inc(double increment) { fdouble+=increment; } void mul(double k) { fdouble*=k; } void div(double d) { if(d == 0) throw Exception("number.zerodivision", 0, "Division by zero"); fdouble/=d; } void mod(double d) { if(d == 0) throw Exception("number.zerodivision", 0, "Modulus by zero"); fdouble=fmod(fdouble, d); } private: double fdouble; }; #endif parser-3.5.1/src/types/pa_vvoid.h0000644000076400007640000000334714712042466013675 00000000000000/** @file Parser: @b void parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VVOID_H #define PA_VVOID_H #define IDENT_PA_VVOID_H "$Id: pa_vvoid.h,v 1.47 2024/11/04 03:53:26 moko Exp $" #define STRICT_VARS #include "classes.h" #include "pa_vstateless_object.h" #include "pa_globals.h" #include "pa_vstring.h" extern Methoded* void_class; /// value of type 'void'. ex: usually $sjfklsjfksjdfk has this type class VVoid: public VString { public: // Value override const char* type() const { return "void"; } override VStateless_class *get_class() { return void_class; } /// VVoid: true [the only one, that reports true] override bool is_void() const { return true; } /// VVoid: json-string ("null") override const String* get_json_string(Json_options& options) { if(options.fvoid == Json_options::V_STRING){ static const String singleton_json_empty_string(String("\"\"")); return &singleton_json_empty_string; } else { static const String singleton_json_null(String("null")); return &singleton_json_null; } } #ifdef STRICT_VARS static bool strict_vars; #define CHECK_STRICT if(strict_vars) throw Exception(PARSER_RUNTIME, 0, "Use of uninitialized value"); #else #define CHECK_STRICT #endif /// VVoid: with OPTIMIZE_SINGLE_STRING_WRITE it allows void to survive in [$void] override bool is_string() const { return true; } override const String* get_string() { CHECK_STRICT return VString::get_string(); } override Value& as_expr_result() { CHECK_STRICT return VString::as_expr_result(); } inline static VVoid *get(){ static VVoid singleton; return &singleton; } }; #endif parser-3.5.1/src/types/pa_vconsole.h0000644000076400007640000000302214712042465014363 00000000000000/** @file Parser: @b console class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VCONSOLE_H #define PA_VCONSOLE_H #define IDENT_PA_VCONSOLE_H "$Id: pa_vconsole.h,v 1.30 2024/11/04 03:53:25 moko Exp $" // includes #include "pa_sapi.h" #include "pa_common.h" #include "pa_vstateless_class.h" #include "pa_string.h" // defines #define CONSOLE_LINE_NAME "line" /// console class class VConsole: public VStateless_class { public: // Value const char* type() const { return "console"; } /// console: line Value* get_element(const String& aname) { #ifndef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL // CLASS, CLASS_NAME if(Value* result=VStateless_class::get_element(aname)) return result; #endif // $line if(aname==CONSOLE_LINE_NAME) { char local_value[MAX_STRING]; if(fgets(local_value, sizeof(local_value), stdin)) return new VString(*new String(pa_strdup(local_value), String::L_TAINTED)); return 0; // EOF } return bark("%s field not found", &aname); } /// console: $line override const VJunction* put_element(const String& aname, Value* avalue) { // $line if(aname==CONSOLE_LINE_NAME) { fused=true; puts(avalue->as_string().cstr()); fflush(stdout); return 0; } throw Exception(PARSER_RUNTIME, &aname, "writing to invalid field"); } bool was_used(){ return fused; } public: // usage VConsole() { fused=false; } private: bool fused; }; #endif parser-3.5.1/src/types/pa_wcontext.C0000644000076400007640000000140514712042466014345 00000000000000/** @file Parser: write context class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_wcontext.h" volatile const char * IDENT_PA_WCONTEXT_C="$Id: pa_wcontext.C,v 1.44 2024/11/04 03:53:26 moko Exp $" IDENT_PA_WCONTEXT_H; // appends a fstring to result void WContext::write(Value& avalue) { if(fvalue) { // already have value? // must not construct twice throw Exception(PARSER_RUNTIME, 0, "%s may not be overwritten with %s, store it to variable instead", fvalue->type(), avalue.type()); } else fvalue=&avalue; } void WContext::detach_junctions() { for(Array_iterator i(junctions); i; ) i.next()->reattach(fparent); } parser-3.5.1/src/types/pa_vform.h0000644000076400007640000000527514720373040013673 00000000000000/** @file Parser: @b form class decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VFORM_H #define PA_VFORM_H #define IDENT_PA_VFORM_H "$Id: pa_vform.h,v 1.70 2024/11/23 15:34:56 moko Exp $" // includes #include "classes.h" #include "pa_common.h" #include "pa_value.h" #include "pa_vhash.h" // forwards class Request_info; class Request_charsets; enum POST_CONTENT_TYPE { UNKNOWN, FORM_URLENCODED, MULTIPART_FORMDATA }; /** derivates from VStateless_class so that :CLASS element referred to @a this. and users could do such tricks: @verbatim ^rem{pass somebody something with elements} ^rem{this time that would be elements of a form} ^somebody[$form:CLASS] ^rem{this time that would be elements of a table record} $news[^table:sql[select * from news]] ^somebody[^news.record[]] @endverbatim */ class VForm: public VStateless_class { public: // Value const char* type() const { return "form"; } // form: fields,tables,files,imap,method,field Value* get_element(const String& aname); Charset* get_body_charset(); /// form: (field)=value override const VJunction* put_element(const String& name, Value* value); public: // usage VForm(Request_charsets& acharsets, Request_info& arequest_info); private: Request_charsets& fcharsets; Request_info& frequest_info; bool can_have_body; bool charset_detected; POST_CONTENT_TYPE post_content_type; char *strpart(const char* str, size_t len); char *getAttributeValue(const char* data,const char *attr,size_t len); void UnescapeChars(char **sp, const char* cp, size_t len); void ParseGetFormInput(const char* query_string, size_t length); void ParseFormInput(const char* data, size_t length, Charset* client_charset=0); void ParseMimeInput(char *content_type, const char* data, size_t length, Charset* client_charset=0); void AppendFormEntry( const char* cname_cstr, const char* raw_cvalue_ptr, const size_t raw_cvalue_size, Charset* client_charset=0); void AppendFormFileEntry( const char* cname_cstr, const char* raw_cvalue_ptr, const size_t raw_cvalue_size, const char* file_name_cstr, Charset* client_charset=0); bool should_refill_fields_tables_and_files(); void refill_fields_tables_and_files(); void detect_post_charset(); private: Charset* filled_source; Charset* filled_client; Charset* fpost_charset; // charset which was specified in content-type in incoming POST VHash vfields, vtables, vfiles, vimap, velements; HashStringValue &fields, &tables, &files, &imap, &elements; private: String::C transcode(const char* client, size_t client_size, Charset* client_charset=0); }; #endif parser-3.5.1/src/types/pa_varray.h0000644000076400007640000001430414713714200014036 00000000000000/** @file Parser: @b array parser type decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VARRAY_H #define PA_VARRAY_H #define IDENT_PA_VARRAY_H "$Id: pa_varray.h,v 1.25 2024/11/09 17:14:40 moko Exp $" #include "classes.h" #include "pa_value.h" #include "pa_array.h" #include "pa_vhash.h" #include "pa_vint.h" #include "pa_globals.h" #include "pa_symbols.h" // defines #define VARRAY_TYPE "array" //#define DEBUG_ARRAY_USED extern Methoded* array_class; /// Sparse Array template class SparseArray: public Array { mutable size_t fused; public: inline SparseArray(size_t initial=0) : Array(initial), fused(0) {} inline SparseArray(size_t size, T* elements) : Array(size), fused(size) { memcpy(this->felements, elements, size * sizeof(T)); this->fsize=size; } void copy(SparseArray &src) { size_t size=src.fsize; if(size){ fit(size-1); memcpy(this->felements, src.felements, size * sizeof(T)); this->fsize=size; fused=src.fused; } } // note: 'operator+=' is used directly from Array void fit(size_t index); inline T get(size_t index) const { return index < this->fsize ? this->felements[index] : NULL; } inline void put(size_t index, T element){ this->fit(index); this->felements[index]=element; if(index >= this->fsize){ this->fsize=index+1; } } inline bool put_dont_replace(size_t index, T element){ this->fit(index); if(this->felements[index]) return true; this->felements[index]=element; if(index >= this->fsize){ this->fsize=index+1; } return false; } inline void insert(size_t index, T element) { if(index >= this->fsize){ this->fit(index); this->felements[index]=element; this->fsize=index+1; } else { Array::insert(index, element); } } size_t used() const{ #ifndef DEBUG_ARRAY_USED if(!fused) #endif { size_t used=0; for(Array_iterator i(*this); i;) { if(i.next()) used++; } #ifdef DEBUG_ARRAY_USED if(fused && fused!=used) throw Exception(PARSER_RUNTIME, 0, "cached elements count %d differs from actual %d", fused, used); printf(fused ? "cached used %d\n" : "counted used %d\n", used); #endif fused=used; } return fused; } inline void clear(size_t index) { if(index < this->fsize){ this->felements[index]=NULL; if(index == this->fsize-1){ this->fsize--; locate_last_used(); } } } inline void clear() { Array::clear(); } inline void remove(size_t index) { if(index < this->fsize){ Array::remove(index); if(index==this->fsize) locate_last_used(); } } inline T pop() { if(this->fsize){ T result=this->felements[this->fsize-1]; this->fsize--; locate_last_used(); return result; } return NULL; } inline void invalidate(){ fused=0; } inline void locate_last_used(){ for(;this->fsize>0 && !this->felements[this->fsize-1];this->fsize--); } inline void confirm_all_used(){ fused=this->fsize; } inline void change_used(int delta){ if(fused){ fused+=delta; } } void compact(bool compact_undef){ T* dst=this->felements; T* elements_end=dst + this->fsize; if(compact_undef){ for(T* src=this->felements; src < elements_end; src++) if(*src && (*src)->is_defined()) *dst++=*src; } else { for(T* src=this->felements; src < elements_end; src++) if(*src) *dst++=*src; } this->fsize=dst-this->felements; } }; class VArray: public VHashBase { public: // value override const char* type() const { return VARRAY_TYPE; } override VStateless_class *get_class() { return array_class; } /// VArray: used elements count override int as_int() const { return farray.used(); } override double as_double() const { return (double)farray.used(); } override bool is_defined() const { return farray.count()!=0; } override bool as_bool() const { return farray.count()!=0; } override Value& as_expr_result() { return *new VInt(farray.used()); } /// VArray: virtual hash override HashStringValue *get_hash() { return &hash(); } override HashStringValue* get_fields() { return &hash(); } override HashStringValue* get_fields_reference() { return &hash(); } /// VArray: json-string override const String* get_json_string(Json_options& options); /// VArray: (key)=value override Value* get_element(const String& aname) { #if !defined(FEATURE_GET_ELEMENT4CALL) || !defined(OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL) // $method, CLASS, CLASS_NAME if(Value* result=VStateless_object::get_element(aname)) return result; #endif // $element, here as index() allows only numbers if(Value* result=farray.get(index(aname))) return result; return NULL; } #ifdef FEATURE_GET_ELEMENT4CALL override Value* get_element4call(const String& aname) { // $method first if(Value* result=VStateless_object::get_element(aname)) return result; // $element if(is_index(aname)) if(Value* result=farray.get(index(aname))) return result; return bark("%s method not found", &aname); } #endif /// VArray: (key)=value override const VJunction* put_element(const String& aname, Value* avalue) { farray.put(index(aname), avalue); farray.invalidate(); return 0; } public: // VHashBase override HashStringValue& hash(); override void set_default(Value*) { } override Value* get_default() { return 0; } override void add(Value* avalue) { farray+=avalue; /* only json uses it, thus no need to invalidate()*/ } public: // usage VArray(size_t initial=0): farray(initial) {} VArray(size_t size, Value** elements): farray(size, elements) {} ArrayValue &array() { return farray; } static size_t index(int aindex){ if(aindex<0) throw Exception("number.format", 0, "index is out of range (negative)"); return aindex; } static size_t index(const String::Body& aindex){ return pa_atoui(aindex.cstr()); } static size_t index(const String& aindex){ return pa_atoui(aindex.cstr(), 10, &aindex); } static bool is_index(const String& aindex){ for(const char *pos=aindex.cstr(); *pos ;pos++){ if ((*pos < '0') || (*pos > '9')) return false; } return true; } bool contains(size_t index){ return farray.get(index) != NULL; } private: ArrayValue farray; }; #endif parser-3.5.1/src/types/pa_vhashfile.C0000644000076400007640000002054214712042466014446 00000000000000/** @file Parser: @b table class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_globals.h" #include "pa_common.h" #include "pa_vtable.h" #include "pa_vstring.h" #include "pa_vhashfile.h" #include "pa_vdate.h" volatile const char * IDENT_PA_VHASHFILE_C="$Id: pa_vhashfile.C,v 1.76 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VHASHFILE_H; // consts const uint HASHFILE_VALUE_SERIALIZED_VERSION=0x0001; // methods void check_dir(const char* file_name){ String& sfile_name = *new String(file_name); if(!entry_exists(sfile_name)) create_dir_for_file(sfile_name); } void VHashfile::check(const char *step, pa_status_t status) { if(status==PA_SUCCESS) return; const char* str=strerror(status); throw Exception("file.access", 0, "%s error: %s (%d), actual filename '%s'", step, str ? str : "", status, file_name); } void VHashfile::open(const String& afile_name) { file_name=afile_name.taint_cstr(String::L_FILE_SPEC); } void VHashfile::close() { if(!is_open()) return; check("pa_sdbm_close", pa_sdbm_close(m_db)); m_db=0; } bool VHashfile::is_open() { return m_db != 0; } pa_sdbm_t *VHashfile::get_db_for_reading() { if(is_open()){ return m_db; } if(file_name){ check_dir(file_name); check("pa_sdbm_open(shared)", pa_sdbm_open(&m_db, file_name, PA_CREATE|PA_READ|PA_SHARELOCK, 0664, 0)); } if(!is_open()) throw Exception("file.read", 0, "can't open %s for reading", type()); return m_db; } pa_sdbm_t *VHashfile::get_db_for_writing() { if(is_open()){ if(pa_sdbm_rdonly(m_db)) { close(); // close if was opened for reading } else { return m_db; } } if(file_name) { check_dir(file_name); // reopen in write mode & exclusive lock check("pa_sdbm_open(exclusive)", pa_sdbm_open(&m_db, file_name, PA_CREATE|PA_WRITE, 0664, 0)); } if(!is_open()) throw Exception("file.access", 0, "can't open %s for writing", type()); return m_db; } VHashfile::~VHashfile() { if(is_open()) close(); } struct Hashfile_value_serialized_prolog { uint version; time_t time_to_die; }; pa_sdbm_datum_t VHashfile::serialize_value(const String& string, time_t time_to_die) const { pa_sdbm_datum_t result; size_t length=string.length(); result.dsize=sizeof(Hashfile_value_serialized_prolog)+length; result.dptr=new(PointerFreeGC) char[result.dsize]; Hashfile_value_serialized_prolog& prolog=*reinterpret_cast(result.dptr); char *output_cstr=result.dptr+sizeof(Hashfile_value_serialized_prolog); prolog.version=HASHFILE_VALUE_SERIALIZED_VERSION; prolog.time_to_die=time_to_die; if(length) // reported errors on storing empty values to hashfiles, but without details. maybe here [win32, intel:solaris, freebsd were OK...] memcpy(output_cstr, string.cstr(), length); return result; } const String* VHashfile::deserialize_value(pa_sdbm_datum_t key, const pa_sdbm_datum_t value) { // key not found || it's surely not in our format if(!value.dptr || (size_t)value.dsizeget_hash()) { if(Value *value_value=hash->get(value_name)) { if(value_value->get_junction()) throw Exception(PARSER_RUNTIME, 0, VALUE_NAME" must not be code"); value_string=&value_value->as_string(); if(Value *expires=hash->get(expires_name)) { if(VDate* vdate=dynamic_cast(expires)) time_to_die=vdate->get_time(); // $expires[DATE] else if(double days_till_expire=expires->as_double()) time_to_die=time(NULL)+(time_t)(60*60*24*days_till_expire); // $expires(days) } } else throw Exception(PARSER_RUNTIME, &aname, "put hash value must contain ." VALUE_NAME); } else value_string=&avalue->as_string(); pa_sdbm_datum_t key; key.dptr=const_cast(aname.cstr()); key.dsize=aname.length(); pa_sdbm_datum_t value=serialize_value(*value_string, time_to_die); #ifndef PAIRMAX // !see PAIRMAX definition in sdbm_private.h. values should be the same #define PAIRMAX 8008 #endif if(key.dsize+value.dsize > PAIRMAX) throw Exception(PARSER_RUNTIME, 0,"hashfile record length (key+value) exceeds limit (%d bytes)", PAIRMAX); check("pa_sdbm_store", pa_sdbm_store(db, key, value, PA_SDBM_REPLACE)); } Value *VHashfile::get_field(const String& aname) { CHECK(aname) pa_sdbm_t *db=get_db_for_reading(); pa_sdbm_datum_t key; key.dptr=const_cast(aname.cstr()); key.dsize=aname.length(); pa_sdbm_datum_t value; check("pa_sdbm_fetch", pa_sdbm_fetch(db, &value, key)); const String *sresult=deserialize_value(key, value); return sresult? new VString(*sresult): 0; } void VHashfile::remove(const pa_sdbm_datum_t key) { pa_sdbm_t *db=get_db_for_writing(); check("pa_sdbm_delete", pa_sdbm_delete(db, key)); } void VHashfile::remove(const String& aname) { CHECK(aname) pa_sdbm_datum_t key; key.dptr=const_cast(aname.cstr()); key.dsize=aname.length(); remove(key); } void VHashfile::for_each(bool callback(pa_sdbm_datum_t, void*), void* info) { pa_sdbm_t *db=get_db_for_reading(); // collect keys Array* keys=0; check("pa_sdbm_lock", pa_sdbm_lock(db, PA_FLOCK_SHARED)); try { pa_sdbm_datum_t key; if(pa_sdbm_firstkey(db, &key)==PA_SUCCESS) { size_t count=0; do { // must cound beforehead, becase doing reallocs later would be VERY slow and cause HUGE fragmentation count++; } while(pa_sdbm_nextkey(db, &key)==PA_SUCCESS); keys=new Array(count); if(pa_sdbm_firstkey(db, &key)==PA_SUCCESS) do { // must clone because it points to page which may go away // [if they modify hashfile inside foreach] key.dptr = pa_strdup(key.dptr, key.dsize); *keys+=key; } while(pa_sdbm_nextkey(db, &key)==PA_SUCCESS); } } catch(...) { check("pa_sdbm_unlock", pa_sdbm_unlock(db)); rethrow; } check("pa_sdbm_unlock", pa_sdbm_unlock(db)); // iterate them if(keys) keys->for_each(callback, info); } #ifndef DOXYGEN struct For_each_string_callback_info { VHashfile* self; void* nested_info; bool (*nested_callback)(const String::Body, const String&, void*); }; #endif static bool for_each_string_callback(pa_sdbm_datum_t apkey, void* ainfo) { For_each_string_callback_info& info=*static_cast(ainfo); pa_sdbm_t *db=info.self->get_db_for_reading(); pa_sdbm_datum_t apvalue; info.self->check("pa_sdbm_fetch", pa_sdbm_fetch(db, &apvalue, apkey)); if(const String* svalue=info.self->deserialize_value(apkey, apvalue)) { const char *clkey=pa_strdup(apkey.dptr, apkey.dsize); return info.nested_callback(clkey, *svalue, info.nested_info); } return false; } void VHashfile::for_each(bool callback(const String::Body, const String&, void*), void* ainfo) { For_each_string_callback_info info; info.self=this; info.nested_info=ainfo; info.nested_callback=callback; for_each(for_each_string_callback, &info); } static bool get_hash__put(const String::Body key, const String& value, void* aresult) { static_cast(aresult)->put(key, new VString(value)); return false; } HashStringValue *VHashfile::get_hash() { HashStringValue& result=*new HashStringValue(); for_each(get_hash__put, &result); return &result; } static void delete_file(const char* base_name, const char* ext) { String sfile_name(base_name); sfile_name<, Alexandr Petrosian */ #include "pa_vclass.h" #include "pa_vobject.h" volatile const char * IDENT_PA_VCLASS_C="$Id: pa_vclass.C,v 1.67 2024/11/04 03:53:25 moko Exp $" IDENT_PA_VCLASS_H; #ifdef OBJECT_PROTOTYPE bool VClass::prototype = true; #endif #ifdef CLASS_GETTER_UNPROTECTED bool VClass::getter_protected = true; #endif Property& VClass::get_property(const String& aname) { Property* result=ffields.get(aname); if (result) { if (!result->getter && !result->setter) { // replacing field with property result=new Property(); } else { // cloning existing property to avoid ancestor modification result=new Property(*result); } } else { // creating new property result=new Property(); } ffields.put(aname, result); return *result; } void VClass::real_set_method(const String& aname, Method* amethod) { if(aname.starts_with("GET_")){ if(aname=="GET_DEFAULT") set_default_getter(amethod); else get_property(aname.mid(4, aname.length())).getter=amethod; } else if(aname.starts_with("SET_")){ if(aname=="SET_DEFAULT") set_default_setter(amethod); else get_property(aname.mid(4, aname.length())).setter=amethod; } else if(aname=="GET"){ set_scalar(amethod); } // NOT under 'else' for backward compatiblilty: // if someone used get_xxx names to name regular methods // still register method: VStateless_class::real_set_method(aname, amethod); } void VClass::set_base(VStateless_class* abase){ VStateless_class::set_base(abase); if(abase) { if(HashStringProperty *props=abase->get_properties()) ffields.merge_dont_replace(*props); else throw Exception("parser.compile", 0, "Class %s base class (%s) is not user-defined", type(), abase->type()); } } bool VClass::is(const char* atype) { bool result=Value::is(atype); return result ? result : fbase ? fbase->is(atype) : false; } /// VClass: $CLASS, (field/property)=STATIC value;(method)=method_ref with self=object_class Value* VClass::get_element(Value& aself, const String& aname) { // simple things first: $field=static field/property if(Property* prop=ffields.get(aname)) { if(prop->getter) return new VJunction(aself, prop->getter, true /*is_getter*/); if(prop->setter){ if(Value *result=get_default_getter(aself, aname)) return result; throw Exception(PARSER_RUNTIME, 0, "this property has no getter method (@GET_%s[])", aname.cstr()); } // just field, can be 0 as we don't remove return prop->value; } // $CLASS, $method, or other base element if(Value* result=VStateless_class::get_element(aself, aname)) return result; // no field or method found: looking for default getter return get_default_getter(aself, aname); } static void add_field( HashStringProperty::key_type key, HashStringProperty::value_type prop, HashStringValue* result ){ if(prop->value) result->put(key, prop->value); } HashStringValue* VClass::get_hash() { HashStringValue* result=new HashStringValue(); ffields.for_each(add_field, result); return result; } /// VClass: (field/property)=value - static values only const VJunction* VClass::put_element(Value& aself, const String& aname, Value* avalue) { if(Property* prop=ffields.get(aname)) { if (prop->setter) return new VJunction(aself, prop->setter); if(prop->getter){ if(VJunction *result=get_default_setter(aself, aname)) return result; #ifdef CLASS_GETTER_UNPROTECTED if(!getter_protected) prop->getter=0; else #endif throw Exception(PARSER_RUNTIME, 0, "this property has no setter method (@SET_%s[value])", aname.cstr()); } // just field, value can be 0 and unlike usual we don't remove it prop->value=avalue; } else { if(VJunction *result=get_default_setter(aself, aname)) return result; prop=new Property(); prop->value=avalue; ffields.put(aname, prop); for(ArrayClass::Iterator i(fderived); i; ) { HashStringProperty *props=i.next()->get_properties(); if(props) props->put_dont_replace(aname, prop); } } return 0; } /// part of put_element const VJunction* VClass::put_element_replace_only(Value& aself, const String& aname, Value* avalue) { if(Property* prop=ffields.get(aname)) { if (prop->setter) return new VJunction(aself, prop->setter); #ifdef OBJECT_PROTOTYPE if(!prototype) #endif { if(prop->getter){ if(VJunction *result=get_default_setter(aself, aname)) return result; throw Exception(PARSER_RUNTIME, 0, "this property has no setter method (@SET_%s[value])", aname.cstr()); } // just field, value can be 0 and unlike usual we don't remove it prop->value=avalue; return PUT_ELEMENT_REPLACED_FIELD; } } return 0; } /// @returns object of this class Value* VClass::create_new_value(Pool&) { return new VObject(*this); } const String* VClass::get_json_string(Json_options& options){ if(options.default_method){ return default_method_2_json_string(*options.default_method, options); } return options.hash_json_string(get_hash()); } parser-3.5.1/src/types/pa_vrequest.C0000644000076400007640000000730114734016311014343 00000000000000/** @file Parser: @b request class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vrequest.h" #include "pa_request_info.h" #include "pa_request_charsets.h" #include "pa_charsets.h" #include "pa_vstring.h" #include "pa_vhash.h" #include "pa_vform.h" #include "pa_vvoid.h" #include "pa_vfile.h" volatile const char * IDENT_PA_VREQUEST_C="$Id: pa_vrequest.C,v 1.73 2024/12/28 15:05:15 moko Exp $" IDENT_PA_VREQUEST_H; // defines #define DOCUMENT_ROOT_NAME "document-root" #define REQUEST_HEADERS_ELEMENT_NAME "headers" VRequest::VRequest(Request_info& ainfo, Request_charsets& acharsets, VForm& aform, SAPI_Info& asapi_info): finfo(ainfo), fsapi_info(asapi_info), fcharsets(acharsets), fform(aform) { if(ainfo.argv) for(size_t i=0; ainfo.argv[i]; i++) { fargv.put_dont_replace( String(i, "%d"), new VString(*new String(pa_strdup(ainfo.argv[i]), String::L_TAINTED)) ); } } Value* VRequest::get_element(const String& aname) { #ifndef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL // $request:CLASS, $request:CLASS_NAME if(Value* result=VStateless_class::get_element(aname)) return result; #endif // $request:charset if(aname==CHARSET_NAME) return new VString(*new String(fcharsets.source().NAME(), String::L_TAINTED)); // $request:body-charset if(aname==REQUEST_BODY_CHARSET_NAME || aname==POST_CHARSET_NAME /*backward*/){ if(Charset* body_charset=fform.get_body_charset()) return new VString(*new String(body_charset->NAME(), String::L_TAINTED)); else return VVoid::get(); } // $resuest:body-file if(aname==REQUEST_BODY_BODY_NAME || aname==POST_BODY_NAME /*backward*/){ VFile& result=*new VFile; result.set_binary(true/*tainted*/, (finfo.post_data)?finfo.post_data:"" /*to distinguish from stat-ed file*/, finfo.post_size); return &result; } // $request:argv if(aname==REQUEST_ARGV_ELEMENT_NAME) return new VHash(fargv); //$request:headers if(aname==REQUEST_HEADERS_ELEMENT_NAME){ if(!ffields.count()) fill(); return new VHash(ffields); } // $request:query $request:uri $request:document-root $request:body $request:method const char* buf; if(aname=="query") buf=finfo.query_string; else if(aname=="uri") buf=finfo.uri; else if(aname=="path") buf=path_from_uri(pa_strdup(finfo.uri)); else if(aname==DOCUMENT_ROOT_NAME) buf=finfo.document_root; else if(aname=="body") buf=finfo.post_data; else if(aname=="method") buf=finfo.method; else return bark("%s field not found", &aname); return new VString(*new String(buf, String::L_TAINTED)); } const VJunction* VRequest::put_element(const String& aname, Value* avalue) { // $charset if(aname==CHARSET_NAME) { fcharsets.set_source(pa_charsets.get(avalue->as_string())); return 0; } // $document-root if(aname==DOCUMENT_ROOT_NAME) { finfo.document_root=avalue->as_string().taint_cstr(String::L_FILE_SPEC); return 0; } return Value::put_element(aname, avalue); } void VRequest::fill(){ for(SAPI::Env::Iterator i(fsapi_info); i; i.next() ){ char* key=i.key(); if(pa_strncasecmp(key, "HTTP_")==0) { for(char* c=key+5; *c; c++) *c=(char)toupper((unsigned char)*c); ffields.put( key+5 /*skip "HTTP_" */, new VString(*new String(i.value(), String::L_TAINTED)) ); } } } const char* VRequest::path_from_uri(char* uri){ const char *result=uri; lsplit(uri,'?'); if(result && *result) result=unescape_chars(result, strlen(result), &pa_UTF8_charset, false /* uri */); if(result && *result) result=Charset::transcode(result, pa_UTF8_charset, fcharsets.source()).cstr(); if(result && *result) return result; return ""; // to match an empty URI in console mode } parser-3.5.1/src/types/pa_vresponse.C0000644000076400007640000000251014712042466014514 00000000000000/** @file Parser: @b response class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vresponse.h" #include "pa_request_charsets.h" #include "pa_charsets.h" #include "pa_charset.h" #include "pa_vstring.h" #include "pa_vdate.h" #include "pa_vhash.h" volatile const char * IDENT_PA_VRESPONSE_C="$Id: pa_vresponse.C,v 1.42 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VRESPONSE_H; // defines #define REQUEST_HEADERS_ELEMENT_NAME "headers" Value* VResponse::get_element(const String& aname) { // $charset if(aname==CHARSET_NAME) return new VString(*new String(fcharsets.client().NAME(), String::L_TAINTED)); // $headers if(aname==REQUEST_HEADERS_ELEMENT_NAME) return new VHash(ffields); // $method if(Value* result=VStateless_class::get_element(aname)) return result; // $field return ffields.get(aname.change_case(fcharsets.source(), String::CC_UPPER)); } const VJunction* VResponse::put_element(const String& aname, Value* avalue) { // guard charset change if(aname==CHARSET_NAME) fcharsets.set_client(pa_charsets.get(avalue->as_string())); else ffields.put(aname.change_case(fcharsets.source(), String::CC_UPPER), !avalue || (avalue->is_string() && !avalue->is_defined()) ? 0: avalue); return 0; } parser-3.5.1/src/types/pa_vtable.h0000644000076400007640000000405214712042466014015 00000000000000/** @file Parser: @b table parser class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VTABLE_H #define PA_VTABLE_H #define IDENT_PA_VTABLE_H "$Id: pa_vtable.h,v 1.71 2024/11/04 03:53:26 moko Exp $" #include "pa_vstateless_object.h" #include "pa_table.h" //#include "pa_vvoid.h" #include "pa_vint.h" // defines #define VTABLE_TYPE "table" // externs extern Methoded* table_class; /// value of type 'table'. implemented with Table class VTable: public VStateless_object { public: // Value override const char* type() const { return VTABLE_TYPE; } override VStateless_class *get_class() { return table_class; } /// VTable: count override int as_int() const { return (int)table().count(); } /// VTable: count override double as_double() const { return (double)table().count(); } /// VTable: count!=0 override bool is_defined() const { return table().count()!=0; } /// VTable: 0 or !0 override bool as_bool() const { return table().count()!=0; } /// VTable: count override Value& as_expr_result() { return *new VInt(as_int()); } /// VTable: json-string override const String* get_json_string(Json_options& options); /// extract VTable override Table* get_table() { return ftable; } /// VTable: columns,methods override Value* get_element(const String& aname); #ifdef FEATURE_GET_ELEMENT4CALL /// VTable: methods,columns override Value* get_element4call(const String& aname); #endif /// VTable: columns virtual const VJunction* put_element(const String&, Value*); public: // usage VTable(Table* atable=0): ftable(atable) {} void set_table(Table& avalue) { ftable=&avalue; } Table& table() const { if(!ftable) bark("getting unset vtable value", 0); return *ftable; } private: Value* fields_element(); String& get_json_string_array(String&, const char *); String& get_json_string_object(String&, const char *); String& get_json_string_compact(String&, const char *); private: Table* ftable; }; #endif parser-3.5.1/src/types/Makefile.in0000644000076400007640000006212614740273416013764 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/types ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libtypes_la_LIBADD = am_libtypes_la_OBJECTS = pa_value.lo pa_varray.lo pa_vcookie.lo \ pa_vfile.lo pa_vform.lo pa_vimage.lo pa_vjunction.lo \ pa_vregex.lo pa_vrequest.lo pa_vresponse.lo \ pa_vstateless_class.lo pa_vstring.lo pa_wcontext.lo \ pa_vtable.lo pa_vxnode.lo pa_vxdoc.lo pa_vstatus.lo \ pa_vmail.lo pa_vobject.lo pa_vclass.lo pa_vhashfile.lo \ pa_vmath.lo pa_vmethod_frame.lo pa_vvoid.lo pa_vhash.lo \ pa_venv.lo pa_vdate.lo pa_vmemcached.lo libtypes_la_OBJECTS = $(am_libtypes_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/pa_value.Plo \ ./$(DEPDIR)/pa_varray.Plo ./$(DEPDIR)/pa_vclass.Plo \ ./$(DEPDIR)/pa_vcookie.Plo ./$(DEPDIR)/pa_vdate.Plo \ ./$(DEPDIR)/pa_venv.Plo ./$(DEPDIR)/pa_vfile.Plo \ ./$(DEPDIR)/pa_vform.Plo ./$(DEPDIR)/pa_vhash.Plo \ ./$(DEPDIR)/pa_vhashfile.Plo ./$(DEPDIR)/pa_vimage.Plo \ ./$(DEPDIR)/pa_vjunction.Plo ./$(DEPDIR)/pa_vmail.Plo \ ./$(DEPDIR)/pa_vmath.Plo ./$(DEPDIR)/pa_vmemcached.Plo \ ./$(DEPDIR)/pa_vmethod_frame.Plo ./$(DEPDIR)/pa_vobject.Plo \ ./$(DEPDIR)/pa_vregex.Plo ./$(DEPDIR)/pa_vrequest.Plo \ ./$(DEPDIR)/pa_vresponse.Plo \ ./$(DEPDIR)/pa_vstateless_class.Plo ./$(DEPDIR)/pa_vstatus.Plo \ ./$(DEPDIR)/pa_vstring.Plo ./$(DEPDIR)/pa_vtable.Plo \ ./$(DEPDIR)/pa_vvoid.Plo ./$(DEPDIR)/pa_vxdoc.Plo \ ./$(DEPDIR)/pa_vxnode.Plo ./$(DEPDIR)/pa_wcontext.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libtypes_la_SOURCES) DIST_SOURCES = $(libtypes_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I../classes -I../sql -I../lib/gd -I../lib/sdbm/pa-include -I../lib/memcached -I../classes/gd @PCRE_INCLUDES@ @XML_INCLUDES@ @MIME_INCLUDES@ noinst_HEADERS = pa_value.h pa_junction.h pa_method.h pa_varray.h pa_vbool.h pa_vcaller_wrapper.h pa_vclass.h pa_vcode_frame.h pa_vcookie.h pa_vdate.h pa_vdouble.h pa_venv.h pa_vfile.h pa_vform.h pa_vhash.h pa_vhashfile.h pa_vimage.h pa_vint.h pa_vjunction.h pa_vmath.h pa_vmethod_frame.h pa_vobject.h pa_vregex.h pa_vrequest.h pa_vresponse.h pa_vstateless_class.h pa_vstateless_object.h pa_vstatus.h pa_vstring.h pa_vtable.h pa_vvoid.h pa_vxdoc.h pa_vxnode.h pa_wcontext.h pa_wwrapper.h pa_vmail.h pa_vmemory.h pa_vconsole.h pa_property.h pa_vmemcached.h noinst_LTLIBRARIES = libtypes.la libtypes_la_SOURCES = pa_value.C pa_varray.C pa_vcookie.C pa_vfile.C pa_vform.C pa_vimage.C pa_vjunction.C pa_vregex.C pa_vrequest.C pa_vresponse.C pa_vstateless_class.C pa_vstring.C pa_wcontext.C pa_vtable.C pa_vxnode.C pa_vxdoc.C pa_vstatus.C pa_vmail.C pa_vobject.C pa_vclass.C pa_vhashfile.C pa_vmath.C pa_vmethod_frame.C pa_vvoid.C pa_vhash.C pa_venv.C pa_vdate.C pa_vmemcached.C EXTRA_DIST = types.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/types/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/types/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libtypes.la: $(libtypes_la_OBJECTS) $(libtypes_la_DEPENDENCIES) $(EXTRA_libtypes_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libtypes_la_OBJECTS) $(libtypes_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_value.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_varray.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vclass.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vcookie.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vdate.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_venv.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vfile.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vform.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vhash.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vhashfile.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vimage.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vjunction.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vmail.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vmath.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vmemcached.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vmethod_frame.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vobject.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vregex.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vrequest.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vresponse.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vstateless_class.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vstatus.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vstring.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vtable.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vvoid.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vxdoc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_vxnode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_wcontext.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .C.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/pa_value.Plo -rm -f ./$(DEPDIR)/pa_varray.Plo -rm -f ./$(DEPDIR)/pa_vclass.Plo -rm -f ./$(DEPDIR)/pa_vcookie.Plo -rm -f ./$(DEPDIR)/pa_vdate.Plo -rm -f ./$(DEPDIR)/pa_venv.Plo -rm -f ./$(DEPDIR)/pa_vfile.Plo -rm -f ./$(DEPDIR)/pa_vform.Plo -rm -f ./$(DEPDIR)/pa_vhash.Plo -rm -f ./$(DEPDIR)/pa_vhashfile.Plo -rm -f ./$(DEPDIR)/pa_vimage.Plo -rm -f ./$(DEPDIR)/pa_vjunction.Plo -rm -f ./$(DEPDIR)/pa_vmail.Plo -rm -f ./$(DEPDIR)/pa_vmath.Plo -rm -f ./$(DEPDIR)/pa_vmemcached.Plo -rm -f ./$(DEPDIR)/pa_vmethod_frame.Plo -rm -f ./$(DEPDIR)/pa_vobject.Plo -rm -f ./$(DEPDIR)/pa_vregex.Plo -rm -f ./$(DEPDIR)/pa_vrequest.Plo -rm -f ./$(DEPDIR)/pa_vresponse.Plo -rm -f ./$(DEPDIR)/pa_vstateless_class.Plo -rm -f ./$(DEPDIR)/pa_vstatus.Plo -rm -f ./$(DEPDIR)/pa_vstring.Plo -rm -f ./$(DEPDIR)/pa_vtable.Plo -rm -f ./$(DEPDIR)/pa_vvoid.Plo -rm -f ./$(DEPDIR)/pa_vxdoc.Plo -rm -f ./$(DEPDIR)/pa_vxnode.Plo -rm -f ./$(DEPDIR)/pa_wcontext.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/pa_value.Plo -rm -f ./$(DEPDIR)/pa_varray.Plo -rm -f ./$(DEPDIR)/pa_vclass.Plo -rm -f ./$(DEPDIR)/pa_vcookie.Plo -rm -f ./$(DEPDIR)/pa_vdate.Plo -rm -f ./$(DEPDIR)/pa_venv.Plo -rm -f ./$(DEPDIR)/pa_vfile.Plo -rm -f ./$(DEPDIR)/pa_vform.Plo -rm -f ./$(DEPDIR)/pa_vhash.Plo -rm -f ./$(DEPDIR)/pa_vhashfile.Plo -rm -f ./$(DEPDIR)/pa_vimage.Plo -rm -f ./$(DEPDIR)/pa_vjunction.Plo -rm -f ./$(DEPDIR)/pa_vmail.Plo -rm -f ./$(DEPDIR)/pa_vmath.Plo -rm -f ./$(DEPDIR)/pa_vmemcached.Plo -rm -f ./$(DEPDIR)/pa_vmethod_frame.Plo -rm -f ./$(DEPDIR)/pa_vobject.Plo -rm -f ./$(DEPDIR)/pa_vregex.Plo -rm -f ./$(DEPDIR)/pa_vrequest.Plo -rm -f ./$(DEPDIR)/pa_vresponse.Plo -rm -f ./$(DEPDIR)/pa_vstateless_class.Plo -rm -f ./$(DEPDIR)/pa_vstatus.Plo -rm -f ./$(DEPDIR)/pa_vstring.Plo -rm -f ./$(DEPDIR)/pa_vtable.Plo -rm -f ./$(DEPDIR)/pa_vvoid.Plo -rm -f ./$(DEPDIR)/pa_vxdoc.Plo -rm -f ./$(DEPDIR)/pa_vxnode.Plo -rm -f ./$(DEPDIR)/pa_wcontext.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/types/pa_vmemory.h0000644000076400007640000000115114712042466014233 00000000000000/** @file Parser: @b memory parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VMEMORY_H #define PA_VMEMORY_H #define IDENT_PA_VMEMORY_H "$Id: pa_vmemory.h,v 1.15 2024/11/04 03:53:26 moko Exp $" #include "classes.h" #include "pa_vstateless_object.h" #include "pa_globals.h" extern Methoded* memory_class; /// class VMemory: public VStateless_class { public: // Value const char* type() const { return "memory"; } VMemory(): VStateless_class(memory_class) {} }; #endif parser-3.5.1/src/types/pa_vmethod_frame.C0000644000076400007640000000734514726176524015333 00000000000000/** @file Parser: method frame class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian \ */ #include "pa_vmethod_frame.h" #include "pa_vcaller_wrapper.h" #include "pa_request.h" #include "pa_vfile.h" volatile const char * IDENT_PA_VMETHOD_FRAME_C="$Id: pa_vmethod_frame.C,v 1.53 2024/12/11 02:47:48 moko Exp $" IDENT_PA_VMETHOD_FRAME_H IDENT_PA_VCALLER_WRAPPER_H; // MethodParams: methods const char *skip_name[]={ "", "continue", "break", "return" }; Value& MethodParams::get_processed(Value& value, const char* msg, int index, Request& r) { if(!value.get_junction()) throw Exception(PARSER_RUNTIME, 0, "%s (parameter #%d)", msg, 1+index); Value& result=r.process(value); if(r.get_skip()){ const char *skip=skip_name[r.get_skip()]; r.set_skip(Request::SKIP_NOTHING); throw Exception(PARSER_RUNTIME, 0, "%s is not allowed in expression passed to native method (parameter #%d)", skip, 1+index); } return result; } // Should be synced with Value::as_hash HashStringValue* MethodParams::as_hash(int index, const char* name) { Value& value=get(index); if(value.get_junction()) throw Exception(PARSER_RUNTIME, 0, "%s param must not be code (parameter #%d)", name ? name : "options", 1+index); if(!value.is_defined()) // empty hash is not defined, but we don't need it anyway return 0; if(HashStringValue* result=value.get_hash()) return result; if(value.is_string() && value.get_string()->trim().is_empty()) return 0; throw Exception(PARSER_RUNTIME, 0, "%s must have hash representation (parameter #%d is '%s')", name ? name : "options", 1+index, value.type()); } Table* MethodParams::as_table(int index, const char* name) { Value& value=get(index); if(value.get_junction()) throw Exception(PARSER_RUNTIME, 0, "%s param must not be code (parameter #%d)", name ? name : "options", 1+index); if(Table* result=value.get_table()) return result; if(value.is_string() && value.get_string()->trim().is_empty()) return 0; throw Exception(PARSER_RUNTIME, 0, "%s param must have table representation (parameter #%d is '%s')", name ? name : "options", 1+index, value.type()); } const String& MethodParams::as_file_name(int index) { const String* result=get(index).get_string(); if(result && !result->is_empty()) return *result; throw Exception(PARSER_RUNTIME, 0, "%s (parameter #%d is '%s')", FILE_NAME_MUST_BE_NE_STRING, 1+index, get(index).type()); } const String& MethodParams::as_file_spec(int index) { if(VFile* vfile=dynamic_cast(&get(index))) return vfile->get_element(name_name)->as_string(); return as_string(index, FILE_NAME_MUST_BE_STRING_OR_FILE); } // VMethodFrame: methods void VNativeMethodFrame::call(Request &r){ check_call_type(); method.native_code(r, fnumbered_params); } void VParserMethodFrame::call(Request &r){ check_call_type(); r.recursion_checked_execute(*method.parser_code); r.check_skip_return(); } VParserMethodFrame::VParserMethodFrame(const Method& amethod, VMethodFrame *acaller, Value& aself) : VMethodFrame(amethod, acaller, aself), my_result(NULL) { if(method.locals_names) { // are there any local var names? // remember them, those are flags that fname is local == to be looked up in 'my' for(ArrayString::Iterator i(*method.locals_names); i; ) { // "result" excluded from local variables during compilation, no need to call set_my_variable my.put(*i.next(), VString::empty()); } } } Value* VParserMethodFrame::get_caller_wrapper(){ static VCallerWrapper *caller_wrapper_template=0; if(!caller()) return 0; if(caller_wrapper_template && &caller_wrapper_template->caller() == caller()) return caller_wrapper_template; return caller_wrapper_template=new VCallerWrapper(*caller()); } parser-3.5.1/src/types/pa_vmail.C0000644000076400007640000006706714726207753013631 00000000000000/** @file Parser: @b mail class. relies on gmime library, by Jeffrey Stedfast Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_sapi.h" #include "pa_vmail.h" #include "pa_vstring.h" #include "pa_request.h" #include "pa_common.h" #include "pa_base64.h" #include "pa_charset.h" #include "pa_charsets.h" #include "pa_random.h" #include "pa_vdate.h" #include "pa_vfile.h" #include "pa_varray.h" #include "pa_uue.h" volatile const char * IDENT_PA_VMAIL_C="$Id: pa_vmail.C,v 1.146 2024/12/11 04:07:07 moko Exp $" IDENT_PA_VMAIL_H; #ifdef WITH_MAILRECEIVE extern "C" { #include "gmime/gmime.h" } #include "pa_charsets.h" #endif // defines #define RAW_NAME "raw" #define ELEMENTS_NAME "elements" // internals enum PartType { P_TEXT, P_HTML, P_FILE, P_MESSAGE, P_TYPES_COUNT }; static const char* const part_name_begins[P_TYPES_COUNT] = { "text", "html", "file", "message" }; // defines for statics #define FORMAT_NAME "format" #define CHARSET_NAME "charset" #define CID_NAME "content-id" #define CONTENT_TRANSFER_ENCODING_NAME "content-transfer-encoding" #define CONTENT_TRANSFER_ENCODING_CAPITALIZED "Content-Transfer-Encoding" // statics static const String format_name(FORMAT_NAME); static const String charset_name(CHARSET_NAME); static const String cid_name(CID_NAME); static const String content_transfer_encoding_name(CONTENT_TRANSFER_ENCODING_NAME); // consts const int MAX_CHARS_IN_HEADER_LINE = (991 - 9 /* Subject: */ - 19 /* =?Windows-1251?Q?...?= */ - 128 /* just in case */) / 3 /* quote-printable */ - 5 /* maximum part of trancated UTF-8 char */; // VMail extern Methoded* mail_class; VMail::VMail(): VStateless_class(mail_class) {} #ifdef WITH_MAILRECEIVE #define EXCEPTION_VALUE "x-exception" static Charset* source_charset; static const char *transcode(const char *value) { if(value && !source_charset->isUTF8()){ String::C transcoded=Charset::transcode(String::C(value, strlen(value)), pa_UTF8_charset, *source_charset); value=transcoded.str; } return value; } static void putReceived(HashStringValue& received, const char* name, Value* value, bool capitalizeName=false) { if(name && value) received.put(capitalizeName ? capitalize(pa_strdup(name)) : pa_strdup(name), value); } static void putReceived(HashStringValue& received, const char* name, const char* value, bool capitalizeName=false) { if(name && value) putReceived(received, name, new VString(*new String(pa_strdup(value), String::L_TAINTED)), capitalizeName); } static void putReceived(HashStringValue& received, const char* name, time_t value) { if(name) received.put(pa_strdup(name), new VDate(value) ); } struct Field2received_info { HashStringValue *hash; HashStringValue *elements; Field2received_info(HashStringValue& part){ VHash* vhash(new VHash); VHash* velements(new VHash); putReceived(part, RAW_NAME, vhash); putReceived(part, ELEMENTS_NAME, velements); hash=&vhash->hash(); elements=&velements->hash(); } }; static void MimeHeaderField2received(const char* name, const char* value, gpointer data) { Field2received_info* info=static_cast(data); if(name && value){ name = capitalize(pa_strdup(name)); VString *svalue = new VString(*new String(pa_strdup(value), String::L_TAINTED)); info->hash->put(name, svalue); // elements VArray* varray=(VArray*)(info->elements->get(name)); if(!varray) info->elements->put(name, varray=new VArray()); varray->array()+=svalue; } } static void parse(Request& r, GMimeMessage *message, HashStringValue& received); #ifndef DOXYGEN struct MimePart2body_info { Request* r; HashStringValue* body; int partCounts[P_TYPES_COUNT]; }; #endif #if GMIME_MAJOR_VERSION > 2 typedef void (* GMimeHeaderForeachFunc) (const char *name, const char *value, gpointer user_data); void g_mime_header_list_foreach (GMimeHeaderList *headers, GMimeHeaderForeachFunc func, gpointer user_data) { int cnt = g_mime_header_list_get_count(headers); for(int i = 0; i < cnt; i++){ GMimeHeader *header = g_mime_header_list_get_header_at(headers, i); func (g_mime_header_get_name(header), g_mime_header_get_value(header), user_data); } } #define g_mime_part_get_content_object(arg) g_mime_part_get_content(arg) #define g_mime_filter_crlf_new(encode, dots) g_mime_filter_dos2unix_new(encode) #define G_MIME_CTYPE_PARAMS(action) { \ GMimeParamList *params=g_mime_content_type_get_parameters(type); \ int cnt = g_mime_param_list_length(params); \ for(int i = 0; i < cnt; i++){ \ GMimeParam *param = g_mime_param_list_get_parameter_at(params, i); \ action \ }} #else #define G_MIME_CTYPE_PARAMS(action) { \ const GMimeParam *param=g_mime_content_type_get_params(type); \ while(param) { \ action \ param=g_mime_param_next(param); \ }} #define g_mime_init() g_mime_init(0) #define g_mime_parser_construct_message(msg,p) g_mime_parser_construct_message(msg) #endif static char *readStream(GMimeStream* gstream, size_t &length){ length=MAX_STRING; char *result=(char*)pa_malloc_atomic(length+1); char *ptr=result; while(true) { size_t current_size=ptr-result; ssize_t todo_size=length-current_size; ssize_t received_size=g_mime_stream_read (gstream, ptr, todo_size); if(received_size<0) throw Exception(PARSER_RUNTIME, 0, "mail content stream read error"); if(received_size==0) break; if(received_size==todo_size) { length=length*2; result=(char *)pa_realloc(result, length+1); ptr=result+current_size+received_size; } else { ptr+=received_size; } } length=ptr-result; result[length]='\0'; return result; } static void MimePart2body(GMimeObject *parent, GMimeObject *part, gpointer data) { MimePart2body_info& info=*static_cast(data); // skipping message/partial & frames if (GMIME_IS_MESSAGE_PARTIAL (part) || GMIME_IS_MULTIPART (part)) return; if (GMimeContentType *type=g_mime_object_get_content_type(part)) { PartType partType=P_FILE; if (GMIME_IS_MESSAGE_PART(part)){ partType=P_MESSAGE; } else { const char *disposition=g_mime_object_get_disposition(part); if(!disposition || strcmp(disposition, GMIME_DISPOSITION_ATTACHMENT)){ if(g_mime_content_type_is_type(type, "text", "plain")) partType=P_TEXT; else if(g_mime_content_type_is_type(type, "text", "html")) partType=P_HTML; } } // partName int partNumber=++info.partCounts[partType]; const char *partName=part_name_begins[partType]; char partNameNumbered[MAX_STRING]; snprintf(partNameNumbered, MAX_STRING, "%s%d", partName, partNumber); // $.partN[ VHash* vpartHash(new VHash); if(partNumber==1) putReceived(*info.body, partName, vpartHash); putReceived(*info.body, partNameNumbered, vpartHash); HashStringValue& partHash=vpartHash->hash(); // $.raw[ Field2received_info f2r_info(partHash); g_mime_header_list_foreach(part->headers, MimeHeaderField2received, &f2r_info); // $.content-type[ VHash* vcontent_type(new VHash); putReceived(partHash, "content-type", vcontent_type); // $.value[text/plain] char value[MAX_STRING]; snprintf(value, MAX_STRING, "%s/%s", type->type ? type->type : "x-unknown", type->subtype ? type->subtype : "x-unknown"); putReceived(vcontent_type->hash(), VALUE_NAME, value); // $.charset[windows-1251] && co G_MIME_CTYPE_PARAMS( putReceived(vcontent_type->hash(), g_mime_param_get_name(param), transcode(g_mime_param_get_value(param)), true /*capitalizeName*/); ); if (GMIME_IS_MESSAGE_PART (part)) { /* message/rfc822, $.raw[] will be overwitten */ GMimeMessage *message = g_mime_message_part_get_message ((GMimeMessagePart *) part); parse(*info.r, message, partHash); } else { GMimePart *gpart = (GMimePart *)part; putReceived(partHash, "description", g_mime_part_get_content_description(gpart)); putReceived(partHash, "content-id", g_mime_part_get_content_id(gpart)); putReceived(partHash, "content-md5", g_mime_part_get_content_md5(gpart)); putReceived(partHash, "content-location", g_mime_part_get_content_location(gpart)); // $.value[string|file] if(GMimeDataWrapper* gcontent=g_mime_part_get_content_object(gpart)){ GMimeStream* gstream=g_mime_stream_filter_new(g_mime_data_wrapper_get_stream(gcontent)); if(GMimeFilter* filter=g_mime_filter_basic_new(g_mime_part_get_content_encoding(gpart), false)) g_mime_stream_filter_add(GMIME_STREAM_FILTER(gstream), filter); size_t length; if(partType==P_FILE) { char *content=readStream(gstream, length); const char* content_filename=transcode(g_mime_part_get_filename(gpart)); VFile* vfile(new VFile); vfile->set_binary(true/*tainted*/, content, length, new String(content_filename), content_filename ? new VString(info.r->mime_type_of(content_filename)) : 0); putReceived(partHash, VALUE_NAME, vfile); } else { // P_TEXT, P_HTML if(Value *charset=vcontent_type->hash().get("Charset")) if(GMimeFilter* filter=g_mime_filter_charset_new(charset->get_string()->cstr(), source_charset->NAME_CSTR())) g_mime_stream_filter_add(GMIME_STREAM_FILTER(gstream), filter); char *content=readStream(gstream, length); putReceived(partHash, VALUE_NAME,new VString(*new String(content))); } } } } } static void parse(Request& r, GMimeMessage *message, HashStringValue& received) { try { // firstly user-defined strings go // user headers { // $.raw[ Field2received_info f2r_info(received); g_mime_header_list_foreach(g_mime_object_get_header_list(GMIME_OBJECT(message)), MimeHeaderField2received, &f2r_info); } // secondly standard headers putReceived(received, "message-id", g_mime_message_get_message_id(message)); #if GMIME_MAJOR_VERSION > 2 const char *msg_from=internet_address_list_to_string(g_mime_message_get_addresses (message, GMIME_ADDRESS_TYPE_FROM), NULL, false); const char *msg_to=internet_address_list_to_string(g_mime_message_get_addresses (message, GMIME_ADDRESS_TYPE_TO), NULL, false); const char *msg_cc=internet_address_list_to_string(g_mime_message_get_addresses (message, GMIME_ADDRESS_TYPE_CC), NULL, false); const char *msg_reply_to=internet_address_list_to_string(g_mime_message_get_addresses (message, GMIME_ADDRESS_TYPE_REPLY_TO), NULL, false); GDateTime *gdate = g_mime_message_get_date(message); time_t date = gdate ? g_date_time_to_unix(gdate) : 0; #else const char *msg_from=g_mime_message_get_sender(message); const char *msg_to=internet_address_list_to_string(g_mime_message_get_recipients(message, GMIME_RECIPIENT_TYPE_TO), false); const char *msg_cc=internet_address_list_to_string(g_mime_message_get_recipients(message, GMIME_RECIPIENT_TYPE_CC), false); const char *msg_reply_to=g_mime_message_get_reply_to(message); time_t date; g_mime_message_get_date(message, &date, 0); #endif putReceived(received, "from", transcode(msg_from)); putReceived(received, "to", transcode(msg_to)); putReceived(received, "cc", transcode(msg_cc)); putReceived(received, "reply-to", transcode(msg_reply_to)); putReceived(received, "subject", transcode(g_mime_message_get_subject(message))); // .date(time_t in UTC) putReceived(received, "date", date); // .body[part/parts MimePart2body_info info={&r, &received, {0}}; g_mime_message_foreach(message, MimePart2body, &info); } catch(const Exception& e) { putReceived(received, VALUE_NAME, ""); putReceived(received, EXCEPTION_VALUE, e.comment()); } catch(...) { putReceived(received, VALUE_NAME, ""); } } void VMail::fill_received(Request& r) { if(r.request_info.mail_received) { source_charset=&r.charsets.source(); g_mime_init(); // create stream with CRLF filter #if GMIME_MAJOR_VERSION > 2 GMimeStream *stream = g_mime_stream_filter_new(g_mime_stream_pipe_new(STDIN_FILENO)); #else GMimeStream *stream = g_mime_stream_filter_new(g_mime_stream_fs_new(STDIN_FILENO)); #endif g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream), g_mime_filter_crlf_new(false, false)); try { // parse incoming message GMimeMessage *message=g_mime_parser_construct_message(g_mime_parser_new_with_stream(stream), NULL); if(message){ parse(r, message, vreceived.hash()); g_object_unref(GMIME_OBJECT(message)); } } catch(const Exception& e) { HashStringValue& received=vreceived.hash(); putReceived(received, VALUE_NAME, ""); putReceived(received, EXCEPTION_VALUE, e.comment()); } catch(...) { // abnormal stream free g_object_unref(stream); rethrow; } g_object_unref(stream); g_mime_shutdown(); } } #else // WITH_MAILRECEIVE void VMail::fill_received(Request&){} #endif // WITH_MAILRECEIVE typedef int (*string_contains_char_which_check)(int); static bool string_contains_char_which(const char* string, string_contains_char_which_check check) { while(char c=*string++) { if(check((unsigned char)c)) return true; } return false; } static char *trimBoth(char *s) { // sanity check if(!s) return 0; // trim head whitespace while(*s && isspace((unsigned char)*s)) s++; // trim tail whitespace char *tail=s+strlen(s); if(tail>s) { do { --tail; if(isspace((unsigned char)*tail)) *tail=0; } while(tail>s); } // return it return s; } static void extractEmail(String& result, char *email) { email=trimBoth(email); result.append_help_length(email, 0, String::L_TAINTED); /* http://www.faqs.org/rfcs/rfc822.html addr-spec = local-part "@" domain ; global address local-part = word *("." word) ; uninterpreted case-preserved word = atom / quoted-string domain = sub-domain *("." sub-domain) sub-domain = domain-ref / domain-literal domain-ref = atom ; symbolic reference domain-literal << ignoring for now quoted-string in word << ignoring for now atom = 1* << the ONLY to check specials = "(" / ")" / "<" / ">" / "@" ; Must be in quoted- / "," / ";" / ":" / "\" / <"> ; string, to use / "." / "[" / "]" ; within a word. */ const char* exception_type="email.format"; if(strpbrk(email, "()<>,;:\\\"[]"/*specials minus @ and . */)) throw Exception(exception_type, &result, "email contains bad characters (specials)"); if(string_contains_char_which(email, (string_contains_char_which_check)isspace)) throw Exception(exception_type, &result, "email contains bad characters (whitespace)"); if(string_contains_char_which(email, (string_contains_char_which_check)iscntrl)) throw Exception(exception_type, &result, "email contains bad characters (control)"); if(result.is_empty()) throw Exception(exception_type, 0, "email is empty"); } static const String& extractEmails(const String& string) { char *emails=string.cstrm(); String& result=*new String; while(char *email=lsplit(&emails, ',')) { rsplit(email, '>'); if(char *in_brackets=lsplit(email, '<')) email=in_brackets; if(!result.is_empty()) result<<","; extractEmail(result, email); } return result; } #ifndef DOXYGEN struct Store_message_element_info { Request_charsets& charsets; String& header; const String* & from; bool extract_to; String* & to; bool mime_version_specified; Array* parts[P_TYPES_COUNT]; int parts_count; bool backward_compatibility; Value* content_type; bool had_content_disposition; Store_message_element_info(Request_charsets& acharsets, String& aheader, const String* & afrom, bool aextract_to, String* & ato): charsets(acharsets), header(aheader), from(afrom), extract_to(aextract_to), to(ato), mime_version_specified(false), parts_count(0), backward_compatibility(false), content_type(0), had_content_disposition(false) { for(int pt=0; pt(1); } }; #endif size_t mail_header_utf8_substring(const char *mail, size_t sub_length, size_t length){ int error_offset; if(int error_code=pa_pcre_valid_utf((unsigned char *)mail, sub_length, &error_offset)){ if(error_codecharsets.source(), String::CC_LOWER); // exclude internals if(low_element_name==MAIL_OPTIONS_NAME || low_element_name==CHARSET_NAME || low_element_name==VALUE_NAME || low_element_name==RAW_NAME || low_element_name==ELEMENTS_NAME || low_element_name==FORMAT_NAME || low_element_name==NAME_NAME || low_element_name==CID_NAME || low_element_name==MAIL_DEBUG_NAME) return; // grep parts for(int pt=0; ptstart_len) { const char* at_num=low_element_name.mid(start_len, start_len+1).cstr(); if(!isdigit((unsigned char)*at_num)) continue; } *info->parts[pt]+=element_value; info->parts_count++; return; } } // fetch some special headers if(low_element_name=="from") info->from=&extractEmails(element_value->as_string()); if(low_element_name==CONTENT_DISPOSITION) info->had_content_disposition=true; if(info->extract_to) { // defined only when SMTP used, see mail.C [collecting info for RCPT to-s] bool is_to=low_element_name=="to" ; bool is_cc=low_element_name=="cc" ; bool is_bcc=low_element_name=="bcc" ; if(is_to||is_cc||is_bcc) { if(!info->to) info->to=new String; else *info->to << ","; *info->to << extractEmails(element_value->as_string()); } if(is_bcc) // blinding it return; } if(low_element_name=="mime-version") info->mime_version_specified=true; // has content type? if(low_element_name==CONTENT_TYPE_NAME) { info->content_type=element_value; if(info->backward_compatibility) return; } // preparing header line const String& source_line=attributed_meaning_to_string(*element_value, String::L_AS_IS); if(source_line.is_empty()) return; // we don't need empty headers here [used in clearing content-disposition] const char* source_line_cstr=source_line.cstr(); String::C mail=Charset::transcode(String::C(source_line_cstr, source_line.length()), info->charsets.source(), info->charsets.mail()); String& mail_line=*new String; if(low_element_name=="to" || low_element_name=="cc" || low_element_name=="bcc") { // never wrap address lines, mailer cannot handle wrapped properly mail_line.append_strdup(mail.str, mail.length, String::L_MAIL_HEADER); } else { while(mail.length) { bool too_long=mail.length > MAX_CHARS_IN_HEADER_LINE; size_t length=too_long ? info->charsets.mail().isUTF8() ? mail_header_utf8_substring(mail.str, MAX_CHARS_IN_HEADER_LINE, mail.length) : MAX_CHARS_IN_HEADER_LINE : mail.length; mail_line.append_strdup(mail.str, length, String::L_MAIL_HEADER); mail.length-=length; mail.str+=length; if(too_long) mail_line << "\n "; // break header and continue it on next line } } // append header line info->header << capitalize(raw_element_name.cstr()) << ": " << mail_line.untaint_cstr(String::L_AS_IS, 0, &info->charsets) << "\n"; } static const String& file_value_to_string(Request& r, Value* send_value) { String& result=*new String; VFile* vfile; const String* file_name=0; Value* vformat=0; Value* vcid=0; const String* dummy_from; String* dummy_to; Store_message_element_info info(r.charsets, result, dummy_from, false, dummy_to); HashStringValue *send_hash=send_value->get_hash(); if(send_hash && !dynamic_cast(send_value)) { // hash send_hash->for_each(store_message_element, &info); // $.value if(Value* value=send_hash->get(value_name)) vfile=value->as_vfile(); else throw Exception(PARSER_RUNTIME, 0, "file part has no $value"); // $.format vformat=send_hash->get(format_name); // $.content-id vcid=send_hash->get(cid_name); // $.name if(Value* vfile_name=send_hash->get(name_name)) // $name specified file_name=&vfile_name->as_string(); } else // must be VFile then vfile=send_value->as_vfile(); if(!file_name) file_name=&vfile->fields().get(name_name)->as_string(); const char* file_name_cstr; const char* quoted_file_name_cstr; { Request_charsets charsets(r.charsets.source(), r.charsets.mail()/*uri!*/, r.charsets.mail()); file_name_cstr=file_name->untaint_and_transcode_cstr(String::L_FILE_SPEC, &charsets); quoted_file_name_cstr=String(file_name_cstr).taint_cstr(String::L_MAIL_HEADER, 0, &charsets); } // Content-Type: application/octet-stream result << HTTP_CONTENT_TYPE_CAPITALIZED ": " << r.mime_type_of(file_name_cstr) << "; name=\"" << quoted_file_name_cstr << "\"\n"; if(!info.had_content_disposition) // $.Content-Disposition wasn't specified by user result << CONTENT_DISPOSITION_CAPITALIZED ": " << ( vcid ? CONTENT_DISPOSITION_INLINE : CONTENT_DISPOSITION_ATTACHMENT ) << "; " << CONTENT_DISPOSITION_FILENAME_NAME"=\"" << quoted_file_name_cstr << "\"\n"; if(vcid) result << "Content-Id: <" << vcid->as_string() << ">\n"; // @todo: value must be escaped as %hh const String* type=vformat?&vformat->as_string():0; if(!type/*default*/ || *type=="base64") { result << CONTENT_TRANSFER_ENCODING_CAPITALIZED ": base64\n\n"; result << pa_base64_encode(vfile->value_ptr(), vfile->value_size()); } else { if(*type=="uue") { result << CONTENT_TRANSFER_ENCODING_CAPITALIZED ": x-uuencode\n\n"; result << pa_uuencode((const unsigned char*)vfile->value_ptr(), vfile->value_size(), file_name_cstr); } else throw Exception(PARSER_RUNTIME, type, "unknown attachment encode format"); } return result; } static const String& text_value_to_string(Request& r, PartType pt, Value* send_value, Store_message_element_info& info) { String& result=*new String; Value* text_value; Value* content_transfer_encoding=0; if(HashStringValue* send_hash=send_value->get_hash()) { // $.USER-HEADERS info.content_type=0; info.backward_compatibility=false; // reset send_hash->for_each(store_message_element, &info); // $.value text_value=send_hash->get(value_name); if(!text_value) throw Exception(PARSER_RUNTIME, 0, "%s part has no $" VALUE_NAME, part_name_begins[pt]); content_transfer_encoding=send_hash->get(content_transfer_encoding_name); } else text_value=send_value; if(!info.content_type) { result << HTTP_CONTENT_TYPE_CAPITALIZED ": text/" << (pt==P_TEXT?"plain":"html") << "; charset=" << info.charsets.mail().NAME() << "\n"; } if(!content_transfer_encoding) result << CONTENT_TRANSFER_ENCODING_CAPITALIZED << ": 8bit\n"; // header|body separator result << "\n"; // body const String* body; String::Language body_lang=String::L_AS_IS; switch(pt) { case P_TEXT: { body=&text_value->as_string(); break; } case P_HTML: { body_lang=String::Language(String::L_HTML | String::L_OPTIMIZE_BIT); if(text_value->get_junction()) body=&r.process_to_string(*text_value); else throw Exception(PARSER_RUNTIME, 0, "html part value must be code"); break; } default: throw Exception(0, 0, "unhandled part type #%d", pt); } if(body) { Request_charsets charsets(r.charsets.source(), r.charsets.mail()/*uri!*/, r.charsets.mail()); const char* body_cstr=body->untaint_and_transcode_cstr(body_lang, &charsets); result.append_know_length(body_cstr, strlen(body_cstr), String::L_CLEAN); } return result; } /// @todo files and messages in order (file, file2, ...) const String& VMail::message_hash_to_string(Request& r, HashStringValue* message_hash, const String* & from, bool extract_to, String* & to) { if(!message_hash) throw Exception(PARSER_RUNTIME, 0, "message must be hash"); String& result=*new String; if(Value* vrecodecharset_name=message_hash->get(charset_name)) r.charsets.set_mail(pa_charsets.get(vrecodecharset_name->as_string())); else r.charsets.set_mail(r.charsets.source()); // no big deal that we leave it set. they wont miss this point which would reset it Store_message_element_info info(r.charsets, result, from, extract_to, to); { // for backward compatibilyty $.body+$.content-type -> $.text[$.value[] $.content-type[]] Value* body=message_hash->get("body"); if(body) { message_hash->remove("body"); info.backward_compatibility=true; } message_hash->for_each(store_message_element, &info); if(body) { VHash& text_part=*new VHash(); HashStringValue& hash=text_part.hash(); hash.put(value_name, body); if(info.content_type) hash.put(content_type_name, info.content_type); *info.parts[P_TEXT]+=&text_part; info.parts_count++; } if(!info.mime_version_specified) result << "MIME-Version: 1.0\n"; // MIME-Version: default } int textCount=info.parts[P_TEXT]->count(); if(textCount>1) throw Exception(PARSER_RUNTIME, 0, "multiple text parts are not supported, use file part"); int htmlCount=info.parts[P_HTML]->count(); if(htmlCount>1) throw Exception(PARSER_RUNTIME, 0, "multiple html parts are not supported, use file part"); bool multipart=info.parts_count>1; bool alternative=textCount && htmlCount; // header char *boundary=0; if(multipart) { boundary=get_uuid_boundary(); bool is_inline = false; { Array& files=*info.parts[P_FILE]; for(size_t i=0; iget_hash()) && file->get(cid_name)){ is_inline = true; break; } } } result << HTTP_CONTENT_TYPE_CAPITALIZED ": " << ( is_inline ? HTTP_CONTENT_TYPE_MULTIPART_RELATED : HTTP_CONTENT_TYPE_MULTIPART_MIXED ) << ";"; // multi-part result << " boundary=\"" << boundary << "\"\n\nThis is a multi-part message in MIME format."; } // alternative or not { if(alternative) { result << "\n\n--" << boundary << "\n" // intermediate boundary HTTP_CONTENT_TYPE_CAPITALIZED ": multipart/alternative; boundary=\"ALT" << boundary << "\"\n"; } for(int i=0; i<2; i++) { PartType pt=i==0?P_TEXT:P_HTML; if(info.parts[pt]->count()) { if(alternative) result << "\n\n--ALT" << boundary << "\n"; // intermediate boundary else if(boundary) result << "\n\n--" << boundary << "\n"; // intermediate boundary result << text_value_to_string(r, pt, info.parts[pt]->get(0), info); } } if(alternative) result << "\n\n--ALT" << boundary << "--\n"; } // messages { Array& messages=*info.parts[P_MESSAGE]; for(size_t i=0; iget_hash(), dummy_from, false, dummy_to); } } // files go last { Array& files=*info.parts[P_FILE]; for(size_t i=0; i, Alexandr Petrosian */ #ifndef PA_VSTRING_H #define PA_VSTRING_H #define IDENT_PA_VSTRING_H "$Id: pa_vstring.h,v 1.81 2024/11/04 03:53:26 moko Exp $" // includes #include "pa_vstateless_object.h" #include "pa_vdouble.h" // externs extern Methoded* string_class; /// value of type 'string'. implemented with @c String class VString: public VStateless_object { public: // Value override const char* type() const { return "string"; } override VStateless_class *get_class() { return string_class; } /// VString: eq ''=false, ne ''=true override bool is_defined() const { return !fstring->is_empty(); } /// VString: 0 or !0 override bool as_bool() const { return as_double()!=0; } /// VString: true override bool is_string() const { return true; } /// VString: VDouble override Value& as_expr_result() { return *new VDouble(fstring->as_double()); } /// VString: fstring override const String* get_string() { return fstring; }; /// VString: fstring override double as_double() const { return fstring->as_double(); } /// VString: fstring override int as_int() const { return fstring->as_int(); } /// VString: vfile override VFile* as_vfile(String::Language lang, const Request_charsets *charsets=0); /// VString: json string override const String* get_json_string(Json_options&) { String* result = new String(); result->append_quoted(fstring); return result; } /// VString: $method override Value* get_element(const String& aname) { #if !defined(FEATURE_GET_ELEMENT4CALL) || !defined(OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL) // CLASS, CLASS_NAME and normally hidden $method if(Value* result=VStateless_object::get_element(aname)) return result; #endif // void, empty or whitespace string are hash compatible if (fstring->is_empty() || fstring->trim().is_empty()) return 0; // bad $string.field return Value::get_element(aname); } public: // usage VString(): fstring(&String::Empty) {} VString(const String& avalue): fstring(&avalue) {} const String& string() const { return *fstring; } void set_string(const String& astring) { fstring=&astring; } inline static VString *empty(){ static VString singleton; return &singleton; } private: const String* fstring; }; #endif parser-3.5.1/src/types/pa_vmail.h0000644000076400007640000000175514712042466013657 00000000000000/** @file Parser: @b mail class decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VMAIL_H #define PA_VMAIL_H #define IDENT_PA_VMAIL_H "$Id: pa_vmail.h,v 1.27 2024/11/04 03:53:26 moko Exp $" #include "classes.h" #include "pa_common.h" #include "pa_vhash.h" // defines #define MAIL_RECEIVED_ELEMENT_NAME "received" #define MAIL_OPTIONS_NAME "options" #define MAIL_DEBUG_NAME "print-debug" // forwards class Request_info; /** $mail:received letter */ class VMail: public VStateless_class { VHash vreceived; public: // Value override const char* type() const { return "mail"; } // mail: methods,received field Value* get_element(const String& aname); public: // usage VMail(); void fill_received(Request& r); const String& message_hash_to_string(Request& r, HashStringValue* message_hash, const String* & from, bool extract_to, String* & to); }; #endif parser-3.5.1/src/types/pa_vmath.C0000644000076400007640000000102714712042466013611 00000000000000/** @file Parser: @b math class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vmath.h" #include "pa_vdouble.h" volatile const char * IDENT_PA_VMATH_C="$Id: pa_vmath.C,v 1.18 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VMATH_H; // externs extern Methoded* math_class; // methods VMath::VMath(): VStateless_class(math_class) { fconsts.put("PI", new VDouble(PI)); fconsts.put("E", new VDouble(MathE)); } parser-3.5.1/src/types/pa_venv.C0000644000076400007640000000272214712042465013452 00000000000000/** @file Parser: @b env class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_venv.h" #include "pa_vstring.h" #include "pa_vhash.h" #include "pa_version.h" volatile const char * IDENT_PA_PA_VENV_C="$Id: pa_venv.C,v 1.24 2024/11/04 03:53:25 moko Exp $" IDENT_PA_VENV_H; #define PARSER_VERSION_ELEMENT_NAME "PARSER_VERSION" #define ENV_FIELDS_ELEMENT_NAME "fields" static const String parser_version(PARSER_VERSION); Value* VEnv::get_element(const String& aname) { #ifndef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL // $env:CLASS, $env:CLASS_NAME if(Value* result=VStateless_class::get_element(aname)) return result; #endif // $env:PARSER_VERSION if(aname==PARSER_VERSION_ELEMENT_NAME) return new VString(parser_version); // $env:fields if(aname==ENV_FIELDS_ELEMENT_NAME){ HashStringValue *result=new HashStringValue(); for(SAPI::Env::Iterator i(finfo); i; i.next() ) result->put( i.key(), new VString(*new String(i.value(), String::L_TAINTED)) ); return new VHash(*result); } // $env:field if(const char* value=SAPI::Env::get(finfo, aname.cstr())) return new VString(*new String(value, String::L_TAINTED)); return 0; } const VJunction* VEnv::put_element(const String& aname, Value* avalue) { if(SAPI::Env::set(finfo, aname.cstr(), avalue->as_string().cstr())) return 0; return Value::put_element(aname, avalue); } parser-3.5.1/src/types/pa_property.h0000644000076400007640000000146314712042465014426 00000000000000/** @file Parser: Property class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_PROPERTY_H #define PA_PROPERTY_H #define IDENT_PA_PROPERTY_H "$Id: pa_property.h,v 1.10 2024/11/04 03:53:25 moko Exp $" class Method; class Value; /** \b junction is getter and setter methods. it is used to cache our knowledge that some element is in fact property and to save us one hash lookup and one name construction (element--get_element/set_leement) */ class Property: public PA_Object { public: Method* getter; Method* setter; Value *value; Property() : getter(0), setter(0), value(0){} Property(Property &prop) : getter(prop.getter), setter(prop.setter), value(prop.value){} }; #endif parser-3.5.1/src/types/pa_vxdoc.C0000644000076400007640000001342514712042466013622 00000000000000/** @dom Parser: @b dom parser type. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #ifdef XML #include "pa_vxdoc.h" #include "pa_vbool.h" #include "pa_request.h" #include "pa_charset.h" volatile const char * IDENT_PA_VXDOC_C="$Id: pa_vxdoc.C,v 1.56 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VXDOC_H; // defines #define SEARCH_NAMESPACES_NAME "search-namespaces" #define XDOC_OUTPUT_METHOD_OPTION_NAME "method" #define XDOC_OUTPUT_METHOD_OPTION_VALUE_XML "xml" #define XDOC_OUTPUT_METHOD_OPTION_VALUE_HTML "html" #define XDOC_OUTPUT_METHOD_OPTION_VALUE_TEXT "text" #define XDOC_OUTPUT_FILENAME_OPTION_NAME "name" VXnode& VXdoc::wrap(xmlNode& anode) { VXnode* result; if((result=static_cast(anode._private))) { assert(anode.doc==fdocument); return *result; } result=new VXnode(anode); anode._private=result; anode.doc=fdocument; return *result; } bool VXdoc::is(const char* atype) { return atype && ( strcmp(VXdoc::type(), atype)==0 || strcmp(VXnode::type(), atype)==0 ); } /// VXdoc: true Value& VXdoc::as_expr_result() { return VBool::get(as_bool()); } /// VXdoc: $method Value* VXdoc::get_element(const String& aname) { if(aname==SEARCH_NAMESPACES_NAME) { return &search_namespaces; } // up try { return VXnode::get_element(aname); } catch(Exception) { // ignore bad node elements, they can be valid here... // fields xmlDoc& xmldoc=get_xmldoc(); if(aname=="doctype") { // readonly attribute DocumentType doctype; if(xmlNode* node=(xmlNode*)xmldoc.intSubset) return &wrap(*node); else return 0; } else if(aname=="implementation") { // readonly attribute DOMImplementation implementation; return 0; } else if(aname=="documentElement") { // readonly attribute Element documentElement; xmlNode* rootElement=xmlDocGetRootElement(&xmldoc); return rootElement ? &wrap(*rootElement) : 0; } return bark("%s field not found", &aname); } } static int param_option_over_output_option( HashStringValue& param_options, const char* option_name, const String*& output_option) { if(Value* value=param_options.get(option_name)){ output_option=&value->as_string(); return 1; } return 0; } static int param_option_over_output_option( HashStringValue& param_options, const char* option_name, int& output_option) { if(Value* value=param_options.get(String::Body(option_name))) { const String& s=value->as_string(); if(s=="yes") output_option=1; else if(s=="no") output_option=0; else throw Exception(PARSER_RUNTIME, &s, "%s must be either 'yes' or 'no'", option_name); return 1; } return 0; } void XDocOutputOptions::append(Request& r, HashStringValue* options, bool with_filename){ /* */ if(options) { int valid_options=0; // $.charset[windows-1251|...] valid_options+=param_option_over_output_option(*options, "charset", this->encoding); // $.encoding[windows-1251|...] valid_options+=param_option_over_output_option(*options, "encoding", this->encoding); if(valid_options==2) throw Exception(PARSER_RUNTIME, 0, "you cannot specify $.charset and $.encoding together"); // $.method[xml|html|text] valid_options+=param_option_over_output_option(*options, XDOC_OUTPUT_METHOD_OPTION_NAME, this->method); // $.version[1.0] valid_options+=param_option_over_output_option(*options, "version", this->version); // $.omit-xml-declaration[yes|no] valid_options+=param_option_over_output_option(*options, "omit-xml-declaration", this->omitXmlDeclaration); // $.standalone[yes|no] valid_options+=param_option_over_output_option(*options, "standalone", this->standalone); // $.indent[yes|no] valid_options+=param_option_over_output_option(*options, "indent", this->indent); // $.media-type[text/{html|xml|plain}] valid_options+=param_option_over_output_option(*options, "media-type", this->mediaType); if(with_filename) // $.name[file name] valid_options+=param_option_over_output_option(*options, XDOC_OUTPUT_FILENAME_OPTION_NAME, this->filename); if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } // default encoding from pool if(!this->encoding) this->encoding=new String(r.charsets.source().NAME(), String::L_TAINTED); // default method=xml if(!this->method) this->method=new String(XDOC_OUTPUT_METHOD_OPTION_VALUE_XML); // default mediaType = depending on method if(!this->mediaType) { if(*this->method==XDOC_OUTPUT_METHOD_OPTION_VALUE_XML) this->mediaType=new String("text/xml"); else if(*this->method==XDOC_OUTPUT_METHOD_OPTION_VALUE_HTML) this->mediaType=new String("text/html"); else // XDOC_OUTPUT_METHOD_OPTION_VALUE_TEXT & all others this->mediaType=new String("text/plain"); } } // defined at classes/xdoc.C String::C xdoc2buf(Request& r, VXdoc& vdoc, XDocOutputOptions& oo, const String* file_spec, bool use_source_charset_to_render_and_client_charset_to_write_to_header); const String* VXdoc::get_json_string(Json_options& options){ XDocOutputOptions xdoc_options_default; String::C buf=xdoc2buf(*options.r, *this, options.xdoc_options ? *options.xdoc_options : xdoc_options_default, 0/*file_name. not to file, to memory*/, true/*use source charset to render, client charset to put to header*/); String& result=*new String("\"", String::L_AS_IS); result << String(buf, String::L_JSON); result << "\""; return &result; } #endif parser-3.5.1/src/types/Makefile.am0000644000076400007640000000220514670115033013733 00000000000000AM_CPPFLAGS = -I../classes -I../sql -I../lib/gd -I../lib/sdbm/pa-include -I../lib/memcached -I../classes/gd @PCRE_INCLUDES@ @XML_INCLUDES@ @MIME_INCLUDES@ noinst_HEADERS = pa_value.h pa_junction.h pa_method.h pa_varray.h pa_vbool.h pa_vcaller_wrapper.h pa_vclass.h pa_vcode_frame.h pa_vcookie.h pa_vdate.h pa_vdouble.h pa_venv.h pa_vfile.h pa_vform.h pa_vhash.h pa_vhashfile.h pa_vimage.h pa_vint.h pa_vjunction.h pa_vmath.h pa_vmethod_frame.h pa_vobject.h pa_vregex.h pa_vrequest.h pa_vresponse.h pa_vstateless_class.h pa_vstateless_object.h pa_vstatus.h pa_vstring.h pa_vtable.h pa_vvoid.h pa_vxdoc.h pa_vxnode.h pa_wcontext.h pa_wwrapper.h pa_vmail.h pa_vmemory.h pa_vconsole.h pa_property.h pa_vmemcached.h noinst_LTLIBRARIES = libtypes.la libtypes_la_SOURCES = pa_value.C pa_varray.C pa_vcookie.C pa_vfile.C pa_vform.C pa_vimage.C pa_vjunction.C pa_vregex.C pa_vrequest.C pa_vresponse.C pa_vstateless_class.C pa_vstring.C pa_wcontext.C pa_vtable.C pa_vxnode.C pa_vxdoc.C pa_vstatus.C pa_vmail.C pa_vobject.C pa_vclass.C pa_vhashfile.C pa_vmath.C pa_vmethod_frame.C pa_vvoid.C pa_vhash.C pa_venv.C pa_vdate.C pa_vmemcached.C EXTRA_DIST = types.vcproj parser-3.5.1/src/types/pa_vobject.C0000644000076400007640000001002314712042466014122 00000000000000/** @file Parser: @b object class impl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vobject.h" #include "pa_vhash.h" #include "pa_vtable.h" #include "pa_vstring.h" #include "pa_vmethod_frame.h" #include "pa_request.h" volatile const char * IDENT_PA_VOBJECT_C="$Id: pa_vobject.C,v 1.57 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VOBJECT_H; Value* VObject::get_scalar_value(const char* as_something) const { VObject* unconst_this=const_cast(this); if(Value* scalar=fclass.get_scalar(*unconst_this)) if(Junction* junction=scalar->get_junction()) if(const Method *method=junction->method){ if(method->params_count>1) throw Exception(PARSER_RUNTIME, 0, "scalar getter method can't have more than 1 parameter (has %d parameters)", method->params_count); METHOD_FRAME_ACTION(*method, 0 /*no caller*/, *unconst_this, { Value *param; if(method->params_count==1){ param=new VString(*new String(as_something)); frame.store_params(¶m, 1); } /* no need for else frame.empty_params() */ pa_thread_request().call(frame); return &frame.result(); }); } return 0; } bool VObject::is(const char* atype) { return fclass.is(atype); } bool VObject::is_defined() const { Temp_recursion go_down(pa_thread_request()); if(Value* value=get_scalar_value("def")) return value->as_bool(); return Value::is_defined(); } Value& VObject::as_expr_result() { Temp_recursion go_down(pa_thread_request()); if(Value* value=get_scalar_value("expression")) return value->as_expr_result(); return Value::as_expr_result(); } int VObject::as_int() const { Temp_recursion go_down(pa_thread_request()); if(Value* value=get_scalar_value("int")) return value->as_int(); return Value::as_int(); } double VObject::as_double() const { Temp_recursion go_down(pa_thread_request()); if(Value* value=get_scalar_value("double")) return value->as_double(); return Value::as_double(); } bool VObject::as_bool() const { Temp_recursion go_down(pa_thread_request()); if(Value* value=get_scalar_value("bool")) return value->as_bool(); return Value::as_bool(); } VFile* VObject::as_vfile() { Temp_recursion go_down(pa_thread_request()); if(Value* value=get_scalar_value("file")) return value->as_vfile(); return Value::as_vfile(); } HashStringValue* VObject::get_hash() { Temp_recursion go_down(pa_thread_request()); if(Value* value=get_scalar_value("hash")) return value->get_hash(); return &ffields; } Table *VObject::get_table() { Temp_recursion go_down(pa_thread_request()); if(Value* value=get_scalar_value("table")) return value->get_table(); return Value::get_table(); } Value* VObject::get_element(const String& aname) { // object field if(Value* result=ffields.get(aname)) return result; // class method or property, or _object_ default getter return fclass.get_element(*this, aname); } #ifdef FEATURE_GET_ELEMENT4CALL // get_element copy to remove extra virtual call Value* VObject::get_element4call(const String& aname) { // object field if(Value* result=ffields.get(aname)) return result; // class method or property, or _object_ default getter if(Value* result=fclass.get_element(*this, aname)) return result; return bark("%s method not found", &aname); } #endif const VJunction* VObject::put_element(const String& aname, Value* avalue){ // class setter if(const VJunction* result=fclass.put_element_replace_only(*this, aname, avalue)) return result == PUT_ELEMENT_REPLACED_FIELD ? 0 : result; // object field or default setter, avoiding virtual is_enabled_default_setter call if (state & IS_SETTER_ACTIVE){ return ffields.put_replaced(aname, avalue) ? 0 : fclass.get_default_setter(*this, aname); } else { ffields.put(aname, avalue); } return 0; } const String* VObject::get_json_string(Json_options& options){ if(options.default_method){ return default_method_2_json_string(*options.default_method, options); } return options.hash_json_string(get_hash()); } parser-3.5.1/src/types/pa_vdate.C0000644000076400007640000004206714712042465013605 00000000000000/** @file Parser: @b date parser class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vstateless_object.h" #include "pa_vdate.h" #include "pa_vint.h" #include "pa_vstring.h" volatile const char * IDENT_PA_PA_VDATE_C="$Id: pa_vdate.C,v 1.28 2024/11/04 03:53:25 moko Exp $" IDENT_PA_VDATE_H; #define ZERO_DATE (-62169984000ll-SECS_PER_DAY) // '0000-00-00 00:00:00' - 1 day #define MAX_DATE (253402300799ll+SECS_PER_DAY) // '9999-12-31 23:59:59' + 1 day static const int DAYS_IN_MONTH[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; static const int DAYS_BEFORE_MONTH[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; #define IS_LEAP(y) (((y) % 4) == 0 && (((y) % 100) != 0 || (((y)+1900) % 400) == 0)) int VDate::getMonthDays(int year, int month) { return (month == 1 /* january -- 0 */ && IS_LEAP(year)) ? 29 : DAYS_IN_MONTH[month]; } void pa_gmtime(pa_time_t lcltime, struct tm *res); pa_time_t pa_mktime(struct tm *tim_p); static int gmt_offset() { #if defined(HAVE_TIMEZONE) tzset(); #if _MSC_VER >= 1900 long timezone = 0; _get_timezone(&timezone); #endif return -timezone; #else time_t t=time(0); tm *tm=localtime(&t); #if defined(HAVE_TM_GMTOFF) return tm->tm_gmtoff; #elif defined(HAVE_TM_TZADJ) return -tm->tm_tzadj; #else #error neither HAVE_TIMEZONE nor HAVE_TM_GMTOFF nor HAVE_TM_TZADJ defined #endif #endif } static void pa_set_tz(const char* ntz) { if(ntz && *ntz){ static char temp_tz_pair[MAX_STRING]; snprintf(temp_tz_pair, sizeof(temp_tz_pair), "TZ=%s", ntz); putenv(temp_tz_pair); } else { #ifdef HAVE_UNSETENV unsetenv("TZ"); #else putenv("TZ="); #endif } tzset(); // required in Windows } /// Auto-object used for temporarily substituting/removing timezone variable class Temp_tz { const char* ntz; char saved_tz[MAX_STRING]; public: static const char *default_tz; public: Temp_tz(const char *atz) : ntz(atz) { if(!ntz) ntz=default_tz; if(!ntz) return; if(const char* ctz=getenv("TZ")){ pa_strncpy(saved_tz, ctz, MAX_STRING); } else saved_tz[0]=0; pa_set_tz(ntz); } ~Temp_tz() { if(ntz) pa_set_tz(saved_tz); } }; const char *Temp_tz::default_tz=0; static void pa_localtime(const char *tz, pa_time_t atime, struct tm &tmIn) { Temp_tz temp_tz(tz); #ifdef PA_DATE64 tmIn=*localtime(&atime); #else if(atime >= 0 && atime <= INT_MAX){ time_t itime=(time_t)atime; tmIn=*localtime(&itime); } else { pa_gmtime(atime+gmt_offset(), &tmIn); } #endif } static pa_time_t pa_mktime(const char *tz, struct tm &tmIn) { Temp_tz temp_tz(tz); #ifdef PA_DATE64 return mktime(&tmIn); #else time_t result=mktime(&tmIn); if(result != -1) return (pa_time_t)result; return pa_mktime(&tmIn)-gmt_offset(); #endif } const String* VDate::get_sql_string(sql_string_type aformat) { switch(aformat){ case sql_string_datetime:{ static const char *format="%.4d-%.2d-%.2d %.2d:%.2d:%.2d"; static int size=4+1+2+1+2 +1+ 2+1+2+1+2 +1/*zero-teminator*/+1/*for faulty snprintfs*/; char *buf=new(PointerFreeGC) char[size]; snprintf(buf, size, format, ftm.tm_year+1900, ftm.tm_mon+1, ftm.tm_mday, ftm.tm_hour, ftm.tm_min, ftm.tm_sec); return new String(buf); } case sql_string_date:{ static const char *format="%.4d-%.2d-%.2d"; static int size=4+1+2+1+2 +1/*zero-teminator*/+1/*for faulty snprintfs*/; char *buf=new(PointerFreeGC) char[size]; snprintf(buf, size, format, ftm.tm_year+1900, ftm.tm_mon+1, ftm.tm_mday); return new String(buf); } case sql_string_time:{ static const char *format="%.2d:%.2d:%.2d"; static int size=2+1+2+1+2 +1/*zero-teminator*/+1/*for faulty snprintfs*/; char *buf=new(PointerFreeGC) char[size]; snprintf(buf, size, format, ftm.tm_hour, ftm.tm_min, ftm.tm_sec); return new String(buf); } } return &String::Empty; } const String* VDate::get_gmt_string() { struct tm gtm; #ifdef PA_DATE64 gtm=*gmtime(&ftime); #else pa_gmtime(ftime, >m); #endif /// http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3 static const char month_names[12][4]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"}; static const char days[7][4]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"}; static const char *format="%s, %.2d %s %.4d %.2d:%.2d:%.2d GMT"; static int size=3+1+1+2+1+3+1+4+1+2+1+2+1+2+4 +1/*zero-teminator*/+1/*for faulty snprintfs*/; char *buf=new(PointerFreeGC) char[size]; snprintf(buf, size, format, days[gtm.tm_wday], gtm.tm_mday, month_names[gtm.tm_mon], gtm.tm_year+1900, gtm.tm_hour, gtm.tm_min, gtm.tm_sec); return new String(buf); } const String* VDate::get_iso_string(iso_string_type format) { Temp_tz temp_tz(ftz_cstr); int offset=gmt_offset(); /// http://www.w3.org/TR/NOTE-datetime if(offset || (format & iso_string_no_z)){ char sign=offset<0 ? '-':'+'; offset=abs(offset); static const char *sformats[]={ "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d%c%.2d:%.2d", "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d.000%c%.2d:%.2d", "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d%c%.2d%.2d", "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d.000%c%.2d%.2d", }; static int size=4+1+2+1+2 +1 +2+1+2+1+2 +4 +1 +2+1+2 +1/*zero-teminator*/+1/*for faulty snprintfs*/; const char *sformat=sformats[format & (iso_string_ms | iso_string_no_colon)]; char *buf=new(PointerFreeGC) char[size]; snprintf(buf, size, sformat, ftm.tm_year+1900, ftm.tm_mon+1, ftm.tm_mday, ftm.tm_hour, ftm.tm_min, ftm.tm_sec, sign, offset/3600, (offset/60)%60); return new String(buf); } else { static const char *sformats[]={ "%.4d-%.2d-%.2dT%.2d:%.2d:%.2dZ", "%.4d-%.2d-%.2dT%.2d:%.2d:%.2d.000Z" }; static int size=4+1+2+1+2 +1 +2+1+2+1+2 +4 +1 +1/*zero-teminator*/+1/*for faulty snprintfs*/; const char *sformat=sformats[format & (iso_string_ms)]; char *buf=new(PointerFreeGC) char[size]; snprintf(buf, size, sformat, ftm.tm_year+1900, ftm.tm_mon+1, ftm.tm_mday, ftm.tm_hour, ftm.tm_min, ftm.tm_sec); return new String(buf); } } Value* VDate::get_element(const String& aname) { // $method if(Value* result=VStateless_object::get_element(aname)) return result; // $TZ if(aname=="TZ") return ftz_cstr ? new VString(*new String(ftz_cstr)): new VString(); int result; if(aname=="year") result=1900+ftm.tm_year; else if(aname=="month") result=1+ftm.tm_mon; else if(aname=="day") result=ftm.tm_mday; else if(aname=="hour") result=ftm.tm_hour; else if(aname=="minute") result=ftm.tm_min; else if(aname=="second") result=ftm.tm_sec; else if(aname=="weekday") result=ftm.tm_wday; else if(aname=="yearday") result=ftm.tm_yday; else if(aname=="daylightsaving") result=ftm.tm_isdst; else if(aname=="week") { yw week = CalcWeek(ftm); result=week.week; } else if(aname=="weekyear") { yw week = CalcWeek(ftm); result=1900+week.year; } else { return bark("%s field not found", &aname); } return new VInt(result); } extern int to_year(int iyear); const VJunction* VDate::put_element(const String& aname, Value* avalue) { tm tmIn=get_tm(); if(aname=="year") tmIn.tm_year=to_year(avalue->as_int()); else if(aname=="month") tmIn.tm_mon=avalue->as_int()-1; else if(aname=="day") tmIn.tm_mday=avalue->as_int(); else if(aname=="hour") tmIn.tm_hour=avalue->as_int(); else if(aname=="minute") tmIn.tm_min=avalue->as_int(); else if(aname=="second") tmIn.tm_sec=avalue->as_int(); else bark("%s field not found", &aname); set_tm(tmIn); return 0; } const String* VDate::get_json_string(Json_options& options) { String* result=new String(); switch(options.date){ case Json_options::D_SQL: result->append_quoted(get_sql_string()); break; case Json_options::D_GMT: result->append_quoted(get_gmt_string()); break; case Json_options::D_ISO: result->append_quoted(get_iso_string()); break; case Json_options::D_TIMESTAMP: #ifdef PA_DATE64 *result << pa_uitoa(ftime); #else *result << format_double(ftime, "%.15g"); #endif break; } return result; } void VDate::validate() { if((ftm.tm_year==-1901) && (ftm.tm_mon==10) && (ftm.tm_mday==30)){ ftm.tm_year=-1900; ftm.tm_mon=-1; ftm.tm_mday=0; } if((ftm.tm_year+1900)<0 || (ftm.tm_year+1900)>9999){ throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "year '%d' is out of range 0..9999", ftm.tm_year+1900); } } void VDate::set_time(pa_time_t atime) { if(atime==-1) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "invalid datetime"); if(atimeMAX_DATE) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "unix time %.15g is out of range 0..9999 year", (double)atime); ftime=atime; pa_localtime(ftz_cstr, ftime, ftm); validate(); } void VDate::set_tm(tm &tmIn) { pa_time_t atime=pa_mktime(ftz_cstr, tmIn); if(atime==-1) throw Exception(DATE_RANGE_EXCEPTION_TYPE, 0, "invalid datetime '%04d-%02d-%02d'", tmIn.tm_year+1900, tmIn.tm_mon+1, tmIn.tm_mday); ftime=atime; ftm=tmIn; validate(); } void VDate::set_tz(const char* atz) { ftz_cstr=atz && atz[0] ? atz : 0; // ftm should be updated afterwards } void VDate::set_default_tz(const char* atz) { Temp_tz::default_tz=atz && atz[0] ? atz : 0; } static int ISOWeekCount (int year) { static const unsigned int YearWeeks[] = { 52,52,52,52,53, 52,52,52,52,52, 53,52,52,52,52, 52,53,52,52,52, 52,53,52,52,52, 52,52,53 }; return YearWeeks[(year+1900) % 28]; } VDate::yw VDate::CalcWeek(tm tms) { yw week = {tms.tm_year, 0}; // http://www.merlyn.demon.co.uk/weekinfo.htm static const unsigned int FirstThurs[] = {7,5,4,3,2,7,6,5,4,2,1,7,6,4,3,2,1,6,5,4,3,1,7,6,5,3,2,1}; int diff = tms.tm_yday-(FirstThurs[(tms.tm_year+1900) % 28]-4); if (diff < 0){ tms.tm_mday = diff; pa_mktime(0, tms); // normalize week = CalcWeek(tms); } else { week.week = 1 + diff/7; if ( week.week > 52 && ISOWeekCount(week.year) < week.week ){ week.year++; week.week = 1; } } return week; } #ifndef PA_DATE64 /* * gmtime_r.c * Original Author: Adapted from tzcode maintained by Arthur David Olson. * Modifications: * - Changed to mktm_r and added __tzcalc_limits - 04/10/02, Jeff Johnston * - Fixed bug in mday computations - 08/12/04, Alex Mogilnikov * - Fixed bug in __tzcalc_limits - 08/12/04, Alex Mogilnikov * - Move code from _mktm_r() to gmtime_r() - 05/09/14, Freddie Chopin * - Fixed bug in calculations for dates after year 2069 or before year 1901. Ideas for * solution taken from musl's __secs_to_tm() - 07/12/2014, Freddie Chopin * * - Use faster algorithm from civil_from_days() by Howard Hinnant - 12/06/2014, * Freddie Chopin * * Converts the calendar time pointed to by tim_p into a broken-down time * expressed as local time. Returns a pointer to a structure containing the * broken-down time. */ /* Move epoch from 01.01.1970 to 01.03.0000 (yes, Year 0) - this is the first * day of a 400-year long "era", right after additional day of leap year. * This adjustment is required only for date calculation, so instead of * modifying time_t value (which would require 64-bit operations to work * correctly) it's enough to adjust the calculated number of days since epoch. */ #define SECS_PER_HOUR 3600 #define SECS_PER_MIN 60 #define DAYS_PER_WEEK 7 #define YEAR_BASE 1900 #define EPOCH_ADJUSTMENT_DAYS 719468L /* year to which the adjustment was made */ #define ADJUSTED_EPOCH_YEAR 0 /* 1st March of year 0 is Wednesday */ #define ADJUSTED_EPOCH_WDAY 3 /* there are 97 leap years in 400-year periods. ((400 - 97) * 365 + 97 * 366) */ #define DAYS_PER_ERA 146097L /* there are 24 leap years in 100-year periods. ((100 - 24) * 365 + 24 * 366) */ #define DAYS_PER_CENTURY 36524L /* there is one leap year every 4 years */ #define DAYS_PER_4_YEARS (3 * 365 + 366) /* number of days in a non-leap year */ #define DAYS_PER_YEAR 365 /* number of days in January */ #define DAYS_IN_JANUARY 31 /* number of days in non-leap February */ #define DAYS_IN_FEBRUARY 28 /* number of years per era */ #define YEARS_PER_ERA 400 void pa_gmtime(pa_time_t lcltime, struct tm *res) { long days, rem; int era, weekday, year; unsigned erayear, yearday, month, day; unsigned long eraday; days = (long)(lcltime / SECS_PER_DAY); rem = (long)(lcltime - (pa_time_t)days * SECS_PER_DAY); days += EPOCH_ADJUSTMENT_DAYS; if (rem < 0) { rem += SECS_PER_DAY; --days; } /* compute hour, min, and sec */ res->tm_hour = (int) (rem / SECS_PER_HOUR); rem %= SECS_PER_HOUR; res->tm_min = (int) (rem / SECS_PER_MIN); res->tm_sec = (int) (rem % SECS_PER_MIN); /* compute day of week */ if ((weekday = ((ADJUSTED_EPOCH_WDAY + days) % DAYS_PER_WEEK)) < 0) weekday += DAYS_PER_WEEK; res->tm_wday = weekday; /* compute year, month, day & day of year */ /* for description of this algorithm see * http://howardhinnant.github.io/date_algorithms.html#civil_from_days */ era = (days >= 0 ? days : days - (DAYS_PER_ERA - 1)) / DAYS_PER_ERA; eraday = days - era * DAYS_PER_ERA; /* [0, 146096] */ erayear = (eraday - eraday / (DAYS_PER_4_YEARS - 1) + eraday / DAYS_PER_CENTURY - eraday / (DAYS_PER_ERA - 1)) / 365; /* [0, 399] */ yearday = eraday - (DAYS_PER_YEAR * erayear + erayear / 4 - erayear / 100); /* [0, 365] */ month = (5 * yearday + 2) / 153; /* [0, 11] */ day = yearday - (153 * month + 2) / 5 + 1; /* [1, 31] */ month += month < 10 ? 2 : -10; year = ADJUSTED_EPOCH_YEAR + erayear + era * YEARS_PER_ERA + (month <= 1); res->tm_yday = yearday >= DAYS_PER_YEAR - DAYS_IN_JANUARY - DAYS_IN_FEBRUARY ? yearday - (DAYS_PER_YEAR - DAYS_IN_JANUARY - DAYS_IN_FEBRUARY) : yearday + DAYS_IN_JANUARY + DAYS_IN_FEBRUARY + IS_LEAP(erayear); res->tm_year = year - YEAR_BASE; res->tm_mon = month; res->tm_mday = day; res->tm_isdst = 0; } /* * mktime.c * Original Author: G. Haley * * Converts the broken-down time, expressed as local time, in the structure * pointed to by tim_p into a calendar time value. The original values of the * tm_wday and tm_yday fields of the structure are ignored, and the original * values of the other fields have no restrictions. On successful completion * the fields of the structure are set to represent the specified calendar * time. Returns the specified calendar time. If the calendar time can not be * represented, returns the value (time_t) -1. */ #define _DAYS_IN_MONTH(x) ((x == 1) ? days_in_feb : DAYS_IN_MONTH[x]) #define _DAYS_IN_YEAR(year) (IS_LEAP(year) ? 366 : 365) static void validate_structure(struct tm *tim_p) { div_t res; int days_in_feb = 28; /* calculate time & date to account for out of range values */ if (tim_p->tm_sec < 0 || tim_p->tm_sec > 59) { res = div (tim_p->tm_sec, 60); tim_p->tm_min += res.quot; if ((tim_p->tm_sec = res.rem) < 0) { tim_p->tm_sec += 60; --tim_p->tm_min; } } if (tim_p->tm_min < 0 || tim_p->tm_min > 59) { res = div (tim_p->tm_min, 60); tim_p->tm_hour += res.quot; if ((tim_p->tm_min = res.rem) < 0) { tim_p->tm_min += 60; --tim_p->tm_hour; } } if (tim_p->tm_hour < 0 || tim_p->tm_hour > 23) { res = div (tim_p->tm_hour, 24); tim_p->tm_mday += res.quot; if ((tim_p->tm_hour = res.rem) < 0) { tim_p->tm_hour += 24; --tim_p->tm_mday; } } if (tim_p->tm_mon < 0 || tim_p->tm_mon > 11) { res = div (tim_p->tm_mon, 12); tim_p->tm_year += res.quot; if ((tim_p->tm_mon = res.rem) < 0) { tim_p->tm_mon += 12; --tim_p->tm_year; } } if (_DAYS_IN_YEAR (tim_p->tm_year) == 366) days_in_feb = 29; if (tim_p->tm_mday <= 0) { while (tim_p->tm_mday <= 0) { if (--tim_p->tm_mon == -1) { tim_p->tm_year--; tim_p->tm_mon = 11; days_in_feb = ((_DAYS_IN_YEAR (tim_p->tm_year) == 366) ? 29 : 28); } tim_p->tm_mday += _DAYS_IN_MONTH (tim_p->tm_mon); } } else { while (tim_p->tm_mday > _DAYS_IN_MONTH (tim_p->tm_mon)) { tim_p->tm_mday -= _DAYS_IN_MONTH (tim_p->tm_mon); if (++tim_p->tm_mon == 12) { tim_p->tm_year++; tim_p->tm_mon = 0; days_in_feb = ((_DAYS_IN_YEAR (tim_p->tm_year) == 366) ? 29 : 28); } } } } pa_time_t pa_mktime(struct tm *tim_p) { pa_time_t tim = 0; long days = 0; int year; /* validate structure */ validate_structure (tim_p); /* compute hours, minutes, seconds */ tim += tim_p->tm_sec + (tim_p->tm_min * SECS_PER_MIN) + (tim_p->tm_hour * SECS_PER_HOUR); /* compute days in year */ days += tim_p->tm_mday - 1; days += DAYS_BEFORE_MONTH[tim_p->tm_mon]; if (tim_p->tm_mon > 1 && _DAYS_IN_YEAR (tim_p->tm_year) == 366) days++; /* compute day of the year */ tim_p->tm_yday = days; if (tim_p->tm_year > 10000 || tim_p->tm_year < -10000) return (time_t) -1; /* compute days in other years */ if ((year = tim_p->tm_year) > 70) { for (year = 70; year < tim_p->tm_year; year++) days += _DAYS_IN_YEAR (year); } else if (year < 70) { for (year = 69; year > tim_p->tm_year; year--) days -= _DAYS_IN_YEAR (year); days -= _DAYS_IN_YEAR (year); } /* compute total seconds */ tim += (pa_time_t)days * SECS_PER_DAY; /* compute day of the week */ if ((tim_p->tm_wday = (days + 4) % 7) < 0) tim_p->tm_wday += 7; return tim; } #endif parser-3.5.1/src/types/pa_vresponse.h0000644000076400007640000000247014712042466014566 00000000000000/** @file Parser: response class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VRESPONSE_H #define PA_VRESPONSE_H #define IDENT_PA_VRESPONSE_H "$Id: pa_vresponse.h,v 1.50 2024/11/04 03:53:26 moko Exp $" #include "pa_vstateless_object.h" #include "pa_string.h" #include "classes.h" // defines #define RESPONSE_CLASS_NAME "response" // forwards class Response; class Request_info; class Request_charsets; // externals extern Methoded* response_class; /// value of type 'response' class VResponse: public VStateless_class { Request_info& finfo; Request_charsets& fcharsets; HashStringValue ffields; public: // Value override const char* type() const { return RESPONSE_CLASS_NAME; } /// Response: ffields override HashStringValue* get_hash() { return &ffields; } /// Response: method,fields override Value* get_element(const String& aname); /// Response: (attribute)=value override const VJunction* put_element(const String& name, Value* value); public: // usage VResponse(Request_info& ainfo, Request_charsets& acharsets): VStateless_class(response_class), finfo(ainfo), fcharsets(acharsets) {} /// used in pa_request.C HashStringValue& fields() { return ffields; } }; #endif parser-3.5.1/src/types/pa_vfile.h0000644000076400007640000000634314712042465013651 00000000000000/** @file Parser: @b file parser type decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VFILE_H #define PA_VFILE_H #define IDENT_PA_VFILE_H "$Id: pa_vfile.h,v 1.88 2024/11/04 03:53:25 moko Exp $" // include #include "pa_common.h" #include "pa_globals.h" #include "pa_vstateless_object.h" #include "pa_vbool.h" // defines #define NONAME_DAT "noname.dat" #define VFILE_TYPE "file" #define MODE_NAME "mode" static const String mode_name(MODE_NAME); // forwards class Methoded; /** holds received from user or read from disk file. @see VForm */ class VFile: public VStateless_object { const char* fvalue_ptr; size_t fvalue_size; bool ftext_tainted; bool fis_text_mode; bool fis_text_content; HashStringValue ffields; public: // Value override const char* type() const { return VFILE_TYPE; } override VStateless_class *get_class(); /// VFile: true override bool as_bool() const { return true; } /// VFile: true override Value& as_expr_result() { return VBool::get(true); } /// VFile: this override VFile* as_vfile() { return this; } /// VFile: json-string override const String* get_json_string(Json_options& options); /// VFile: method,field override Value* get_element(const String& aname); /// VFile: fields override HashStringValue *get_hash(); public: // usage VFile(): fvalue_ptr(0), fvalue_size(0), ftext_tainted(false), fis_text_mode(false), fis_text_content(false){} VFile(HashStringValue& afields): fvalue_ptr(0), fvalue_size(0), ftext_tainted(false), fis_text_mode(false), fis_text_content(false), ffields(afields) {} /// WARNING: when setting text files be sure to append terminating zero to avalue_ptr /// WARNING: the content can be modified while creating "text" vfile void set(bool atainted, bool ais_text_mode, char* avalue_ptr, size_t avalue_size, const String* afile_name=0, Value* acontent_type=0, Request* r=0); void set(VFile& avfile, bool *ais_text_mode, const String* afile_name=0, Value* acontent_type=0, Request* r=0); void set_binary(bool atainted, const char* avalue_ptr, size_t avalue_size, const String* afile_name=0, Value* acontent_type=0, Request* r=0); void set_binary_string(bool atainted, const char* avalue_ptr, size_t avalue_size); void save(Request_charsets& charsets, const String& file_spec, bool is_text, Charset* asked_charset=0); static bool is_text_mode(const String& mode); static bool is_valid_mode (const String& mode); const char* value_ptr() const { if(!fvalue_ptr) throw Exception(PARSER_RUNTIME, 0, "getting value of stat-ed file"); return fvalue_ptr; } size_t value_size() const { return fvalue_size; } bool is_text_mode() const { return fis_text_mode; } HashStringValue& fields() { return ffields; } Charset* detect_binary_charset(Charset* charset); void transcode(Charset& from_charset, Charset& to_charset); private: const char* text_cstr(); void set_all(bool atainted, bool ais_text_mode, const char* avalue_ptr, size_t avalue_size, const String* afile_name); void set_mode(bool ais_text); void set_name(const String* afile_name); void set_content_type(Value* acontent_type, const String* afile_name=0, Request* r=0); }; #endif parser-3.5.1/src/types/pa_wcontext.h0000644000076400007640000000470214712042466014415 00000000000000/** @file Parser: write context class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_WCONTEXT_H #define PA_WCONTEXT_H #define IDENT_PA_WCONTEXT_H "$Id: pa_wcontext.h,v 1.73 2024/11/04 03:53:26 moko Exp $" #include "pa_value.h" #include "pa_vstring.h" #include "pa_vhash.h" class Request; /** ValueRef convenient helper when delayed initialization required */ class ValueRef { public: ValueRef() : fvalue(0) {} ValueRef(Value& avalue) : fvalue(&avalue) {} ValueRef(Value* avalue) : fvalue(avalue) {} operator Value& () { return *fvalue; } Value* operator &() { return fvalue; } const String &as_string() { return fvalue->as_string(); } private: Value* fvalue; }; /** Write context they do different write()s here, later picking up the result @see Request::wcontext */ class WContext: public Value { friend class Request; public: // Value override const char* type() const { return "wcontext"; } /// WContext: accumulated fstring override const String* get_string() { static String empty; return fstring ? fstring : ∅ }; /// WContext: none yet | transparent override VStateless_class *get_class() { return fvalue ? fvalue->get_class() : 0; } public: // WContext /// appends a fstring to result virtual void write(const String& astring) { if(!fstring) fstring=new String; astring.append_to(*fstring); } /// writes Value; raises an error if already, providing origin virtual void write(Value& avalue); /// if value is string convertable writes fstring, else writes Value virtual void write_as_string(Value& avalue) { if(const String* string=avalue.get_string()) write(*string); else write(avalue); } /** retrives the resulting value that can be String if value==0 or the Value object wmethod_frame first checks for $result and if there is one, returns it instead */ virtual ValueRef result() { static String empty; static VString vempty(empty); return fvalue ? fvalue : fstring ? new VString(*fstring) : &vempty; } void attach_junction(VJunction* ajunction) { junctions+=ajunction; } public: // usage WContext(WContext *aparent): fparent(aparent), fstring(0), fvalue(0){} virtual ~WContext() { detach_junctions(); } private: void detach_junctions(); protected: WContext *fparent; String* fstring; Value* fvalue; private: Array junctions; }; #endif parser-3.5.1/src/types/pa_vstatus.h0000644000076400007640000000112414712042466014246 00000000000000/** @file Parser: @b status class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VSTATUS_H #define PA_VSTATUS_H #define IDENT_PA_VSTATUS_H "$Id: pa_vstatus.h,v 1.27 2024/11/04 03:53:26 moko Exp $" // includes #include "pa_vstateless_class.h" /// status class class VStatus: public VStateless_class { public: // Value const char* type() const { return "status"; } // VStatus: field Value* get_element(const String& aname); public: // usage }; #endif parser-3.5.1/src/types/pa_vimage.C0000644000076400007640000000323614712042466013746 00000000000000/** @file Parser: @b image parser type. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vimage.h" #include "pa_vint.h" #include "pa_vstring.h" #include "gif.h" #include "pa_vbool.h" volatile const char * IDENT_PA_VIMAGE_C="$Id: pa_vimage.C,v 1.52 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VIMAGE_H; void VImage::set(const String* src, int width, int height, gdImage* aimage, Value* aexif, Value* axmp) { fimage=aimage; // $src if(src) ffields.put("src", new VString(*src)); // $width if(width) ffields.put("width", new VInt(width)); // $height if(height) ffields.put("height", new VInt(height)); // $exif if(aexif) ffields.put("exif", aexif); // $xmp if(axmp) ffields.put("xmp", axmp); // defaults // $border(0) ffields.put("border", new VInt(0)); // internals, take a look at image.C append_attrib_pair before update // $line-width(1) ffields.put("line-width", new VInt(1)); } Value& VImage::as_expr_result() { return VBool::get(as_bool()); } Value* VImage::get_element(const String& aname) { // $method if(Value* result=VStateless_object::get_element(aname)) return result; // $src, $size return ffields.get(aname); } const VJunction* VImage::put_element(const String& aname, Value* avalue) { ffields.put(aname, avalue); if(fimage) { if(aname=="line-width") { fimage->SetLineWidth(min(max(avalue->as_int(), 1), 10)); } else if(aname=="line-style") { const String& sline_style=avalue->as_string(); fimage->SetLineStyle(sline_style.length()?sline_style.taint_cstr(String::L_AS_IS):0); } } return 0; } parser-3.5.1/src/types/pa_vstateless_class.C0000644000076400007640000001102014712042466016046 00000000000000/** @file Parser: stateless class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian \ */ #include "pa_vstateless_class.h" #include "pa_vstring.h" #include "pa_vbool.h" #include "pa_symbols.h" #include "pa_request.h" volatile const char * IDENT_PA_VSTATELESS_CLASS_C="$Id: pa_vstateless_class.C,v 1.69 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VSTATELESS_CLASS_H IDENT_PA_METHOD_H; bool VStateless_class::gall_vars_local=false; override Value& VStateless_class::as_expr_result() { return VBool::get(as_bool()); } /// @TODO why?! request must be different ptr from global [used in VStateless_class.set_method] void VStateless_class::set_method(const String& aname, Method* amethod) { if(flocked) throw Exception(PARSER_RUNTIME, &aname, "cannot add method to system class (maybe you have forgotten .CLASS in ^process[$caller.CLASS]{...}?)"); if(fderived.count() && aname != auto_method_name) { Method *omethod=fmethods.get(aname); for(ArrayClass::Iterator i(fderived); i; ) { VStateless_class *c=i.next(); if(c->fmethods.get(aname)==omethod) c->real_set_method(aname, amethod); } } real_set_method(aname, amethod); } void VStateless_class::real_set_method(const String& aname, Method* amethod) { #ifdef SYMBOLS_CACHING // instance() as called from static constuctors Symbols::instance().add(aname); #endif fmethods.put(aname, amethod); if(amethod) amethod->name=&aname; } void VStateless_class::add_native_method( const char* cstr_name, Method::Call_type call_type, NativeCodePtr native_code, int min_numbered_params_count, int max_numbered_params_count, Method::Call_optimization #ifdef OPTIMIZE_CALL call_optimization #endif ) { Method* method=new Method( call_type, min_numbered_params_count, max_numbered_params_count, 0/*params_names*/, 0/*locals_names*/, 0/*parser_code*/, native_code, false/*all_vars_local*/ #ifdef OPTIMIZE_RESULT , Method::RO_USE_WCONTEXT #endif #ifdef OPTIMIZE_CALL , call_optimization #endif ); set_method(*new String(cstr_name), method); } /// VStateless_class: $method Value* VStateless_class::get_element(Value& aself, const String& aname) { #ifndef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL // $CLASS if(SYMBOLS_EQ(aname,CLASS_SYMBOL)) return this; // $CLASS_NAME if(SYMBOLS_EQ(aname,CLASS_NAME_SYMBOL)) return new VString(*new String(type())); #endif // $method=junction(self+class+method) if(Method* method=get_method(aname)) return method->get_vjunction(aself); return 0; } Value* VStateless_class::get_scalar(Value& aself){ if(fscalar) return new VJunction(aself, fscalar, true /*getter*/); return 0; } void VStateless_class::set_scalar(Method* amethod){ fscalar=amethod; } Value* VStateless_class::get_default_getter(Value& aself, const String& aname){ if(fdefault_getter && aself.is_enabled_default_getter()) return new VJunction(aself, fdefault_getter, true /*getter*/, (String*)&aname); return 0; } void VStateless_class::set_default_getter(Method* amethod){ fdefault_getter=amethod; } bool VStateless_class::has_default_getter(){ return fdefault_getter != NULL; } VJunction* VStateless_class::get_default_setter(Value& aself, const String& aname){ if(fdefault_setter && aself.is_enabled_default_setter()) return new VJunction(aself, fdefault_setter, false /*setter*/, (String*)&aname); return 0; } void VStateless_class::set_default_setter(Method* amethod){ fdefault_setter=amethod; } bool VStateless_class::has_default_setter(){ return fdefault_setter != NULL; } void VStateless_class::set_base(VStateless_class* abase){ if(abase){ abase->add_derived(*this); fbase=abase; bool no_auto = fmethods.get(auto_method_name) == NULL; // we assume there is no derivatives at this point fmethods.merge_dont_replace(abase->fmethods); // we don't want to inherit @auto (issue #75) unless we should (feature #1233) if (no_auto){ Method* mauto = fmethods.get(auto_method_name); if(mauto != NULL && mauto->params_count < 2) fmethods.remove(auto_method_name); } if(fbase->fscalar && !fscalar) fscalar=fbase->fscalar; if(fbase->fdefault_getter && !fdefault_getter) fdefault_getter=fbase->fdefault_getter; if(fbase->fdefault_setter && !fdefault_setter) fdefault_setter=fbase->fdefault_setter; } } void VStateless_class::add_derived(VStateless_class &aclass){ if(this == &aclass) throw Exception(PARSER_RUNTIME, 0, "circular class inheritance detected in class '%s'", type()); fderived+=&aclass; if (fbase) fbase->add_derived(aclass); } parser-3.5.1/src/types/pa_vstateless_object.h0000644000076400007640000000375514712042466016274 00000000000000/** @file Parser: @b stateless_object class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VSTATELESS_OBJECT_H #define PA_VSTATELESS_OBJECT_H #define IDENT_PA_VSTATELESS_OBJECT_H "$Id: pa_vstateless_object.h,v 1.48 2024/11/04 03:53:26 moko Exp $" // include #include "pa_vjunction.h" #include "pa_vstateless_class.h" /** the object of some class. "of some class" means "with some set of methods and CLASS_fields". */ class VStateless_object: public Value { public: // Value /// VStateless_object: class_transparent override Value* get_element(const String& aname) { // $methods (CLASS, CLASS_NAME only if no OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL) return get_class()->get_element(*this, aname); } #ifdef FEATURE_GET_ELEMENT4CALL /// same as get_element, but with proper error reporting override Value* get_element4call(const String& aname) { if(Value* result=get_class()->get_element(*this, aname)) return result; return bark("%s method not found", &aname); } #endif /// VStateless_object: class_transparent override const VJunction* put_element(const String& aname, Value* avalue) { return get_class()->put_element(*this, aname, avalue); } /// VStateless_object: class_transparent override Value* get_default_getter(Value& aself, const String& aname) { return get_class()->get_default_getter(aself, aname); } /// VStateless_object: class_transparent override Value* get_scalar(Value& aself){ return get_class()->get_scalar(aself); } }; class VSimple_stateless_object: public VStateless_object { public: // Value /// VSimple_stateless_object: class_transparent override Value* get_element(const String& aname) { // $methods (CLASS, CLASS_NAME only if no OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL) if(Value* result=get_class()->get_element(*this, aname)) return result; // bad $type.field return Value::get_element(aname); } }; #endif parser-3.5.1/src/types/pa_vmath.h0000644000076400007640000000150714712042466013661 00000000000000/** @file Parser: @b math class decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VMATH_H #define PA_VMATH_H #define IDENT_PA_VMATH_H "$Id: pa_vmath.h,v 1.27 2024/11/04 03:53:26 moko Exp $" // includes #include "classes.h" #include "pa_common.h" // defines #define PI 3.14159265358979 #define MathE 2.718281828459 /** */ class VMath: public VStateless_class { public: // Value const char* type() const { return "math"; } // math: method,field Value* get_element(const String& aname) { // $method if(Value* result=VStateless_class::get_element(aname)) return result; // $const return fconsts.get(aname); } public: // usage VMath(); private: HashStringValue fconsts; }; #endif parser-3.5.1/src/types/pa_vmemcached.h0000644000076400007640000000250414712042466014634 00000000000000/** @file Parser: memcached class decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Ivan Poluyanov Artem Stepanov */ #ifndef PA_VMEMCACHED_H #define PA_VMEMCACHED_H #define IDENT_PA_VMEMCACHED_H "$Id: pa_vmemcached.h,v 1.12 2024/11/04 03:53:26 moko Exp $" #include "classes.h" #include "pa_vstateless_object.h" #include "pa_memcached.h" // defines #define VMEMCACHED_TYPE "memcached" // externs extern Methoded *memcached_class; class VMemcached: public VStateless_object { public: override const char* type() const { return VMEMCACHED_TYPE; } override VStateless_class *get_class() { return memcached_class; } override bool as_bool() const { return true; } override Value* get_element(const String& aname); override const VJunction* put_element(const String& aname, Value* avalue); public: // usage VMemcached(): fm(0), fttl(0) {} ~VMemcached(){ if(fm) f_memcached_free(fm); } void open(const String& options_string, time_t attl, bool connect); void open_parse(const String& connect_string, time_t attl); bool add(const String& aname, Value* avalue); void remove(const String& aname); void flush(time_t attl=0); void quit(); Value &mget(ArrayString &akeys); private: memcached_st* fm; time_t fttl; }; #endif parser-3.5.1/src/types/pa_vdate.h0000644000076400007640000000512414712042465013643 00000000000000/** @file Parser: @b date parser class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VDATE_H #define PA_VDATE_H #define IDENT_PA_VDATE_H "$Id: pa_vdate.h,v 1.71 2024/11/04 03:53:25 moko Exp $" #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" #include "pa_vdouble.h" // defines #define VDATE_TYPE "date" //#define PA_DATE64 #ifdef PA_DATE64 #define pa_time_t time_t #else #define pa_time_t double #endif #define SECS_PER_DAY 86400L // externs extern Methoded* date_class; /// value of type 'date'. class VDate: public VStateless_object { public: // Value override const char* type() const { return VDATE_TYPE; } override VStateless_class *get_class() { return date_class; } /// VDate: json-string override const String* get_json_string(Json_options& options); /// VDate: ftime -> float days override Value& as_expr_result() { return *new VDouble(as_double()); } /// VDate: true override bool is_evaluated_expr() const { return true; } /// VDate: ftime -> float days override double as_double() const { volatile double result = ((double)ftime) / SECS_PER_DAY; // avoid x87 returns 80 bit double return result; } /// VDate: ftime -> int days override int as_int() const { return clip2int(trunc(as_double())); } /// VDate: 0 or !0 override bool as_bool() const { return ftime!=0; } /// VDate: method,field override Value* get_element(const String& aname); /// VDate: field override const VJunction* put_element(const String& aname, Value* avalue); public: // usage VDate(pa_time_t adate) : ftz_cstr(0) { set_time(adate); } VDate(tm &tmIn) : ftz_cstr(0) { set_tm(tmIn); } void set_time(pa_time_t atime); void set_tm(tm &tmIn); void validate(); void set_tz(const char* atz); static void set_default_tz(const char* atz); pa_time_t get_time() const { return ftime; } tm get_tm() const { return ftm; } const char *get_tz() const { return ftz_cstr; } enum sql_string_type {sql_string_datetime, sql_string_date, sql_string_time}; enum iso_string_type {iso_string_default = 0, iso_string_ms = 1, iso_string_no_colon = 2, iso_string_no_z = 4}; const String* get_sql_string(sql_string_type format = sql_string_datetime); const String* get_iso_string(iso_string_type format = iso_string_default); const String* get_gmt_string(); struct yw { int year; int week; }; static yw CalcWeek(tm tms); static int getMonthDays(int year, int month); private: pa_time_t ftime; tm ftm; const char* ftz_cstr; }; #endif parser-3.5.1/src/types/pa_vcookie.h0000644000076400007640000000222314712042465014174 00000000000000/** @file Parser: @b cookie class decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VCOOKIE_H #define PA_VCOOKIE_H #define IDENT_PA_VCOOKIE_H "$Id: pa_vcookie.h,v 1.45 2024/11/04 03:53:25 moko Exp $" #include "pa_hash.h" #include "pa_common.h" #include "pa_vstateless_class.h" #include "pa_sapi.h" // forwards class Request_info; class Request_charsets; /// cookie class class VCookie: public VStateless_class { HashStringValue before; HashStringValue after; HashStringValue deleted; public: // Value override const char* type() const { return "cookie"; } // cookie: field override Value* get_element(const String& aname); // cookie: field override const VJunction* put_element(const String& name, Value* value); public: // usage VCookie(Request_charsets& acharsets, Request_info& arequest_info); void output_result(SAPI_Info& sapi_info); private: Request_charsets& fcharsets; Request_info& frequest_info; private: Charset* filled_source; Charset* filled_client; bool should_refill(); void refill(); }; #endif parser-3.5.1/src/types/pa_vtable.C0000644000076400007640000001467114712042466013760 00000000000000/** @file Parser: @b table class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vtable.h" #include "pa_vstring.h" #include "pa_vhash.h" #include "pa_vvoid.h" #include "pa_request.h" volatile const char * IDENT_PA_VTABLE_C="$Id: pa_vtable.C,v 1.57 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VTABLE_H; #ifndef DOXYGEN struct Record_info { Table* table; HashStringValue* hash; }; #endif static void store_column_item_to_hash(const String* column_name, Record_info *info) { const String* column_item=info->table->item(*column_name); info->hash->put(*column_name, column_item ? new VString(*column_item) : VString::empty() ); } Value* VTable::fields_element() { Value& result=*new VHash; Table& ltable=table(); if(!ltable.count()) return &result; HashStringValue* hash=result.get_hash(); if(Table::columns_type columns=ltable.columns()) { // named Record_info record_info={<able, hash}; columns->for_each(store_column_item_to_hash, &record_info); } else { // nameless size_t row_size=ltable[ltable.current()]->count(); // number of columns in current row for(size_t index=0; indexput(pa_uitoa(index), column_item ? new VString(*column_item) : VString::empty() ); } } return &result; } Value* VTable::get_element(const String& aname) { // fields if(SYMBOLS_EQ(aname,FIELDS_SYMBOL)) return fields_element(); #ifdef FEATURE_GET_ELEMENT4CALL // columns first if(ftable) { int index=ftable->column_name2index(aname, false); if(index>=0) // column aname|number valid { const String* string=ftable->item(index); // there is such column return string ? new VString(*string) : VString::empty(); } } #ifndef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL // CLASS, CLASS_NAME if(Value* result=VStateless_object::get_element(aname)) return result; #endif throw Exception(PARSER_RUNTIME, &aname, "column not found"); } Value* VTable::get_element4call(const String& aname) { // methods if(Value* result=VStateless_object::get_element(aname)) return result; return bark("%s method not found", &aname); } #else // methods first if(Value* result=VStateless_object::get_element(aname)) return result; // columns if(ftable) { int index=ftable->column_name2index(aname, false); if(index>=0) // column aname|number valid { const String* string=ftable->item(index); // there is such column return new string ? VString(*string) : VString::empty(); } } throw Exception(PARSER_RUNTIME, &aname, "column not found"); } #endif const VJunction* VTable::put_element(const String& aname, Value* avalue) { if(ftable) { int index=ftable->column_name2index(aname, false); if(index>=0) // column aname|number valid { if(index > pa_loop_limit) throw Exception(PARSER_RUNTIME, &aname, "too big column number"); const String *svalue=avalue->get_string(); if(!svalue) throw Exception(PARSER_RUNTIME, 0, "column value must be string compatible"); ftable->put_item(index, svalue); return 0; } } throw Exception(PARSER_RUNTIME, &aname, "column not found"); } String& VTable::get_json_string_array(String& result, const char *indent) { // [ // ["c1", "c2", "c3" ...] || null (for nameless), // ["v11", "v12", "v13" ...], // ["v21", "v22", "v23" ...], // ... // ] Table& ltable=table(); // columns if(ltable.columns()){ // named indent ? result << "\n\t" << indent << "[\"" : result << "\n[\""; bool need_delim=false; for(Array_iterator c(*ltable.columns()); c; ) { if(need_delim) result << "\",\""; result.append(*c.next(), String::L_JSON, true/*forced lang*/); need_delim=true; } result << "\"]"; } else { // nameless indent ? result << "\n\t" << indent << "null" : result << "\nnull"; } // data if(ltable.count()){ result << ","; for(Array_iterator r(ltable); r; ) { indent ? result << "\n\t" << indent << "[\"" : result << "\n[\""; bool need_delim=false; for(Array_iterator c(*r.next()); c; ) { if(need_delim) result << "\",\""; result.append(*c.next(), String::L_JSON, true/*forced lang*/); need_delim=true; } r ? result << "\"]," : result << "\"]"; } } result << "\n" << indent; return result; } String& VTable::get_json_string_object(String& result, const char *indent) { // [ // {"c1":"v11", "c2":"v12", "c3":"v13"}, // {"c1":"v21", "c2":"v22", "c3":"v23"}, // ... // ] Table& ltable=table(); ArrayString* columns=ltable.columns(); size_t columns_count = (columns) ? columns->count() : 0; for(Array_iterator r(ltable); r; ) { indent ? result << "\n\t" << indent << "{\"" : result << "\n{\""; ArrayString* row=r.next(); for(size_t index=0; indexcount(); index++){ if(index) result << "\",\""; result.append(index < columns_count ? *columns->get(index) : String(pa_uitoa(index)), String::L_JSON, true/*forced lang*/); result << "\":\""; result.append(*row->get(index), String::L_JSON, true/*forced lang*/); } r ? result << "\"}," : result << "\"}\n" << indent; } return result; } String& VTable::get_json_string_compact(String& result, const char *indent) { // [ // "v11", // ["v21", "v22", "v23" ...], // ... // ] Table& ltable=table(); for(Array_iterator r(ltable); r; ) { ArrayString& line=*r.next(); if (line.count()==1){ indent ? result << "\n\t" << indent << "\"" : result << "\n\""; result.append(*line[0], String::L_JSON, true/*forced lang*/); r ? result << "\"," : result << "\"\n" << indent; } else { indent ? result << "\n\t" << indent << "[\"" : result << "\n[\""; bool need_delim=false; for(Array_iterator c(line); c; ) { if(need_delim) result << "\",\""; result.append(*c.next(), String::L_JSON, true/*forced lang*/); need_delim=true; } r ? result << "\"]," : result << "\"]\n" << indent; } } return result; } const String* VTable::get_json_string(Json_options& options) { String* result = new String("[", String::L_AS_IS); switch(options.table){ case Json_options::T_ARRAY: result=&get_json_string_array(*result, options.indent); break; case Json_options::T_OBJECT: result=&get_json_string_object(*result, options.indent); break; case Json_options::T_COMPACT: result=&get_json_string_compact(*result, options.indent); break; } *result << "]"; return result; } parser-3.5.1/src/types/pa_vstateless_class.h0000644000076400007640000001331314712042466016122 00000000000000/** @file Parser: stateless class decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VSTATELESS_CLASS_H #define PA_VSTATELESS_CLASS_H #define IDENT_PA_VSTATELESS_CLASS_H "$Id: pa_vstateless_class.h,v 1.99 2024/11/04 03:53:26 moko Exp $" // include #include "pa_pool.h" #include "pa_hash.h" #include "pa_vjunction.h" #include "pa_method.h" // forwards class VStateless_class; typedef Array ArrayClass; typedef HASH_STRING HashStringProperty; typedef HASH_STRING HashStringMethod; class Temp_method; /** object' class. stores - base: VClass::base() - methods: VStateless_class::fmethods @see Method, VStateless_object, Temp_method */ class VStateless_class: public Value { friend class Temp_method; HashStringMethod fmethods; bool flocked; bool fall_vars_local; bool fpartial; Method::Call_type fcall_type; protected: VStateless_class* fbase; /// all derived classes, recursively ArrayClass fderived; Method* fscalar; Method* fdefault_getter; Method* fdefault_setter; public: // Value /// VStateless_class: this override VStateless_class* get_class() { return this; } /// VStateless_class: fbase override VStateless_class* base() { return fbase; } override Value* get_element(const String& aname) { return get_element(*this, aname); } /// get_element with aself for VObject junctions virtual Value* get_element(Value& aself, const String& aname); #ifdef FEATURE_GET_ELEMENT4CALL /// same as get_element, but with proper error reporting override Value* get_element4call(const String& aname) { if(Value* result=get_element(*this, aname)) return result; return bark("%s method not found", &aname); } #endif override const VJunction* put_element(const String& aname, Value* avalue) { return put_element(*this, aname, avalue); } /// put_element with aself for VObject junctions virtual const VJunction* put_element(Value& aself, const String& aname, Value* /*avalue*/) { aself.bark("element cannot be stored into %s", &aname); return 0; } override Value& as_expr_result(); Value* get_scalar(Value& aself); void set_scalar(Method* amethod); Value* get_default_getter(Value& aself, const String& aname); void set_default_getter(Method* amethod); bool has_default_getter(); VJunction* get_default_setter(Value& aself, const String& aname); void set_default_setter(Method* amethod); bool has_default_setter(); void add_derived(VStateless_class &aclass); public: // usage static bool gall_vars_local; // @conf[] $MAIN:LOCALS VStateless_class(VStateless_class* amethoded_donor=0): flocked(false), fall_vars_local(gall_vars_local), fpartial(false), fcall_type(Method::CT_ANY), fbase(0), fderived(0), fscalar(0), fdefault_getter(0), fdefault_setter(0) { if(amethoded_donor) fmethods.merge_dont_replace(amethoded_donor->fmethods); } void lock() { flocked=true; } Method* get_method(const String::Body &aname) const { return fmethods.get(aname); } HashStringMethod& get_methods(){ return fmethods; } bool is_vars_local(){ return fall_vars_local; } void set_all_vars_local(){ fall_vars_local=true; } bool is_partial(){ return fpartial; } void set_partial(){ fpartial=true; } Method::Call_type get_methods_call_type(){ return fcall_type; } void set_methods_call_type(Method::Call_type call_type){ if(fcall_type!=Method::CT_ANY) throw Exception(PARSER_RUNTIME, 0, "You can specify call type option in a class only once"); fcall_type=call_type; } void add_native_method( const char* cstr_name, Method::Call_type call_type, NativeCodePtr native_code, int min_numbered_params_count, int max_numbered_params_count, Method::Call_optimization call_optimization=Method::CO_WITHOUT_WCONTEXT); void set_method(const String& aname, Method* amethod); /// overrided in VClass virtual void real_set_method(const String& aname, Method* amethod); virtual HashStringProperty* get_properties(){ return 0; }; virtual void set_base(VStateless_class* abase); VStateless_class* base_class() { return fbase; } bool derived_from(VStateless_class& vclass){ return fbase==&vclass || ( fbase && fbase->derived_from(vclass) ); } /// @returns new value for current class, used in classes/ & VClass virtual Value* create_new_value(Pool&) { return 0; } const Method* get_element_method(const String &aname) { // not get_method() to allow $aname[$method] if(Value* value=get_element(aname)) if(Junction* junction=value->get_junction()) return junction->method; return 0; } }; /// Auto-object used for temporarily substituting/removing class method class Temp_method { VStateless_class& fclass; const String& fname; Method* saved_method; public: Temp_method(VStateless_class& aclass, const String& aname, Method* amethod) : fclass(aclass), fname(aname), saved_method(aclass.get_method(aname)) { fclass.set_method(aname, amethod); } ~Temp_method() { fclass.set_method(fname, saved_method); } }; class VBaseClassWrapper: public Value { VStateless_class& fclass; Value& fself; public: // Value override const char* type() const { return fclass.type(); } override VStateless_class* get_class() { return &fclass; } override VStateless_class* base() { return fclass.base(); } override Value* get_element(const String& aname) { return fclass.get_element(fself, aname); } override const VJunction* put_element(const String& aname, Value* avalue) { return fclass.put_element(fself, aname, avalue); } override Value& as_expr_result(){ return fclass.as_expr_result(); } public: // usage VBaseClassWrapper(VStateless_class& aclass, Value& aself): fclass(aclass), fself(aself) {}; }; #endif parser-3.5.1/src/types/pa_vcookie.C0000644000076400007640000002034214732404263014131 00000000000000/** @file Parser: cookie class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_sapi.h" #include "pa_common.h" #include "pa_vcookie.h" #include "pa_vstring.h" #include "pa_vdate.h" #include "pa_vhash.h" #include "pa_request.h" volatile const char * IDENT_PA_VCOOKIE_C="$Id: pa_vcookie.C,v 1.106 2024/12/23 18:30:55 moko Exp $" IDENT_PA_VCOOKIE_H; // defines #define PATH_NAME "path" #define PATH_VALUE_DEFAULT "/" #define SESSION_NAME "session" #define DEFAULT_EXPIRES_DAYS 90 #define COOKIE_FIELDS_ELEMENT_NAME "fields" // statics static const String path_name(PATH_NAME); static const String path_value_default(PATH_VALUE_DEFAULT); // VCookie VCookie::VCookie(Request_charsets& acharsets, Request_info& arequest_info): fcharsets(acharsets), frequest_info(arequest_info), filled_source(0), filled_client(0) { } Value* VCookie::get_element(const String& aname) { #ifndef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL // CLASS, CLASS_NAME if(Value* result=VStateless_class::get_element(aname)) return result; #endif // $fields if(aname==COOKIE_FIELDS_ELEMENT_NAME){ if(should_refill()) refill(); HashStringValue *result=new HashStringValue(before); for(HashStringValue::Iterator i(after); i; i.next()) result->put(i.key(), i.value()); for(HashStringValue::Iterator i(deleted); i; i.next()) result->remove(i.key()); return new VHash(*result); } // $cookie if(deleted.get(aname)) // deleted? return 0; if(Value* after_meaning=after.get(aname)) { // assigned 'after'? if(HashStringValue *hash=after_meaning->get_hash()) return hash->get(value_name); else return after_meaning; } if(should_refill()) refill(); // neither deleted nor assigned // return any value it had 'before' return before.get(aname); } static Value& expires_vdate(double days_till_expire) { return *new VDate(time(NULL)+60*60*24*days_till_expire); } const VJunction* VCookie::put_element(const String& aname, Value* avalue) { // $cookie Value* lvalue; if(HashStringValue *hash=avalue->get_hash()) { if(Value* expires=hash->get(expires_name)){ const String* string; if(!(expires->is_string() && (string=expires->get_string()) && (*string==SESSION_NAME))) if(!dynamic_cast(expires)) if(double days_till_expire=expires->as_double()) expires_vdate(days_till_expire); // checking if date is valid here to avoid failure when sending headers } lvalue=hash->get(value_name); } else lvalue=avalue; if(lvalue && lvalue->is_string()) { // taint string being assigned String& tainted=*new String; tainted.append(*lvalue->get_string(), String::L_TAINTED, true /*forced*/); lvalue=new VString(tainted); } if( !lvalue || lvalue->as_string().is_empty() ) { deleted.put(aname, avalue); after.put(aname, 0); } else { after.put(aname, avalue); deleted.put(aname, 0); } return 0; } /* @todo http://curl.haxx.se/rfc/cookie_spec.html http://www.w3.org/Protocols/rfc2109/rfc2109 When sending cookies to a server, all cookies with a more specific path mapping should be sent before cookies with less specific path mappings. For example, a cookie "name1=foo" with a path mapping of "/" should be sent after a cookie "name1=foo2" with a path mapping of "/bar" if they are both to be sent. There are limitations on the number of cookies that a client can store at any one time. This is a specification of the minimum number of cookies that a client should be prepared to receive and store. 300 total cookies 4 kilobytes per cookie, where the name and the OPAQUE_STRING combine to form the 4 kilobyte limit. 20 cookies per server or domain. (note that completely specified hosts and domains are treated as separate entities and have a 20 cookie limitation for each, not combined) */ const String* output_set_cookie_value( HashStringValue::key_type aname, HashStringValue::value_type ameaning, bool adelete){ String* result=new String(); // attribute= *result << String(aname, String::L_HTTP_COOKIE) << "="; Value* lmeaning; // figure out 'meaning' // Set-Cookie: (attribute)=(value); path=/ HashStringValue *hash; double default_expires_days=adelete?-DEFAULT_EXPIRES_DAYS:+DEFAULT_EXPIRES_DAYS; if((hash=ameaning->get_hash())) { // ...[hash value] // clone to safely change it lmeaning=new VHash(*hash); hash=lmeaning->get_hash(); // $expires if(Value* expires=hash->get(expires_name)) { const String* string; if(expires->is_string() && (string=expires->get_string()) && (*string==SESSION_NAME)) { // $expires[session] hash->remove(expires_name); } else { if(Value* vdate=dynamic_cast(expires)) hash->put(expires_name, vdate); // $expires[DATE] else if(double days_till_expire=expires->as_double()) hash->put(expires_name, &expires_vdate(days_till_expire)); // $expires(days) else hash->remove(expires_name); // $expires(0) } } else // $expires not assigned, defaulting hash->put(expires_name, &expires_vdate(default_expires_days)); } else { // ...[string value] Value* wrap_meaning=new VHash; hash=wrap_meaning->get_hash(); // wrapping lmeaning into hash hash->put(value_name, ameaning); // string = $expires not assigned, defaulting hash->put(expires_name, &expires_vdate(default_expires_days)); // replacing lmeaning with hash-wrapped one lmeaning=wrap_meaning; } if(adelete) {// removing value /* http://curl.haxx.se/rfc/cookie_spec.html http://www.w3.org/Protocols/rfc2109/rfc2109 to delete a cookie, it can do so by returning a cookie with the same name, and an expires time which is in the past */ // Set-Cookie: (attribute)=; path=/ lmeaning->get_hash()->remove(value_name); } // defaulting path if(!lmeaning->get_hash()->get(path_name)) lmeaning->get_hash()->put(path_name, new VString(path_value_default)); // append lmeaning *result << attributed_meaning_to_string(*lmeaning, String::L_HTTP_COOKIE, true, true /* allow bool attr */); return result; } struct Cookie_pass_info { SAPI_Info* sapi_info; Request_charsets* charsets; }; void output_set_cookie_header( HashStringValue::key_type aattribute, HashStringValue::value_type ameaning, bool adelete, Cookie_pass_info& cookie_info ){ SAPI::add_header_attribute(*cookie_info.sapi_info, "set-cookie", output_set_cookie_value(aattribute, ameaning, adelete)->untaint_cstr(String::L_AS_IS, 0, cookie_info.charsets)); } void output_after( HashStringValue::key_type aattribute, HashStringValue::value_type ameaning, Cookie_pass_info& cookie_info ){ output_set_cookie_header(aattribute, ameaning, false, cookie_info); } void output_deleted( HashStringValue::key_type aattribute, HashStringValue::value_type ameaning, Cookie_pass_info& cookie_info ){ if(ameaning) output_set_cookie_header(aattribute, ameaning, true, cookie_info); } void VCookie::output_result(SAPI_Info& sapi_info) { Cookie_pass_info cookie_info={&sapi_info, &fcharsets}; after.for_each(output_after, cookie_info); deleted.for_each(output_deleted, cookie_info); } bool VCookie::should_refill(){ return !( &fcharsets.source()==filled_source && &fcharsets.client()==filled_client ); } //#include void VCookie::refill(){ //request_info.cookie="test-session=value%3D5; test-default1=value%3D1; test-default2=value%3D2; test-tomorrow=value%3D3"; //request_info.cookie="enabled=yes; auth.uid=196325308053599810; enabled=yes; msnames; msuri"; // mdm if(!frequest_info.cookie) return; char *cookies=strdup(frequest_info.cookie); char *current=cookies; //_asm int 3; do { if(char *attribute=search_stop(current, '=')) if(char *meaning=search_stop(current, ';')) { const String& sattribute= *new String(unescape_chars(attribute, strlen(attribute), &fcharsets.source(), true), String::L_TAINTED); const String& smeaning= *new String(unescape_chars(meaning, strlen(meaning), &fcharsets.source(), true), String::L_TAINTED); before.put(sattribute, new VString(smeaning)); //if(sattribute == "test_js") throw Exception(0, 0, "'%s' '%s'", meaning, smeaning.cstr()); } } while(current); filled_source=&fcharsets.source(); filled_client=&fcharsets.client(); } parser-3.5.1/src/types/pa_vcaller_wrapper.h0000644000076400007640000000244714712042465015735 00000000000000/** @file Parser: VCaller class decl. as wrapper for $caller access Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) */ #ifndef PA_VCALLER_WRAPPER_H #define PA_VCALLER_WRAPPER_H #include "pa_value.h" #include "pa_vmethod_frame.h" #define IDENT_PA_VCALLER_WRAPPER_H "$Id: pa_vcaller_wrapper.h,v 1.5 2024/11/04 03:53:25 moko Exp $" class VCallerWrapper: public Value { VMethodFrame &fcaller; public: // Value override const char* type() const { return "caller"; } /// VCaller: transparent override VStateless_class* get_class() { return caller().get_class(); } /// VCaller: transparent override VStateless_class* base() { return caller().base(); } /// VCaller: empty string to disable $backup[$caller] override const String* get_string() { return &String::Empty; } /// VCaller: method or transparent override Value* get_element(const String& aname) { if(SYMBOLS_EQ(aname,METHOD_SYMBOL)) return caller().method.get_vjunction(caller().self()); return caller().get_element(aname); } /// VCaller: transparent override const VJunction* put_element(const String& aname, Value* avalue) { return caller().put_element(aname, avalue); } public: // usage VCallerWrapper(VMethodFrame &acaller): fcaller(acaller) {} VMethodFrame &caller() { return fcaller; } }; #endif parser-3.5.1/src/types/pa_vcode_frame.h0000644000076400007640000000156614712042465015020 00000000000000/** @file Parser: @b code_frame write wrapper write context Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VCODE_FRAME_H #define PA_VCODE_FRAME_H #define IDENT_PA_VCODE_FRAME_H "$Id: pa_vcode_frame.h,v 1.44 2024/11/04 03:53:25 moko Exp $" #include "pa_wcontext.h" #include "pa_vvoid.h" /// specialized write wrapper, completely transparent class VCodeFrame: public WContext { public: // Value override const char* type() const { return "code_frame"; } /// VCodeFrame: twice transparent override const VJunction* put_element(const String& aname, Value* avalue) { // $hash[^if(1){$.field[]}] // put goes to $hash return fparent->put_element(aname, avalue); } public: // usage VCodeFrame(WContext& parent): WContext(&parent){ } }; #endif parser-3.5.1/src/types/pa_junction.h0000644000076400007640000000437414712042465014377 00000000000000/** @file Parser: Junction class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_JUNCTION_H #define PA_JUNCTION_H #define IDENT_PA_JUNCTION_H "$Id: pa_junction.h,v 1.17 2024/11/04 03:53:25 moko Exp $" #include "pa_string.h" #include "pa_array.h" #include "pa_exception.h" #include "pa_operation.h" #include "pa_value.h" /** \b junction is some code joined with context of it's evaluation. there are code-junctions and method-junctions - code-junctions are used when some parameter passed in cury brackets - method-junctions used in ^method[] calls or $method references Junctions register themselves in method_frame [if any] for consequent invalidation. This prevents evaluation of junctions in outdated context To stop situations like this: @code @main[] ^method1[] ^method2[] @method1[] $junction{ some code } @method2[] ^junction[] @endcode On wcontext[most dynamic context of all] scope exit (WContext::~WContext()) got cleaned - Junction::wcontext becomes WContext.fparent (if any), or Junction::method_frame becomes 0 (if no parent), which later in Request::process triggers exception parent changing helps ^switch implementation to remain simple */ class Junction { public: /// Code-Junction constructor Junction(Value& aself, const Method* amethod, VMethodFrame* amethod_frame, Value* arcontext, WContext* awcontext, ArrayOperation* acode ): self(aself), method(amethod), method_frame(amethod_frame), rcontext(arcontext), wcontext(awcontext), code(acode) {} /// Method-Junction or Getter-Junction constructor Junction(Value& aself, const Method* amethod, bool ais_getter=false, String* aauto_name=0 ): self(aself), method(amethod), auto_name(aauto_name), is_getter(ais_getter) {} void reattach(WContext *new_wcontext); /// always present Value& self; //@{ /// @name either these // so called 'method-junction' const Method* method; //@} //@{ /// @name or these are present // so called 'code-junction' VMethodFrame* method_frame; Value* rcontext; WContext* wcontext; ArrayOperation* code; //@} //@{ String* auto_name; //@} //@{ bool is_getter; //@{ }; #endif parser-3.5.1/src/types/pa_value.h0000644000076400007640000001674714712042465013671 00000000000000/** @file Parser: Value, Method, Junction . Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VALUE_H #define PA_VALUE_H #define IDENT_PA_VALUE_H "$Id: pa_value.h,v 1.176 2024/11/04 03:53:25 moko Exp $" #include "pa_common.h" #include "pa_array.h" #include "pa_exception.h" #include "pa_property.h" #include "pa_opcode.h" // forwards class VStateless_class; class WContext; class Request; class Request_charsets; class Junction; class VJunction; class Method; class Value; class MethodParams; class VObject; class VMethodFrame; class VFile; class Table; struct XDocOutputOptions; template class SparseArray; typedef SparseArray ArrayValue; struct Json_options : public PA_Allocated { Request* r; String::Body key; HashStringValue* methods; Value* default_method; Value* params; bool skip_unknown; bool one_line; uint json_string_recursion; const char* indent; XDocOutputOptions* xdoc_options; enum Date { D_SQL, D_GMT, D_ISO, D_TIMESTAMP } date; enum Table { T_ARRAY, T_OBJECT, T_COMPACT } table; enum Array { A_ARRAY, A_OBJECT, A_COMPACT } array; enum File { F_BODYLESS, F_BASE64, F_TEXT } file; enum Void { V_NULL, V_STRING } fvoid; Json_options(Request* arequest): r(arequest), methods(NULL), default_method(NULL), params(NULL), skip_unknown(false), one_line(false), json_string_recursion(0), indent(NULL), xdoc_options(NULL), date(D_SQL), table(T_OBJECT), array(A_COMPACT), file(F_BODYLESS), fvoid(V_NULL) {} bool set_date_format(const String &value){ if(value == "sql-string") date = D_SQL; else if (value == "gmt-string") date = D_GMT; else if (value == "iso-string") date = D_ISO; else if (value == "unix-timestamp") date = D_TIMESTAMP; else return false; return true; } bool set_table_format(const String &value){ if(value == "array") table = T_ARRAY; else if (value == "object") table = T_OBJECT; else if (value == "compact") table = T_COMPACT; else return false; return true; } bool set_array_format(const String &value){ if(value == "array") array = A_ARRAY; else if (value == "object") array = A_OBJECT; else if (value == "compact") array = A_COMPACT; else return false; return true; } bool set_file_format(const String &value){ if(value == "base64") file = F_BASE64; else if (value == "text") file = F_TEXT; else if (value == "stat") file = F_BODYLESS; else return false; return true; } bool set_void_format(const String &value){ if(value == "null") fvoid = V_NULL; else if(value == "string") fvoid = V_STRING; else return false; return true; } const String* hash_json_string(HashStringValue *hash); const String* array_json_string(ArrayValue *array); const String* array_compact_json_string(ArrayValue *array); }; /// grandfather of all @a values in @b Parser class Value: public PA_Object { public: // Value /// value type, used for error reporting and 'is' expression operator virtual const char* type() const =0; /** all except VObject/VClass: true if @atype eq type() VObject/VClass: can locate parent class by it's type */ virtual bool is(const char* atype) { return atype && strcmp(type(), atype)==0; } /// is this value defined? virtual bool is_defined() const { return true; } /// is this value string? virtual bool is_string() const { return false; } /// is this value void? virtual bool is_void() const { return false; } /// is this value bool? virtual bool is_bool() const { return false; } /// is this value number? virtual bool is_evaluated_expr() const { return false; } /// what's the meaning of this value in context of expression? virtual Value& as_expr_result() { return *bark("is '%s', cannot be used in expression"); } /** extract HashStringValue if any WARNING: FOR LOCAL USE ONLY, THIS POINTER IS NOT TO PASS TO ANYBODY! */ virtual HashStringValue* get_hash() { return 0; } /// extract const String virtual const String* get_string() { return 0; } /// extract json-string virtual const String* get_json_string(Json_options& options); const String* default_method_2_json_string(Value& default_method, Json_options& options); /// for reflection virtual HashStringValue* get_fields() { return 0; } virtual HashStringValue* get_fields_reference() { return 0; } /// extract double virtual double as_double() const { bark("is '%s', it does not have numerical (double) value"); return 0; } /// extract integer virtual int as_int () const { bark("is '%s', it does not have numerical (int) value"); return 0; } /// extract bool virtual bool as_bool() const { bark("is '%s', it does not have logical value"); return 0; } /// extract file virtual VFile* as_vfile(); virtual VFile* as_vfile(String::Language /*lang*/, const Request_charsets* /*charsets*/) { return as_vfile(); } /// extract Junction virtual Junction* get_junction(); /// @return Value element; can return Junction for methods; Code-Junction for code; Getter-Junction for property virtual Value* get_element(const String& /*aname*/); #ifdef FEATURE_GET_ELEMENT4CALL /// same as get_element, but methods have higher priority in table and hash virtual Value* get_element4call(const String& aname){ return get_element(aname); } #endif /// store Value element under @a name /// @returns putter method junction, or 0 virtual const VJunction* put_element(const String& aname, Value* /*avalue*/) { // to prevent modification of system classes, // created at system startup, and not having exception // handler installed, we neet to bark using request.pool bark("element cannot be stored into %s", &aname); return 0; } /// VObject default getter & setter support virtual void enable_default_getter(){ } virtual void enable_default_setter(){ } virtual void disable_default_getter(){ } virtual void disable_default_setter(){ } virtual bool is_enabled_default_getter(){ return true; } virtual bool is_enabled_default_setter(){ return true; } /// extract VStateless_class virtual VStateless_class* get_class()=0; /// extract base class, if any virtual VStateless_class* base() { return 0; } /// extract VTable virtual Table* get_table() { return 0; } /// warning war, no overhead as destructors are called manually only when required virtual ~Value() {} public: // usage /// @return sure String or barks if it doesn't have string value const String& as_string() { const String* result=get_string(); if(!result) bark("is '%s', it has no string representation"); return *result; } /// @return Hash or barks if it is not hash compatible HashStringValue* as_hash(const char* name=0); /// throws exception specifying bark-reason and name() type() of problematic value Value* bark(const char *reason, const String *problem_source=0) const { throw Exception(PARSER_RUNTIME, problem_source, reason, type()); } }; /** $content-type[text/html] -> content-type: text/html $content-type[$.value[text/html] $.charset[windows-1251]] -> content-type: text/html; charset=windows-1251 */ const String& attributed_meaning_to_string(Value& meaning, String::Language lang, bool forced=false, bool allow_bool=false); // defines ///@{common field names #define CHARSET_NAME "charset" #define VALUE_NAME "value" #define EXPIRES_NAME "expires" #define CONTENT_TYPE_NAME "content-type" #define NAME_NAME "name" //@} ///@{common field names extern const String value_name; extern const String expires_name; extern const String content_type_name; extern const String name_name; ///@} #endif parser-3.5.1/src/types/pa_vhashfile.h0000644000076400007640000000446114712042466014515 00000000000000/** @file Parser: @b hashfile parser type decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VHASHFILE_H #define PA_VHASHFILE_H #define IDENT_PA_VHASHFILE_H "$Id: pa_vhashfile.h,v 1.50 2024/11/04 03:53:26 moko Exp $" #include "classes.h" #include "pa_pool.h" #include "pa_value.h" #include "pa_hash.h" #include "pa_vint.h" #include "pa_sdbm.h" // defines #define VHASHFILE_TYPE "hashfile" // externs extern Methoded *hashfile_class; /// value of type 'hashfile', implemented with SDBM library bundled in ../libs/sdbm class VHashfile : public VStateless_object, Pooled { public: // value override const char *type() const { return VHASHFILE_TYPE; } override VStateless_class *get_class() { return hashfile_class; } /// VHashfile: convert to VHash override HashStringValue *get_hash(); override HashStringValue* get_fields() { return get_hash(); } /// VHashfile: (key)=value override Value* get_element(const String& aname) { // $method if(Value *result=VStateless_object::get_element(aname)) return result; // $element return get_field(aname); } /// VHashfile: (key)=value, (key)=(value+expires) override const VJunction* put_element(const String& aname, Value* avalue) { put_field(aname, avalue); return 0; // nobody is supposed to derive from hashfile, so does not matter } public: // usage VHashfile(Pool& apool): Pooled(apool), m_db(0) {} override ~VHashfile(); void open(const String& afile_name); void close(); bool is_open(); pa_sdbm_t *get_db_for_reading(); pa_sdbm_t *get_db_for_writing(); // void clear(); void delete_files(); void remove(const String& aname); void for_each(bool callback(pa_sdbm_datum_t, void*), void* info); void for_each(bool callback(const String::Body, const String&, void*), void* info); public: void remove(const pa_sdbm_datum_t key); pa_sdbm_datum_t serialize_value(const String& string, time_t time_to_die) const; const String* deserialize_value(const pa_sdbm_datum_t key, const pa_sdbm_datum_t value); void check(const char *step, pa_status_t status); private: Value *get_field(const String& aname); void put_field(const String& aname, Value *avalue); private: const char* file_name; pa_sdbm_t *m_db; }; #endif parser-3.5.1/src/types/pa_method.h0000644000076400007640000001073014725725065014027 00000000000000/** @file Parser: Method class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_METHOD_H #define PA_METHOD_H #define IDENT_PA_METHOD_H "$Id: pa_method.h,v 1.37 2024/12/10 02:40:53 moko Exp $" #define OPTIMIZE_CALL #define OPTIMIZE_RESULT #include "pa_operation.h" #include "pa_vjunction.h" /** native code method params can be NULL when method min&max params (see VStateless_class::add_native_method) counts are zero. */ typedef void (*NativeCodePtr)(Request& request, MethodParams& params); /** class method. methods can have - named or - numbered parameters methods can be - parser or - native onces holds - parameter names or number limits - local names - code [parser or native] */ class Method: public PA_Object { public: /// allowed method call types enum Call_type { CT_ANY, ///< method can be called either statically or dynamically CT_STATIC, ///< method can be called only statically CT_DYNAMIC ///< method can be called only dynamically }; enum Result_optimization { RO_UNKNOWN, // during first parser method call, until $result detected on method ends. RO_USE_RESULT, // write to $result detected, will not collect all writes to output scope. RO_USE_WCONTEXT // native code or parser code without $result usage. }; enum Call_optimization { CO_NONE, CO_WITHOUT_FRAME, // for some native methods method frame is not required, faster but $self is unavailable CO_WITHOUT_WCONTEXT // for all native methods wcontext is not required, as no $result, faster }; Call_type call_type; /// either numbered params for native-code methods = operators int min_numbered_params_count, max_numbered_params_count; /// or named params&locals for parser-code methods ArrayString* params_names; int params_count; ArrayString* locals_names; /// the Code ArrayOperation* parser_code; /*OR*/ NativeCodePtr native_code; bool all_vars_local; // in local vars list 'locals' was specified: all vars are local #ifdef OPTIMIZE_RESULT Result_optimization result_optimization; #endif #ifdef OPTIMIZE_CALL Call_optimization call_optimization; #endif mutable VJunction *junction_template; const String* name; // method name, never null const String* extra_params; // last argument uses the *name notation ArrayString* named_params; // last arguments use the .name notation Method( Call_type acall_type, int amin_numbered_params_count, int amax_numbered_params_count, ArrayString* aparams_names, ArrayString* alocals_names, ArrayOperation* aparser_code, NativeCodePtr anative_code, bool aall_vars_local=false #ifdef OPTIMIZE_RESULT , Result_optimization aresult_optimization=RO_UNKNOWN #endif #ifdef OPTIMIZE_CALL , Call_optimization acall_optimization=CO_NONE #endif ) : call_type(acall_type), min_numbered_params_count(amin_numbered_params_count), max_numbered_params_count(amax_numbered_params_count), params_names(aparams_names), params_count(0), locals_names(alocals_names), parser_code(aparser_code), native_code(anative_code), all_vars_local(aall_vars_local), #ifdef OPTIMIZE_RESULT result_optimization(aresult_optimization), #endif #ifdef OPTIMIZE_CALL call_optimization(acall_optimization), #endif junction_template(0), name(&String::Empty) { if (params_names){ params_count=(int)params_names->count(); const char *last_param = params_names->get(params_count-1)->cstr(); if (last_param[0] == '*' && last_param[1]){ extra_params = new String(pa_strdup(last_param+1)); params_names->remove(--params_count); return; } else if (last_param[0] == '.' && last_param[1]){ named_params = new ArrayString(params_count); do { // local variables are not ordered, but direct order for reflection named_params->insert(0, new String(pa_strdup(last_param+1))); params_names->remove(--params_count); if (!params_count) break; last_param = params_names->get(params_count-1)->cstr(); } while (last_param[0] == '.' && last_param[1]); return; } } extra_params = NULL; named_params = NULL; } /// call this before invoking to ensure proper actual numbered params count void check_actual_numbered_params(Value& self, MethodParams* actual_numbered_params) const; VJunction* get_vjunction(Value& aself) const { if(!junction_template) return junction_template=new VJunction(aself, this); return junction_template->get(aself); } }; #endif parser-3.5.1/src/types/pa_vfile.C0000644000076400007640000001734514732404263013610 00000000000000 /** @file Parser: @b file parser type. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "classes.h" #include "pa_base64.h" #include "pa_vfile.h" #include "pa_vstring.h" #include "pa_vint.h" #include "pa_charsets.h" #include "pa_request.h" volatile const char * IDENT_PA_VFILE_C="$Id: pa_vfile.C,v 1.84 2024/12/23 16:59:17 moko Exp $" IDENT_PA_VFILE_H; // externs extern Methoded* file_class; // defines for statics #define SIZE_NAME "size" #define TEXT_NAME "text" #define MODE_VALUE_TEXT "text" #define MODE_VALUE_BINARY "binary" #define CONTENT_TYPE_TEXT "text/plain" #define CONTENT_TYPE_BINARY "application/octet-stream" // statics static const String size_name(SIZE_NAME); static const String text_name(TEXT_NAME); static const String mode_value_text(MODE_VALUE_TEXT); static const String mode_value_binary(MODE_VALUE_BINARY); static const String content_type_text(CONTENT_TYPE_TEXT); static const String content_type_binary(CONTENT_TYPE_BINARY); inline bool content_type_is_default(Value *content_type){ if(content_type){ const String *ct=content_type->get_string(); return ct == &content_type_text || ct == &content_type_binary; } return true; } // methods VStateless_class *VFile::get_class() { return file_class; } HashStringValue *VFile::get_hash() { PA_UNUSED Value *prefetch=get_element(text_name); return &ffields; } void VFile::set_all(bool atainted, bool ais_text_mode, const char* avalue_ptr, size_t avalue_size, const String* afile_name) { fvalue_ptr=avalue_ptr; fvalue_size=avalue_size; ftext_tainted=atainted; fis_text_content=ais_text_mode; ffields.clear(); set_name(afile_name); ffields.put(size_name, new VDouble(fvalue_size)); set_mode(ais_text_mode); } void VFile::set(bool atainted, bool ais_text_mode, char* avalue_ptr, size_t avalue_size, const String* afile_name, Value* acontent_type, Request* r) { if(ais_text_mode && avalue_ptr && avalue_size) { fix_line_breaks(avalue_ptr, avalue_size); } set_all(atainted, ais_text_mode, avalue_ptr, avalue_size, afile_name); set_content_type(acontent_type, afile_name, r); } void VFile::set_binary(bool atainted, const char* avalue_ptr, size_t avalue_size, const String* afile_name, Value* acontent_type, Request* r) { set_all(atainted, false, avalue_ptr, avalue_size, afile_name); set_content_type(acontent_type, afile_name, r); } void VFile::set_binary_string(bool atainted, const char* avalue_ptr, size_t avalue_size) { set_all(atainted, false, avalue_ptr, avalue_size, 0); } void VFile::set(VFile& avfile, bool *ais_text_mode, const String* afile_name, Value* acontent_type, Request* r) { fvalue_ptr=avfile.fvalue_ptr; fvalue_size=avfile.fvalue_size; ftext_tainted=avfile.ftext_tainted; fis_text_mode=avfile.fis_text_mode; fis_text_content=avfile.fis_text_content; ffields.clear(); for(HashStringValue::Iterator i(avfile.ffields); i; i.next()) if(i.key() != text_name) // do not copy cached .text value ffields.put(*new String(i.key(), String::L_TAINTED), i.value()); if(ais_text_mode) set_mode(*ais_text_mode); if(afile_name) set_name(afile_name); if(acontent_type || afile_name || ( ais_text_mode && content_type_is_default(ffields.get(content_type_name)) )) set_content_type(acontent_type, afile_name, r); } const char* VFile::text_cstr() { const char* p=value_ptr(); if(fis_text_content) return p; size_t size=fvalue_size; if(const char *premature_zero_pos=(const char *)memchr(p, 0, size)) size=premature_zero_pos-p; char *copy_ptr=size?pa_strdup(p, size):0; // text mode but binary content if(fis_text_mode && size) fix_line_breaks(copy_ptr, size); return copy_ptr; } void VFile::set_mode(bool ais_text_mode){ fis_text_mode=ais_text_mode; if(fvalue_ptr) ffields.put(mode_name, new VString(ais_text_mode? mode_value_text : mode_value_binary )); } void VFile::set_name(const String* afile_name){ const char *lfile_name; if(afile_name && !afile_name->is_empty()) { if(afile_name->starts_with("http://") || afile_name->starts_with("https://")){ size_t query=afile_name->pos('?'); if(query!=STRING_NOT_FOUND) afile_name=&afile_name->mid(0,query); } lfile_name=pa_filename(afile_name->taint_cstr(String::L_FILE_SPEC)); if(!lfile_name[0]) lfile_name=NONAME_DAT; } else lfile_name=NONAME_DAT; ffields.put(name_name, new VString(*new String(lfile_name, String::L_FILE_SPEC))); } void VFile::set_content_type(Value* acontent_type, const String* afile_name, Request* r){ if(!acontent_type && afile_name && r) acontent_type=new VString(r->mime_type_of(afile_name)); if(!acontent_type) acontent_type=new VString(fis_text_mode ? content_type_text : content_type_binary); ffields.put(content_type_name, acontent_type); } Charset* VFile::detect_binary_charset(Charset *charset){ if(!charset) if(Value* content_type=ffields.get(content_type_name)) if(const String *ct=content_type->get_string()) charset=detect_charset(ct->cstr()); return pa_charsets.checkBOM((char*&)fvalue_ptr, fvalue_size, charset); // checkBOM can alter ptr, but not the content } void VFile::transcode(Charset& from_charset, Charset& to_charset){ String::C result=Charset::transcode(String::C(fvalue_ptr, fvalue_size), from_charset, to_charset); fvalue_ptr=result.str; fvalue_size=result.length; ffields.put(size_name, new VInt(fvalue_size)); } void VFile::save(Request_charsets& charsets, const String& file_spec, bool is_text, Charset* asked_charset) { if(fvalue_ptr) file_write(charsets, file_spec, fvalue_ptr, fvalue_size, is_text, false/*do_append*/, asked_charset); else throw Exception(PARSER_RUNTIME, &file_spec, "saving stat-ed file"); } bool VFile::is_text_mode(const String& mode) { if(mode==mode_value_text) return true; if(mode==mode_value_binary) return false; throw Exception(PARSER_RUNTIME, &mode, "is an invalid mode, must be either '" MODE_VALUE_TEXT "' or '" MODE_VALUE_BINARY "'"); } bool VFile::is_valid_mode(const String& mode) { return (mode==mode_value_text || mode==mode_value_binary); } Value* VFile::get_element(const String& aname) { Value* result; // $method if(result=VStateless_object::get_element(aname)) return result; // $field if(result=ffields.get(aname)) return result; // $text - if not cached if(aname == text_name && fvalue_ptr && fvalue_size) { // assigned file have ptr and we really have some bytes result=new VString(*new String(text_cstr(), ftext_tainted ? String::L_TAINTED : String::L_AS_IS)); // cache it ffields.put(text_name, result); return result; } return 0; } const String* VFile::get_json_string(Json_options& options){ String& result=*new String("{\n", String::L_AS_IS); String * indent=NULL; if (options.indent){ indent = new String(",\n\t", String::L_AS_IS); *indent << options.indent << "\""; result << "\t" << options.indent; } result << "\"class\":\"file\""; for(HashStringValue::Iterator i(ffields); i; i.next() ){ String::Body key=i.key(); if(key != text_name){ indent ? result << *indent : result << ",\n\""; result << String(key, String::L_JSON) << "\":" << *i.value()->get_json_string(options); } } if(fvalue_ptr){ switch(options.file){ case Json_options::F_BASE64: { indent ? result << *indent : result << ",\n\""; result << "base64\":\""; const char* encoded=pa_base64_encode(fvalue_ptr, fvalue_size); result.append_help_length(encoded, 0, String::L_JSON); result << "\""; break; } case Json_options::F_TEXT: { indent ? result << *indent : result << ",\n\""; result << "text\":\""; result.append_help_length(text_cstr(), 0, String::L_JSON); result << "\""; break; } case Json_options::F_BODYLESS: break; } } result << "\n" << options.indent << "}"; return &result; } parser-3.5.1/src/types/types.vcproj0000644000076400007640000002004214705201170014264 00000000000000 parser-3.5.1/src/types/pa_vxnode.C0000644000076400007640000001320414712042466013775 00000000000000/** @node Parser: @b dnode parser type. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #ifdef XML #include "pa_vxnode.h" #include "pa_vxdoc.h" #include "pa_vstring.h" #include "pa_vbool.h" #include "pa_vhash.h" #include "pa_request_charsets.h" #include "pa_charset.h" #include "pa_xml_exception.h" volatile const char * IDENT_PA_VXNODE_C="$Id: pa_vxnode.C,v 1.63 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VXNODE_H; Request_charsets& VXnode::charsets() { return get_vxdoc().charsets(); } /// VXnode: true Value& VXnode::as_expr_result() { return VBool::get(as_bool()); } Value* VXnode::get_element(const String& aname) { // $method if(Value* result=VStateless_object::get_element(aname)) return result; // fields xmlNode& selfNode=get_xmlnode(); if(aname=="nodeName") { return new VString(charsets().source().transcode(selfNode.name)); } else if(aname=="nodeValue") { switch(selfNode.type) { case XML_ATTRIBUTE_NODE: case XML_PI_NODE: case XML_CDATA_SECTION_NODE: case XML_COMMENT_NODE: case XML_TEXT_NODE: return new VString(charsets().source().transcode(xmlNodeGetContent(&selfNode))); default: return 0; } } else if(aname=="nodeType") { return new VInt(selfNode.type); } else if(aname=="parentNode") { if(xmlNode* result_node=selfNode.parent) return &get_vxdoc().wrap(*result_node); return 0; } else if(aname=="childNodes") { if(xmlNode* currentNode=selfNode.children) { VHash* result=new VHash; int i=0; do { result->hash().put(pa_uitoa(i++), &get_vxdoc().wrap(*currentNode)); } while((currentNode=currentNode->next)); return result; } return 0; } else if(aname=="firstChild") { if(xmlNode* result_node=selfNode.children) return &get_vxdoc().wrap(*result_node); return 0; } else if(aname=="lastChild") { if(xmlNode* result_node=selfNode.last) return &get_vxdoc().wrap(*result_node); return 0; } else if(aname=="previousSibling") { if(xmlNode* result_node=selfNode.prev) return &get_vxdoc().wrap(*result_node); return 0; } else if(aname=="nextSibling") { if(xmlNode* result_node=selfNode.next) return &get_vxdoc().wrap(*result_node); return 0; } else if(aname=="ownerDocument") { return &get_vxdoc(); } else switch(selfNode.type) { case XML_ELEMENT_NODE: if(aname=="attributes") { if(xmlNode* currentNode=(xmlNode*)selfNode.properties) { VHash* result=new VHash; do { result->hash().put( charsets().source().transcode(currentNode->name), &get_vxdoc().wrap(*currentNode)); } while((currentNode=currentNode->next)); return result; } return 0; } else if(aname=="tagName") return new VString(charsets().source().transcode(selfNode.name)); else if(aname=="prefix") return (selfNode.ns ? new VString(charsets().source().transcode(selfNode.ns->prefix)) : 0); else if(aname=="namespaceURI") return (selfNode.ns ? new VString(charsets().source().transcode(selfNode.ns->href)) : 0); break; case XML_ATTRIBUTE_NODE: if(aname=="specified") return &VBool::get(true); // were not working in gdome, leaving out else if(aname=="name") return new VString(charsets().source().transcode(selfNode.name)); else if(aname=="value") return new VString(charsets().source().transcode(xmlNodeGetContent(&selfNode))); else if(aname=="prefix") return (selfNode.ns ? new VString(charsets().source().transcode(selfNode.ns->prefix)) : 0); else if(aname=="namespaceURI") return (selfNode.ns ? new VString(charsets().source().transcode(selfNode.ns->href)) : 0); break; /* case XML_COMMENT_NODE: substringData(unsigned int offset, unsigned int count) */ case XML_PI_NODE: if(aname=="target") return new VString(charsets().source().transcode(selfNode.name)); else if(aname=="data") return new VString(charsets().source().transcode(xmlNodeGetContent(&selfNode))); break; case XML_DTD_NODE: { if(aname=="name") { // readonly attribute DOMString aname; // The aname of DTD; i.e., the aname immediately following // the DOCTYPE keyword in an XML source document. return new VString(charsets().source().transcode(selfNode.name)); } /* readonly attribute NamedNodeMap entities; readonly attribute NamedNodeMap notations; virtual const XalanNamedNodeMap* getEntities () const = 0 This function returns a NamedNodeMap containing the general entities, both external and internal, declared in the DTD. More... virtual const XalanNamedNodeMap* getNotations () const = 0 This function returns a named selfNode map containing an entry for each notation declared in a document's DTD. More... */ } break; /* someday case XML_NOTATION_NODE: { GdomeNotation *notation=XML_NOT(selfNode); if(aname=="publicId") { // readonly attribute DOMString publicId; return new VString(charsets().source().transcode(gdome_not_publicId(notation, &exc))); } else if(aname=="systemId") { // readonly attribute DOMString systemId; return new VString(charsets().source().transcode(gdome_not_systemId(notation, &exc))); } } break; */ default: // calm compiler on unhandled cases break; } return bark("%s field not found", &aname); } const VJunction* VXnode::put_element(const String& aname, Value* avalue) { xmlNode& selfNode=get_xmlnode(); if(aname=="nodeValue") { xmlNodeSetContent(&selfNode, charsets().source().transcode(avalue->as_string().cstr_to_string_body_untaint(String::L_XML, 0, &charsets() ))); return 0; } return Value::put_element(aname, avalue); } #endif parser-3.5.1/src/types/pa_value.C0000644000076400007640000001304714712042465013612 00000000000000/** @file Parser: Value class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_value.h" #include "pa_vstateless_class.h" #include "pa_vmethod_frame.h" #include "pa_vdate.h" #include "pa_vobject.h" #include "pa_request.h" volatile const char * IDENT_PA_VALUE_C="$Id: pa_value.C,v 1.52 2024/11/04 03:53:25 moko Exp $" IDENT_PA_VALUE_H IDENT_PA_PROPERTY_H; // globals const String name_name(NAME_NAME); const String value_name(VALUE_NAME); const String expires_name(EXPIRES_NAME); const String content_type_name(CONTENT_TYPE_NAME); // methods Junction* Value::get_junction() { return 0; } Value* Value::get_element(const String& /*aname*/) { return bark("element cannot be fetched from %s"); } VFile* Value::as_vfile() { throw Exception(PARSER_RUNTIME, 0, "parameter is '%s', it does not have file value", type()); } // Should be synced with MethodParams::as_hash HashStringValue* Value::as_hash(const char* name) { if(get_junction()) throw Exception(PARSER_RUNTIME, 0, "%s must not be code", name ? name : "options"); if(!is_defined()) // empty hash is not defined, but we don't need it anyway return 0; if(HashStringValue* result=get_hash()) return result; if(is_string() && get_string()->trim().is_empty()) return 0; throw Exception(PARSER_RUNTIME, 0, "%s must have hash representation", name ? name : "options"); } const String* Value::get_json_string(Json_options& options) { if(HashStringValue* hash=get_hash()) return options.hash_json_string(hash); if(!options.skip_unknown) throw Exception(PARSER_RUNTIME, 0, "Unsupported value's type (%s)", type()); return new String("null"); } const String* Value::default_method_2_json_string(Value& default_method, Json_options& options){ if(default_method.is_string()){ // specified as string with method name const String& method_name=*default_method.get_string(); Method* method=this->get_class()->get_method(method_name); if(!method) { // class/object does not have method with specified name so serialize it as hash (default) return options.hash_json_string(get_hash()); } Value *params[]={new VString(*new String(options.key, String::L_JSON)), options.params ? options.params : VVoid::get()}; METHOD_FRAME_ACTION(*method, options.r->method_frame, *this,{ frame.store_params(params, 2); options.r->call(frame); return &frame.result().as_string(); }); } else { // specified as method-junction Junction* junction=default_method.get_junction(); Value *params[]={new VString(*new String(options.key, String::L_JSON)), this, options.params ? options.params : VVoid::get()}; METHOD_FRAME_ACTION(*junction->method, options.r->method_frame, junction->self,{ frame.store_params(params, 3); options.r->call(frame); return &frame.result().as_string(); }); } } /// call this before invoking to ensure proper actual numbered params count void Method::check_actual_numbered_params(Value& self, MethodParams* actual_numbered_params) const { int actual_count=actual_numbered_params ? actual_numbered_params->count() : 0; if(actual_countmax_numbered_params_count) throw Exception(PARSER_RUNTIME, name, "native method of '%s' accepts %s %d parameter(s) (%d present)", self.type(), actual_count(&value)) { result << *vdate->get_gmt_string(); } else throw Exception(PARSER_RUNTIME, &result, "trying to append here neither string nor date (%s)", value.type()); } #ifndef DOXYGEN struct Attributed_meaning_info { String* header; // header line being constructed String::Language lang; // language in which to append to that line bool forced; // do they force that lang? bool allow_bool; // allow bool types during print attributes }; #endif static void append_attribute_subattribute(HashStringValue::key_type akey, HashStringValue::value_type avalue, Attributed_meaning_info *info) { if(akey==VALUE_NAME) return; if(avalue->is_bool() && (!info->allow_bool || avalue->as_bool()==false)) return; // ...; charset=windows1251 *info->header << "; "; info->header->append(String(akey, String::L_TAINTED), info->lang, info->forced); if(!avalue->is_bool()) { if( akey==content_disposition_filename_name ) { *info->header << "=\""; append_attribute_meaning(*info->header, *avalue, info->lang, info->forced); *info->header << "\""; } else { *info->header << "="; append_attribute_meaning(*info->header, *avalue, info->lang, info->forced); } } } const String& attributed_meaning_to_string(Value& meaning, String::Language lang, bool forced, bool allow_bool) { String& result=*new String; if(HashStringValue *hash=meaning.get_hash()) { // $value(value) $subattribute(subattribute value) if(Value* value=hash->get(value_name)) append_attribute_meaning(result, *value, lang, forced); Attributed_meaning_info attributed_meaning_info={&result, lang, false, allow_bool}; hash->for_each(append_attribute_subattribute, &attributed_meaning_info); } else // result value append_attribute_meaning(result, meaning, lang, forced); return result; } parser-3.5.1/src/types/pa_varray.C0000644000076400007640000000225414712042465014000 00000000000000/** @file Parser: @b array class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_varray.h" #include "pa_vfile.h" #include "pa_request.h" volatile const char * IDENT_PA_VARRAY_C="$Id: pa_varray.C,v 1.8 2024/11/04 03:53:25 moko Exp $" IDENT_PA_VARRAY_H; // Explicit instantiation for Visual Studio template class SparseArray; template void SparseArray::fit(size_t index){ if(index > (size_t)pa_array_limit) throw Exception(PARSER_RUNTIME, 0, "array index %d exceeds the $MAIN:LIMITS.max_array_size (%d)", index, pa_array_limit); Array::fit(index); } HashStringValue& VArray::hash(){ HashStringValue& result=*new HashStringValue(); for(ArrayValue::Iterator i(farray); i; i.next()) { if(i.value()) result.put(i.key(), i.value()); } return result; } const String* VArray::get_json_string(Json_options& options) { return options.array == Json_options::A_COMPACT ? options.array_compact_json_string(&array()) : options.array == Json_options::A_ARRAY ? options.array_json_string(&array()) : Value::get_json_string(options); } parser-3.5.1/src/types/pa_vform.C0000644000076400007640000002562514732404263013634 00000000000000/** @file Parser: @b form class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian based on The CGI_C library, by Thomas Boutell. */ #include "pa_sapi.h" #include "pa_vform.h" #include "pa_vstring.h" #include "pa_globals.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_varray.h" #include "pa_common.h" #include "pa_vtable.h" #include "pa_charset.h" volatile const char * IDENT_PA_VFORM_C="$Id: pa_vform.C,v 1.129 2024/12/23 18:30:55 moko Exp $" IDENT_PA_VFORM_H; // defines //#define DEBUG_POST // parse helper funcs static size_t getHeader(const char* data, size_t len){ size_t i; int enter=-1; if (data) { for (i=0;i=0) enter++; if (enter>1) return i; } else { if (data[i]!='\r') enter=0; } } return 0; } static const char* searchAttribute(const char* data, const char* attr, //< expected to be lowercased size_t len){ size_t i; if (data) for (i=0;istart) { // ?x,y int x=atoi(data+start, aftercomma-1-start); int y=atoi(data+aftercomma, length-aftercomma); imap.put(String("x"), new VInt(x)); imap.put(String("y"), new VInt(y)); } else { // ?qtail AppendFormEntry("qtail", data+start, length-start, client_charset); } // cut tail length=pos; break; } } } // Scan for pairs, unescaping and storing them as they are found for(size_t pos=0; posstart)?unescape_chars(data+start, aftereq-1-start, &fcharsets.client()):"nameless"; char *value=unescape_chars(data+aftereq, finish-aftereq, &fcharsets.client()); AppendFormEntry(attr, value, strlen(value), client_charset); } } static char* pa_tolower(char *str){ if(!str) return 0; for(char *p=str; *p; p++) *p=(char)tolower((unsigned char)*p); return str; } void VForm::ParseMimeInput( char *content_type, const char* data, size_t length, Charset* client_charset) { /* Scan for mime-presented pairs, storing them as they are found. */ const char* boundary=pa_tolower(getAttributeValue(content_type, "boundary=", strlen(content_type))); if(!boundary) throw Exception(0, 0, "VForm::ParseMimeInput no boundary attribute of Content-Type"); const char* lastData=&data[length]; while(true) { const char *dataStart=searchAttribute(data, boundary, lastData-data), *dataEnd=searchAttribute(dataStart, boundary, lastData-dataStart); size_t headerSize=getHeader(dataStart, lastData-dataStart); if(!dataStart || !dataEnd || !headerSize) break; if(searchAttribute(dataStart, "content-disposition: form-data", headerSize)) { size_t valueSize=(dataEnd-dataStart)-headerSize-5-strlen(boundary); char *attr=getAttributeValue(dataStart, " name=", headerSize), *fName=getAttributeValue(dataStart, " filename=", headerSize); if(attr) { /* OK, we have a new pair, add it to the list. */ // fName checks are because MSIE passes unassigned as filename="" and empty body if( fName && (strlen(fName) || valueSize) ){ AppendFormFileEntry(attr, valueSize? &dataStart[headerSize+1]: "", valueSize, fName, client_charset); } else { AppendFormEntry(attr, valueSize? &dataStart[headerSize+1]: "", valueSize, client_charset); } } } data=(dataEnd-strlen(boundary)); } } void VForm::AppendFormFileEntry(const char* cname_cstr, const char* raw_cvalue_ptr, const size_t raw_cvalue_size, const char* file_name_cstr, Charset* client_charset){ const char* fname = pa_strdup(file_name_cstr); const String* sfile_name=new String(transcode(fname, strlen(fname), client_charset)); const String& sname=*new String(transcode(cname_cstr, strlen(cname_cstr), client_charset)); // maybe transcode text/* files? // NO!!! some users want to upload file 'as is' or file encoding can be unknown VFile* vfile=new VFile; vfile->set_binary(true/*tainted*/, raw_cvalue_ptr, raw_cvalue_size, sfile_name); fields.put_dont_replace(sname, vfile); // files { Value* vhash=files.get(sname); if(!vhash) files.put(sname, vhash=new VHash); HashStringValue& hash=*vhash->get_hash(); hash.put(pa_uitoa(hash.count()), vfile); } // elements { Value* varray=elements.get(sname); if(!varray) elements.put(sname, varray=new VArray); if(VArray* array=dynamic_cast(varray)) array->array()+=vfile; } } void VForm::AppendFormEntry(const char* cname_cstr, const char* raw_cvalue_ptr, const size_t raw_cvalue_size, Charset* client_charset) { const String& sname=*new String(transcode(cname_cstr, strlen(cname_cstr), client_charset)); const char* premature_zero_pos=(const char* )memchr(raw_cvalue_ptr, 0, raw_cvalue_size); size_t cvalue_size=premature_zero_pos ? premature_zero_pos - (const char* )raw_cvalue_ptr : raw_cvalue_size; char *cvalue_ptr=pa_strdup(raw_cvalue_ptr, cvalue_size); fix_line_breaks(cvalue_ptr, cvalue_size); String& string=*new String(transcode(cvalue_ptr, cvalue_size, client_charset), String::L_TAINTED); Value *value=new VString(string); // tables { Value* vtable=tables.get(sname); if(!vtable) { Table::columns_type columns(new ArrayString(1)); *columns+=new String("field"); vtable=new VTable(new Table(columns)); tables.put(sname, vtable); } Table& table=*vtable->get_table(); // this string becomes next row Table::element_type row(new ArrayString(1)); *row+=&string; table+=row; } // elements { Value* varray=elements.get(sname); if(!varray) elements.put(sname, varray=new VArray); if(VArray* array=dynamic_cast(varray)) array->array()+=value; } fields.put_dont_replace(sname, value); } void VForm::refill_fields_tables_and_files() { fields.clear(); tables.clear(); files.clear(); imap.clear(); elements.clear(); //frequest_info.query_string="a=123"; // parsing QS [GET and ?name=value from uri rewrite)] if(frequest_info.query_string) { size_t length=strlen(frequest_info.query_string); char *buf=pa_strdup(frequest_info.query_string, length); ParseGetFormInput(buf, length); } #ifdef DEBUG_POST frequest_info.method="POST"; File_read_result file=file_read_binary(*new String("test.stdin"), true /*fail on problem*/); frequest_info.post_size=file.length; frequest_info.post_data=(char*)file.str; frequest_info.content_type="multipart/form-data; boundary=----------mcqY2UDNcdEAoN1mLmne2i"; #endif // parsing POST data switch(post_content_type){ case FORM_URLENCODED: { detect_post_charset(); ParseFormInput(frequest_info.post_data, frequest_info.post_size, fpost_charset); break; } case MULTIPART_FORMDATA: { ParseMimeInput(pa_strdup(frequest_info.content_type), frequest_info.post_data, frequest_info.post_size); break; } case UNKNOWN: break; } filled_source=&fcharsets.source(); filled_client=&fcharsets.client(); } void VForm::detect_post_charset(){ if(can_have_body && !charset_detected){ fpost_charset=detect_charset(frequest_info.content_type); charset_detected=true; } } bool VForm::should_refill_fields_tables_and_files() { return &fcharsets.source()!=filled_source || &fcharsets.client()!=filled_client; } Value* VForm::get_element(const String& aname) { if(should_refill_fields_tables_and_files()) refill_fields_tables_and_files(); // $fields if(SYMBOLS_EQ(aname, FIELDS_SYMBOL)) return new VHash(vfields); // $tables if(SYMBOLS_EQ(aname, TABLES_SYMBOL)) return &vtables; // $files if(SYMBOLS_EQ(aname, FILES_SYMBOL)) return &vfiles; // $imap if(SYMBOLS_EQ(aname, IMAP_SYMBOL)) return new VHash(vimap); // $elements if(SYMBOLS_EQ(aname, ELEMENTS_SYMBOL)) return &velements; // methods (if any) if(Value* result=VStateless_class::get_element(aname)) return result; // $field return fields.get(aname); } Charset* VForm::get_body_charset(){ detect_post_charset(); return fpost_charset; } const VJunction* VForm::put_element(const String& aname, Value* avalue) { if(should_refill_fields_tables_and_files()) refill_fields_tables_and_files(); fields.put(aname, avalue); return 0; } parser-3.5.1/src/types/pa_vvoid.C0000644000076400007640000000064014712042466013621 00000000000000/** @file Parser: @b string class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vvoid.h" #include "pa_vfile.h" volatile const char * IDENT_PA_VVOID_C="$Id: pa_vvoid.C,v 1.11 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VVOID_H; #ifdef STRICT_VARS bool VVoid::strict_vars = false; #endif parser-3.5.1/src/types/pa_wwrapper.h0000644000076400007640000000574514712042466014421 00000000000000/** @file Parser: @b write_wrapper write context Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_WWRAPPER_H #define PA_WWRAPPER_H #define IDENT_PA_WWRAPPER_H "$Id: pa_wwrapper.h,v 1.55 2024/11/04 03:53:26 moko Exp $" #define OPTIMIZE_SINGLE_STRING_WRITE #include "pa_wcontext.h" #include "pa_exception.h" /// specialized write context, adds to WContext VHash autocreation ability class WWrapper: public WContext { public: // Value override const char* type() const { return "wwrapper"; } /// WWrapper: transparent override Value* get_element(const String& aname) { return as_value().get_element(aname); } /// WWrapper: transparent override const VJunction* put_element(const String& aname, Value* avalue) { if(!fvalue) { fvalue=new VHash; // not constructing anymore [if were constructing] // so to allow method calls after real constructor-method call // sample: // $hash[ // $.key1[$i] // ^i.inc[] ^rem{allow such calls} // $.key2[$1] } return fvalue->put_element(aname, avalue); } public: // usage WWrapper(WContext *aparent) : WContext(aparent) { } private: // raises an exception on 0 value Value& as_value() const { if(!fvalue) throw Exception(0, 0, "accessing wrapper without value"); return *fvalue; } }; #ifdef OPTIMIZE_SINGLE_STRING_WRITE class WObjectPoolWrapper: public WWrapper { public: enum WState { WS_NONE, WS_KEEP_VALUE, WS_TRANSPARENT }; WObjectPoolWrapper(WContext *aparent) : WWrapper(aparent), fstate(WS_NONE) { } override const VJunction* put_element(const String& aname, Value* avalue) { if(fstate == WS_KEEP_VALUE) fvalue=0; // VHash will be created, thus no need to flush fvalue fstate=WS_TRANSPARENT; return WWrapper::put_element(aname, avalue); } override void write(const String& astring) { if(fstate == WS_KEEP_VALUE) flush(); fstate=WS_TRANSPARENT; WWrapper::write(astring); } override void write(Value& avalue) { if(fstate == WS_KEEP_VALUE) flush(); fstate=WS_TRANSPARENT; WWrapper::write(avalue); } override void write_as_string(Value& avalue) { switch(fstate){ case WS_NONE:{ // alang is allways L_PASS_APPENDED, but just in case we check it // only VString can be cached, no get_string() call as VInt/etc will be affected if(avalue.is_string()){ fvalue=&avalue; fstate=WS_KEEP_VALUE; return; } break; } case WS_KEEP_VALUE:{ flush(); break; } case WS_TRANSPARENT: break; } fstate=WS_TRANSPARENT; // we copy WWrapper::write here to prevent virtual call to our class if(const String* string=avalue.get_string()) WWrapper::write(*string); else WWrapper::write(avalue); } //override StringOrValue result() - not required as as_value() will be allways called private: WState fstate; inline void flush(){ WWrapper::write(*fvalue->get_string()); fvalue=0; } }; #endif #endif parser-3.5.1/src/types/pa_vmemcached.C0000644000076400007640000001720614712042466014574 00000000000000/** @file Parser: memcached class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Ivan Poluyanov Artem Stepanov */ #include "pa_vmemcached.h" #include "pa_value.h" #include "pa_vstring.h" #include "pa_vhash.h" #include "pa_vvoid.h" volatile const char * IDENT_PA_VMEMCACHED_C="$Id: pa_vmemcached.C,v 1.25 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VMEMCACHED_H; const char *memcached_library="libmemcached" LT_MODULE_EXT; // support functions static void error(const char *step, memcached_st* m, memcached_return rc) { const char* str=f_memcached_strerror(m, rc); throw Exception("memcached", 0, "%s error: %s (%d)", step, str ? str : "", rc); } inline void check(const char *action, memcached_st* m, memcached_return rc) { if(rc==MEMCACHED_SUCCESS) return; error(action, m, rc); } inline void check(const char *action, memcached_st* m, memcached_return rc, memcached_return ok) { if(rc==MEMCACHED_SUCCESS || rc==ok) return; error(action, m, rc); } inline void check_key(const String& akey) { if(akey.is_empty()) throw Exception("memcached", 0, "key must not be empty"); if(akey.length() > MEMCACHED_MAX_KEY) throw Exception("memcached", &akey, "key length %d exceeds limit (%d bytes)", akey.length(), MEMCACHED_MAX_KEY); } // serialization helpers #define SERIALIZED_STRING 256 struct Serialization_data{ unsigned int flags; const char *ptr; size_t length; Serialization_data() : flags(0), ptr(0), length(0){} Serialization_data(unsigned int aflags) : flags(aflags), ptr(0), length(0){} Serialization_data(unsigned int aflags, const char *aptr, size_t alength) : flags(aflags), ptr(aptr), length(alength){} }; static void serialize_string(const String &str, Serialization_data &data){ if(str.is_empty()){ data = Serialization_data(SERIALIZED_STRING); return; } if (str.is_not_just_lang()){ String::Cm cm = str.serialize(0); data = Serialization_data(SERIALIZED_STRING, cm.str, cm.length); } else { data = Serialization_data(SERIALIZED_STRING + (unsigned int)str.just_lang(), str.cstr(), str.length()); } } static VString *deserialize_string(Serialization_data &data){ String *result; if(data.flags==SERIALIZED_STRING){ result = new String(); if (data.length>0 && !result->deserialize(0, (void *)data.ptr, data.length)) return NULL; } else { // we can't use length from memcached as there can be '\0' inside String::Language lang=(String::Language)(data.flags-SERIALIZED_STRING); result = new String(data.ptr, lang); } return new VString(*result); } static Value &deserialize(Serialization_data &data){ Value *result=NULL; if(data.flags>=SERIALIZED_STRING && data.flags<(SERIALIZED_STRING+256)){ // String->deserialize uses passed string if(data.length>0) data.ptr=pa_strdup(data.ptr, data.length); result=deserialize_string(data); } if (!result) throw Exception(PARSER_RUNTIME, 0, "unable to deserialize data id %d, size %d", data.flags, data.length); return *result; } // VMemcached static void load_memcached(const char *library){ const char *memcached_status = memcached_load(library); if(memcached_status) throw Exception("memcached", 0, "failed to load memcached library %s: %s", library, memcached_status); } void VMemcached::open(const String& options_string, time_t attl, bool connect){ load_memcached(memcached_library); if(f_memcached==NULL) throw Exception("memcached", 0, "options hash requires libmemcached version 0.49 or later"); if(options_string.is_empty()) throw Exception("memcached", 0, "options hash must not be empty"); fttl=attl; fm=f_memcached(options_string.cstr(), options_string.length()); if (connect) check("connect", fm, f_memcached_version(fm), MEMCACHED_NOT_SUPPORTED); } void VMemcached::open_parse(const String& connect_string, time_t attl){ load_memcached(memcached_library); if(connect_string.is_empty()) throw Exception("memcached", 0, "connect string must not be empty"); fttl=attl; fm=f_memcached_create(NULL); memcached_server_st* fservers = f_memcached_servers_parse(connect_string.cstr()); check("server_push", fm, f_memcached_server_push(fm, fservers)); check("connect", fm, f_memcached_version(fm), MEMCACHED_NOT_SUPPORTED); } void VMemcached::flush(time_t attl) { check("flush", fm, f_memcached_flush(fm, attl)); } void VMemcached::quit() { f_memcached_quit(fm); } void VMemcached::remove(const String& aname) { check_key(aname); check("delete", fm, f_memcached_delete(fm, aname.cstr(), aname.length(), (time_t)0), MEMCACHED_NOTFOUND); } Value* VMemcached::get_element(const String& aname) { if(Value *result=VStateless_object::get_element(aname)) return result; check_key(aname); memcached_return rc; Serialization_data data; data.ptr=f_memcached_get(fm, aname.cstr(), aname.length(), &data.length, &data.flags, &rc); if(rc==MEMCACHED_SUCCESS){ return &deserialize(data); } if(rc==MEMCACHED_NOTFOUND) return VVoid::get(); error("get", fm, rc); return 0; // calm down compiler } Value &VMemcached::mget(ArrayString& akeys) { VHash &hresult = *new VHash(); size_t kl = akeys.count(); if(kl==0) return hresult; const char **keys = new(PointerGC) const char *[kl]; size_t *key_lengths = new(PointerFreeGC) size_t[kl]; for(size_t i=0; iget_hash()) { int valid_options=1; if(Value* ttl_value=hash->get(expires_name)){ ttl=ttl_value->as_int(); valid_options++; } if(avalue=hash->get(value_name)){ if(avalue->get_junction()) throw Exception("memcached", 0, VALUE_NAME " must not be code"); } else throw Exception("memcached", &aname, "value hash must contain ." VALUE_NAME); if(valid_options!=hash->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } if(avalue->is_string()){ serialize_string(*avalue->get_string(), data); } else { throw Exception("memcached", &aname, "%s serialization is not supported yet", avalue->type()); } return ttl; } bool VMemcached::add(const String& aname, Value* avalue){ check_key(aname); Serialization_data data; time_t ttl=serialize_value(fttl, aname, avalue, data); memcached_return rc=f_memcached_add(fm, aname.cstr(), aname.length(), data.ptr, data.length, ttl, data.flags); if(rc == MEMCACHED_NOTSTORED) return false; if(rc != MEMCACHED_SUCCESS) error("add", fm, rc); return true; } const VJunction* VMemcached::put_element(const String& aname, Value* avalue){ check_key(aname); Serialization_data data; time_t ttl=serialize_value(fttl, aname, avalue, data); check("set", fm, f_memcached_set(fm, aname.cstr(), aname.length(), data.ptr, data.length, ttl, data.flags)); return 0; } parser-3.5.1/src/types/pa_vclass.h0000644000076400007640000000543314712042465014036 00000000000000/** @file Parser: @b class parser class decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VCLASS_H #define PA_VCLASS_H #define IDENT_PA_VCLASS_H "$Id: pa_vclass.h,v 1.77 2024/11/04 03:53:25 moko Exp $" #define OBJECT_PROTOTYPE #define CLASS_GETTER_UNPROTECTED // includes #include "pa_vstateless_class.h" #include "pa_vjunction.h" /** stores - static fields, getters & setters: VClass::ffields */ class VClass: public VStateless_class { public: // Value override const char* type() const { if(!ftype) throw Exception(PARSER_RUNTIME, 0, "getting type of nameless class"); return ftype; } /// VClass: true override bool as_bool() const { return true; } override bool is(const char* atype); override Value* get_element(Value& aself, const String& aname); override const VJunction* put_element(Value& self, const String& name, Value* value); /// indicator value meaning that put_element_replace_only overwritten static field in non-prototype mode #define PUT_ELEMENT_REPLACED_FIELD reinterpret_cast(1) // for VObject::put_element const VJunction* put_element_replace_only(Value& self, const String& name, Value* value); override const String* get_json_string(Json_options& options); override Value* create_new_value(Pool&); override HashStringValue *get_hash(); override HashStringValue* get_fields() { return get_hash(); }; public: #ifdef OBJECT_PROTOTYPE static bool prototype; #endif #ifdef CLASS_GETTER_UNPROTECTED static bool getter_protected; #endif // VStateless_class override void real_set_method(const String& aname, Method* amethod); override HashStringProperty* get_properties(){ return &ffields; }; override void set_base(VStateless_class* abase); /// VClass default getter & setter support override void enable_default_getter(){ state |= IS_GETTER_ACTIVE; } override void enable_default_setter(){ if(has_default_setter()) state |= IS_SETTER_ACTIVE; } override void disable_default_getter(){ state &= ~IS_GETTER_ACTIVE; } override void disable_default_setter(){ state &= ~IS_SETTER_ACTIVE; } override bool is_enabled_default_getter(){ return (state & IS_GETTER_ACTIVE) > 0; } override bool is_enabled_default_setter(){ return (state & IS_SETTER_ACTIVE) > 0; } private: const char* ftype; const String& ffilespec; enum State { IS_GETTER_ACTIVE = 0x01, IS_SETTER_ACTIVE = 0x02 }; int state; // default setter & getter state HashStringProperty ffields; Property& get_property(const String& aname); public: VClass(const char* atype, const String* afilespec=0) : ftype(atype), ffilespec(afilespec ? *afilespec : String::Empty), state(IS_GETTER_ACTIVE){} const String& get_filespec(){ return ffilespec; } }; #endif parser-3.5.1/src/types/pa_vbool.h0000644000076400007640000000332114712042465013656 00000000000000/** @file Parser: @b bool class decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VBOOL_H #define PA_VBOOL_H #define IDENT_PA_VBOOL_H "$Id: pa_vbool.h,v 1.41 2024/11/04 03:53:25 moko Exp $" // include #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" // defines #define VBOOL_TYPE "bool" #define MAX_BOOL_AS_STRING 20 extern Methoded* bool_class; // VBool class VBool: public VSimple_stateless_object { public: // Value override const char* type() const { return VBOOL_TYPE; } /// VBool: 0 override VStateless_class *get_class() { return bool_class; } /// VBool: true override bool is_evaluated_expr() const { return true; } /// VBool: clone override Value& as_expr_result() { return *this; } /// VBool: true virtual bool is_defined() const { return true; } /// VBool: fbool override double as_double() const { return fbool ? 1 : 0; } /// VBool: fbool override int as_int() const { return fbool ? 1 : 0; } /// VBool: fbool override bool as_bool() const { return fbool; } override bool is_bool() const { return true; } /// VBool: json-string ("true"|"false") override const String* get_json_string(Json_options&) { static const String singleton_json_true(String("true")), singleton_json_false(String("false")); return fbool ? &singleton_json_true : &singleton_json_false; } inline static VBool &get(bool abool){ static VBool singleton_true(true), singleton_false(false); return abool?singleton_true:singleton_false; } public: // usage VBool(bool abool): fbool(abool) {} bool get_bool() { return fbool; } private: bool fbool; }; #endif parser-3.5.1/src/types/pa_vregex.C0000644000076400007640000001342014712042466013772 00000000000000/** @file Parser: @b regex class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_vregex.h" #include "pa_vint.h" #include "pa_vstring.h" volatile const char * IDENT_PA_VREGEX_C="$Id: pa_vregex.C,v 1.25 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VREGEX_H; // defines #define REGEX_PATTERN_NAME "pattern" #define REGEX_OPTIONS_NAME "options" const char* get_pcre_exec_error_text(int exec_result){ if(exec_result == PCRE_ERROR_BADUTF8_OFFSET || #ifdef HAVE_PCRE2 exec_result <= PCRE2_ERROR_UTF8_ERR1 /* -3 */ && exec_result >= PCRE2_ERROR_UTF8_ERR21 /* -21 */ #else exec_result == PCRE_ERROR_BADUTF8 #endif ) return "UTF-8 validation failed during pcre_exec (%d)."; return "execution error (%d)"; } Value& VRegex::as_expr_result() { return *new VInt(as_int()); } void VRegex::regex_options(const String* options, int* result){ struct Regex_option { const char* key; const char* keyAlt; int clear; int set; int *result; } regex_option[]={ {"i", "I", 0, PCRE_CASELESS, result}, // a=A {"s", "S", 0, PCRE_DOTALL, result}, // ^\n\n$ [default] {"m", "M", PCRE_DOTALL, PCRE_MULTILINE, result}, // ^aaa\n$^bbb\n$ {"x", 0, 0, PCRE_EXTENDED, result}, // whitespace in regex ignored {"U", 0, 0, PCRE_UNGREEDY, result}, // ungreedy patterns (greedy by default) {"g", "G", 0, MF_GLOBAL_SEARCH, result+1}, // many rows {"'", 0, 0, MF_NEED_PRE_POST_MATCH, result+1}, {"n", 0, 0, MF_JUST_COUNT_MATCHES, result+1}, {0, 0, 0, 0, 0} }; result[0]=PCRE_EXTRA /* backslash+non-special char causes error */ | PCRE_DOTALL /* dot matches all chars including newline char */ | PCRE_DOLLAR_ENDONLY /* dollar matches only end of string, but not newline chars */; result[1]=0; if(options && !options->is_empty()){ size_t valid_options=0; for(Regex_option *o=regex_option; o->key; o++) if( options->pos(o->key)!=STRING_NOT_FOUND || (o->keyAlt && options->pos(o->keyAlt)!=STRING_NOT_FOUND) ){ *o->result &= ~o->clear; *o->result |= o->set; valid_options++; } if(options->length()!=valid_options) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } } void VRegex::set(Charset& acharset, const String* aregex, const String* aoptions){ if(aregex->is_empty()) throw Exception(PARSER_RUNTIME, 0, "regexp is empty"); fcharset=&acharset; fpattern=aregex->untaint_cstr(String::L_REGEX); foptions_cstr=aoptions ? aoptions->cstr() : 0; regex_options(aoptions, foptions); } void VRegex::set(VRegex& avregex){ fcharset=avregex.fcharset; fpattern=avregex.fpattern; foptions_cstr=avregex.foptions_cstr; regex_options(foptions_cstr ? new String(foptions_cstr) : 0, foptions); } void VRegex::compile(){ const char* err_ptr; int options=foptions[0]; // @todo (for UTF-8): check string & pattern and use PCRE_NO_UTF8_CHECK option if(fcharset->isUTF8()) options |= (PCRE_UTF8 | PCRE_UCP); #ifdef HAVE_PCRE2 int err; size_t err_offset; PCRE2_UCHAR buffer[120]; if(!fcmp_ctxt) fcmp_ctxt=pcre2_compile_context_create(fgen_ctxt); pcre2_set_character_tables(fcmp_ctxt, fcharset->pcre_tables); fcode=pcre2_compile((PCRE2_SPTR)fpattern, PCRE2_ZERO_TERMINATED, options, &err, &err_offset, fcmp_ctxt); if(!fcode){ pcre2_get_error_message(err, buffer, sizeof(buffer)); err_ptr=(const char*)buffer; } #else int err_offset; fcode=pcre_compile(fpattern, options, &err_ptr, &err_offset, fcharset->pcre_tables); #endif if(!fcode){ throw Exception(PCRE_EXCEPTION_TYPE, new String(fpattern + (fpattern[err_offset] ? err_offset : 0), String::L_TAINTED), "regular expression syntax error - %s", err_ptr); } } size_t VRegex::full_info(int type){ size_t result; int fullinfo_result=pcre_fullinfo(fcode, fextra, type, &result); if(fullinfo_result<0){ throw Exception(PCRE_EXCEPTION_TYPE, new String(fpattern, String::L_TAINTED), "pcre_full_info error (%d)", fullinfo_result); } return result; } size_t VRegex::get_info_size(){ return full_info(PCRE_INFO_SIZE); } size_t VRegex::get_study_size(){ #ifdef HAVE_PCRE2 return 0; #else return full_info(PCRE_INFO_STUDYSIZE); #endif } void VRegex::study(){ #ifndef HAVE_PCRE2 if(fstudied) return; const char* err_ptr; fextra=pcre_study(fcode, 0/*options*/, &err_ptr); if(err_ptr){ throw Exception(PCRE_EXCEPTION_TYPE, new String(fpattern, String::L_TAINTED), "pcre_study error: %s", err_ptr); } fstudied=true; #endif } int VRegex::exec(const char* string, size_t string_len, int* ovector, int ovector_size, int prestart){ #ifdef HAVE_PCRE2 if(!fmatch_ctxt) fmatch_ctxt=pcre2_match_context_create(fgen_ctxt); if(!fmatch_data) fmatch_data=pcre2_match_data_create_from_pattern(fcode, fgen_ctxt); int result=pcre2_match(fcode, (PCRE2_SPTR)string, string_len, prestart, prestart>0 ? PCRE2_NO_UTF_CHECK : 0, fmatch_data, fmatch_ctxt); #else int result=pcre_exec(fcode, fextra, string, string_len, prestart, prestart>0 ? PCRE_NO_UTF8_CHECK : 0, ovector, ovector_size); #endif if(result<0 && result!=PCRE_ERROR_NOMATCH){ throw Exception(PCRE_EXCEPTION_TYPE, new String(fpattern, String::L_TAINTED), get_pcre_exec_error_text(result), result); } #ifdef HAVE_PCRE2 if(result>0){ result=min(result, ovector_size/3); size_t* groups=pcre2_get_ovector_pointer(fmatch_data); for(int i=0; i, Alexandr Petrosian */ #include "pa_vhash.h" #include "pa_vfile.h" volatile const char * IDENT_PA_VHASH_C="$Id: pa_vhash.C,v 1.16 2024/11/04 03:53:26 moko Exp $" IDENT_PA_VHASH_H; VFile* VHash::as_vfile(String::Language /*lang*/, const Request_charsets * /*charsets*/){ return new VFile(fhash); } void VHash::extract_default(){ if( (_default=fhash.get(Symbols::_DEFAULT_SYMBOL) ) ) fhash.remove(Symbols::_DEFAULT_SYMBOL); } parser-3.5.1/src/types/pa_vmethod_frame.h0000644000076400007640000003374714726423015015373 00000000000000/** @file Parser: @b method_frame write context Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VMETHOD_FRAME_H #define PA_VMETHOD_FRAME_H #define IDENT_PA_VMETHOD_FRAME_H "$Id: pa_vmethod_frame.h,v 1.144 2024/12/11 23:53:49 moko Exp $" #include "pa_symbols.h" #include "pa_wcontext.h" #include "pa_vvoid.h" #include "pa_vjunction.h" // forwards class Request; /** @b method parameters passed in this array. contains handy typecast ad junction/not junction ensurers */ class MethodParams { public: MethodParams() : felements(0), fsize(0) {} #ifdef USE_DESTRUCTORS ~MethodParams() { Value **flast=felements+count(); for(Value **current=felements;currentget_junction(); if (junction && junction->code) delete (VJunction*)(*current); } } #endif void store_params(Value **params, size_t count) { felements=params; fsize=count; } inline size_t count() const { return fsize; } inline Value& get(size_t index) const { assert(indexget_string() : WContext::get_string(); } /// VParserMethodFrame: my or self_transparent or $caller override Value* get_element(const String& aname) { if(SYMBOLS_EQ(aname,RESULT_SYMBOL)) return my_result ? my_result : VVoid::get(); if(SYMBOLS_EQ(aname,CALLER_SYMBOL)) return get_caller_wrapper(); if(SYMBOLS_EQ(aname,SELF_SYMBOL)) return &self(); if(Value* result=my.get(aname)) return result; if(Value* result=self().get_element(aname)) return result; return 0; } /// VParserMethodFrame: my or self_transparent override const VJunction* put_element(const String& aname, Value* avalue) { if(SYMBOLS_EQ(aname,RESULT_SYMBOL)){ my_result=avalue; #ifdef OPTIMIZE_RESULT // This check is only for maintaining consistency. Even if we change the mode from RO_USE_WCONTEXT, it will not work because // CO_WITHOUT_WCONTEXT is also active. In this mode writes go directly to the parent context and result() is never called. // If we also change CO_WITHOUT_WCONTEXT, the current method call will still continue writing to the parent context and // result() will not be called. Only subsequent method calls will use $result. // The current behavior is more predictable: the first method call determines result_optimization, and subsequent calls never change it. if(method.result_optimization==Method::RO_UNKNOWN) ((Method *)&method)->result_optimization=Method::RO_USE_RESULT; #endif return 0; } if(my.put_replaced(aname, avalue)) return 0; return self().put_element(aname, avalue); } public: // WContext /// VParserMethodFrame: skip write when RO_USE_RESULT override void write(const String& astring) { #ifdef OPTIMIZE_RESULT if(method.result_optimization != Method::RO_USE_RESULT) #endif WContext::write(astring); } override void write(Value& avalue) { WContext::write(avalue); } override ValueRef result() { // if we have $result, return it, else return as usual: accumulated fstring or fvalue if(my_result) return my_result; #ifdef OPTIMIZE_RESULT if(method.result_optimization==Method::RO_USE_RESULT) return VVoid::get(); // Due to call optimization, the following code is called only once. // CO_WITHOUT_WCONTEXT means subsequent writes will be to the parent context, and the result() won't be called. ((Method *)&method)->result_optimization=Method::RO_USE_WCONTEXT; #ifdef OPTIMIZE_CALL // nested as CO_WITHOUT_WCONTEXT assumes that $result not used ((Method *)&method)->call_optimization=Method::CO_WITHOUT_WCONTEXT; #endif #endif return WContext::result(); } public: // usage HashString my; // public for ^stack[] Value* my_result; VParserMethodFrame(const Method& amethod, VMethodFrame *acaller, Value& aself); void store_params(Value **params, size_t count) { size_t param_count=method.params_count; size_t i=0; if(count>param_count){ for(; ias_hash("named parameter"); size_t named_count=method.named_params->count(); for(i=0; iget(fname) : NULL; set_my_variable(fname, arg ? arg : VVoid::get()); } } else throw Exception(PARSER_RUNTIME, method.name, "method of '%s' accepts maximum %d parameter(s) (%d present)", self().type(), param_count, count); } else { for(; icount(); for(i=0; i0){ set_my_variable(*(*method.params_names)[0], VString::empty()); for(size_t i=1; icount(); for(size_t i=0; iresult_optimization=Method::RO_USE_RESULT; #endif return; } my.put(aname, value); // remember param } Value* get_caller_wrapper(); }; class VLocalParserMethodFrame: public VParserMethodFrame { public: // Value override const VJunction* put_element(const String& aname, Value* avalue){ set_my_variable(aname, avalue); return 0; } public: // usage VLocalParserMethodFrame(const Method& amethod, VMethodFrame *acaller, Value& aself) : VParserMethodFrame(amethod, acaller, aself) {} }; template class VExpressionFrame: public Parent { public: VExpressionFrame(const Method& amethod, VMethodFrame *acaller, Value& aself) : Parent(amethod, acaller, aself) {} /// in expressions only strings are written as strings override void write_as_string(Value& avalue) { if(avalue.is_string()) Parent::write(*avalue.get_string()); else Parent::write(avalue); } }; template class VConstructorFrame: public Parent { public: VConstructorFrame(const Method& amethod, VMethodFrame *acaller, Value& aself) : Parent(amethod, acaller, aself) { // prevent non-string writes for better error reporting [constructors are not expected to return anything] VMethodFrame::write(aself); } override void write(const String& /*astring*/) {} }; #define METHOD_FRAME_ACTION(method, caller, self, action) \ if((method).native_code){ \ VNativeMethodFrame frame(method, caller, self); \ action; \ } else { \ if((method).all_vars_local){ \ VLocalParserMethodFrame frame(method, caller, self); \ action; \ } else { \ VParserMethodFrame frame(method, caller, self); \ action; \ } \ } #define EXPRESSION_FRAME_ACTION(method, caller, self, action) \ if((method).native_code){ \ VExpressionFrame frame(method, caller, self); \ action; \ } else { \ if((method).all_vars_local){ \ VLocalParserMethodFrame frame(method, caller, self); \ action; \ } else { \ VParserMethodFrame frame(method, caller, self); \ action; \ } \ } #define CONSTRUCTOR_FRAME_ACTION(method, caller, self, action) \ if((method).native_code){ \ VConstructorFrame frame(method, caller, self); \ action; \ } else { \ if((method).all_vars_local){ \ VConstructorFrame frame(method, caller, self); \ action; \ } else { \ VConstructorFrame frame(method, caller, self); \ action; \ } \ } #endif parser-3.5.1/src/types/pa_vregex.h0000644000076400007640000000617314713714200014037 00000000000000/** @file Parser: @b regex class decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_VREGEX_H #define PA_VREGEX_H #define IDENT_PA_VREGEX_H "$Id: pa_vregex.h,v 1.18 2024/11/09 17:14:40 moko Exp $" // include #include "classes.h" #include "pa_common.h" #include "pa_vstateless_object.h" #include "pa_charset.h" // defines #define VREGEX_TYPE "regex" enum Match_feature { MF_GLOBAL_SEARCH = 0x01, MF_NEED_PRE_POST_MATCH = 0x02, MF_JUST_COUNT_MATCHES = 0x04 }; extern Methoded* regex_class; // VRegex class VRegex: public VStateless_object { public: // Value override const char* type() const { return VREGEX_TYPE; } override VStateless_class *get_class() { return regex_class; } /// VRegex: PCRE_INFO_SIZE override int as_int() { return (int)get_info_size(); } /// VRegex: PCRE_INFO_SIZE override double as_double() { return (double)get_info_size(); } /// VRegex: scalar override Value& as_expr_result(); /// VRegex: true virtual bool is_defined() const { return true; } /// VRegex: true override bool as_bool() const { return true; } override Value* get_element(const String& aname); public: // usage #ifdef HAVE_PCRE2 static pcre2_general_context* fgen_ctxt; #endif VRegex(): fcharset(0), fpattern(0), foptions_cstr(0), fcode(0), #ifdef HAVE_PCRE2 fcmp_ctxt(0), fmatch_ctxt(0), fmatch_data(0) #else fextra(0), fstudied(false) #endif { foptions[0]=0; foptions[1]=0; } VRegex(Charset& acharset, const String* aregex, const String* aoptions): #ifdef HAVE_PCRE2 fcmp_ctxt(0), fmatch_ctxt(0), fmatch_data(0) #else fextra(0), fstudied(false) #endif { set(acharset, aregex, aoptions); compile(); } ~VRegex(){ #ifdef HAVE_PCRE2 pcre2_match_data_free(fmatch_data); pcre2_match_context_free(fmatch_ctxt); pcre2_compile_context_free(fcmp_ctxt); pcre2_code_free(fcode); #else if(fextra) pcre_free(fextra); if(fcode) pcre_free(fcode); #endif } void set(Charset& acharset, const String* aregex, const String* aoptions); void set(VRegex& avregex); void compile(); void study(); int exec(const char* string, size_t string_len, int* ovector, int ovector_size, int prestart=0); // size_t info(); size_t full_info(int type); size_t get_info_size(); size_t get_study_size(); size_t get_options(); bool is_pre_post_match_needed(){ return (foptions[1] & MF_NEED_PRE_POST_MATCH)!=0; } bool is_just_count(){ return (foptions[1] & MF_JUST_COUNT_MATCHES)!=0; } bool is_global_search(){ return (foptions[1] & MF_GLOBAL_SEARCH)!=0; } private: static void regex_options(const String* options, int* result); private: Charset* fcharset; const char* fpattern; const char* foptions_cstr; int foptions[2]; #ifdef HAVE_PCRE2 pcre2_code* fcode; pcre2_compile_context* fcmp_ctxt; pcre2_match_context* fmatch_ctxt; pcre2_match_data* fmatch_data; #else pcre* fcode; pcre_extra* fextra; bool fstudied; #endif }; class VRegexCleaner { public: VRegex *vregex; VRegexCleaner(): vregex(0) { } ~VRegexCleaner(){ if(vregex) delete vregex; } }; #endif parser-3.5.1/src/types/pa_vstatus.C0000644000076400007640000001606614726355563014226 00000000000000/** @file Parser: @b status class impl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian Win32 rusage author: Victor Fedoseev */ #include "pa_vstatus.h" #include "pa_cache_managers.h" #include "pa_vhash.h" #include "pa_vdouble.h" #include "pa_vstring.h" #include "pa_threads.h" volatile const char * IDENT_PA_VSTATUS_C="$Id: pa_vstatus.C,v 1.45 2024/12/11 18:35:31 moko Exp $" IDENT_PA_VSTATUS_H; #ifdef _MSC_VER #include #include "psapi.h" // should be in windows.h, but were't typedef struct _IO_COUNTERS_ { ULONGLONG ReadOperationCount; ULONGLONG WriteOperationCount; ULONGLONG OtherOperationCount; ULONGLONG ReadTransferCount; ULONGLONG WriteTransferCount; ULONGLONG OtherTransferCount; } IO_COUNTERS_; typedef IO_COUNTERS_ *PIO_COUNTERS_; typedef unsigned __int64 ui64; // kernel32.dll (NT/2K/XP) typedef BOOL (WINAPI *PGETPROCESSTIMES)(HANDLE,LPFILETIME,LPFILETIME,LPFILETIME,LPFILETIME); //typedef BOOL (WINAPI *PGETPROCESSHEAPS)(DWORD,PHANDLE); typedef BOOL (WINAPI *GETPROCESSIOCOUNTERS)(HANDLE,PIO_COUNTERS_); // psapi.dll (2K/XP) typedef BOOL (WINAPI *PGETPROCESSMEMORYINFO)(HANDLE,PPROCESS_MEMORY_COUNTERS,DWORD); // from CRT time.c /* * Number of 100 nanosecond units from 1/1/1601 to 1/1/1970 */ #define EPOCH_BIAS 116444736000000000i64 /* * Union to facilitate converting from FILETIME to unsigned __int64 */ typedef union { unsigned __int64 ft_scalar; FILETIME ft_struct; } FT; int gettimeofday(struct timeval *tv, void *) { FT ft; GetSystemTimeAsFileTime( &(ft.ft_struct) ); ft.ft_scalar -= EPOCH_BIAS; tv->tv_sec = (long)(ft.ft_scalar/10000000i64); tv->tv_usec = (long)((ft.ft_scalar- tv->tv_sec*10000000i64)/10i64); return 0; } #endif Value& rusage_element() { VHash& rusage=*new VHash; HashStringValue& hash=rusage.hash(); #ifdef _MSC_VER double d1; HANDLE hProc = GetCurrentProcess(); HMODULE hMod = LoadLibrary("kernel32.dll"); if(hMod){ // NT/2K/XP PGETPROCESSTIMES pGetProcessTimes = (PGETPROCESSTIMES)GetProcAddress(hMod, "GetProcessTimes"); if(pGetProcessTimes){ FILETIME CreationTime, ExitTime; FT KernelTime, UserTime; if(pGetProcessTimes(hProc, &CreationTime, &ExitTime, &KernelTime.ft_struct, &UserTime.ft_struct)){ // dwHighDateTime & dwLowDateTime - 1/10 000 000 seconds in 64 bit /* the amount of time that the process has executed in user mode */ d1 = double((LONGLONG)UserTime.ft_scalar)/10000000.0; hash.put("utime", new VDouble(d1)); /* the amount of time that the process has executed in kernel mode */ d1 = double((LONGLONG)KernelTime.ft_scalar)/10000000.0; hash.put("stime", new VDouble(d1)); } } // NT/2K/XP GETPROCESSIOCOUNTERS pGetProcessIoCounters = (GETPROCESSIOCOUNTERS)GetProcAddress(hMod, "GetProcessIoCounters"); if(pGetProcessIoCounters){ IO_COUNTERS_ ioc; if(pGetProcessIoCounters(hProc, &ioc)){ /* Specifies the number of I/O operations performed, other than read and write operations */ hash.put("OtherOperationCount", new VDouble(double((LONGLONG)ioc.OtherOperationCount))); /* Specifies the number of bytes transferred during operations other than read and write operations */ hash.put("OtherTransferCount", new VDouble(double((LONGLONG)ioc.OtherTransferCount)/1024.0)); /* Specifies the number of read operations performed */ hash.put("ReadOperationCount", new VDouble(double((LONGLONG)ioc.ReadOperationCount))); /* Specifies the number of bytes read */ hash.put("ReadTransferCount", new VDouble(double((LONGLONG)ioc.ReadTransferCount)/1024.0)); /* Specifies the number of write operations performed */ hash.put("WriteOperationCount", new VDouble(double((LONGLONG)ioc.WriteOperationCount))); /* Specifies the number of bytes written */ hash.put("WriteTransferCount", new VDouble(double((LONGLONG)ioc.WriteTransferCount)/1024.0)); } } FreeLibrary(hMod); /* PGETPROCESSHEAPS pGetProcessHeaps = (PGETPROCESSHEAPS)GetProcAddress(hMod, "GetProcessHeaps"); if(pGetProcessHeaps){ } */ } // 2K/XP hMod = LoadLibrary("psapi.dll"); if(hMod){ PGETPROCESSMEMORYINFO pGetProcessMemoryInfo = (PGETPROCESSMEMORYINFO)GetProcAddress(hMod, "GetProcessMemoryInfo"); if(pGetProcessMemoryInfo){ PROCESS_MEMORY_COUNTERS pmc; pmc.cb = sizeof(PROCESS_MEMORY_COUNTERS); if(pGetProcessMemoryInfo(hProc, &pmc, sizeof(PROCESS_MEMORY_COUNTERS))){ /* The peak working set size */ d1 = double(pmc.PeakWorkingSetSize)/1024.0; hash.put("maxrss", new VDouble(d1)); /* The peak nonpaged pool usage */ d1 = double(pmc.QuotaPeakNonPagedPoolUsage)/1024.0; hash.put("QuotaPeakNonPagedPoolUsage", new VDouble(d1)); /* The peak paged pool usage */ d1 = double(pmc.QuotaPeakPagedPoolUsage)/1024.0; hash.put("QuotaPeakPagedPoolUsage", new VDouble(d1)); /* The peak pagefile usage */ d1 = double(pmc.PeakPagefileUsage)/1024.0; hash.put("PeakPagefileUsage", new VDouble(d1)); } } FreeLibrary(hMod); } #else #ifdef HAVE_GETRUSAGE struct rusage u; if(getrusage(RUSAGE_SELF,&u)<0) throw Exception(0, 0, "getrusage failed (#%d)", errno); hash.put("utime", new VDouble(u.ru_utime.tv_sec+u.ru_utime.tv_usec/1000000.0)); hash.put("stime", new VDouble(u.ru_stime.tv_sec+u.ru_stime.tv_usec/1000000.0)); hash.put("maxrss", new VDouble(u.ru_maxrss)); hash.put("ixrss", new VDouble(u.ru_ixrss)); hash.put("idrss", new VDouble(u.ru_idrss)); hash.put("isrss", new VDouble(u.ru_isrss)); #endif #endif struct timeval tp; if(gettimeofday(&tp, NULL)<0) throw Exception(0, 0, "gettimeofday failed (#%d)", errno); hash.put("tv_sec", new VDouble(tp.tv_sec)); hash.put("tv_usec", new VDouble(tp.tv_usec)); return rusage; } #ifndef PA_DEBUG_DISABLE_GC Value& memory_element() { VHash& memory=*new VHash; HashStringValue& hash=memory.hash(); size_t heap_size=GC_get_heap_size(); size_t free_bytes=GC_get_free_bytes(); size_t bytes_since_gc=GC_get_bytes_since_gc(); size_t total_bytes=GC_get_total_bytes(); hash.put("used", new VDouble((heap_size-free_bytes)/1024.0)); hash.put("free", new VDouble(free_bytes/1024.0)); hash.put("ever_allocated_since_compact", new VDouble(bytes_since_gc/1024.0)); hash.put("ever_allocated_since_start", new VDouble(total_bytes/1024.0)); return memory; } #endif extern const char* parser3_mode; const char *parser3_log_filespec(); Value* VStatus::get_element(const String& aname) { #ifndef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL // CLASS, CLASS_NAME if(Value* result=VStateless_class::get_element(aname)) return result; #endif // getstatus if(Cache_manager* manager=cache_managers->get(aname)) return manager->get_status(); if(aname=="pid") return new VInt(getpid()); if(aname=="tid") return new VInt(pa_get_thread_id()); if(aname=="mode") return new VString(*new String(parser3_mode)); if(aname=="log-filename") return new VString(*new String(pa_strdup(parser3_log_filespec()))); if(aname=="rusage") return &rusage_element(); #ifndef PA_DEBUG_DISABLE_GC if(aname=="memory") return &memory_element(); #endif return 0; } parser-3.5.1/src/targets/0000755000076400007640000000000014740300546012270 500000000000000parser-3.5.1/src/targets/apache/0000755000076400007640000000000014740300546013511 500000000000000parser-3.5.1/src/targets/apache/Makefile.in0000644000076400007640000006236714740273416015521 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/targets/apache ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) am__DEPENDENCIES_1 = am_mod_parser3_la_OBJECTS = mod_parser3_core.lo \ mod_parser3_la-mod_parser3.lo mod_parser3_la_OBJECTS = $(am_mod_parser3_la_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/mod_parser3_core.Plo \ ./$(DEPDIR)/mod_parser3_la-mod_parser3.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(mod_parser3_la_SOURCES) DIST_SOURCES = $(mod_parser3_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ PA_LIBS = ../../classes/libclasses.la ../../types/libtypes.la ../../main/libmain.la ../../lib/gd/libgd.la \ ../../lib/cord/libcord.la ../../lib/md5/libmd5.la ../../lib/sdbm/libsdbm.la ../../lib/smtp/libsmtp.la \ ../../lib/pcre/libpcre_internal.la ../../lib/json/libjson.la ../../lib/memcached/libmemcached.la \ ../../lib/punycode/libpunycode.la AM_CPPFLAGS = $(APACHE_INC) -I./ -I../../classes -I../../types @XML_INCLUDES@ # Automake 1.9 does not support LIBTOOLFLAGS mod_parser3_la_LINK = $(LIBTOOL) --tag=CXX --tag=disable-static --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(mod_parser3_la_LDFLAGS) $(LDFLAGS) -o $@ noinst_HEADERS = pa_httpd.h lib_LTLIBRARIES = mod_parser3.la mod_parser3_la_SOURCES = mod_parser3_core.C mod_parser3.c mod_parser3_la_DEPENDENCIES = Makefile $(PA_LIBS) mod_parser3_la_LDFLAGS = -module -avoid-version mod_parser3_la_CFLAGS = $(APACHE_CFLAGS) mod_parser3_la_LIBADD = $(PA_LIBS) @GC_LIBS@ @PCRE_LIBS@ @XML_LIBS@ @MIME_LIBS@ $(LIBLTDL) all: all-am .SUFFIXES: .SUFFIXES: .C .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/targets/apache/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/targets/apache/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } mod_parser3.la: $(mod_parser3_la_OBJECTS) $(mod_parser3_la_DEPENDENCIES) $(EXTRA_mod_parser3_la_DEPENDENCIES) $(AM_V_GEN)$(mod_parser3_la_LINK) -rpath $(libdir) $(mod_parser3_la_OBJECTS) $(mod_parser3_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_parser3_core.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod_parser3_la-mod_parser3.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .C.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mod_parser3_la-mod_parser3.lo: mod_parser3.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_parser3_la_CFLAGS) $(CFLAGS) -MT mod_parser3_la-mod_parser3.lo -MD -MP -MF $(DEPDIR)/mod_parser3_la-mod_parser3.Tpo -c -o mod_parser3_la-mod_parser3.lo `test -f 'mod_parser3.c' || echo '$(srcdir)/'`mod_parser3.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mod_parser3_la-mod_parser3.Tpo $(DEPDIR)/mod_parser3_la-mod_parser3.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mod_parser3.c' object='mod_parser3_la-mod_parser3.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(mod_parser3_la_CFLAGS) $(CFLAGS) -c -o mod_parser3_la-mod_parser3.lo `test -f 'mod_parser3.c' || echo '$(srcdir)/'`mod_parser3.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/mod_parser3_core.Plo -rm -f ./$(DEPDIR)/mod_parser3_la-mod_parser3.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/mod_parser3_core.Plo -rm -f ./$(DEPDIR)/mod_parser3_la-mod_parser3.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/targets/apache/Makefile.am0000644000076400007640000000173413764677666015523 00000000000000PA_LIBS = ../../classes/libclasses.la ../../types/libtypes.la ../../main/libmain.la ../../lib/gd/libgd.la \ ../../lib/cord/libcord.la ../../lib/md5/libmd5.la ../../lib/sdbm/libsdbm.la ../../lib/smtp/libsmtp.la \ ../../lib/pcre/libpcre_internal.la ../../lib/json/libjson.la ../../lib/memcached/libmemcached.la \ ../../lib/punycode/libpunycode.la AM_CPPFLAGS = $(APACHE_INC) -I./ -I../../classes -I../../types @XML_INCLUDES@ # Automake 1.9 does not support LIBTOOLFLAGS mod_parser3_la_LINK = $(LIBTOOL) --tag=CXX --tag=disable-static --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(mod_parser3_la_LDFLAGS) $(LDFLAGS) -o $@ noinst_HEADERS = pa_httpd.h lib_LTLIBRARIES = mod_parser3.la mod_parser3_la_SOURCES = mod_parser3_core.C mod_parser3.c mod_parser3_la_DEPENDENCIES = Makefile $(PA_LIBS) mod_parser3_la_LDFLAGS = -module -avoid-version mod_parser3_la_CFLAGS = $(APACHE_CFLAGS) mod_parser3_la_LIBADD = $(PA_LIBS) @GC_LIBS@ @PCRE_LIBS@ @XML_LIBS@ @MIME_LIBS@ $(LIBLTDL) parser-3.5.1/src/targets/apache/mod_parser3_core.C0000644000076400007640000002035314726355563017003 00000000000000/** @file Parser: apache 1.3/2.X module, part, compiled by parser3project. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ volatile const char * IDENT_MOD_PARSER3_CORE_C="$Id: mod_parser3_core.C,v 1.43 2024/12/11 18:35:31 moko Exp $"; #include "pa_config_includes.h" #include "pa_globals.h" #include "pa_httpd.h" #include "pa_common.h" #include "pa_sapi.h" #include "classes.h" #include "pa_request.h" #if defined(_MSC_VER) && !defined(_DEBUG) # include # define PA_SUPPRESS_SYSTEM_EXCEPTION #endif // generals static bool globals_inited=false; const char* parser3_mode="apache"; // $status:mode const char *parser3_log_filespec(){ return ""; } // $status:log-filename void pa_setup_module_cells() { if(globals_inited) return; globals_inited=true; /// no trying to __try here [yet] try { // init libraries pa_globals_init(); } catch(const Exception& e) { // global problem SAPI::die("setup_module_cells failed: %s", e.comment()); } } void pa_destroy_module_cells() { if(!globals_inited) return; pa_globals_done(); } //@{ /// SAPI func decl class SAPI_Info { public: pa_request_rec* r; }; void SAPI::log(SAPI_Info& SAPI_info, const char* fmt, ...) { va_list args; va_start(args,fmt); char buf[MAX_LOG_STRING]; size_t size=vsnprintf(buf, MAX_LOG_STRING, fmt, args); size=remove_crlf(buf, buf+size); pa_ap_log_rerror(0, 0, PA_APLOG_ERR | PA_APLOG_NOERRNO, SAPI_info.r, "%s", buf); va_end(args); } void SAPI::die(const char* fmt, ...) { va_list args; va_start(args, fmt); char buf[MAX_LOG_STRING]; size_t size=vsnprintf(buf, MAX_LOG_STRING, fmt, args); size=remove_crlf(buf, buf+size); pa_ap_log_error(PA_APLOG_MARK, PA_APLOG_EMERG, 0, "%s", buf); exit(1); // va_end(args); } void SAPI::send_error(SAPI_Info& SAPI_info, const char *exception_cstr, const char *status){ // capitalized headers passed for preventing malloc during capitalization add_header_attribute(SAPI_info, HTTP_STATUS_CAPITALIZED, status); add_header_attribute(SAPI_info, HTTP_CONTENT_TYPE_CAPITALIZED, "text/plain"); send_headers(SAPI_info); send_body(SAPI_info, exception_cstr, strlen(exception_cstr)); } char* SAPI::Env::get(SAPI_Info& SAPI_info, const char* name) { const char* dont_return_me=pa_ap_table_get(SAPI_info.r->subprocess_env, name); return dont_return_me?pa_strdup(dont_return_me):0; } bool SAPI::Env::set(SAPI_Info&, const char*, const char*) { return false; } #ifndef DOXYGEN struct SAPI_environment_append_info { const char** cur; }; #endif static int SAPI_environment_append(void *d, const char* k, const char* val) { if(k && val) { SAPI_environment_append_info& info=*static_cast(d); *info.cur++=pa_strcat(k, "=", val); } return 1/*true*/; } const char* const* SAPI::Env::get(SAPI_Info& SAPI_info) { const pa_table *t=SAPI_info.r->subprocess_env; const char** result=new(PointerGC) const char*[pa_ap_table_size(t)+1/*0*/]; SAPI_environment_append_info info={result}; pa_ap_table_do(SAPI_environment_append, &info, t, 0); *info.cur=0; // mark EOE return result; } size_t SAPI::read_post(SAPI_Info& SAPI_info, char *buf, size_t max_bytes) { // pa_ap_log_error(PA_APLOG_MARK, PA_APLOG_DEBUG, SAPI_info.r->server, "mod_parser3: SAPI::read_post(max=%u)", max_bytes); int retval; if((retval = pa_ap_setup_client_block(SAPI_info.r, PA_REQUEST_CHUNKED_ERROR))) return 0; if(!pa_ap_should_client_block(SAPI_info.r)) return 0; uint total_read_bytes=0; void (*handler)(int)=pa_signal(PA_SIGPIPE, PA_SIG_IGN); while (total_read_bytesstatus=302; if(strcasecmp(dont_store_key, HTTP_CONTENT_TYPE)==0) { /* r->content_type, *not* r->headers_out("Content-type"). If you don't * set it, it will be filled in with the server's default type (typically * "text/plain"). You *must* also ensure that r->content_type is lower * case. */ *SAPI_info.r->content_type = pa_ap_pstrdup(SAPI_info.r->pool, dont_store_value); } else if(strcasecmp(dont_store_key, HTTP_STATUS)==0) *SAPI_info.r->status=atoi(dont_store_value); else pa_ap_table_addn(SAPI_info.r->headers_out, pa_ap_pstrdup(SAPI_info.r->pool, capitalize(dont_store_key)), pa_ap_pstrdup(SAPI_info.r->pool, dont_store_value)); } void SAPI::send_headers(SAPI_Info& SAPI_info) { pa_ap_hard_timeout("Send header", SAPI_info.r); pa_ap_send_http_header(SAPI_info.r); pa_ap_kill_timeout(SAPI_info.r); } void SAPI::clear_headers(SAPI_Info&) { } size_t SAPI::send_body(SAPI_Info& SAPI_info, const void *buf, size_t size) { pa_ap_hard_timeout("Send body", SAPI_info.r); size = (size_t)pa_ap_rwrite(buf, size, SAPI_info.r); pa_ap_kill_timeout(SAPI_info.r); return size; } //@} /** main workhorse @todo intelligent cache-control */ static void real_parser_handler(SAPI_Info& SAPI_info, Parser_module_config *dcfg) { // collect garbage from prev request pa_gc_collect(); // populate env pa_ap_add_common_vars(SAPI_info.r); pa_ap_add_cgi_vars(SAPI_info.r); // Request info Request_info request_info; memset(&request_info, 0, sizeof(request_info)); request_info.document_root=SAPI::Env::get(SAPI_info, "DOCUMENT_ROOT"); request_info.path_translated=SAPI_info.r->filename; request_info.method=SAPI_info.r->method; request_info.query_string=SAPI_info.r->args; request_info.uri=request_info.strip_absolute_uri(SAPI::Env::get(SAPI_info, "REQUEST_URI")); request_info.content_type=SAPI::Env::get(SAPI_info, "CONTENT_TYPE"); request_info.content_length=pa_atoul(SAPI::Env::get(SAPI_info, "CONTENT_LENGTH")); request_info.cookie=SAPI::Env::get(SAPI_info, "HTTP_COOKIE"); request_info.mail_received=false; // prepare to process request Request request(SAPI_info, request_info, String::Language(String::L_HTML|String::L_OPTIMIZE_BIT)); // process the request const char *config=dcfg->parser_config_filespec; #ifdef SYSTEM_CONFIG_FILE if(!config && entry_exists(SYSTEM_CONFIG_FILE)){ config=SYSTEM_CONFIG_FILE; } #endif request.core(config, SAPI_info.r->header_only!=0); } #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION static const Exception call_real_parser_handler__do_PEH_return_it(SAPI_Info& SAPI_info, Parser_module_config *dcfg) { try { real_parser_handler(SAPI_info, dcfg); } catch(const Exception& e) { return e; } return Exception(); } static void call_real_parser_handler__supress_system_exception(SAPI_Info& SAPI_info, Parser_module_config *dcfg) { Exception parser_exception; LPEXCEPTION_POINTERS system_exception=0; __try { parser_exception=call_real_parser_handler__do_PEH_return_it(SAPI_info, dcfg); } __except ( (system_exception=GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) { if(system_exception) if(_EXCEPTION_RECORD *er=system_exception->ExceptionRecord) throw Exception("system", 0, "0x%08X at 0x%08X", er->ExceptionCode, er->ExceptionAddress); else throw Exception("system", 0, ""); else throw Exception("system", 0, ""); } if(parser_exception) throw Exception(parser_exception); } #endif /// @test r->finfo.st_mode check seems to work only on win32 int pa_parser_handler(pa_request_rec *r, Parser_module_config *dcfg) { // SAPI info SAPI_Info SAPI_info; SAPI_info.r=r; if(r->file_not_found) return PA_HTTP_NOT_FOUND; try { // global try #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION call_real_parser_handler__supress_system_exception( #else real_parser_handler( #endif SAPI_info, dcfg); // successful finish } catch(const Exception& e) { // just in case // log it SAPI::log(SAPI_info, "%s", e.comment()); SAPI::send_error(SAPI_info, e.comment()); } /* * We did what we wanted to do, so tell the rest of the server we * succeeded. */ return PA_OK; } parser-3.5.1/src/targets/apache/mod_parser3.c0000644000076400007640000002247314712042465016025 00000000000000/** @file Parser: apache 1.3 and 2.2 module Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "httpd.h" #include "http_config.h" #include "http_core.h" #include "http_log.h" #include "http_main.h" #include "http_protocol.h" #include "util_script.h" #include "pa_httpd.h" volatile const char * IDENT_MOD_PARSER3_C="$Id: mod_parser3.c,v 1.24 2024/11/04 03:53:25 moko Exp $" IDENT_PA_HTTPD_H; #define PARSER3_HANDLER "parser3-handler" /* * To Ease Compatibility */ #ifdef STANDARD20_MODULE_STUFF #include "apr_strings.h" #include "ap_mpm.h" #define ap_pcalloc apr_pcalloc #define ap_pstrdup apr_pstrdup #define ap_table_get apr_table_get #define ap_table_elts apr_table_elts #define ap_table_addn apr_table_addn #define ap_table_do apr_table_do #else #include "ap_alloc.h" #define apr_pool_t pool #define apr_table_t table #endif /* STANDARD20_MODULE_STUFF */ /* * Declare ourselves so the configuration routines can find and know us. * We'll fill it in at the end of the module. */ #ifdef STANDARD20_MODULE_STUFF module AP_MODULE_DECLARE_DATA parser3_module; static int is_threaded = 0; #else module MODULE_VAR_EXPORT parser3_module; #endif /* * Locate our directory configuration record for the current request. */ static Parser_module_config *our_dconfig(request_rec *r) { return (Parser_module_config *) ap_get_module_config(r->per_dir_config, &parser3_module); } static const char* cmd_parser_config(cmd_parms *cmd, void *mconfig, const char *file_spec) { Parser_module_config *cfg = (Parser_module_config *) mconfig; cfg->parser_config_filespec=file_spec; return NULL; } /* * Now let's declare routines for each of the callback phase in order. */ static int parser_handler(request_rec *r) { #ifdef STANDARD20_MODULE_STUFF if(strcmp(r->handler, PARSER3_HANDLER)) return DECLINED; if(is_threaded){ const char *message="Parser3 module requires 'a2enmod mpm_prefork'"; r->status=HTTP_INTERNAL_SERVER_ERROR; r->content_type="text/plain"; ap_rwrite(message, strlen(message), r); return OK; } #endif // we setup module here to avoid GPF on init with php5-xsl installed pa_setup_module_cells(); { // converting to parser version pa_request_rec pr={ r, r->pool, r->header_only, &r->status, r->method, r->headers_out, r->subprocess_env, &r->content_type, r->uri, r->filename, r->path_info, r->args, #ifdef STANDARD20_MODULE_STUFF r->finfo.filetype == 0 #else r->finfo.st_mode == 0 #endif }; return pa_parser_handler(&pr, our_dconfig(r)); } } /* * This function is called during process initialisation. */ #ifdef STANDARD20_MODULE_STUFF static void parser_child_init(apr_pool_t *p, server_rec *s) { #else static void parser_module_init(server_rec *s, apr_pool_t *p) { #endif // ap_log_perror(APLOG_MARK, APLOG_EMERG, 0, p, "parser inited %d", getpid()); } /* * All our process-death routine does is add its trace to the log. */ static void parser_module_done(server_rec *s, apr_pool_t *p) { pa_destroy_module_cells(); } /* * This function gets called to create a per-directory configuration record. */ static void *parser_create_dir_config(apr_pool_t *p, char *dirspec) { Parser_module_config *cfg= ap_pcalloc(p, sizeof(Parser_module_config)); cfg->parser_config_filespec=NULL; return cfg; } /* * This function gets called to create a per-server configuration record. */ static void *parser_create_server_config(apr_pool_t *p, server_rec *s) { Parser_module_config *cfg= ap_pcalloc(p, sizeof(Parser_module_config)); cfg->parser_config_filespec=NULL; return cfg; } /* * List of directives specific to our module. */ static const command_rec parser_cmds[] = { {"ParserConfig", (const char *(*)())cmd_parser_config, 0, OR_OPTIONS, TAKE1, "Parser config filespec"}, {NULL} }; /*--------------------------------------------------------------------------*/ /* Now the list of content handlers available from this module. */ /*--------------------------------------------------------------------------*/ #ifndef STANDARD20_MODULE_STUFF static const handler_rec parser_handlers[] = { {PARSER3_HANDLER, parser_handler}, {NULL} }; #endif /*--------------------------------------------------------------------------*/ /* Finally, the list of callback routines and data structures that */ /* provide the hooks into our module from the other parts of the server. */ /*--------------------------------------------------------------------------*/ #ifdef STANDARD20_MODULE_STUFF /* * register hooks. */ static void parser_register_hooks(apr_pool_t* pool) { int mpm_query_info; is_threaded = ap_mpm_query(AP_MPMQ_IS_THREADED, &mpm_query_info) == APR_SUCCESS && mpm_query_info != AP_MPMQ_NOT_SUPPORTED; ap_hook_handler(parser_handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_child_init(parser_child_init, NULL, NULL, APR_HOOK_MIDDLE); }; module AP_MODULE_DECLARE_DATA parser3_module = { STANDARD20_MODULE_STUFF, #else module MODULE_VAR_EXPORT parser3_module = { STANDARD_MODULE_STUFF, parser_module_init, /* module initializer */ #endif parser_create_dir_config, /* per-directory config creator */ 0, /* dir config merger */ parser_create_server_config, /* server config creator */ 0, /* server config merger */ parser_cmds, /* command apr_table_t */ #ifdef STANDARD20_MODULE_STUFF parser_register_hooks /* register hooks */ #else parser_handlers, /* [9] list of handlers */ 0, /* [2] filename-to-URI translation */ 0, /* [5] check/validate user_id */ 0, /* [6] check user_id is valid *here* */ 0, /* [4] check access by host address */ 0, /* [7] MIME type checker/setter */ 0, /* [8] fixups */ 0, /* [10] logger */ 0, /* [3] header parser */ 0, /* process initializer */ parser_module_done /* process exit/cleanup */ #endif // STANDARD20_MODULE_STUFF }; #if defined(_MSC_VER) # define APACHE_WIN32_SRC "../../../../win32/apache22/" # ifdef _DEBUG # pragma comment(lib, APACHE_WIN32_SRC "srclib/apr/Debug/libapr-1.lib") # pragma comment(lib, APACHE_WIN32_SRC "Debug/libhttpd.lib") # else # pragma comment(lib, APACHE_WIN32_SRC "srclib/apr/Release/libapr-1.lib") # pragma comment(lib, APACHE_WIN32_SRC "Release/libhttpd.lib") # endif #endif // interface to C++ void pa_ap_log_rerror(const char *file, int line, int level, const pa_request_rec *s, const char *fmt, ...) { const char* str; va_list l; va_start(l, fmt); str=va_arg(l, const char*); va_end(l); ap_log_rerror(file, line, #if (AP_SERVER_MAJORVERSION_NUMBER == 2) && (AP_SERVER_MINORVERSION_NUMBER >= 4) APLOG_MODULE_INDEX, #endif level, #ifdef STANDARD20_MODULE_STUFF 0, #endif (request_rec*)s->real_request_rec, "%s", str); } void pa_ap_log_error(const char *file, int line, int level, const pa_server_rec *s, const char *fmt, ...) { const char* str; va_list l; va_start(l, fmt); str=va_arg(l, const char*); va_end(l); ap_log_error(file, line, #if (AP_SERVER_MAJORVERSION_NUMBER == 2) && (AP_SERVER_MINORVERSION_NUMBER >= 4) APLOG_MODULE_INDEX, #endif level, #ifdef STANDARD20_MODULE_STUFF 0, #endif (server_rec*)s, "%s", str); } // ap_alloc.h const char* pa_ap_table_get(const pa_table *t, const char *name) { return ap_table_get((const apr_table_t*)t, name); } void pa_ap_table_addn(pa_table *t, const char *name, const char *val) { ap_table_addn((apr_table_t*)t, name, val); } int pa_ap_table_size(const pa_table *t) { return ap_table_elts((const apr_table_t*)t)->nelts; } void pa_ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const pa_table *t, ...) { ap_table_do(comp, rec, (apr_table_t*)t, NULL); } char * pa_ap_pstrdup(pa_pool *p, const char *s) { return ap_pstrdup((apr_pool_t*)p, s); } // http_protocol.h int pa_ap_setup_client_block(pa_request_rec *r, int read_policy) { return ap_setup_client_block((request_rec*)r->real_request_rec, read_policy); } int pa_ap_should_client_block(pa_request_rec *r) { return ap_should_client_block((request_rec*)r->real_request_rec); } long pa_ap_get_client_block(pa_request_rec *r, char *buffer, int bufsiz) { return ap_get_client_block((request_rec*)r->real_request_rec, buffer, bufsiz); } void pa_ap_send_http_header(pa_request_rec *r) { // Apache2 send headers before body automatically #ifndef STANDARD20_MODULE_STUFF ap_send_http_header((request_rec*)r->real_request_rec); #endif } int pa_ap_rwrite(const void *buf, int nbyte, pa_request_rec *r) { return ap_rwrite(buf, nbyte, (request_rec*)r->real_request_rec); } // http_main.h void pa_ap_hard_timeout(const char *s, pa_request_rec *r) { // Apache 2 uses non-blocking I/O #ifndef STANDARD20_MODULE_STUFF ap_hard_timeout((char *)s, (request_rec*)r->real_request_rec); #endif } void pa_ap_reset_timeout(pa_request_rec *r) { #ifndef STANDARD20_MODULE_STUFF ap_reset_timeout((request_rec*)r->real_request_rec); #endif } void pa_ap_kill_timeout(pa_request_rec *r) { #ifndef STANDARD20_MODULE_STUFF ap_kill_timeout((request_rec*)r->real_request_rec); #endif } // util_script.h void pa_ap_add_cgi_vars(pa_request_rec *r) { ap_add_cgi_vars((request_rec*)r->real_request_rec); } void pa_ap_add_common_vars(pa_request_rec *r) { ap_add_common_vars((request_rec*)r->real_request_rec); } // signal.h void (*pa_signal (int sig, void (*disp)(int)))(int) { #ifndef _MSC_VER if(sig==PA_SIGPIPE && disp==PA_SIG_IGN) return signal(SIGPIPE, SIG_IGN); #endif return 0; } parser-3.5.1/src/targets/apache/pa_httpd.h0000644000076400007640000000764214712042465015420 00000000000000/** @file Parser: http wrapper. Copyright (c) 2003-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef PA_HTTPD_H #define PA_HTTPD_H #define IDENT_PA_HTTPD_H "$Id: pa_httpd.h,v 1.10 2024/11/04 03:53:25 moko Exp $"; #ifdef __cplusplus extern "C" { #endif // import from c to c++ typedef void pa_pool; typedef void pa_server_rec; typedef void pa_table; typedef struct pa_request_rec_tag { void* real_request_rec; pa_pool* pool; int header_only; /* HEAD request, as opposed to GET */ int* status; const char *method; /* GET, HEAD, POST, etc. */ pa_table *headers_out; void* subprocess_env; const char ** content_type; char *uri; /* the path portion of the URI */ char *filename; /* filename if found, otherwise NULL */ char *path_info; char *args; /* QUERY_ARGS, if any */ int file_not_found; /* non-zero if no such file */ } pa_request_rec; /// apache parser module configuration [httpd.conf + .htaccess-es] typedef struct Parser_module_config_tag { const char* parser_config_filespec; ///< filespec of site's config file } Parser_module_config; void pa_setup_module_cells(); void pa_destroy_module_cells(); int pa_parser_handler(pa_request_rec*, Parser_module_config*); // export from c to c++ // http_log.h #define PA_APLOG_EMERG 0 /* system is unusable */ #define PA_APLOG_ALERT 1 /* action must be taken immediately */ #define PA_APLOG_CRIT 2 /* critical conditions */ #define PA_APLOG_ERR 3 /* error conditions */ #define PA_APLOG_WARNING 4 /* warning conditions */ #define PA_APLOG_NOTICE 5 /* normal but significant condition */ #define PA_APLOG_INFO 6 /* informational */ #define PA_APLOG_DEBUG 7 /* debug-level messages */ #define PA_APLOG_LEVELMASK 7 /* mask off the level value */ #define PA_APLOG_NOERRNO (PA_APLOG_LEVELMASK + 1) #define PA_APLOG_MARK __FILE__,__LINE__ void pa_ap_log_rerror(const char *file, int line, int level, const pa_request_rec *s, const char *fmt, ...); void pa_ap_log_error(const char *file, int line, int level, const pa_server_rec *s, const char *fmt, ...); // ap_alloc.h const char * pa_ap_table_get(const pa_table *, const char *); void pa_ap_table_addn(pa_table *, const char *name, const char *val); int pa_ap_table_size(const pa_table *); void pa_ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const pa_table *t,...); char * pa_ap_pstrdup(pa_pool *, const char *s); // http_protocol.h /* Possible values for request_rec.read_body (set by handling module): * REQUEST_NO_BODY Send 413 error if message has any body * REQUEST_CHUNKED_ERROR Send 411 error if body without Content-Length * REQUEST_CHUNKED_DECHUNK If chunked, remove the chunks for me. * REQUEST_CHUNKED_PASS Pass the chunks to me without removal. */ #define PA_REQUEST_NO_BODY 0 #define PA_REQUEST_CHUNKED_ERROR 1 #define PA_REQUEST_CHUNKED_DECHUNK 2 #define PA_REQUEST_CHUNKED_PASS 3 int pa_ap_setup_client_block(pa_request_rec *r, int read_policy); int pa_ap_should_client_block(pa_request_rec *r); long pa_ap_get_client_block(pa_request_rec *r, char *buffer, int bufsiz); void pa_ap_send_http_header(pa_request_rec *l); int pa_ap_rwrite(const void *buf, int nbyte, pa_request_rec *r); // http_main.h void pa_ap_hard_timeout(const char *, pa_request_rec *); void pa_ap_reset_timeout(pa_request_rec *); void pa_ap_kill_timeout(pa_request_rec *); // util_script.h void pa_ap_add_cgi_vars(pa_request_rec *r); void pa_ap_add_common_vars(pa_request_rec *r); // httpd.h #define PA_HTTP_NOT_FOUND 404 #define PA_OK 0 /* Module has handled this stage. */ // signal.h #define PA_SIGPIPE 1 /* must translate to real one */ #define PA_SIG_IGN (void (*)(int))1 /* must translate to real one */ void (*pa_signal (int sig, void (*disp)(int)))(int); #ifdef __cplusplus } #endif #endif parser-3.5.1/src/targets/Makefile.in0000644000076400007640000004616714740273416014300 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/targets ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = cgi isapi apache am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ #don't compile apache @COMPILE_APACHE_MODULE_FALSE@SUBDIRS = cgi isapi @COMPILE_APACHE_MODULE_TRUE@SUBDIRS = apache cgi all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/targets/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/targets/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/targets/Makefile.am0000644000076400007640000000014311763355105014245 00000000000000if COMPILE_APACHE_MODULE SUBDIRS = apache cgi else #don't compile apache SUBDIRS = cgi isapi endif parser-3.5.1/src/targets/cgi/0000755000076400007640000000000014740300546013032 500000000000000parser-3.5.1/src/targets/cgi/Makefile.in0000644000076400007640000005204514740273416015032 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = parser3$(EXEEXT) subdir = src/targets/cgi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_parser3_OBJECTS = parser3.$(OBJEXT) parser3_OBJECTS = $(am_parser3_OBJECTS) am__DEPENDENCIES_1 = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/parser3.Po am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(parser3_SOURCES) DIST_SOURCES = $(parser3_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # Parser has circular library dependencies, thus libmain.a is linked twice and --preserve-dup-deps libtool option is used PA_LIBS = ../../main/.libs/libmain.a ../../classes/.libs/libclasses.a ../../types/.libs/libtypes.a ../../main/.libs/libmain.a \ ../../lib/gd/libgd.la ../../lib/cord/libcord.la ../../lib/md5/libmd5.la ../../lib/sdbm/libsdbm.la \ ../../lib/pcre/libpcre_internal.la ../../lib/smtp/libsmtp.la ../../lib/json/libjson.la \ ../../lib/punycode/libpunycode.la ../../lib/memcached/libmemcached.la AM_CPPFLAGS = -I../../classes -I../../types @PCRE_INCLUDES@ @XML_INCLUDES@ # Automake 1.9 does not support LIBTOOLFLAGS CXXLINK = $(LIBTOOL) --preserve-dup-deps --mode=link --tag=CXX $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ noinst_HEADERS = pa_sapi_info.h parser3_DEPENDENCIES = Makefile $(PA_LIBS) parser3_SOURCES = parser3.C parser3_LDADD = $(PA_LIBS) $(LIBLTDL) @GC_LIBS@ @PCRE_LIBS@ @XML_LIBS@ @MIME_LIBS@ EXTRA_DIST = parser3.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/targets/cgi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/targets/cgi/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list parser3$(EXEEXT): $(parser3_OBJECTS) $(parser3_DEPENDENCIES) $(EXTRA_parser3_DEPENDENCIES) @rm -f parser3$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(parser3_OBJECTS) $(parser3_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser3.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .C.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/parser3.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/parser3.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/targets/cgi/parser3.C0000644000076400007640000005220614730704522014443 00000000000000/** @file Parser: scripting and CGI main. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ volatile const char * IDENT_PARSER3_C="$Id: parser3.C,v 1.367 2024/12/19 02:47:46 moko Exp $"; #include "pa_config_includes.h" #include "pa_sapi.h" #include "classes.h" #include "pa_common.h" #include "pa_request.h" #include "pa_version.h" #include "pa_threads.h" #include "pa_vconsole.h" #include "pa_sapi_info.h" #ifdef _MSC_VER #include #include #include extern "C" HANDLE WINAPI GC_CreateThread(LPSECURITY_ATTRIBUTES, DWORD, LPTHREAD_START_ROUTINE, LPVOID, DWORD, LPDWORD); #else extern "C" int GC_pthread_create(pthread_t *, const pthread_attr_t *, void *(*)(void *), void * /* arg */); #endif // defines // comment remove me after debugging //#define PA_DEBUG_CGI_ENTRY_EXIT #if defined(_MSC_VER) && !defined(_DEBUG) # define PA_SUPPRESS_SYSTEM_EXCEPTION #endif // consts #define REDIRECT_PREFIX "REDIRECT_" #define PARSER_CONFIG_ENV_NAME "CGI_PARSER_CONFIG" #define PARSER_LOG_ENV_NAME "CGI_PARSER_LOG" SAPI_Info sapi_console; SAPI_Info_CGI sapi_cgi; static SAPI_Info *sapi_info = &sapi_cgi; static THREAD_LOCAL SAPI_Info *sapi_info_4log = NULL; // global for correct send error in die() const char* parser3_mode = "cgi"; // $status:mode static const char* filespec_to_process = 0; // [file] static const char* httpd_host_port = 0; // -p option static const char* config_filespec = 0; // -f option or from env or next to the executable if exists static const char* log_filespec = 0; // -l option static bool mail_received = false; // -m option? [asked to parse incoming message to $mail:received] static const char* parser3_filespec = 0; // argv[0] static char** argv_extra = NULL; // for error logging static THREAD_LOCAL Request_info *request_info_4log = NULL; // global for correct log() reporting static const char* filespec_4log = NULL; // null only if system-wide auto.p used template static T *dir_pos(T *fname){ T *result=NULL; while (fname=strpbrk(fname, "/\\")){ result=fname; fname++; } return result; } const char *parser3_log_filespec() { // $status:log-filename const char* slog=log_filespec; if(!slog) slog=getenv(PARSER_LOG_ENV_NAME); if(!slog) slog=getenv(REDIRECT_PREFIX PARSER_LOG_ENV_NAME); if(!slog) { static char log_spec[MAX_STRING + 12 /* '/parser3.log' */]; pa_strncpy(log_spec, filespec_4log, MAX_STRING); if(char* log_dir_pos=dir_pos(log_spec)){ strcpy(log_dir_pos, "/parser3.log"); } else { // no path, just filename strcpy(log_spec, "./parser3.log"); } slog=log_spec; } return slog; } // SAPI static void pa_log(const char* fmt, va_list args) { // use no memory [so that we could log out-of-memory error] const char* slog=parser3_log_filespec(); FILE *f=strcmp(slog,"-") ? fopen(slog, "at") : stderr; // fallback to stderr if(!f) f=stderr; setbuf(f, 0); // stderr stream is unbuffered by default, but still... // prefix time_t t=time(0); if(const char* stamp=ctime(&t)) { // never saw that if(size_t len=strlen(stamp)) // saw once stamp being ="" fprintf(f, "[%.*s] [%u] ", (int)len-1, stamp, (unsigned int)pa_get_thread_id() ); } // message char buf[MAX_LOG_STRING]; size_t size=vsnprintf(buf, MAX_LOG_STRING, fmt, args); size=remove_crlf(buf, buf+size); fwrite(buf, size, 1, f); if(request_info_4log && request_info_4log->method) { fprintf(f, " [uri=%s, method=%s, cl=%lu]\n", request_info_4log->uri ? request_info_4log->uri : "", request_info_4log->method, (unsigned long)request_info_4log->content_length); } else fputs(" [no request info]\n", f); if(f!=stderr) fclose(f); else fflush(f); } void pa_log(const char* fmt, ...) { va_list args; va_start(args,fmt); pa_log(fmt, args); va_end(args); } // appends to parser3.log located next to the config file if openable, to stderr otherwize void SAPI::log(SAPI_Info&, const char* fmt, ...) { va_list args; va_start(args,fmt); pa_log(fmt, args); va_end(args); } void SAPI::die(const char* fmt, ...) { va_list args; // logging first, first vsnprintf va_start(args,fmt); pa_log(fmt, args); va_end(args); // inform user, second vsnprintf va_start(args, fmt); char message[MAX_STRING]; vsnprintf(message, MAX_STRING, fmt, args); SAPI::send_error(sapi_info_4log ? *sapi_info_4log : *sapi_info, message); exit(1); // va_end(args); } void SAPI::send_error(SAPI_Info& info, const char *exception_cstr, const char *status){ info.send_error(exception_cstr, status); } char* SAPI::Env::get(SAPI_Info& info, const char* name) { return info.get_env(name); } bool SAPI::Env::set(SAPI_Info& info, const char* name, const char* value) { return info.set_env(name, value); } const char* const *SAPI::Env::get(SAPI_Info& info) { return info.get_env(); } size_t SAPI::read_post(SAPI_Info& info, char* buf, size_t max_bytes) { return info.read_post(buf, max_bytes); } void SAPI::add_header_attribute(SAPI_Info& info, const char* dont_store_key, const char* dont_store_value) { info.add_header(dont_store_key, dont_store_value); } void SAPI::send_headers(SAPI_Info& info) { info.send_headers(); } void SAPI::clear_headers(SAPI_Info& info) { info.clear_headers(); } size_t SAPI::send_body(SAPI_Info& info, const void *buf, size_t size) { return info.send_body(buf, size); } static const char* full_disk_path(const char* file_name = "") { char* result; if(file_name[0]=='/' #ifdef WIN32 || file_name[0] && file_name[1]==':' #endif ){ result=pa_strdup(file_name); } else { char cwd[MAX_STRING]; result=pa_strcat(getcwd(cwd, MAX_STRING) ? cwd : "", "/", file_name); } #ifdef WIN32 back_slashes_to_slashes(result); #endif return result; } static void log_signal(const char* signal_name) { pa_log("%s received %s processing request", signal_name, request ? "while" : "before or after"); } #ifdef SIGPIPE #define SIGPIPE_NAME "SIGPIPE" static const String sigpipe_name(SIGPIPE_NAME); static void SIGPIPE_handler(int /*sig*/){ Value* sigpipe=0; if(request) sigpipe=request->main_class.get_element(sigpipe_name); if(sigpipe && sigpipe->as_bool()) log_signal(SIGPIPE_NAME); if(request) request->set_skip(Request::SKIP_INTERRUPTED); } #endif // requires pa_thread_request() in entry_exists() under Windows static const char* locate_config(const char* config_filespec_option, const char* executable_path){ filespec_4log=config_filespec_option; if(!filespec_4log) filespec_4log=getenv(PARSER_CONFIG_ENV_NAME); if(!filespec_4log) filespec_4log=getenv(REDIRECT_PREFIX PARSER_CONFIG_ENV_NAME); if(!filespec_4log){ const char* exec_dir_pos = dir_pos(executable_path); #ifdef SYSTEM_CONFIG_FILE if(exec_dir_pos){ #endif // next to the executable if(!exec_dir_pos || (exec_dir_pos==executable_path+1 && *executable_path=='.')){ // when just parser3 or ./parser3 full path should be used to avoid "parser already configured" filespec_4log=full_disk_path(AUTO_FILE_NAME); } else { filespec_4log=pa_strcat(pa_strdup(executable_path, exec_dir_pos - executable_path), "/" AUTO_FILE_NAME); } if(entry_exists(filespec_4log)) return filespec_4log; #ifdef SYSTEM_CONFIG_FILE } if(entry_exists(SYSTEM_CONFIG_FILE)){ filespec_4log=NULL; return SYSTEM_CONFIG_FILE; } #endif return NULL; } return filespec_4log; } #ifdef WIN32 static const char* maybe_reconstruct_IIS_status_in_qs(const char* original) { // 404;http://servername/page[?param=value...] // ';' should be urlencoded by HTTP standard, so we shouldn't get it from browser // and can consider that as an indication that this is IIS way to report errors if(original && isdigit((unsigned char)original[0]) && isdigit((unsigned char)original[1]) && isdigit((unsigned char)original[2]) && original[3]==';'){ size_t original_len=strlen(original); char* reconstructed=new(PointerFreeGC) char[original_len +12/*IIS-STATUS=&*/ +14/*IIS-DOCUMENT=&*/ +1]; char* cur=reconstructed; memcpy(cur, "IIS-STATUS=", 11); cur+=11; memcpy(cur, original, 3); cur+=3; *cur++='&'; const char* qmark_at=strchr(original, '?'); memcpy(cur, "IIS-DOCUMENT=", 13); cur+=13; { size_t value_len=(qmark_at ? qmark_at-original : original_len)-4; memcpy(cur, original+4, value_len); cur+=value_len; } if(qmark_at) { *cur++='&'; strcpy(cur, qmark_at+1/*skip ? itself*/); } else *cur=0; return reconstructed; } return original; } static const char* maybe_back_slashes_to_slashes(const char* original){ char *result=pa_strdup(original); back_slashes_to_slashes(result); return result; } #define MAYBE_RECONSTRUCT_IIS_STATUS_IN_QS(s) maybe_reconstruct_IIS_status_in_qs(s) #define MAYBE_BACK_SLASHES_TO_SLASHES(s) maybe_back_slashes_to_slashes(s) #else #define MAYBE_RECONSTRUCT_IIS_STATUS_IN_QS(s) s #define MAYBE_BACK_SLASHES_TO_SLASHES(s) s #endif class RequestController { public: RequestController(Request* r){ request=r; } ~RequestController(){ request=0; } }; class RequestInfoController { public: RequestInfoController(Request_info* rinfo, SAPI_Info* sinfo){ request_info_4log=rinfo; sapi_info_4log=sinfo; } ~RequestInfoController(){ request_info_4log=0; sapi_info_4log=0; } }; /** httpd support */ static const String httpd_class_name("httpd"); static void config_handler(SAPI_Info &info) { Request_info request_info; RequestInfoController ric(&request_info, &info); request_info.document_root = full_disk_path(); request_info.uri = ""; request_info.argv = argv_extra; // prepare to process request Request r(info, request_info, String::Language(String::L_HTML|String::L_OPTIMIZE_BIT)); // only once config_filespec = locate_config(config_filespec, parser3_filespec); // process main auto.p only r.core(config_filespec, false, String::Empty); } static void connection_handler(SAPI_Info_HTTPD &info, HTTPD_Connection &connection) { Request_info request_info; RequestInfoController ric(&request_info, &info); try { if(!connection.read_header()) return; // ignore "void" connections info.populate_env(); request_info.document_root = full_disk_path(); request_info.path_translated = filespec_to_process; request_info.method = connection.method(); request_info.query_string = connection.query(); request_info.uri = request_info.strip_absolute_uri(connection.uri()); request_info.content_type = connection.content_type(); request_info.content_length = (size_t)connection.content_length(); request_info.cookie = info.get_env("HTTP_COOKIE"); request_info.mail_received = false; request_info.argv = argv_extra; // prepare to process request Request r(info, request_info, String::Language(String::L_HTML|String::L_OPTIMIZE_BIT)); // process the request r.core(config_filespec, strcasecmp(request_info.method, "HEAD")==0, main_method_name, &httpd_class_name); } catch(const Exception& e) { // exception in connection handling SAPI::log(info, "%s", e.comment()); const char* status = info.exception_http_status(e.type()); if(*status) SAPI::send_error(info, e.comment(), status); } } #ifdef _MSC_VER DWORD WINAPI connection_thread(void *arg){ #else static void *connection_thread(void *arg){ #endif HTTPD_Connection &connection=*(HTTPD_Connection*)arg; SAPI_Info_HTTPD info(connection); try { connection_handler(info, connection); } catch(const Exception& e) { // exception in send_error pa_log("%s", e.comment()); } delete(&connection); return 0; } static void httpd_mode() { config_handler(*sapi_info); SOCKET sock = HTTPD_Server::bind(httpd_host_port); #ifdef SIGPIPE signal(SIGPIPE, SIG_IGN); #endif while(1){ #ifndef _MSC_VER pid_t pid=1; if(HTTPD_Server::mode == HTTPD_Server::PARALLEL) while (waitpid((pid_t)(-1), 0, WNOHANG) > 0); #endif try { HTTPD_Connection connection; if(!connection.accept(sock, 500)) continue; switch (HTTPD_Server::mode) { case HTTPD_Server::MULTITHREADED: #ifdef _MSC_VER if (!GC_CreateThread(0, 0, connection_thread, new HTTPD_Connection(connection), 0, 0)) throw Exception("httpd.fork", 0, "thread creation failed"); connection.sock=INVALID_SOCKET; break; #else #ifdef HAVE_TLS pthread_t thread; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); if(int result=GC_pthread_create(&thread, &attr, connection_thread, new HTTPD_Connection(connection))) throw Exception("httpd.fork", 0, "thread creation failed (%d)", result); connection.sock=INVALID_SOCKET; break; #endif case HTTPD_Server::PARALLEL: pid=fork(); if(pid<0) throw Exception("httpd.fork", 0, "fork failed: %s (%d)", strerror(errno), errno); if(pid>0) continue; // parent should close connection.sock as well #endif case HTTPD_Server::SEQUENTIAL: // and fork child SAPI_Info_HTTPD info(connection); connection_handler(info, connection); } // closing connection socket in HTTPD_Connection destructor } catch(const Exception& e) { // exception in accept or send_error pa_log("%s", e.comment()); } #ifndef _MSC_VER if(pid==0) // fork child exit(0); #endif } } /** main workhorse */ static void real_parser_handler(bool cgi) { // init libraries pa_globals_init(); if(httpd_host_port){ httpd_mode(); } const char* request_method=getenv("REQUEST_METHOD"); if(!filespec_to_process){ SAPI::send_error(*sapi_info, "Parser/" PARSER_VERSION); exit(1); } // global request info Request_info request_info; RequestInfoController ric(&request_info, sapi_info); request_info.path_translated = filespec_to_process; request_info.method = request_method ? request_method : "GET"; request_info.query_string = MAYBE_RECONSTRUCT_IIS_STATUS_IN_QS(getenv("QUERY_STRING")); if(cgi) { // obligatory const char* path_info=getenv("PATH_INFO"); if(!path_info) SAPI::die("parser3: illegal CGI call (missing PATH_INFO)"); request_info.document_root = getenv("DOCUMENT_ROOT"); if(!request_info.document_root) { // IIS or fcgiwrap minimalistic setup ssize_t prefix_len = strlen(filespec_to_process) - strlen(path_info); if(prefix_len < 0 || strcmp(filespec_to_process + prefix_len, path_info) != 0) SAPI::die("parser3: illegal CGI call (invalid PATH_INFO in reinventing DOCUMENT_ROOT)"); char* document_root = new(PointerFreeGC) char[prefix_len + 1/*0*/]; memcpy(document_root, filespec_to_process, prefix_len); document_root[prefix_len] = 0; request_info.document_root = document_root; } request_info.uri = request_info.strip_absolute_uri(getenv("REQUEST_URI")); if(request_info.uri) { // apache & others stuck to standards // another obligatory const char* script_name = getenv("SCRIPT_NAME"); if(!script_name) SAPI::die("parser3: illegal CGI call (missing SCRIPT_NAME)"); /* http://parser3/env.html?123 =OK $request:uri=/env.html?123 REQUEST_URI='/env.html?123' SCRIPT_NAME='/cgi-bin/parser3' PATH_INFO='/env.html' http://parser3/cgi-bin/parser3/env.html?123 =ERROR $request:uri=/cgi-bin/parser3/env.html?123 REQUEST_URI='/cgi-bin/parser3/env.html?123' SCRIPT_NAME='/cgi-bin/parser3' PATH_INFO='/env.html' */ size_t script_name_len = strlen(script_name); size_t uri_len = strlen(request_info.uri); if(strncmp(request_info.uri, script_name, script_name_len)==0 && script_name_len != uri_len) // under IIS they are the same SAPI::die("parser3: illegal CGI call (REQUEST_URI starts with SCRIPT_NAME)"); } else { // fcgiwrap minimalistic setup request_info.uri = request_info.query_string && *request_info.query_string ? pa_strcat(path_info, "?", request_info.query_string) : path_info; } } else{ request_info.document_root = full_disk_path(); request_info.uri = ""; } request_info.content_type = getenv("CONTENT_TYPE"); request_info.content_length = cgi ? (size_t)pa_atoul(getenv("CONTENT_LENGTH")) : 0; // only SAPI_Info_CGI can read POST request_info.cookie = getenv("HTTP_COOKIE"); request_info.mail_received = mail_received; request_info.argv = argv_extra; #ifdef PA_DEBUG_CGI_ENTRY_EXIT pa_log("request_info: method=%s, uri=%s, q=%s, dr=%s, pt=%s", request_info.method, request_info.uri, request_info.query_string, request_info.document_root, request_info.path_translated); #endif // prepare to process request Request r(*sapi_info, request_info, cgi ? String::Language(String::L_HTML|String::L_OPTIMIZE_BIT) : String::L_AS_IS); { // initing ::request ptr for signal handlers RequestController rc(&r); // process the request r.core(locate_config(config_filespec, parser3_filespec), strcasecmp(request_info.method, "HEAD")==0); // clearing ::request in RequestController destructor to prevent signal handlers from accessing invalid memory } // finalize libraries pa_globals_done(); } #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION static const Exception call_real_parser_handler__do_PEH_return_it(bool cgi) { try { real_parser_handler(cgi); } catch(const Exception& e) { return e; } return Exception(); } static void call_real_parser_handler__supress_system_exception(bool cgi) { Exception parser_exception; LPEXCEPTION_POINTERS system_exception=0; __try { parser_exception=call_real_parser_handler__do_PEH_return_it(cgi); } __except ( (system_exception=GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) { if(system_exception) if(_EXCEPTION_RECORD *er=system_exception->ExceptionRecord) throw Exception("system", 0, "0x%08X at 0x%08X", er->ExceptionCode, er->ExceptionAddress); else throw Exception("system", 0, ""); else throw Exception("system", 0, ""); } if(parser_exception) throw Exception(parser_exception); } #define REAL_PARSER_HANDLER call_real_parser_handler__supress_system_exception #else #define REAL_PARSER_HANDLER real_parser_handler #endif static void usage(const char* message=NULL) { if(message){ fprintf(stderr, message, parser3_filespec); } printf( "Parser/%s\n" "Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com)\n" "Authors: Konstantin Morshnev , Alexandr Petrosian \n" "\n" "Usage: %s [options] [file]\n" "Options are:\n" #ifdef WITH_MAILRECEIVE " -m Parse mail, put received letter to $mail:received\n" #endif " -f config_file Use this config file (/path/to/auto.p)\n" " -l log_file Use this log file (/path/to/parser3.log)\n" " -p [host:]port Start web server on this port\n" " -h Display usage information (this message)\n", PARSER_VERSION, parser3_filespec ? parser3_filespec : "parser3" ); exit(EINVAL); } #define ARG_REQUIRED \ if(c[1] || !*(++carg)){ \ fprintf(stderr, "%s: option '%c' requires an argument\n", parser3_filespec, *c); \ usage(); \ } int main(int argc, char *argv[]) { #ifdef PA_DEBUG_CGI_ENTRY_EXIT pa_log("main: entry"); #endif if(!argc || !argv[0]) usage(); parser3_filespec = MAYBE_BACK_SLASHES_TO_SLASHES(argv[0]); umask(2); // were we started as CGI? bool cgi=(getenv("SERVER_SOFTWARE") || getenv("SERVER_NAME") || getenv("GATEWAY_INTERFACE") || getenv("REQUEST_METHOD")) && !getenv("PARSER_VERSION"); if(!cgi){ sapi_info = &sapi_console; parser3_mode = "console"; } #ifdef SIGPIPE signal(SIGPIPE, SIGPIPE_handler); #endif char* raw_filespec_to_process = NULL; if(cgi) { raw_filespec_to_process=getenv("PATH_TRANSLATED"); argv_extra=argv + 1; } else { char** carg = argv + 1; for(;*carg; carg++){ if((*carg)[0] != '-') break; for(char* c=(*carg)+1; *c; c++){ switch (*c) { case 'h': usage(); break; case 'f': ARG_REQUIRED; config_filespec=*carg; break; case 'l': ARG_REQUIRED; log_filespec=*carg; break; case 'p': ARG_REQUIRED; httpd_host_port=*carg; parser3_mode="httpd"; break; #ifdef WITH_MAILRECEIVE case 'm': mail_received=true; parser3_mode="mail"; break; #endif default: fprintf(stderr, "%s: invalid option '%c'\n", parser3_filespec, *c); usage(); break; } } } if (*carg) { raw_filespec_to_process=*carg; } else { if(!httpd_host_port) usage("%s: file not specified\n"); } if (httpd_host_port && mail_received) usage("%s: -p and -m options should not be used together\n"); argv_extra=carg; } #ifdef _MSC_VER setmode(fileno(stdin), _O_BINARY); setmode(fileno(stdout), _O_BINARY); setmode(fileno(stderr), _O_BINARY); #endif #if defined(_MSC_VER) && defined(_DEBUG) // Get current flag int tmpFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG ); // Turn on leak-checking bit tmpFlag |= _CRTDBG_LEAK_CHECK_DF; // Set flag to the new value _CrtSetDbgFlag( tmpFlag ); _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR ); #endif try { // global try if(raw_filespec_to_process && *raw_filespec_to_process){ filespec_to_process=full_disk_path(raw_filespec_to_process); } REAL_PARSER_HANDLER(cgi); } catch(const Exception& e) { // exception in config_handler SAPI::log(*sapi_info, "%s", e.comment()); SAPI::send_error(*sapi_info, e.comment(), strcmp(e.type(), "file.missing") ? "500" : "404"); } #ifdef PA_DEBUG_CGI_ENTRY_EXIT pa_log("main: successful return"); #endif return sapi_info->http_response_code < 100 ? sapi_info->http_response_code : 0; } parser-3.5.1/src/targets/cgi/Makefile.am0000644000076400007640000000175713764677577015052 00000000000000# Parser has circular library dependencies, thus libmain.a is linked twice and --preserve-dup-deps libtool option is used PA_LIBS = ../../main/.libs/libmain.a ../../classes/.libs/libclasses.a ../../types/.libs/libtypes.a ../../main/.libs/libmain.a \ ../../lib/gd/libgd.la ../../lib/cord/libcord.la ../../lib/md5/libmd5.la ../../lib/sdbm/libsdbm.la \ ../../lib/pcre/libpcre_internal.la ../../lib/smtp/libsmtp.la ../../lib/json/libjson.la \ ../../lib/punycode/libpunycode.la ../../lib/memcached/libmemcached.la AM_CPPFLAGS = -I../../classes -I../../types @PCRE_INCLUDES@ @XML_INCLUDES@ # Automake 1.9 does not support LIBTOOLFLAGS CXXLINK = $(LIBTOOL) --preserve-dup-deps --mode=link --tag=CXX $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ noinst_HEADERS = pa_sapi_info.h bin_PROGRAMS = parser3 parser3_DEPENDENCIES=Makefile $(PA_LIBS) parser3_SOURCES = parser3.C parser3_LDADD = $(PA_LIBS) $(LIBLTDL) @GC_LIBS@ @PCRE_LIBS@ @XML_LIBS@ @MIME_LIBS@ EXTRA_DIST = parser3.vcproj parser-3.5.1/src/targets/cgi/parser3.vcproj0000644000076400007640000001116613764700424015567 00000000000000 parser-3.5.1/src/targets/cgi/pa_sapi_info.h0000644000076400007640000001551014714126655015564 00000000000000#ifndef PA_SAPI_INFO_H #define PA_SAPI_INFO_H #define IDENT_PA_SAPI_INFO_H "$Id: pa_sapi_info.h,v 1.21 2024/11/10 12:57:17 moko Exp $" #include "pa_sapi.h" #include "pa_http.h" /// IIS refuses to read bigger chunks const size_t READ_POST_CHUNK_SIZE=0x400*0x400; // 1M const int HEADERS_SENT = 999; // can't send error message after headers have been sent // for signal handlers and cgi console detection static Request *request=0; class SAPI_Info : public PA_Allocated { public: int http_response_code; String::Body headers; SAPI_Info() : http_response_code(200) {} virtual char* get_env(const char* name) { if(char *local=getenv(name)) return pa_strdup(local); else return 0; } virtual bool set_env(const char*, const char*) { return false; } virtual const char* const *get_env() { #ifdef _MSC_VER extern char **_environ; return _environ; #else extern char **environ; return environ; #endif } virtual size_t read_post(char *, size_t) { return 0; } virtual void add_header(const char* dont_store_key, const char* dont_store_value) { if(strcasecmp(dont_store_key, "location")==0) http_response_code=302; if(strcasecmp(dont_store_key, HTTP_STATUS)==0) http_response_code=atoi(dont_store_value); } virtual void send_headers() {} void clear_headers() { http_response_code=200; headers.clear(); } virtual size_t send_body(const void *buf, size_t size) { return stdout_write(buf, size); } virtual void send_error(const char *exception_cstr, const char *status){ http_response_code=atoi(status); send_body(exception_cstr, strlen(exception_cstr)); } }; class SAPI_Info_CGI : public SAPI_Info { public: virtual size_t read_post(char *buf, size_t max_bytes) { size_t read_size=0; do { ssize_t chunk_size=read(fileno(stdin), buf+read_size, min(READ_POST_CHUNK_SIZE, max_bytes-read_size)); if(chunk_size<=0) break; read_size+=chunk_size; } while(read_sizeconsole.was_used()){ headers << "\r\n"; send_body(headers.cstr(), headers.length()); http_response_code=HEADERS_SENT; } } virtual void send_error(const char *exception_cstr, const char *status){ if (http_response_code==HEADERS_SENT) return; // memory allocation is not allowed char buf[MAX_STRING]; snprintf(buf, MAX_STRING, HTTP_STATUS_CAPITALIZED ": %s\r\n" HTTP_CONTENT_TYPE_CAPITALIZED ": text/plain\r\n\r\n", status); send_body(buf, strlen(buf)); send_body(exception_cstr, strlen(exception_cstr)); } }; static char* replace_char(char* str, char from, char to){ for(char *pos = strchr(str,from); pos; pos=strchr(pos,from)) { *pos = to; } return str; } class SAPI_Info_HTTPD : public SAPI_Info { public: HTTPD_Connection &connection; HashStringString env; SAPI_Info_HTTPD(HTTPD_Connection &aconnection) : connection(aconnection) {} void populate_env() { String::Body host("localhost"); for(Array_iterator i(connection.headers()); i; ){ HTTP_Headers::Header header=i.next(); String name("HTTP_"); name << replace_char(header.name.cstrm(), '-', '_'); String::Body value=header.value; if(header.name == "HOST"){ size_t port=value.pos(':'); if(port != STRING_NOT_FOUND) value=value.mid(0, port); host=value; } env.put(name, value); } env.put("REQUEST_METHOD", connection.method()); env.put("REQUEST_URI", connection.uri()); env.put("QUERY_STRING", connection.query()); env.put("SERVER_NAME", host); env.put("SERVER_PORT", HTTPD_Server::port); env.put("REMOTE_ADDR", connection.remote_addr); } virtual char* get_env(const char* name) { String::Body request_value = env.get(name); if(!request_value.is_empty()) return request_value.cstrm(); if(char *server_value=getenv(name)) return pa_strdup(server_value); return NULL; } virtual bool set_env(const char* name, const char* value) { env.put(name, *new String(value)); return true; } virtual const char* const *get_env() { const char** result=new(PointerGC) const char*[env.count()+1/*0*/]; const char** cur=result; for(HashStringString::Iterator i(env); i; i.next()){ String pair; pair << i.key() << "=" << i.value(); *cur++=pair.cstr(); } *cur=NULL; return result; } virtual size_t read_post(char *buf, size_t max_bytes) { return connection.read_post(buf, max_bytes); } static const char *exception_http_status(const char *type) { struct Lookup { const char *code; const char *type; } static lookup[] = { { "", "httpd.write"}, {"400", "httpd.request"}, {"400", "http.response"}, {"404", "file.missing"}, {"408", "httpd.timeout"}, {"408", "httpd.read"}, {"501", "httpd.method"}, { NULL, ""} }; Lookup *cur = lookup; for(; cur->code; cur++) if(!strcmp(type, cur->type)) return cur->code; return "500"; } static const char *status_message(int code) { struct Lookup { int code; const char *message; } static lookup[] = { {200, "OK"}, {204, "No Content"}, {206, "Partial Content"}, {301, "Moved Permanently"}, {302, "Found"}, {304, "Not Modified"}, {400, "Bad Request"}, {401, "Unauthorized"}, {403, "Forbidden"}, {404, "Not Found"}, {408, "Request Timeout"}, {416, "Range Not Satisfiable"}, {500, "Internal Server Error"}, {501, "Not Implemented"}, {502, "Bad Gateway"}, {504, "Gateway Timeout"}, { 0, "Undescribed"} }; Lookup *cur = lookup; for(; cur->code; cur++) if(code == cur->code) return cur->message; return cur->message; } virtual void add_header(const char* dont_store_key, const char* dont_store_value) { if(strcasecmp(dont_store_key, "location")==0) http_response_code=302; if(strcasecmp(dont_store_key, HTTP_STATUS)==0) http_response_code=atoi(dont_store_value); else headers << capitalize(dont_store_key) << ": " << pa_strdup(dont_store_value) << "\r\n"; } virtual void send_headers() { String result("HTTP/1.0 "); result << pa_uitoa(http_response_code) << " " << status_message(http_response_code) << "\r\n" << headers << "\r\n"; send_body(result.cstr(), result.length()); http_response_code=HEADERS_SENT; } virtual size_t send_body(const void *buf, size_t size) { return connection.send_body(buf, size); } virtual void send_error(const char *exception_cstr, const char *status){ if (http_response_code==HEADERS_SENT) return; // memory allocation is not allowed char buf[MAX_STRING]; snprintf(buf, MAX_STRING, "HTTP/1.0 %s %s\r\n" HTTP_CONTENT_TYPE_CAPITALIZED ": text/plain\r\n\r\n", status, status_message(atoi(status))); send_body(buf, strlen(buf)); send_body(exception_cstr, strlen(exception_cstr)); } }; #endif parser-3.5.1/src/targets/isapi/0000755000076400007640000000000014740300546013375 500000000000000parser-3.5.1/src/targets/isapi/parser3isapi.vcproj0000644000076400007640000001325013764700424017154 00000000000000 parser-3.5.1/src/targets/isapi/parser3isapi.C0000644000076400007640000003155314726355563016052 00000000000000/** @file Parser: IIS extension. Copyright (c) 2000-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ volatile const char * IDENT_PARSER3ISAPI_C="$Id: parser3isapi.C,v 1.135 2024/12/11 18:35:31 moko Exp $"; #ifndef _MSC_VER # error compile ISAPI module with MSVC [no urge for now to make it autoconf-ed (PAF)] #endif #include "pa_config_includes.h" #include "pa_sapi.h" #include "pa_globals.h" #include "pa_request.h" #include "pa_version.h" #include #include #include // defines #if defined(_MSC_VER) && !defined(_DEBUG) # define PA_SUPPRESS_SYSTEM_EXCEPTION #endif #define MAX_STATUS_LENGTH sizeof("xxxx LONGEST STATUS DESCRIPTION") // consts const char* IIS51vars[]={ "APPL_MD_PATH", "APPL_PHYSICAL_PATH", "AUTH_PASSWORD", "AUTH_TYPE", "AUTH_USER", "CERT_COOKIE", "CERT_FLAGS", "CERT_ISSUER", "CERT_KEYSIZE", "CERT_SECRETKEYSIZE", "CERT_SERIALNUMBER", "CERT_SERVER_ISSUER", "CERT_SERVER_SUBJECT", "CERT_SUBJECT", "CONTENT_LENGTH", "CONTENT_TYPE", "GATEWAY_INTERFACE", "HTTPS", "HTTPS_KEYSIZE", "HTTPS_SECRETKEYSIZE", "HTTPS_SERVER_ISSUER", "HTTPS_SERVER_SUBJECT", "INSTANCE_ID", "INSTANCE_META_PATH", "LOCAL_ADDR", "LOGON_USER", "PATH_INFO", "PATH_TRANSLATED", "QUERY_STRING", "REMOTE_ADDR", "REMOTE_HOST", "REMOTE_PORT", "REMOTE_USER", "REQUEST_METHOD", "SCRIPT_NAME", "SERVER_NAME", "SERVER_PORT", "SERVER_PORT_SECURE", "SERVER_PROTOCOL", "SERVER_SOFTWARE", "URL", }; const int IIS51var_count=sizeof(IIS51vars)/sizeof(*IIS51vars); // globals char argv0[MAX_STRING]=""; const char* parser3_mode="isapi"; // $status:mode const char *parser3_log_filespec(){ return ""; } // $status:log-filename // SAPI #ifndef DOXYGEN /* ISAPI SAPI functions receive this context information. see Pool::set_context */ class SAPI_Info { public: LPEXTENSION_CONTROL_BLOCK lpECB; String *header; DWORD http_response_code; }; #endif // goes to 'cs-uri-query' log file field. webmaster: switch it ON[default OFF]. void SAPI::log(SAPI_Info& SAPI_info, const char* fmt, ...) { va_list args; va_start(args,fmt); char buf[MAX_LOG_STRING]; const char* prefix="PARSER_ERROR:"; strcpy(buf, prefix); char *start=buf+strlen(prefix); DWORD size=vsnprintf(start, MAX_LOG_STRING-strlen(prefix), fmt, args); size=remove_crlf(start, start+size); SAPI_info.lpECB->ServerSupportFunction(SAPI_info.lpECB->ConnID, HSE_APPEND_LOG_PARAMETER, buf, &size, 0); } /// @todo event log void SAPI::die(const char* fmt, ...) { va_list args; va_start(args, fmt); if(FILE *log=fopen("c:\\parser3die.log", "at")) { vfprintf(log, fmt, args); fclose(log); } // abnormal exit abort(); // va_end(args); } void SAPI::send_error(SAPI_Info& SAPI_info, const char *exception_cstr, const char *status){ // capitalized headers passed for preventing malloc during capitalization add_header_attribute(SAPI_info, HTTP_STATUS_CAPITALIZED, status); add_header_attribute(SAPI_info, HTTP_CONTENT_TYPE_CAPITALIZED, "text/plain"); send_headers(SAPI_info); send_body(SAPI_info, exception_cstr, strlen(exception_cstr)); } char* SAPI::Env::get(SAPI_Info& SAPI_info, const char* name) { char *variable_buf=new(PointerFreeGC) char[MAX_STRING]; DWORD variable_len = MAX_STRING-1; if(SAPI_info.lpECB->GetServerVariable(SAPI_info.lpECB->ConnID, const_cast(name), variable_buf, &variable_len)) { if(*variable_buf) { // saw returning len=1 && *buf=0 :( variable_buf[variable_len]=0; return variable_buf; } } else if (GetLastError()==ERROR_INSUFFICIENT_BUFFER) { variable_buf=new(PointerFreeGC) char[variable_len+1]; if(SAPI_info.lpECB->GetServerVariable(SAPI_info.lpECB->ConnID, const_cast(name), variable_buf, &variable_len)) { if(*variable_buf) { variable_buf[variable_len]=0; return variable_buf; } } } return 0; } bool SAPI::Env::set(SAPI_Info&, const char*, const char*) { return false; } static int grep_char(const char* s, char c) { int result=0; if(s) { while(s=strchr(s, c)) { s++; // skip found c result++; } } return result; } const char* const *SAPI::Env::get(SAPI_Info& info) { // we know this buf is writable char* all_http_vars=SAPI::Env::get(info, "ALL_HTTP"); const int http_var_count=grep_char(all_http_vars, '\n')+1/*\n for theoretical(never saw) this \0*/; const char* *result=new(PointerFreeGC) const char*[IIS51var_count+http_var_count+1/*0*/]; const char* *cur=result; // IIS5.1 vars for(int i=0; icbAvailable, max_bytes); memcpy(buf, SAPI_info.lpECB->lpbData, read_from_buf); total_read+=read_from_buf; if(read_from_bufcbTotalBytes) { DWORD cbRead=0, cbSize; read_from_input=min(max_bytes-read_from_buf, SAPI_info.lpECB->cbTotalBytes-read_from_buf); while(cbRead < read_from_input) { cbSize=read_from_input - cbRead; if(!SAPI_info.lpECB->ReadClient(SAPI_info.lpECB->ConnID, buf+read_from_buf+cbRead, &cbSize) || cbSize==0) break; cbRead+=cbSize; } total_read+=cbRead; } return total_read; } void SAPI::add_header_attribute(SAPI_Info& SAPI_info, const char* dont_store_key, const char* dont_store_value) { if(strcasecmp(dont_store_key, "location")==0) SAPI_info.http_response_code=302; if(strcasecmp(dont_store_key, HTTP_STATUS)==0) SAPI_info.http_response_code=atoi(dont_store_value); else (*SAPI_info.header) << capitalize(dont_store_key) << ": " << pa_strdup(dont_store_value) << "\r\n"; } /// @todo intelligent cache-control void SAPI::send_headers(SAPI_Info& SAPI_info) { HSE_SEND_HEADER_EX_INFO header_info; char status_buf[MAX_STATUS_LENGTH]; switch(SAPI_info.http_response_code) { case 200: header_info.pszStatus="200 OK"; break; case 302: header_info.pszStatus="302 Moved Temporarily"; break; case 401:// useless untill parser auth mech header_info.pszStatus="401 Authorization Required"; break; default: snprintf(status_buf, MAX_STATUS_LENGTH, "%d Undescribed", SAPI_info.http_response_code); header_info.pszStatus=status_buf; break; } header_info.cchStatus=strlen(header_info.pszStatus); *SAPI_info.header << "\r\n"; // ISAPI v<5 did quite well without it header_info.pszHeader=SAPI_info.header->cstr(); header_info.cchHeader=SAPI_info.header->length(); header_info.fKeepConn=true; SAPI_info.lpECB->dwHttpStatusCode=SAPI_info.http_response_code; SAPI_info.lpECB->ServerSupportFunction(SAPI_info.lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL); } void SAPI::clear_headers(SAPI_Info& SAPI_info) { SAPI_info.header=new String; } size_t SAPI::send_body(SAPI_Info& SAPI_info, const void *buf, size_t size) { DWORD num_bytes=size; if(!SAPI_info.lpECB->WriteClient(SAPI_info.lpECB->ConnID, const_cast(buf), &num_bytes, HSE_IO_SYNC)) return 0; return (size_t)num_bytes; } static bool parser_init() { static bool globals_inited=false; if(globals_inited) return true; globals_inited=true; try { // init libraries pa_globals_init(); // successful finish return true; } catch(.../*const Exception& e*/) { // global problem // unsuccessful finish return false; } } static void parser_done() { // finalize libraries pa_globals_done(); } /// ISAPI // BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer) { pVer->dwExtensionVersion = HSE_VERSION; pa_strncpy(pVer->lpszExtensionDesc, "Parser " PARSER_VERSION, HSE_MAX_EXT_DLL_NAME_LEN); return parser_init(); } // dwFlags & HSE_TERM_MUST_UNLOAD means we can't return false BOOL WINAPI TerminateExtension( DWORD /*dwFlags*/ ) { parser_done(); return TRUE; } /** ISAPI // main workhorse @todo IIS: remove trailing default-document[index.html] from $request.uri. to do that we need to consult metabase, wich is tested&works but seems slow runtime and not could-be-quickly-implemented if prepared. @test PARSER_VERSION from outside */ void real_parser_handler(SAPI_Info& SAPI_info, bool header_only) { // collect garbage from prev request pa_gc_collect(); SAPI_info.header=new String; LPEXTENSION_CONTROL_BLOCK lpECB=SAPI_info.lpECB; // Request info Request_info request_info; memset(&request_info, 0, sizeof(request_info)); char *filespec_to_process=pa_strdup(lpECB->lpszPathTranslated); #ifdef WIN32 back_slashes_to_slashes(filespec_to_process); #endif if(const char* path_info=SAPI::Env::get(SAPI_info, "PATH_INFO")) { // IIS size_t len=strlen(filespec_to_process)-strlen(path_info); char *buf=new(PointerFreeGC) char[len]; pa_strncpy(buf, filespec_to_process, len); request_info.document_root=buf; } else throw Exception(PARSER_RUNTIME, 0, "ISAPI: no PATH_INFO defined (in reinventing DOCUMENT_ROOT)"); request_info.path_translated=filespec_to_process; request_info.method=lpECB->lpszMethod; request_info.query_string=lpECB->lpszQueryString; request_info.uri=lpECB->lpszQueryString && *lpECB->lpszQueryString ? pa_strcat(lpECB->lpszPathInfo, "?", lpECB->lpszQueryString) : lpECB->lpszPathInfo; request_info.content_type=lpECB->lpszContentType; request_info.content_length=lpECB->cbTotalBytes; request_info.cookie=SAPI::Env::get(SAPI_info, "HTTP_COOKIE"); request_info.mail_received=false; // prepare to process request Request request(SAPI_info, request_info, String::Language(String::L_HTML|String::L_OPTIMIZE_BIT)); // beside by binary static char beside_binary_path[MAX_STRING]; pa_strncpy(beside_binary_path, argv0, MAX_STRING); // filespec of my binary if(!(rsplit(beside_binary_path, '/') || rsplit(beside_binary_path, '\\'))) { // strip filename // no path, just filename beside_binary_path[0]='.'; beside_binary_path[1]=0; } char config_filespec[MAX_STRING]; snprintf(config_filespec, MAX_STRING, "%s/%s", beside_binary_path, AUTO_FILE_NAME); // process the request request.core(entry_exists(config_filespec) ? config_filespec : NULL, header_only); } #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION static const Exception call_real_parser_handler__do_PEH_return_it(SAPI_Info& SAPI_info, bool header_only) { try { real_parser_handler(SAPI_info, header_only); } catch(const Exception& e) { return e; } return Exception(); } static void call_real_parser_handler__supress_system_exception(SAPI_Info& SAPI_info, bool header_only) { Exception parser_exception; LPEXCEPTION_POINTERS system_exception=0; __try { parser_exception=call_real_parser_handler__do_PEH_return_it(SAPI_info, header_only); } __except ( (system_exception=GetExceptionInformation()), EXCEPTION_EXECUTE_HANDLER) { if(system_exception) if(_EXCEPTION_RECORD *er=system_exception->ExceptionRecord) throw Exception("system", 0, "0x%08X at 0x%08X", er->ExceptionCode, er->ExceptionAddress); else throw Exception("system", 0, ""); else throw Exception("system", 0, ""); } if(parser_exception) throw Exception(parser_exception); } #endif DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) { //_asm int 3; SAPI_Info SAPI_info={ lpECB, 0, // filling later: so that if there would be error pool would have SAPI_info 200 // default http_response_code [lpECB->dwHttpStatusCode seems to be always 0, even on 404 redirect to /404.html] }; bool header_only=strcasecmp(lpECB->lpszMethod, "HEAD")==0; try { // global try #ifdef PA_SUPPRESS_SYSTEM_EXCEPTION call_real_parser_handler__supress_system_exception( #else real_parser_handler( #endif SAPI_info, header_only); // successful finish } catch(const Exception& e) { // just in case // log it SAPI::log(SAPI_info, "%s", e.comment()); HSE_SEND_HEADER_EX_INFO header_info; header_info.pszStatus="500 Internal Server Error"; header_info.cchStatus=strlen(header_info.pszStatus); header_info.pszHeader=HTTP_CONTENT_TYPE_CAPITALIZED ": text/plain\r\n\r\n"; header_info.cchHeader=strlen(header_info.pszHeader); header_info.fKeepConn=true; // send header lpECB->dwHttpStatusCode=500; lpECB->ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &header_info, NULL, NULL); // send body if(!header_only) SAPI::send_body(SAPI_info, e.comment(), strlen(e.comment())); // unsuccessful finish } return HSE_STATUS_SUCCESS_AND_KEEP_CONN; } BOOL WINAPI DllMain( HINSTANCE hinstDLL, // handle to the DLL module DWORD /*fdwReason*/, // reason for calling function LPVOID /*lpvReserved*/ // reserved ) { GetModuleFileName( hinstDLL, // handle to module argv0, // file name of module sizeof(argv0) // size of buffer ); return TRUE; }parser-3.5.1/src/targets/isapi/Makefile.in0000644000076400007640000003161514740273416015375 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ #do not automake, desined to be compiled with MSVC only VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/targets/isapi ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = parser3isapi.C parser3isapi.def parser3isapi.vcproj all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/targets/isapi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/targets/isapi/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/targets/isapi/Makefile.am0000644000076400007640000000017214002047573015350 00000000000000#do not automake, desined to be compiled with MSVC only EXTRA_DIST = parser3isapi.C parser3isapi.def parser3isapi.vcproj parser-3.5.1/src/targets/isapi/parser3isapi.def0000644000076400007640000000010010033000172016350 00000000000000EXPORTS HttpExtensionProc GetExtensionVersion TerminateExtensionparser-3.5.1/src/main/0000755000076400007640000000000014740300546011543 500000000000000parser-3.5.1/src/main/pa_exec.C0000644000076400007640000003052414732421571013202 00000000000000/** @file Parser: program executing for different OS-es. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian @todo setrlimit */ #include "pa_config_includes.h" #include "pa_exec.h" #include "pa_exception.h" #include "pa_common.h" volatile const char * IDENT_PA_EXEC_C="$Id: pa_exec.C,v 1.104 2024/12/24 02:58:47 moko Exp $" IDENT_PA_EXEC_H; #ifdef _MSC_VER #include /// this func from http://www.ccas.ru/~posp/popov/spawn.htm static DWORD CreateHiddenConsoleProcess(LPCTSTR szCmdLine, LPCTSTR szScriptFileSpec, char *szEnv, PROCESS_INFORMATION* ppi, LPHANDLE phInWrite, LPHANDLE phOutRead, LPHANDLE phErrRead) { DWORD result=0; BOOL fCreated; STARTUPINFO si; SECURITY_ATTRIBUTES sa={0}; HANDLE hInRead; HANDLE hOutWrite; HANDLE hErrWrite; // Create pipes // initialize security attributes for handle inheritance (for WinNT) sa.nLength=sizeof(sa); sa.bInheritHandle=TRUE; sa.lpSecurityDescriptor=NULL; // create STDIN pipe if(!CreatePipe(&hInRead, phInWrite, &sa, 0)) goto error; // Ensure the write handle to the pipe for STDIN is not inherited. if (!SetHandleInformation(*phInWrite, HANDLE_FLAG_INHERIT, 0)) goto error; // create STDOUT pipe if(!CreatePipe(phOutRead, &hOutWrite, &sa, 0)) goto error; // Ensure the read handle to the pipe for STDOUT is not inherited. if (!SetHandleInformation(*phOutRead, HANDLE_FLAG_INHERIT, 0)) goto error; // create STDERR pipe if(!CreatePipe(phErrRead, &hErrWrite, &sa, 0)) goto error; // Ensure the read handle to the pipe for STDERR is not inherited. if (!SetHandleInformation(*phErrRead, HANDLE_FLAG_INHERIT, 0)) goto error; // process startup information memset(&si, 0, sizeof(si)); si.cb=sizeof(si); si.dwFlags=STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES; // child process' console must be hidden for Win95 compatibility si.wShowWindow=SW_HIDE; // assign "other" sides of pipes si.hStdInput=hInRead; si.hStdOutput=hOutWrite; si.hStdError=hErrWrite; // calculating script's directory char dir[MAX_STRING]; pa_strncpy(dir, szScriptFileSpec, MAX_STRING); lsplit(dir,' '); // trim arguments rsplit(dir,'/'); rsplit(dir,'\\'); // trim filename // Create a child process (suspended) fCreated=CreateProcess(NULL, (LPTSTR)szCmdLine, NULL, NULL, TRUE, CREATE_NO_WINDOW, szEnv, dir, &si, ppi); if(!fCreated) result=GetLastError(); CloseHandle(hInRead); CloseHandle(hOutWrite); CloseHandle(hErrWrite); if(!fCreated) goto error; return result; error: if(!result/*yet*/) result=GetLastError(); // get it CloseHandle(*phInWrite); CloseHandle(*phOutRead); CloseHandle(*phErrRead); return result; } static int get_exit_status(HANDLE hProcess) { DWORD dwExitCode = 0; if(!GetExitCodeProcess(hProcess, &dwExitCode)) return -1; if(dwExitCode != STILL_ACTIVE) return dwExitCode; // wait for 1 second for process to exit if(WaitForSingleObject(hProcess, 1000) != WAIT_OBJECT_0) return -2; if(!GetExitCodeProcess(hProcess, &dwExitCode)) return -1; return dwExitCode; } static void read_pipe(String& result, HANDLE hOutRead, String::Language lang) { while(true) { char *buf=new(PointerFreeGC) char[MAX_STRING+1]; DWORD size=0; if(!ReadFile(hOutRead, buf, MAX_STRING, &size, NULL) || !size) break; buf[size]=0; result.append_know_length(buf, size, lang); } } static void read_pipe(File_read_result& result, HANDLE hOutRead) { char *buf=(char*)pa_malloc(MAX_STRING+1); DWORD bufsize = MAX_STRING; result.headers = 0; result.length = 0; result.str = 0; result.success = false; while(true) { DWORD size=0; if(!ReadFile(hOutRead, buf + result.length, bufsize - result.length, &size, NULL) || !size) break; result.length += size; if(result.length >= bufsize){ bufsize *= 2; buf=(char*)pa_realloc(buf, bufsize+1); } result.str=buf; } } static const char* arg_quote(const char *arg) { size_t length = strlen(arg); if (length >= 1 && arg[0] == '-') return arg; // avoid options qouting if (length >= 2 && arg[0] == '"' && arg[length - 1] == '"') return arg; // allready qouted size_t extra_length = 2; // opening and closing quotes for(const char *src = arg; *src; src++){ if(*src == '"') extra_length++; } char *result = (char *)pa_malloc(length + extra_length + 1); char *dest = result; *dest++ = '"'; for(const char *src=arg; *src;){ char c = *src++; if(c == '"') *dest++ = '"'; *dest++ = c; } *dest++ = '"'; *dest = '\0'; return result; } static const char* buildCommand(const char* file_spec_cstr, const ArrayString& argv) { const char* result=file_spec_cstr; if(FILE *f=pa_fopen(file_spec_cstr, "r")) { try { char buf[MAX_STRING]; size_t size=fread(buf, 1, MAX_STRING-1, f); if(size>2) { buf[size]=0; if(strncmp(buf, "#!", 2)==0) { const char* begin=buf+2; while(*begin==' ') // alx: were an old magic for some linux-es begin++; if(const char *end=strchr(begin, '\n')) { String string(pa_strdup(begin, end-begin)); string << " " << file_spec_cstr; result=string.cstr(); } } } } catch(...) { fclose(f); rethrow; } fclose(f); } { // appending argv String string(result); for(size_t i=0; icstr()); } result=string.cstr(); } return result; } #else static pid_t execve_piped(const char* file_spec_cstr, char * const argv[], char * const env[], int *pipe_in, int *pipe_out, int *pipe_err) { pid_t pid; int in_fds[2]; int out_fds[2]; int err_fds[2]; int save_errno; if(pipe_in && pipe(in_fds)<0) { save_errno=errno; errno=save_errno; return 0; } if(pipe_out && pipe(out_fds)<0) { save_errno=errno; if(pipe_in) { close(in_fds[0]); close(in_fds[1]); } errno=save_errno; return 0; } if(pipe_err && pipe(err_fds)<0) { save_errno=errno; if(pipe_in) { close(in_fds[0]); close(in_fds[1]); } if(pipe_out) { close(out_fds[0]); close(out_fds[1]); } errno=save_errno; return 0; } if((pid=fork())<0) { save_errno=errno; if(pipe_in) { close(in_fds[0]); close(in_fds[1]); } if(pipe_out) { close(out_fds[0]); close(out_fds[1]); } if(pipe_err) { close(err_fds[0]); close(err_fds[1]); } errno=save_errno; return -1; } if(!pid) { /* Child process */ if(pipe_out) { close(out_fds[0]); dup2(out_fds[1], STDOUT_FILENO); close(out_fds[1]); } if(pipe_in) { close(in_fds[1]); dup2(in_fds[0], STDIN_FILENO); close(in_fds[0]); } if(pipe_err) { close(err_fds[0]); dup2(err_fds[1], STDERR_FILENO); close(err_fds[1]); } /* grabbed this from Apache source: */ /* HP-UX SIGCHLD fix goes here, if someone will remind me what it is... */ signal(SIGCHLD, SIG_DFL); /* Was that it? */ // chdir to script's directory char dir[MAX_STRING]; pa_strncpy(dir, file_spec_cstr, MAX_STRING); rsplit(dir,'/'); // trim filename PA_UNUSED int ignore_result=chdir(dir); // execute execve(file_spec_cstr, argv, env); exit(-errno); } /* Parent process */ if(pipe_out) { close(out_fds[1]); *pipe_out=out_fds[0]; } if(pipe_in) { close(in_fds[0]); *pipe_in=in_fds[1]; } if(pipe_err) { close(err_fds[1]); *pipe_err=err_fds[0]; } return pid; } static int get_exit_status(int pid) { int status=0; pid_t cid; while ((cid=waitpid(pid, &status, WUNTRACED)) == -1 && errno == EINTR); if(!cid) return -1; return WIFEXITED(status) ? WEXITSTATUS(status) : -2; } static void read_pipe(String& result, int file, String::Language lang){ while(true) { char *buf=new(PointerFreeGC) char[MAX_STRING+1]; ssize_t length=read(file, buf, MAX_STRING); if(length<=0) break; buf[length]=0; result.append_know_length(buf, length, lang); } } static void read_pipe(File_read_result& result, int file){ char *buf=(char*)pa_malloc(MAX_STRING+1); size_t bufsize = MAX_STRING; result.headers = 0; result.length = 0; result.str = 0; result.success = false; while(true) { ssize_t size=read(file, buf + result.length, bufsize - result.length); if(size <= 0) break; result.length += size; if(result.length >= bufsize){ bufsize *= 2; buf=(char*)pa_realloc(buf, bufsize+1); } result.str=buf; } } #endif #ifndef DOXYGEN struct Append_env_pair_info { #ifdef _MSC_VER String::Body& body; Append_env_pair_info(String::Body& abody): body(abody) {} #else char **env_ref; #endif }; #endif static void append_env_pair(HashStringString::key_type key, HashStringString::value_type value, Append_env_pair_info *info) { #ifdef _MSC_VER info->body << key << "=" << value; info->body.append_know_length("\1", 1); // placeholder for of zero byte #else String::Body body; body << key << "=" << value.cstr(); *(info->env_ref++)=body.cstrm(); #endif } PA_exec_result pa_exec(bool forced_allow, const String& file_spec, const HashStringString* env, const ArrayString& argv, String::C in) { PA_exec_result result; #ifdef NO_PA_EXECS if(!forced_allow) throw Exception(PARSER_RUNTIME, &file_spec, "parser execs are disabled [recompile parser without --disable-execs configure option]"); #endif #ifdef _MSC_VER PROCESS_INFORMATION pi; HANDLE hInWrite, hOutRead, hErrRead; const char* script_spec_cstr=file_spec.taint_cstr(String::L_FILE_SPEC); const char* cmd=buildCommand(script_spec_cstr, argv); char* env_cstr=0; if(env) { String::Body body; Append_env_pair_info info(body); env->for_each(append_env_pair, &info); env_cstr=info.body.cstrm(); for(char* replacer=env_cstr; *replacer; replacer++) if(*replacer=='\1') *replacer=0; } if(DWORD error=CreateHiddenConsoleProcess(cmd, script_spec_cstr, env_cstr, &pi, &hInWrite, &hOutRead, &hErrRead)) { char szErrorDesc[MAX_STRING]; const char* param="the file you tried to run"; size_t error_size=FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_ARGUMENT_ARRAY , NULL, error, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), szErrorDesc, sizeof(szErrorDesc), (va_list *)¶m); if(error_size>3) // ".\r\n" szErrorDesc[error_size-3]=0; throw Exception("file.execute", &file_spec, "exec failed - %s (%u). Consider adding shbang line (#!x:\\interpreter\\command line)", error_size ? szErrorDesc : "", error); } else { DWORD written_size; if(in.length>0) WriteFile(hInWrite, in.str, in.length, &written_size, NULL); CloseHandle(hInWrite); read_pipe(result.out, hOutRead); CloseHandle(hOutRead); read_pipe(result.err, hErrRead, String::L_TAINTED); CloseHandle(hErrRead); result.status=get_exit_status(pi.hProcess); // We must close the handles to the new process and its main thread // to prevent handle and memory leaks. CloseHandle(pi.hProcess); CloseHandle(pi.hThread); } #else // execve needs non const char* file_spec_cstr=file_spec.taint_cstrm(String::L_FILE_SPEC); int pipe_write, pipe_read, pipe_err; if(!forced_allow) { struct stat finfo; if(pa_stat(file_spec_cstr, &finfo)!=0) throw Exception("file.missing", &file_spec, "stat failed: %s (%d), actual filename '%s'", strerror(errno), errno, file_spec_cstr); check_safe_mode(finfo, file_spec, file_spec_cstr); } char* argv_cstrs[1+100+1]={file_spec_cstr, 0}; const int argv_size=argv.count(); const int argv_max=sizeof(argv_cstrs)/sizeof(argv_cstrs[0])-1-1; if(argv_size>argv_max) throw Exception(PARSER_RUNTIME, &file_spec, "too many arguments (%d > max %d)", argv_size, argv_max); for(int i=0; icstrm(); argv_cstrs[1+argv_size]=0; char **env_cstrs; if(env) { env_cstrs=new(PointerFreeGC) char *[env->count()+1/*0*/]; Append_env_pair_info info={env_cstrs}; env->for_each(append_env_pair, &info); *info.env_ref=0; } else env_cstrs=0; pid_t pid=execve_piped( file_spec_cstr, argv_cstrs, env_cstrs, &pipe_write, &pipe_read, &pipe_err); if(pid>0) { // in child if(in.length>0) // there is some in data PA_UNUSED int ignore_result=write(pipe_write, in.str, in.length); close(pipe_write); read_pipe(result.out, pipe_read); close(pipe_read); read_pipe(result.err, pipe_err, String::L_TAINTED); close(pipe_err); result.status=get_exit_status(pid); // negative may mean "-errno[execl()]" } else { const char* str=strerror(errno); throw Exception("file.execute", &file_spec, "%s error: %s (%d)", pid<0?"fork":"pipe", str?str:"", errno); } #endif return result; } parser-3.5.1/src/main/untaint.C0000644000076400007640000004661214712042465013264 00000000000000/** @file Parser: String class part: untaint mechanizm. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ volatile const char * IDENT_UNTAINT_C="$Id: untaint.C,v 1.179 2024/11/04 03:53:25 moko Exp $"; #include "pa_string.h" #include "pa_hash.h" #include "pa_exception.h" #include "pa_table.h" #include "pa_globals.h" #include "pa_dictionary.h" #include "pa_common.h" #include "pa_charset.h" #include "pa_request_charsets.h" #include "pa_sapi.h" extern "C" { // author forgot to do that #include "../lib/cord/include/ec.h" } #include "pa_sql_connection.h" // defines #undef CORD_ec_append // redefining to intercept flushes and implement whitespace optimization // of all consequent white space chars leaving only first one #define CORD_ec_append(x, c) \ { \ bool skip=false; \ if(optimize) switch(c) { \ case ' ': case '\n': case '\t': \ if(whitespace) \ skip=true; /*skipping subsequent*/ \ else \ whitespace=true; \ break; \ default: \ whitespace=false; \ break; \ } \ if(!skip) { \ if ((x)[0].ec_bufptr == (x)[0].ec_buf + CORD_BUFSZ) { \ CORD_ec_flush_buf(x); \ } \ *((x)[0].ec_bufptr)++ = (c); \ } \ } #define escape_fragment(action) \ for(; fragment_length--; CORD_next(info->pos)) { \ char c=CORD_pos_fetch(info->pos); \ action \ } #define encode(need_encode_func, prefix, otherwise) \ if(need_encode_func(c)) { \ CORD_ec_append(info->result, prefix); \ to_hex(c); \ } else \ CORD_ec_append(info->result, otherwise); #define to_hex(c) \ { \ CORD_ec_append(info->result, hex_digits[((unsigned char)c) >> 4]); \ CORD_ec_append(info->result, hex_digits[((unsigned char)c) & 0x0F]); \ } #define to_char(c) { CORD_ec_append(info->result, c); whitespace=false; } #define to_string(s) { CORD_ec_append_cord(info->result, (CORD)(s)); whitespace=false; } #define _default CORD_ec_append(info->result, c) inline bool need_file_encode(unsigned char c){ // russian letters and space ENABLED // encoding only these... return strchr( "*?\"<>|" #ifndef WIN32 ":\\" #endif , c)!=0; } inline bool need_uri_encode(unsigned char c){ return !(pa_isalnum(c) || strchr("_-./*", c)); } inline bool need_regex_escape(unsigned char c){ return strchr("\\^$.[]|()?*+{}-", c)!=0; } inline bool need_parser_code_escape(unsigned char c){ return strchr("^$;@()[]{}:#\"", c)!=0; } // String /* HTTP-header = field-name ":" [ field-value ] CRLF field-name = token field-value = *( field-content | LWS ) field-content = token = 1* word = token | quoted-string quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) qdtext = > quoted-pair = "\" CHAR OCTET = CHAR = tspecials = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT SP = HT = LWS = [CRLF] 1*( SP | HT ) TEXT = CTL = if(strchr("()<>@,;:\\\"/[]?={} \t", *ptr)) */ inline bool need_quote_http_header(const char* ptr, size_t size) { for(; size--; ptr++) if(strchr(";\\\"= \t" /* excluded ()<>@, :/ ? []{} */, *ptr)) return true; return false; } #ifndef DOXYGEN struct Append_fragment_info { String::Language lang; String::Languages* dest_languages; size_t dest_body_plan_length; }; #endif int append_fragment_optimizing(char alang, size_t asize, Append_fragment_info* info) { const String::Language lang=(String::Language)(unsigned char)alang; // main idea here: // tainted piece would get OPTIMIZED bit from 'lang' // clean piece would be marked OPTIMIZED manually // pieces with determined languages [not tainted|clean] would retain theirs langs info->dest_languages->append(info->dest_body_plan_length, lang==String::L_TAINTED? info->lang :lang==String::L_CLEAN? (String::Language)(String::L_CLEAN|String::L_OPTIMIZE_BIT) // ORing with OPTIMIZED flag :lang, asize); info->dest_body_plan_length+=asize; return 0; // 0=continue } int append_fragment_nonoptimizing(char alang, size_t asize, Append_fragment_info* info) { const String::Language lang=(String::Language)(unsigned char)alang; // The core idea: tainted pieces got marked with context's lang info->dest_languages->append(info->dest_body_plan_length, lang==String::L_TAINTED? info->lang :lang, asize); info->dest_body_plan_length+=asize; return 0; // 0=continue } /** appends to other String without language change */ String& String::append_to(String& dest) const { if(is_empty()) return dest; // first: fragment infos dest.langs.appendHelper(dest.body, langs, body); // next: letters dest.body<. An 'encoded-word' that appears within a 'phrase' MUST be separated from any adjacent 'word', 'text' or 'special' by 'linear-white-space'. ... (2) The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be represented as "_" (underscore, ASCII 95.). (This character may not pass through some internetwork mail gateways, but its use will greatly enhance readability of "Q" encoded data with mail readers that do not support this encoding.) Note that the "_" always represents hexadecimal 20, even if the SPACE character occupies a different code position in the character set in use. paf: obviously, without "=", or one could not differ "=E0" and "russian letter a" and without "_", or in would mean 0x20 */ inline bool mail_header_char_valid_within_Qencoded(char c) { return (pa_isalnum((unsigned char)c) || strchr("!*+-/", c)); } inline bool addr_spec_soon(const char *src) { for(char c; (c=*src); src++) if(c=='<') return true; else if(!(c==' ' || c=='\t')) return false; return false; } /** RFC Upper case should be used for hexadecimal digits "A" through "F" The 8-bit hexadecimal value 20 (e.g., ISO-8859-1 SPACE) may be represented as "_" */ inline bool mail_header_nonspace_char(char c) { return c != 0x20; } inline void ec_append(CORD_ec& result, bool& optimize, bool& whitespace, CORD_pos pos, size_t size) { while(size--) { CORD_ec_append(result, CORD_pos_fetch(pos)); CORD_next(pos); } } inline void pa_CORD_pos_advance(CORD_pos pos, size_t n) { while(true) { long avail=CORD_pos_chars_left(pos); if(avail<=0) { CORD_next(pos); if(!--n) break; } else if((size_t)avail=n CORD_pos_advance(pos, n); break; } } } #ifndef DOXYGEN struct Cstr_to_string_body_block_info { // input String::Language lang; SQL_Connection* connection; const Request_charsets* charsets; const String::Body* body; // output CORD_ec result; // private CORD_pos pos; size_t fragment_begin; bool whitespace; const char* exception; }; #endif // @todo: replace info->body->mid with something that uses info->pos int cstr_to_string_body_block(String::Language to_lang, size_t fragment_length, Cstr_to_string_body_block_info* info) { bool& whitespace=info->whitespace; size_t fragment_end=info->fragment_begin+fragment_length; //fprintf(stderr, "%d, %d =%s=\n", to_lang, fragment_length, info->body->cstr()); bool optimize=(to_lang & String::L_OPTIMIZE_BIT)!=0; if(!optimize) whitespace=false; switch(to_lang & ~String::L_OPTIMIZE_BIT) { case String::L_CLEAN: case String::L_TAINTED: case String::L_AS_IS: // clean piece // tainted piece, but undefined untaint language // for VString.as_double of tainted values // for ^process{body} evaluation // tainted, untaint language: as-is ec_append(info->result, optimize, whitespace, info->pos, fragment_length); break; case String::L_FILE_SPEC: // tainted, untaint language: file [name] { escape_fragment( encode(need_file_encode, '_', c); ); } break; case String::L_URI: // tainted, untaint language: uri { const char *fragment_str=info->body->mid(info->fragment_begin, fragment_length).cstr(); // skip source [we use recoded version] pa_CORD_pos_advance(info->pos, fragment_length); String::C output(fragment_str, fragment_length); if(info->charsets) output=Charset::transcode(output, info->charsets->source(), info->charsets->client()); char c; for(const char* src=output.str; (c=*src++); ) encode(need_uri_encode, '%', c); } break; case String::L_HTTP_HEADER: // tainted, untaint language: http-field-content-text escape_fragment(switch(c) { case '\n': case '\r': to_string(" "); break; default: _default; break; }); break; case String::L_MAIL_HEADER: // tainted, untaint language: mail-header // http://www.ietf.org/rfc/rfc2047.txt if(info->charsets) { size_t mail_size; const char *mail_ptr= info->body->mid(info->fragment_begin, mail_size=fragment_length).cstr(); // skip source [we use recoded version] pa_CORD_pos_advance(info->pos, mail_size); const char* charset_name=info->charsets->mail().NAME().cstr(); // Subject: Re: parser3: =?koi8-r?Q?=D3=C5=CD=C9=CE=C1=D2?= bool to_quoted_printable=false; bool email=false; uchar c; for(const char* src=mail_ptr; c=(uchar)*src; src++) { if(c=='\r' || c=='\n') c=' '; if(to_quoted_printable && (c==',' || c == '"' || addr_spec_soon(src))) { email=c=='<'; to_string("?="); to_quoted_printable=false; } //RFC + An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'. if(!email && ( ( !to_quoted_printable && (c & 0x80 || (c == ' ' && src == mail_ptr) ) ) // starting quote-printable-encoding on first 8bit char or leading space (issue #123) || ( to_quoted_printable && !mail_header_char_valid_within_Qencoded(c) ) )) { if(!to_quoted_printable) { to_string("=?"); to_string(charset_name); to_string("?Q?"); to_quoted_printable=true; } encode(mail_header_nonspace_char, '=', '_'); } else to_char(c); if(c=='>') email=false; } if(to_quoted_printable) // close to_string("?="); } else ec_append(info->result, optimize, whitespace, info->pos, fragment_length); break; case String::L_SQL: // tainted, untaint language: sql if(info->connection) { const char *fragment_str=info->body->mid(info->fragment_begin, fragment_length).cstr(); // skip source [we use recoded version] pa_CORD_pos_advance(info->pos, fragment_length); to_string(info->connection->quote(fragment_str, fragment_length)); } else { info->exception="untaint in SQL language failed - no connection specified"; info->fragment_begin=fragment_end; return 1; // stop processing. can't throw exception here } break; case String::L_JS: escape_fragment(switch(c) { case '\n': to_string("\\n"); break; case '"': to_string("\\\""); break; case '\'': to_string("\\'"); break; case '\\': to_string("\\\\"); break; case '\xFF': to_string("\\\xFF"); break; case '\r': to_string("\\r"); break; default: _default; break; }); break; case String::L_XML: // [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] escape_fragment(switch(c) { case '\x20': case '\x9': case '\xA': case '\xD': // this is usually removed on input _default; break; case '&': to_string("&"); break; case '>': to_string(">"); break; case '<': to_string("<"); break; case '"': to_string("""); break; case '\'': to_string("'"); break; default: if(((unsigned char)c)<0x20) { // fixing it, so that libxml would not result // in fatal error parsing text // though it really violates standard. // to indicate there were an error // replace bad char not to it's code, // which we can do, // but rather to '!' to show that input were actually // invalid. // life: shows that MSIE can somehow garble form values // so that they contain these chars. to_char('!'); } else { _default; } break; }); break; case String::L_HTML: escape_fragment(switch(c) { case '&': to_string("&"); break; case '>': to_string(">"); break; case '<': to_string("<"); break; case '"': to_string("""); break; case '\'': to_string("'"); break; default: _default; break; }); break; case String::L_REGEX: // tainted, untaint language: regex escape_fragment( if(need_regex_escape(c)) to_char('\\') _default; ); break; case String::L_JSON: // tainted, untaint language: json // escape '"' '\' '/' '\n' '\t' '\r' '\b' '\f' chars and escape chars as \uXXXX if output charset != UTF-8 { if(info->charsets==NULL || info->charsets->client().isUTF8()){ // escaping to \uXXXX is not needed escape_fragment(switch((unsigned char)c) { case '\n': to_string("\\n"); break; case '"' : to_string("\\\""); break; case '\\': to_string("\\\\"); break; case '/' : to_string("\\/"); break; case '\t': to_string("\\t"); break; case '\r': to_string("\\r"); break; case '\b': to_string("\\b"); break; case '\f': to_string("\\f"); break; case 0xE2: // \u2028 and \u2029 (line/paragraph separators), check bug #1023 if(info->charsets && info->charsets->source().isUTF8() && fragment_length>=2){ CORD_next(info->pos); char c1=CORD_pos_fetch(info->pos); CORD_next(info->pos); char c2=CORD_pos_fetch(info->pos); if((unsigned char)c1 == 0x80 && ((unsigned char)c2 >= 0xA8 && (unsigned char)c2 <= 0xAF)){ to_string("\\u20"); to_hex(((unsigned char)c2-0x80)); } else { CORD_ec_append(info->result, c); CORD_ec_append(info->result, c1); CORD_ec_append(info->result, c2); } fragment_length-=2; } else { _default; } break; default: if((unsigned char)c < 0x20){ to_string("\\u00"); to_hex(c); } else { _default; } break; }); } else { const char *fragment_str=info->body->mid(info->fragment_begin, fragment_length).cstr(); // skip source [we use recoded version] pa_CORD_pos_advance(info->pos, fragment_length); to_string(Charset::escape_JSON(String::C(fragment_str, fragment_length), info->charsets->source()).str); } } break; case String::L_HTTP_COOKIE: // tainted, untaint language: cookie (3.3.0 and higher: %uXXXX in UTF-8) if(info->charsets) { const char *fragment_str=info->body->mid(info->fragment_begin, fragment_length).cstr(); // skip source [we use recoded version] pa_CORD_pos_advance(info->pos, fragment_length); to_string(Charset::escape(String::C(fragment_str, fragment_length), info->charsets->source()).str); } else ec_append(info->result, optimize, whitespace, info->pos, fragment_length); break; case String::L_PARSER_CODE: // for auto-untaint in process escape_fragment( if(need_parser_code_escape(c)) to_char('^'); _default; ); break; default: SAPI::die("unknown untaint language #%d", static_cast(to_lang)); // should never break; // never } info->fragment_begin=fragment_end; return 0; // 0=continue } String::Body String::cstr_to_string_body_taint(Language lang, SQL_Connection* connection, const Request_charsets *charsets) const { if(is_empty()) return String::Body(); Cstr_to_string_body_block_info info; // input info.lang=lang; info.connection=connection; info.charsets=charsets; info.body=&body; // output CORD_ec_init(info.result); // private body.set_pos(info.pos, 0); info.fragment_begin=0; info.exception=0; info.whitespace=true; cstr_to_string_body_block(lang, length(), &info); if(info.exception) throw Exception(0, 0, info.exception); return String::Body(CORD_ec_to_cord(info.result)); } int cstr_to_string_body_block_untaint(char alang, size_t fragment_length, Cstr_to_string_body_block_info* info){ const String::Language lang=(String::Language)(unsigned char)alang; // see append_fragment_* for explanation if(info->lang&String::L_OPTIMIZE_BIT) return cstr_to_string_body_block( lang==String::L_TAINTED? info->lang :lang==String::L_CLEAN? (String::Language)(String::L_CLEAN|String::L_OPTIMIZE_BIT) :lang, fragment_length, info); else return cstr_to_string_body_block(lang==String::L_TAINTED ? info->lang:lang, fragment_length, info); } String::Body String::cstr_to_string_body_untaint(Language lang, SQL_Connection* connection, const Request_charsets *charsets) const { if(is_empty()) return String::Body(); Cstr_to_string_body_block_info info; // input info.lang=lang; info.connection=connection; info.charsets=charsets; info.body=&body; // output CORD_ec_init(info.result); // private body.set_pos(info.pos, 0); info.fragment_begin=0; info.exception=0; info.whitespace=true; langs.for_each(body, cstr_to_string_body_block_untaint, &info); if(info.exception) throw Exception(0, 0, info.exception); return String::Body(CORD_ec_to_cord(info.result)); } const char* String::untaint_and_transcode_cstr(Language lang, const Request_charsets *charsets) const { if(charsets && &charsets->source() != &charsets->client()){ // Note: L_URI is allready transcoded during untaint, but transcode does not affect %XX return Charset::transcode(cstr_to_string_body_untaint(lang, 0, charsets), charsets->source(), charsets->client()).cstr(); } else return cstr_to_string_body_untaint(lang, 0, charsets).cstr(); } parser-3.5.1/src/main/pa_common.C0000644000076400007640000007746614732404263013565 00000000000000/** @file Parser: commonly functions. Copyright (c) 2000-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_common.h" #include "pa_exception.h" #include "pa_hash.h" #include "pa_globals.h" #include "pa_charsets.h" #include "pa_http.h" #include "pa_request_charsets.h" #include "pa_request.h" #include "pa_idna.h" #include "pa_convert_utf.h" #ifdef _MSC_VER #include #include #endif #ifdef _MSC_VER #define pa_mkdir(path, mode) _mkdir(path) #else #define pa_mkdir(path, mode) mkdir(path, mode) #endif volatile const char * IDENT_PA_COMMON_C="$Id: pa_common.C,v 1.336 2024/12/23 16:59:17 moko Exp $" IDENT_PA_COMMON_H IDENT_PA_HASH_H IDENT_PA_ARRAY_H IDENT_PA_STACK_H; // some maybe-undefined constants #ifndef _O_TEXT # define _O_TEXT 0 #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #ifdef HAVE_FTRUNCATE # define PA_O_TRUNC 0 #else # ifdef _O_TRUNC # define PA_O_TRUNC _O_TRUNC # else # error you must have either ftruncate function or _O_TRUNC bit declared # endif #endif // defines for globals #define FILE_STATUS_NAME "status" // globals const String file_status_name(FILE_STATUS_NAME); String sql_bind_name(SQL_BIND_NAME); String sql_limit_name(PA_SQL_LIMIT_NAME); String sql_offset_name(PA_SQL_OFFSET_NAME); String sql_default_name(SQL_DEFAULT_NAME); String sql_distinct_name(SQL_DISTINCT_NAME); String sql_value_type_name(SQL_VALUE_TYPE_NAME); // forwards const UTF16* pa_utf16_encode(const char* in, Charset& source_charset); // functions #ifdef _MSC_VER int pa_stat(const char *pathname, struct stat *buffer){ const UTF16* utf16name=pa_utf16_encode(pathname, pa_thread_request().charsets.source()); return _wstat64((const wchar_t *)utf16name, buffer); } int pa_open(const char *pathname, int flags, int mode){ const UTF16* utf16name=pa_utf16_encode(pathname, pa_thread_request().charsets.source()); return _wopen((const wchar_t *)utf16name, flags, mode); } FILE *pa_fopen(const char *pathname, const char *mode){ const UTF16* utf16name=pa_utf16_encode(pathname, pa_thread_request().charsets.source()); const UTF16* utf16mode=pa_utf16_encode(mode, pa_thread_request().charsets.source()); return _wfopen((const wchar_t *)utf16name, (const wchar_t *)utf16mode); } #endif /// these options were handled but not checked elsewhere, now check them int pa_get_valid_file_options_count(HashStringValue& options) { int result=0; if(options.get(PA_SQL_LIMIT_NAME)) result++; if(options.get(PA_SQL_OFFSET_NAME)) result++; if(options.get(PA_COLUMN_SEPARATOR_NAME)) result++; if(options.get(PA_COLUMN_ENCLOSER_NAME)) result++; if(options.get(PA_CHARSET_NAME)) result++; return result; } #ifndef DOXYGEN struct File_read_action_info { char **data; size_t *data_size; char* buf; uint64_t offset; size_t limit; }; #endif static void file_read_action(struct stat& finfo, int f, const String& file_spec, void *context) { File_read_action_info& info = *static_cast(context); size_t to_read_size = check_file_size(info.limit && info.limit < (size_t)finfo.st_size ? info.limit : (size_t)finfo.st_size, &file_spec); if(to_read_size) { if(info.offset) pa_lseek(f, info.offset, SEEK_SET); // seek never fails as POSIX allows the file offset to be set beyond the EOF *info.data = info.buf ? info.buf : (char *)pa_malloc_atomic(to_read_size+1); ssize_t result = read(f, *info.data, to_read_size); if(result<0) throw Exception("file.read", &file_spec, "read failed: %s (%d)", strerror(errno), errno); *info.data_size = result; } else { // empty file // for both, text and binary: for text we need that terminator, for binary we need nonzero pointer to be able to save such files *info.data = (char *)pa_malloc_atomic(1); *(char*)(*info.data) = 0; *info.data_size = 0; return; } } File_read_result file_read_binary(const String& file_spec, bool fail_on_read_problem, char* buf, uint64_t offset, size_t limit) { File_read_result result = {false, 0, 0, 0}; File_read_action_info info = {&result.str, &result.length, buf, offset, limit}; result.success = file_read_action_under_lock(file_spec, "read", file_read_action, &info, 0, fail_on_read_problem); return result; } File_read_result file_read(Request_charsets& charsets, const String& file_spec, bool as_text, HashStringValue *options, bool fail_on_read_problem, size_t offset = 0, size_t limit = 0, bool transcode_text_result = true) { File_read_result result = {false, 0, 0, 0}; if(options){ int valid_options = pa_get_valid_file_options_count(*options); if(valid_options != options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } File_read_action_info info = {&result.str, &result.length, 0, offset, limit}; result.success = file_read_action_under_lock(file_spec, "read", file_read_action, &info, as_text, fail_on_read_problem); if(as_text){ if(result.success){ Charset* asked_charset = 0; if(options) if(Value* vcharset_name = options->get(PA_CHARSET_NAME)) asked_charset = &pa_charsets.get(vcharset_name->as_string()); asked_charset = pa_charsets.checkBOM(result.str, result.length, asked_charset); if(result.length && transcode_text_result && asked_charset){ // length must be checked because transcode returns CONST string in case length==0, which contradicts hacking few lines below String::C body = String::C(result.str, result.length); body=Charset::transcode(body, *asked_charset, charsets.source()); result.str = const_cast(body.str); // hacking a little result.length = body.length; } } if(result.length) fix_line_breaks(result.str, result.length); } return result; } File_read_result file_load(Request& r, const String& file_spec, bool as_text, HashStringValue *options, bool fail_on_read_problem, bool transcode_text_result) { size_t offset = 0; size_t limit = 0; if(options){ if(Value *voffset = (Value *)options->get(sql_offset_name)) offset = r.process(*voffset).as_int(); if(Value *vlimit = (Value *)options->get(sql_limit_name)) limit = r.process(*vlimit).as_int(); // no check on options count here } if(file_spec.starts_with("http://")) { if(offset || limit) throw Exception(PARSER_RUNTIME, 0, "offset and load options are not supported for HTTP:// file load"); // fail on read problem File_read_http_result http = pa_internal_file_read_http(r, file_spec, as_text, options, transcode_text_result); File_read_result result = {true, http.str, http.length, http.headers}; return result; } else return file_read(r.charsets, file_spec, as_text, options, fail_on_read_problem, offset, limit, transcode_text_result); } char* file_read_text(Request_charsets& charsets, const String& file_spec, bool fail_on_read_problem) { File_read_result file = file_read(charsets, file_spec, true, 0, fail_on_read_problem); return file.success ? file.str : 0; } char* file_load_text(Request& r, const String& file_spec, bool fail_on_read_problem, HashStringValue* options, bool transcode_result) { File_read_result file = file_load(r, file_spec, true, options, fail_on_read_problem, transcode_result); return file.success ? file.str : 0; } #ifdef PA_SAFE_MODE void check_safe_mode(struct stat finfo, const String& file_spec, const char* fname) { if(finfo.st_uid/*foreign?*/!=geteuid() && finfo.st_gid/*foreign?*/!=getegid()) throw Exception(PARSER_RUNTIME, &file_spec, "parser is in safe mode: reading files of foreign group and user disabled " "[recompile parser with --disable-safe-mode configure option], " "actual filename '%s', fuid(%d)!=euid(%d) or fgid(%d)!=egid(%d)", fname, finfo.st_uid, geteuid(), finfo.st_gid, getegid() ); } #else void check_safe_mode(struct stat, const String&, const char*) { } #endif bool file_read_action_under_lock(const String& file_spec, const char* action_name, File_read_action action, void *context, bool as_text, bool fail_on_read_problem) { const char* fname=file_spec.taint_cstr(String::L_FILE_SPEC); int f; // first open, next stat: // directory update of NTFS hard links performed on open. // ex: // a.html:^test[] and b.html hardlink to a.html // user inserts ! before ^test in a.html // directory entry of b.html in NTFS not updated at once, // they delay update till open, so we would receive "!^test[" string // if would do stat, next open. // later: it seems, even this does not help sometimes if((f=pa_open(fname, O_RDONLY | (as_text ? _O_TEXT : _O_BINARY) ))>=0) { try { int pa_errno=pa_lock_shared_blocking(f); if(pa_errno!=0) throw Exception("file.lock", &file_spec, "shared lock failed: %s (%d), actual filename '%s'", strerror(pa_errno), pa_errno, fname); struct stat finfo; if(pa_fstat(f, &finfo)!=0) throw Exception("file.missing", // hardly possible: we just opened it OK &file_spec, "stat failed: %s (%d), actual filename '%s'", strerror(errno), errno, fname); check_safe_mode(finfo, file_spec, fname); action(finfo, f, file_spec, context); } catch(...) { pa_unlock(f);close(f); if(fail_on_read_problem) rethrow; return false; } pa_unlock(f);close(f); return true; } else { if(fail_on_read_problem) throw Exception(errno==EACCES ? "file.access" : (errno==ENOENT || errno==ENOTDIR || errno==ENODEV) ? "file.missing" : 0, &file_spec, "%s failed: %s (%d), actual filename '%s'", action_name, strerror(errno), errno, fname); return false; } } void create_dir_for_file(const String& file_spec) { const char *str=file_spec.taint_cstr(String::L_FILE_SPEC); if(str[0]){ const char *pos=str+1; while((pos=strchr(pos,'/')) && pos[1]) { // to avoid trailing /, see #1166 pa_mkdir(pa_strdup(str,pos-str), 0775); pos++; } } } bool file_write_action_under_lock(const String& file_spec, const char* action_name, File_write_action action, void *context, bool as_text, bool do_append, bool do_block, bool fail_on_lock_problem) { const char* fname=file_spec.taint_cstr(String::L_FILE_SPEC); int f; if(access(fname, W_OK)!=0) // no create_dir_for_file(file_spec); if((f=pa_open(fname, O_CREAT | O_RDWR | (as_text ? _O_TEXT : _O_BINARY) | (do_append ? O_APPEND : PA_O_TRUNC), 0664))>=0) { int pa_errno=do_block ? pa_lock_exclusive_blocking(f) : pa_lock_exclusive_nonblocking(f); if(pa_errno!=0) { Exception e("file.lock", &file_spec, "shared lock failed: %s (%d), actual filename '%s'", strerror(pa_errno), pa_errno, fname); close(f); if(fail_on_lock_problem) throw e; return false; } try { #if (defined(HAVE_FCHMOD) && defined(PA_SAFE_MODE)) struct stat finfo; if(pa_fstat(f, &finfo)==0 && finfo.st_mode & 0111) fchmod(f, finfo.st_mode & 0666/*clear executable bits*/); // backward: ignore errors if any #endif action(f, context); } catch(...) { #ifdef HAVE_FTRUNCATE if(!do_append) PA_UNUSED int ignore_result=ftruncate(f, lseek(f, 0, SEEK_CUR)); // one cannot use O_TRUNC, read lower #endif pa_unlock(f);close(f); rethrow; } #ifdef HAVE_FTRUNCATE if(!do_append) PA_UNUSED int ignore_result=ftruncate(f, lseek(f, 0, SEEK_CUR)); // O_TRUNC truncates even exclusevely write-locked file [thanks to Igor Milyakov for discovering] #endif pa_unlock(f);close(f); return true; } else throw Exception(errno==EACCES ? "file.access" : 0, &file_spec, "%s failed: %s (%d), actual filename '%s'", action_name, strerror(errno), errno, fname); // here should be nothing, see rethrow above } #ifndef DOXYGEN struct File_write_action_info { const char* str; size_t length; }; #endif static void file_write_action(int f, void *context) { File_write_action_info& info=*static_cast(context); if(info.length) { ssize_t written=write(f, info.str, info.length); if(written<0) throw Exception("file.write", 0, "write failed: %s (%d)", strerror(errno), errno); if((size_t)written!=info.length) throw Exception("file.write", 0, "write failed: %u of %u bytes written", written, info.length); } } void file_write( Request_charsets& charsets, const String& file_spec, const char* data, size_t size, bool as_text, bool do_append, Charset* asked_charset) { if(as_text && asked_charset){ String::C body=String::C(data, size); body=Charset::transcode(body, charsets.source(), *asked_charset); data=body.str; size=body.length; }; File_write_action_info info={data, size}; file_write_action_under_lock( file_spec, "write", file_write_action, &info, as_text, do_append); } static size_t get_dir(char* fname, size_t helper_length){ bool dir=false; size_t pos=0; for(pos=helper_length; pos; pos--){ char c=fname[pos-1]; if(c=='/' || c=='\\'){ fname[pos-1]=0; dir=true; } else if(dir) break; } return pos; } bool entry_exists(const char* fname, struct stat *afinfo) { struct stat lfinfo; bool result=pa_stat(fname, &lfinfo)==0; if(afinfo) *afinfo=lfinfo; return result; } bool entry_exists(const String& file_spec) { return entry_exists(file_spec.taint_cstr(String::L_FILE_SPEC), 0); } static bool entry_ifdir(char *fname, bool need_dir) { if(need_dir){ size_t size=strlen(fname); while(size) { char c=fname[size-1]; if(c=='/' || c=='\\') fname[--size]=0; else break; } } struct stat finfo; if(entry_exists(fname, &finfo)) { bool is_dir=(finfo.st_mode&S_IFDIR) != 0; return is_dir==need_dir; } return false; } static bool entry_ifdir(const String& file_spec, bool need_dir) { return entry_ifdir(file_spec.taint_cstrm(String::L_FILE_SPEC), need_dir); } // throws nothing! [this is required in file_move & file_delete] static void rmdir(const String& file_spec, size_t pos_after) { char* dir_spec=file_spec.taint_cstrm(String::L_FILE_SPEC); size_t length=strlen(dir_spec); while( (length=get_dir(dir_spec, length)) && (length > pos_after) ){ #ifdef _MSC_VER if(!entry_ifdir(dir_spec, true)) break; DWORD attrs=GetFileAttributes(dir_spec); if( (attrs==INVALID_FILE_ATTRIBUTES) || !(attrs & FILE_ATTRIBUTE_DIRECTORY) || (attrs & FILE_ATTRIBUTE_REPARSE_POINT) ) break; #endif if( rmdir(dir_spec) ) break; }; } bool file_delete(const String& file_spec, bool fail_on_problem, bool keep_empty_dirs) { const char* fname=file_spec.taint_cstr(String::L_FILE_SPEC); if(unlink(fname)!=0) { if(fail_on_problem) throw Exception(errno==EACCES?"file.access":errno==ENOENT?"file.missing":0, &file_spec, "unlink failed: %s (%d), actual filename '%s'", strerror(errno), errno, fname); else return false; } if(!keep_empty_dirs) rmdir(file_spec, 1); return true; } void file_move(const String& old_spec, const String& new_spec, bool keep_empty_dirs) { const char* old_spec_cstr=old_spec.taint_cstr(String::L_FILE_SPEC); const char* new_spec_cstr=new_spec.taint_cstr(String::L_FILE_SPEC); create_dir_for_file(new_spec); if(rename(old_spec_cstr, new_spec_cstr)!=0) throw Exception(errno==EACCES ? "file.access" : errno==ENOENT ? "file.missing" : 0, &old_spec, "rename failed: %s (%d), actual filename '%s' to '%s'", strerror(errno), errno, old_spec_cstr, new_spec_cstr); if(!keep_empty_dirs) rmdir(old_spec, 1); } bool file_exist(const String& file_spec) { return entry_ifdir(file_spec, false); } bool dir_exists(const String& file_spec) { return entry_ifdir(file_spec, true); } const String* file_exist(const String& path, const String& name) { String& result=*new String(path); if(path.last_char() != '/') result << "/"; result << name; return file_exist(result)?&result:0; } bool file_executable(const String& file_spec) { return access(file_spec.taint_cstr(String::L_FILE_SPEC), X_OK)==0; } bool file_stat(const String& file_spec, uint64_t& rsize, time_t& ratime, time_t& rmtime, time_t& rctime, bool fail_on_read_problem) { const char* fname=file_spec.taint_cstr(String::L_FILE_SPEC); struct stat finfo; if(pa_stat(fname, &finfo)!=0) { if(fail_on_read_problem) throw Exception("file.missing", &file_spec, "getting file size failed: %s (%d), real filename '%s'", strerror(errno), errno, fname); else return false; } rsize=finfo.st_size; ratime=(time_t)finfo.st_atime; rmtime=(time_t)finfo.st_mtime; rctime=(time_t)finfo.st_ctime; return true; } size_t check_file_size(uint64_t size, const String* file_spec){ if(size > (uint64_t)pa_file_size_limit) throw Exception(PARSER_RUNTIME, file_spec, "content size of %.15g bytes exceeds the limit (%.15g bytes)", (double)size, (double)pa_file_size_limit); return (size_t)size; } /** String related functions */ bool capitalized(const char* s){ bool upper=true; for(const char* c=s; *c; c++){ if(*c != (upper ? toupper((unsigned char)*c) : tolower((unsigned char)*c))) return false; upper=strchr("-_ ", *c) != 0; } return true; } const char* capitalize(const char* s){ if(!s || capitalized(s)) return s; char* result=pa_strdup(s); if(result){ bool upper=true; for(char* c=result; *c; c++){ *c=upper ? (char)toupper((unsigned char)*c) : (char)tolower((unsigned char)*c); upper=strchr("-_ ", *c) != 0; } } return (const char*)result; } char *str_lower(const char *s, size_t length){ char *result=pa_strdup(s, length); for(char* c=result; *c; c++) *c=(char)tolower((unsigned char)*c); return result; } char *str_upper(const char *s, size_t length){ char *result=pa_strdup(s, length); for(char* c=result; *c; c++) *c=(char)toupper((unsigned char)*c); return result; } void fix_line_breaks(char *str, size_t& length) { //_asm int 3; const char* const eob=str+length; char* dest=str; // fix DOS: \r\n -> \n // fix Macintosh: \r -> \n char* bol=str; while(char* eol=(char*)memchr(bol, '\r', eob -bol)) { size_t len=eol-bol; if(dest!=bol) memmove(dest, bol, len); dest+=len; *dest++='\n'; if(&eol[1]= path; c--) { if(*c == '/' || *c == '\\') return c+1; } return path; } // format: %[flags][width][.precision]type http://msdn.microsoft.com/ru-ru/library/56e442dc(en-us,VS.80).aspx // flags: '-', '+', ' ', '#', '0' http://msdn.microsoft.com/ru-ru/library/8aky45ct(en-us,VS.80).aspx // width, precision: non negative decimal number enum FormatType { FormatInvalid, FormatInt, FormatUInt, FormatDouble }; FormatType format_type(const char* fmt){ enum FormatState { Percent, Flags, Width, Precision, Done } state=Percent; FormatType result=FormatInvalid; const char* pos=fmt; while(char c=*(pos++)){ switch(state){ case Percent: if(c=='%'){ state=Flags; } else { return FormatInvalid; // 1st char must be '%' only } break; case Flags: if(strchr("-+ #0", c)!=0){ break; } // go to the next step case Width: if(c=='.'){ state=Precision; break; } // go to the next step case Precision: if(c>='0' && c<='9'){ if(state == Flags) state=Width; // no more flags break; } else if(c=='d' || c=='i'){ result=FormatInt; } else if(strchr("feEgG", c)!=0){ result=FormatDouble; } else if(strchr("uoxX", c)!=0){ result=FormatUInt; } else { return FormatInvalid; // invalid char } state=Done; break; case Done: return FormatInvalid; // no chars allowed after 'type' } } return result; } const char* format_double(double value, const char* fmt) { char local_buf[MAX_NUMBER]; int size=-1; if(fmt && strlen(fmt)){ switch(format_type(fmt)){ case FormatDouble: size=snprintf(local_buf, sizeof(local_buf), fmt, value); break; case FormatUInt: if(value >= 0){ // on Apple M1 (uint) is 0 size=snprintf(local_buf, sizeof(local_buf), fmt, clip2uint(value)); break; } case FormatInt: size=snprintf(local_buf, sizeof(local_buf), fmt, clip2int(value)); break; case FormatInvalid: throw Exception(PARSER_RUNTIME, 0, "Incorrect format string '%s' was specified.", fmt); } } else return pa_itoa(clip2int(value)); if(size < 0 || size >= MAX_NUMBER-1){ // on win32 we manually reduce max size while printing throw Exception(PARSER_RUNTIME, 0, "Error occurred white executing snprintf with format string '%s'.", fmt); } return pa_strdup(local_buf, (size_t)size); } size_t stdout_write(const void *buf, size_t size) { #ifdef WIN32 size_t to_write = size; do{ int chunk_written=fwrite(buf, 1, min((size_t)8*0x400, size), stdout); if(chunk_written<=0) break; size-=chunk_written; buf=((const char*)buf)+chunk_written; } while(size>0); fflush(stdout); return to_write-size; #else size_t result=fwrite(buf, 1, size, stdout); fflush(stdout); return result; #endif } enum EscapeState { EscapeRest, EscapeFirst, EscapeSecond, EscapeUnicode }; // @todo prescan for reduce required size (unescaped sting in 1 byte charset requires less memory usually) char* unescape_chars(const char* cp, int len, Charset* charset, bool js){ char* s=new(PointerFreeGC) char[len+1]; // must be enough (%uXXXX==6 bytes, max utf-8 char length==6 bytes) XMLByte* dst=(XMLByte *)s; EscapeState escapeState=EscapeRest; uint escapedValue=0; int srcPos=0; short int jsCnt=0; while(srcPosstore_Char(dst, (XMLCh)escapedValue, '?'); escapeState=EscapeRest; } } else { // not full unicode value escapeState=EscapeRest; } break; } } srcPos++; } *dst=0; // zero-termination return s; } char *search_stop(char*& current, char cstop_at) { // sanity check if(!current) return 0; // skip leading WS while(*current==' ' || *current=='\t') current++; if(!*current) return current=0; char *result=current; if(char *pstop_at=strchr(current, cstop_at)) { *pstop_at=0; current=pstop_at+1; } else current=0; return result; } #ifdef WIN32 void back_slashes_to_slashes(char* s) { if(s) for(; *s; s++) if(*s=='\\') *s='/'; } #endif size_t strpos(const char *str, const char *substr) { const char *p = strstr(str, substr); return (p==0)?STRING_NOT_FOUND:p-str; } size_t remove_crlf(char* start, char* end) { char* from=start; char* to=start; bool skip=false; while(from < end){ switch(*from){ case '\n': case '\r': case '\t': case ' ': if(!skip){ *to=' '; to++; skip=true; } break; default: if(from != to) *to=*from; to++; skip=false; } from++; } return to-start; } const char* hex_digits="0123456789ABCDEF"; const char* hex_string(unsigned char* bytes, size_t size, bool upcase) { char *bytes_hex=new(PointerFreeGC) char [size*2/*byte->hh*/+1/*for zero-teminator*/]; unsigned char *src=bytes; unsigned char *end=bytes+size; char *dest=bytes_hex; const char *hex=upcase? hex_digits : "0123456789abcdef"; for(; src 0; j--) { if(dwCrc & 1) dwCrc = (dwCrc >> 1) ^ dwPolynomial; else dwCrc >>= 1; } crc32Table[i] = dwCrc; } } } inline void CalcCrc32(const unsigned char byte, unsigned long &crc32) { crc32 = ((crc32) >> 8) ^ crc32Table[(byte) ^ ((crc32) & 0x000000FF)]; } unsigned long pa_crc32(const char *in, size_t in_size){ unsigned long crc32=0xFFFFFFFF; InitCrc32Table(); for(size_t i = 0; i(context); if(finfo.st_size) { InitCrc32Table(); int nCount=0; do { unsigned char buffer[FILE_BUFFER_SIZE]; nCount = file_block_read(f, buffer, sizeof(buffer)); for(int i = 0; i < nCount; i++) CalcCrc32(buffer[i], crc32); } while(nCount > 0); } } unsigned long pa_crc32(const String& file_spec){ unsigned long crc32=0xFFFFFFFF; file_read_action_under_lock(file_spec, "crc32", file_crc32_file_action, &crc32); return ~crc32; } // content-type: xxx; charset=WE-NEED-THIS // content-type: xxx; charset="WE-NEED-THIS" // content-type: xxx; charset="WE-NEED-THIS"; Charset* detect_charset(const char* content_type){ if(content_type){ char* CONTENT_TYPE=str_upper(content_type); if(const char* begin=strstr(CONTENT_TYPE, "CHARSET=")){ begin+=8; // skip "CHARSET=" char* end=0; if(*begin && (*begin=='"' || *begin =='\'')){ char quote=*begin; begin++; end=(char*)strchr(begin, quote); } if(!end) end=(char*)strchr(begin, ';'); if(end) *end=0; // terminator return *begin ? &pa_charsets.get_direct(begin) : 0; } } return 0; } const UTF16* pa_utf16_encode(const char* in, Charset& source_charset){ if(!in) return 0; String::C sIn(in,strlen(in)); UTF16* utf16=(UTF16*)pa_malloc_atomic(sIn.length*2+2); UTF16* utf16_end=utf16; if(!source_charset.isUTF8()) sIn=Charset::transcode(sIn, source_charset, pa_UTF8_charset); int status=pa_convertUTF8toUTF16((const UTF8**)&sIn.str, (const UTF8*)(sIn.str+sIn.length), &utf16_end, utf16+sIn.length, strictConversion); if(status != conversionOK) throw Exception("utf-16 encode", new String(in), "utf-16 conversion failed (%d)", status); *utf16_end=0; return utf16; } const char* pa_utf16_decode(const UTF16* in, Charset& asked_charset){ if(!in) return 0; const UTF16* utf16_start=in; const UTF16* utf16_end; for(utf16_end=in; *utf16_end; utf16_end++); char *result = (char *)pa_malloc_atomic((utf16_end-in)*6+1); char *result_end = result; int status=pa_convertUTF16toUTF8(&utf16_start, utf16_end, (UTF8**)&result_end, (UTF8*)(result+(utf16_end-in)*6), strictConversion); if(status != conversionOK) throw Exception("utf-16 decode", 0, "utf conversion failed (%d)", status); *result_end='\0'; if(asked_charset.isUTF8()) return result; return Charset::transcode(result, pa_UTF8_charset, asked_charset).cstr(); } static bool is_latin(const char *in){ for(; *in; in++){ if ((unsigned char)(*in) > 0x7F) return false; } return true; } #define MAX_IDNA_LENGTH 256 const char *pa_idna_encode(const char *in, Charset& source_charset){ if(!in || is_latin(in)) return in; uint32_t utf32[MAX_IDNA_LENGTH]; uint32_t *utf32_end=utf32; String::C sIn(in,strlen(in)); if(!source_charset.isUTF8()) sIn=Charset::transcode(sIn, source_charset, pa_UTF8_charset); int status=pa_convertUTF8toUTF32((const UTF8**)&sIn.str, (const UTF8*)(sIn.str+sIn.length), &utf32_end, utf32+MAX_IDNA_LENGTH-1, strictConversion); if(status != conversionOK) throw Exception("idna encode", new String(in), "utf conversion failed (%d)", status); *utf32_end=0; char *result = (char *)pa_malloc(MAX_IDNA_LENGTH); status=pa_idna_to_ascii_4z(utf32, result, MAX_IDNA_LENGTH, 0); if(status != IDNA_SUCCESS) throw Exception("idna encode", new String(in), "encode failed: %s", pa_idna_strerror(status)); return result; } const char *pa_idna_decode(const char *in, Charset &asked_charset){ if(!in || !(*in)) return in; uint32_t utf32[MAX_IDNA_LENGTH]; const uint32_t *utf32_start=utf32; uint32_t *utf32_end; int status=pa_idna_to_unicode_4z(in, utf32, MAX_IDNA_LENGTH, 0); if(status != IDNA_SUCCESS) throw Exception("idna decode", new String(in), "decode failed: %s", pa_idna_strerror(status)); for(utf32_end=utf32; *utf32_end; utf32_end++); char *result = (char *)pa_malloc(MAX_IDNA_LENGTH); char *result_end = result; status=pa_convertUTF32toUTF8(&utf32_start, utf32_end, (UTF8**)&result_end, (UTF8*)(result+MAX_IDNA_LENGTH-1), strictConversion); if(status != conversionOK) throw Exception("idna decode", new String(in), "utf conversion failed (%d)", status); *result_end='\0'; if(!asked_charset.isUTF8()) result = (char *)Charset::transcode(result, pa_UTF8_charset, asked_charset).cstr(); return result; } /// must be last in this file #undef vsnprintf int pa_vsnprintf(char* b, size_t s, const char* f, va_list l) { if(!s) return 0; int r; // note: on win32 & maybe somewhere else // vsnprintf do not writes terminating 0 in 'buffer full' case, reducing // http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 --s; // clients do not check for negative 's', feature: ignore such prints if((ssize_t)s<0) return 0; #ifdef _MSC_VER // win32: if the number of bytes to write exceeds buffer, then count bytes are written and -1 is returned r=_vsnprintf(b, s, f, l); if(r<0) r=s; #else r=vsnprintf(b, s, f, l); /* solaris: man vsnprintf The snprintf() function returns the number of characters formatted, that is, the number of characters that would have been written to the buffer if it were large enough. If the value of n is 0 on a call to snprintf(), an unspecified value less than 1 is returned. */ if(r<0) r=0; else if((size_t)r>s) r=s; #endif b[r]=0; return r; } int pa_snprintf(char* b, size_t s, const char* f, ...) { va_list l; va_start(l, f); int r=pa_vsnprintf(b, s, f, l); va_end(l); return r; } parser-3.5.1/src/main/pa_pool.C0000644000076400007640000000254314712042465013226 00000000000000/** @file Parser: pool class. Copyright (c) 2000-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_pool.h" #include "pa_exception.h" #include "pa_common.h" #include "pa_sapi.h" #include "pa_charset.h" volatile const char * IDENT_PA_POOL_C="$Id: pa_pool.C,v 1.68 2024/11/04 03:53:25 moko Exp $" IDENT_PA_POOL_H; // Pool Pool::Pool(){} static void cleanup(Pool::Cleanup item, int) { if(item.cleanup) item.cleanup(item.data); } Pool::~Pool() { //__asm__("int3"); //_asm int 3; //fprintf(stderr, "cleanups: %d\n", cleanups.size()); // cleanups first, because they use some object's memory pointers cleanups.for_each(cleanup, 0); } void Pool::register_cleanup(void (*cleanup) (void *), void *data) { cleanups+=Cleanup(cleanup, data); } static void unregister_cleanup(Pool::Cleanup& item, void* cleanup_data) { if(item.data==cleanup_data) item.cleanup=0; } void Pool::unregister_cleanup(void *cleanup_data) { cleanups.for_each_ref(::unregister_cleanup, cleanup_data); } // Pooled static void cleanup(void *data) { static_cast(data)->~Pooled(); } Pooled::Pooled(Pool& apool): fpool(apool) { fpool.register_cleanup(cleanup, this); } /// Sole: this got called automatically from Pool::~Pool() Pooled::~Pooled() { fpool.unregister_cleanup(this); } parser-3.5.1/src/main/pa_dictionary.C0000644000076400007640000000410614712042465014417 00000000000000/** @file Parser: dictionary class impl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_dictionary.h" #include "pa_exception.h" volatile const char * IDENT_PA_DICTIONARY_C="$Id: pa_dictionary.C,v 1.32 2024/11/04 03:53:25 moko Exp $" IDENT_PA_DICTIONARY_H; Dictionary::Dictionary(Table& atable): substs(atable.count()) { // clear starting_lines memset(starting_line_of, 0, sizeof(starting_line_of)); // grab first letters of first column of a table constructor_line=1; for(Array_iterator i(atable); i; ) { ArrayString* row=i.next(); append_subst( row->get(0), (row->count()>1) ? row->get(1) : 0, "dictionary table 'from' column elements must not be empty" ); } } Dictionary::Dictionary(const String& from, const String& to): substs(1) { // clear starting_lines memset(starting_line_of, 0, sizeof(starting_line_of)); constructor_line=1; append_subst(&from, &to); } void Dictionary::append_subst(const String* from, const String* to, const char* exception_cstr) { if(from->is_empty()) throw Exception(PARSER_RUNTIME, 0, exception_cstr ? exception_cstr : "'from' must not be empty"); // record simplier 'from' for quick comparisons in 'starts' extremely-tight-callback substs+=Dictionary::Subst(from->cstr(), (to && !to->is_empty()) ? to : 0); unsigned char c=(unsigned char)from->first_char(); if(!starting_line_of[c]) starting_line_of[c]=constructor_line; constructor_line++; } #ifndef DOXYGEN struct First_that_begins_info { int line; const char* str; }; #endif static bool starts(Dictionary::Subst subst, First_that_begins_info* info) { // skip irrelevant lines if(info->line>1) { --info->line; return 0; } return strncmp(subst.from, info->str, subst.from_length)==0; } Dictionary::Subst Dictionary::first_that_begins(const char* str) const { First_that_begins_info info; if((info.line=starting_line_of[(unsigned char)*str])) { info.str=str; return substs.first_that(starts, &info); } else return 0; } parser-3.5.1/src/main/pa_xml_exception.C0000644000076400007640000000251014712042465015125 00000000000000/** @file Parser: exception class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #ifdef XML #include "pa_xml_exception.h" #include "pa_globals.h" #include "pa_common.h" #include "pa_charset.h" volatile const char * IDENT_PA_XML_EXCEPTION_C="$Id: pa_xml_exception.C,v 1.14 2024/11/04 03:53:25 moko Exp $" IDENT_PA_XML_EXCEPTION_H; // methods XmlException::XmlException(const String* aproblem_source, const char* aproblem_comment, ...) { ftype="xml"; fproblem_source=aproblem_source; fcomment=new(PointerFreeGC) char[MAX_STRING]; va_list args; va_start(args, aproblem_comment); vsnprintf((char *)fcomment, MAX_STRING, aproblem_comment, args); va_end(args); } XmlException::XmlException(const String* aproblem_source, Request& r){ ftype="xml"; fproblem_source=aproblem_source; if(const char* xml_generic_errors=xmlGenericErrors()){ fcomment=pa_strdup(xml_generic_errors); if(r.charsets.source().isUTF8()) fcomment=fixUTF8(fcomment); } else fcomment="-UNKNOWN ERROR-"; } XmlException::XmlException(){ ftype="xml"; fproblem_source=0; if(const char* xml_generic_errors=xmlGenericErrors()) fcomment=pa_strdup(xml_generic_errors); else fcomment="-UNKNOWN ERROR-"; } #endif parser-3.5.1/src/main/pa_symbols.C0000644000076400007640000000411014720373040013730 00000000000000/** @file Parser: static symbols cache implementation. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev */ #include "pa_symbols.h" #include "pa_vstring.h" volatile const char * IDENT_PA_SYMBOLS_C="$Id: pa_symbols.C,v 1.13 2024/11/23 15:34:56 moko Exp $" IDENT_PA_SYMBOLS_H; const String Symbols::SELF_SYMBOL("self"); const String Symbols::CALLER_SYMBOL("caller"); const String Symbols::RESULT_SYMBOL("result"); const String Symbols::CLASS_SYMBOL("CLASS"); const String Symbols::CLASS_NAME_SYMBOL("CLASS_NAME"); const String Symbols::METHOD_SYMBOL("method"); const String Symbols::NAME_SYMBOL("name"); const String Symbols::STATIC_SYMBOL("static"); const String Symbols::DYNAMIC_SYMBOL("dynamic"); const String Symbols::LOCALS_SYMBOL("locals"); const String Symbols::PARTIAL_SYMBOL("partial"); const String Symbols::REM_SYMBOL("rem"); const String Symbols::FIELDS_SYMBOL("fields"); const String Symbols::_DEFAULT_SYMBOL("_default"); const String Symbols::TABLES_SYMBOL("tables"); const String Symbols::FILES_SYMBOL("files"); const String Symbols::IMAP_SYMBOL("imap"); const String Symbols::ELEMENTS_SYMBOL("elements"); #ifdef SYMBOLS_CACHING Symbols *symbols=0; void Symbols::add(const String &astring){ put_dont_replace(astring,new VString(astring)); } void Symbols::set(const String &astring){ put(astring,new VString(astring)); } Symbols &Symbols::instance(){ static Symbols singleton; return singleton; } void Symbols::init(){ symbols=&instance(); symbols->set(SELF_SYMBOL); symbols->set(CALLER_SYMBOL); symbols->set(RESULT_SYMBOL); symbols->set(CLASS_SYMBOL); symbols->set(CLASS_NAME_SYMBOL); symbols->set(METHOD_SYMBOL); symbols->set(NAME_SYMBOL); symbols->set(STATIC_SYMBOL); symbols->set(DYNAMIC_SYMBOL); symbols->set(LOCALS_SYMBOL); symbols->set(PARTIAL_SYMBOL); symbols->set(REM_SYMBOL); symbols->set(FIELDS_SYMBOL); symbols->set(_DEFAULT_SYMBOL); symbols->set(TABLES_SYMBOL); symbols->set(FILES_SYMBOL); symbols->set(IMAP_SYMBOL); symbols->set(ELEMENTS_SYMBOL); } #endif // SYMBOLS_CACHING parser-3.5.1/src/main/compile.y0000644000076400007640000013046314723501746013322 00000000000000%{ /** @file Parser: compiler(lexical parser and grammar). Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ volatile const char * IDENT_COMPILE_Y = "$Id: compile.y,v 1.301 2024/12/03 04:07:02 moko Exp $"; /** @todo parser4: - cache compiled code from request to request. to do that... -#: make method definitions, @CLASS, @BASE, @USE instructions, which would be executed afterwards, and actions now performed at compile time would be delayed to run time. -#: make cache expiration on time and on disk-change of class source -#: in apache use subpools for compiled class storage -#: in iis make up specialized Pool object for that */ #define YYSTYPE ArrayOperation* #define YYDEBUG 1 #define YYERROR_VERBOSE 1 #define yyerror(pc, msg) real_yyerror(pc, msg) #define YYPRINT(file, type, value) yyprint(file, type, value) #define YYMALLOC pa_malloc #define YYFREE pa_free // includes #include "compile_tools.h" #include "pa_value.h" #include "pa_request.h" #include "pa_vobject.h" #include "pa_vdouble.h" #include "pa_globals.h" #include "pa_vmethod_frame.h" // defines #define CLASS_NAME "CLASS" #define USE_CONTROL_METHOD_NAME "USE" #define OPTIONS_CONTROL_METHOD_NAME "OPTIONS" // forwards static int real_yyerror(Parse_control* pc, const char* s); static void yyprint(FILE* file, int type, YYSTYPE value); static int yylex(YYSTYPE* lvalp, void* pc); static const VBool vfalse(false); static const VBool vtrue(true); static const VString vempty; // local convinient inplace typecast & var #undef PC #define PC (*pc) #undef POOL #define POOL (*PC.pool) #ifndef DOXYGEN #define CLASS_ADD if(!PC.class_add()){ \ PC.error=pa_strcat(PC.cclass->type(), " - class is already defined"); \ YYERROR; \ } #define YYERROR3(header, value, footer) { \ PC.error=pa_strcat(header, value, footer); \ YYERROR; \ } #define YYERROR1(value) { \ PC.error=value; \ YYERROR; \ } %} %pure-parser %lex-param {Parse_control* pc} %parse-param {Parse_control* pc} %token EON %token STRING %token BOGUS %token BAD_STRING_COMPARISON_OPERATOR %token BAD_HEX_LITERAL %token BAD_METHOD_DECL_START %token BAD_METHOD_PARAMETER_NAME_CHARACTER %token LAND "&&" %token LOR "||" %token LXOR "!||" %token NXOR "!|" %token NLE "<=" %token NGE ">=" %token NEQ "==" %token NNE "!=" %token NSL "<<" %token NSR ">>" %token SLT "lt" %token SGT "gt" %token SLE "le" %token SGE "ge" %token SEQ "eq" %token SNE "ne" %token DEF "def" %token IN "in" %token FEXISTS "-f" %token DEXISTS "-d" %token IS "is" %token LITERAL_TRUE "true" %token LITERAL_FALSE "false" /* logical */ %left "!||" %left "||" %left "&&" %left '<' '>' "<=" ">=" "lt" "gt" "le" "ge" %left "==" "!=" "eq" "ne" %left "is" "def" "in" "-f" "-d" /* bitwise */ %left "!|" %left '|' %left '&' %left "<<" ">>" /* numerical */ %left '+' '-' %left '*' '/' '\\' '%' %left NUNARY /* unary - + */ /* out-of-group */ %left '~' /* bitwise */ %left '!' /* logical */ %% all: one_big_piece { Method* method=new Method(Method::CT_ANY, 0, 0 /*min, max numbered_params_count*/, 0 /*param_names*/, 0 /*local_names*/, $1 /*parser_code*/, 0 /*native_code*/, PC.cclass->is_vars_local()); PC.cclass->set_method(PC.alias_method(main_method_name), method); } | methods; methods: method | methods method; one_big_piece: maybe_codes; method: control_method | code_method; control_method: '@' STRING '\n' maybe_control_strings { const String& command=LA2S(*$2)->trim(String::TRIM_END); YYSTYPE strings_code=$4; if(strings_code->count()<1*OPERATIONS_PER_OPVALUE) YYERROR3("@", command.cstr(), " is empty"); if(command==CLASS_NAME) { if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { CLASS_ADD; // new class' name const String& name=LA2S(*strings_code)->trim(String::TRIM_END); // creating the class VStateless_class* cclass=new VClass(name.cstr(), PC.request.get_used_filespec(PC.file_no)); PC.cclass_new=cclass; PC.append=false; } else { YYERROR1("@" CLASS_NAME " must contain only one line with class name (contains more than one)"); } } else if(command==USE_CONTROL_METHOD_NAME) { CLASS_ADD; for(size_t i=0; icount(); i+=OPERATIONS_PER_OPVALUE){ PC.request.use_file(LA2S(*strings_code, i)->trim(String::TRIM_END), PC.request.get_used_filespec(PC.file_no), strings_code->get(i+1).origin); } } else if(command==BASE_NAME) { if(PC.append) YYERROR3("can't set base while appending methods to class '", PC.cclass->type(), "'"); CLASS_ADD; if(PC.cclass->base_class()) // already changed from default? YYERROR3("class already have a base '", PC.cclass->base_class()->type(), "'"); if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { const String& base_name=LA2S(*strings_code)->trim(String::TRIM_END); if(VStateless_class *base_class=PC.request.get_class(base_name)) { // @CLASS == @BASE sanity check if(PC.cclass==base_class) YYERROR1("@" CLASS_NAME " equals @" BASE_NAME); PC.cclass->get_class()->set_base(base_class); } else { YYERROR3("'", base_name.cstr(), "': undefined class in @" BASE_NAME); } } else { YYERROR1("@" BASE_NAME " must contain sole name"); } } else if(command==OPTIONS_CONTROL_METHOD_NAME) { for(size_t i=0; icount(); i+=OPERATIONS_PER_OPVALUE) { const String& option=LA2S(*strings_code, i)->trim(String::TRIM_END); if(option==Symbols::LOCALS_SYMBOL){ PC.set_all_vars_local(); } else if(option==Symbols::PARTIAL_SYMBOL){ if(PC.cclass_new){ if(VStateless_class* existed=PC.get_existed_class(PC.cclass_new)){ if(!PC.reuse_existed_class(existed)) YYERROR3("can't append methods to '", PC.cclass_new->type(), "' - the class wasn't marked as partial"); } else { // marks the new class as partial. we will be able to add methods here later. PC.cclass_new->set_partial(); } } else { YYERROR1("'partial' option should be used straight after @" CLASS_NAME); } } else if(option==Symbols::STATIC_SYMBOL){ PC.set_methods_call_type(Method::CT_STATIC); } else if(option==Symbols::DYNAMIC_SYMBOL){ PC.set_methods_call_type(Method::CT_DYNAMIC); } else { YYERROR3("'", option.cstr(), "' invalid option. valid options are 'partial', 'locals', 'static' and 'dynamic'"); } } } else { YYERROR3("'", command.cstr(), "' invalid special name. valid names are '" CLASS_NAME "', '" USE_CONTROL_METHOD_NAME "', '" BASE_NAME "' and '" OPTIONS_CONTROL_METHOD_NAME "'."); } }; maybe_control_strings: empty | control_strings; control_strings: control_string | control_strings control_string { $$=$1; P(*$$, *$2); }; control_string: maybe_string '\n'; maybe_string: empty | STRING; code_method: '@' STRING bracketed_maybe_strings maybe_bracketed_strings maybe_comment '\n' { CLASS_ADD; PC.explicit_result=false; YYSTYPE params_names_code=$3; ArrayString* params_names=0; if(int size=params_names_code->count()) { params_names=new ArrayString; for(int i=0; iis_vars_local(); if(int size=locals_names_code->count()) { locals_names=new ArrayString; for(int i=0; i(&$$)=method; } maybe_codes { Method* method=reinterpret_cast($7); // fill in the code method->parser_code=$8; // register in class const String& name=*LA2S(*$2); PC.cclass->set_method(PC.alias_method(name), method); }; maybe_bracketed_strings: empty | bracketed_maybe_strings; bracketed_maybe_strings: '[' maybe_strings ']' {$$=$2;}; maybe_strings: empty | strings; strings: STRING | strings ';' STRING { $$=$1; P(*$$, *$3); }; maybe_comment: empty | STRING; /* codes */ maybe_codes: empty | codes; codes: code | codes code { $$=$1; P(*$$, *$2); }; code: write_string | action; action: get | put | call; /* get */ get: get_value { $$=N(); YYSTYPE code=$1; size_t count=code->count(); #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if(count!=3 || !change_first(*code, OP::OP_VALUE__GET_ELEMENT, /*=>*/OP::OP_VALUE__GET_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT if(count!=3 || !change_first(*code, OP::OP_WITH_SELF__VALUE__GET_ELEMENT, /*=>*/OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT if(count!=5 || !change_first(*code, OP::OP_GET_OBJECT_ELEMENT, /*=>*/OP::OP_GET_OBJECT_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT if(count!=5 || !change_first(*code, OP::OP_GET_OBJECT_VAR_ELEMENT, /*=>*/OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL if(!change(*code, count-1/* last */, OP::OP_GET_ELEMENT__SPECIAL, /*=>*/OP::OP_GET_ELEMENT__SPECIAL__WRITE) ) #endif { change_or_append(*code, count-1 /* last */, OP::OP_GET_ELEMENT, /*=>*/OP::OP_GET_ELEMENT__WRITE, /*or */OP::OP_WRITE_VALUE ); /* value=pop; wcontext.write(value) */ } P(*$$, *code); }; get_value: '$' get_name_value { $$=$2; }; get_name_value: name_without_curly_rdive EON | name_in_curly_rdive; name_in_curly_rdive: '{' name_without_curly_rdive '}' { $$=$2; }; name_without_curly_rdive: name_without_curly_rdive_read | name_without_curly_rdive_class; name_without_curly_rdive_read: name_without_curly_rdive_code { $$=N(); YYSTYPE diving_code=$1; size_t count=diving_code->count(); if(maybe_make_self(*$$, *diving_code, count)) { // $self. } else #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT if(maybe_make_get_object_element(*$$, *diving_code, count)){ // optimization for $object.field + ^object.method[ } else #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT if(maybe_make_get_object_var_element(*$$, *diving_code, count)){ // optimization for $object.$var } else #endif #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if(count>=4 && (*diving_code)[0].code==OP::OP_VALUE && (*diving_code)[3].code==OP::OP_GET_ELEMENT ){ // optimization O(*$$, (PC.in_call_value && count==4) ? OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR // ^object[ : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT_OR_OPERATOR+origin+string : OP::OP_VALUE__GET_ELEMENT // $object : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT+origin+string ); P(*$$, *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value if(count>4) P(*$$, *diving_code, 4); // copy tail } else { O(*$$, OP::OP_WITH_READ); /* stack: starting context */ P(*$$, *diving_code); } #else { O(*$$, OP::OP_WITH_READ); /* stack: starting context */ // ^if OP_ELEMENT => ^if OP_ELEMENT_OR_OPERATOR // optimized OP_VALUE+origin+string+OP_GET_ELEMENT. => OP_VALUE+origin+string+OP_GET_ELEMENT_OR_OPERATOR. if(PC.in_call_value && count==4) diving_code->put(count-1, OP::OP_GET_ELEMENT_OR_OPERATOR); P(*$$, *diving_code); } #endif /* diving code; stack: current context */ }; name_without_curly_rdive_class: class_prefix name_without_curly_rdive_code { $$=$1; P(*$$, *$2); }; name_without_curly_rdive_code: name_advance2 | name_path name_advance2 { $$=$1; P(*$$, *$2); }; /* put */ put: '$' name_expr_wdive construct { $$=N(); #ifdef OPTIMIZE_BYTECODE_CONSTRUCT if(maybe_optimize_construct(*$$, *$2, *$3)){ // $a(expr), $.a(expr), $a[value], $.a[value], $self.a[value], $self.a(expr) } else #endif { P(*$$, *$2); /* stack: context,name */ P(*$$, *$3); /* stack: context,name,constructor_value */ } }; name_expr_wdive: name_expr_wdive_root | name_expr_wdive_write | name_expr_wdive_class; name_expr_wdive_root: name_expr_dive_code { $$=N(); YYSTYPE diving_code=$1; size_t count=diving_code->count(); if(maybe_make_self(*$$, *diving_code, count)) { // $self. } else #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if(count>=4 && (*diving_code)[0].code==OP::OP_VALUE && (*diving_code)[3].code==OP::OP_GET_ELEMENT ){ O(*$$, OP::OP_WITH_ROOT__VALUE__GET_ELEMENT); P(*$$, *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value if(count>4) P(*$$, *diving_code, 4); // tail } else #endif { O(*$$, OP::OP_WITH_ROOT); /* stack: starting context */ P(*$$, *diving_code); } /* diving code; stack: current context */ }; name_expr_wdive_write: '.' name_expr_dive_code { $$=N(); O(*$$, OP::OP_WITH_WRITE); /* stack: starting context */ P(*$$, *$2); /* diving code; stack: context,name */ }; name_expr_wdive_class: class_prefix name_expr_dive_code { $$=$1; P(*$$, *$2); }; construct: construct_square | construct_round | construct_curly ; construct_square: '[' { // allow $result_or_other_variable[ letters here any time ] *reinterpret_cast(&$$)=PC.explicit_result; PC.explicit_result=false; PC.array=false; // no need to save current value as if() is right after PC.array=true; } any_constructor_code_values { PC.explicit_result=*reinterpret_cast(&$2); } ']' { // stack: context, name if(!PC.array){ $$=$3; // stack: context, name, value O(*$$, OP::OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */ } else { $$ = N(); OA(*$$, OP::OP_CONSTRUCT_ARRAY, $3); PC.array=false; } } ; any_constructor_code_values: any_constructor_code_value { $$ = $1; } | any_constructor_code_values ';' any_constructor_code_value { $$ = $1; P(*$$, *$3); PC.array=true; }; ; construct_round: '(' expr_value ')' { $$=N(); // stack: context, name P(*$$, *$2); // stack: context, name, value O(*$$, OP::OP_CONSTRUCT_EXPR); /* value=pop->as_expr_result; name=pop; context=pop; construct(context,name,value) */ } ; construct_curly: '{' maybe_codes '}' { // stack: context, name $$=N(); OA(*$$, OP::OP_CURLY_CODE__CONSTRUCT, $2); /* code=pop; name=pop; context=pop; construct(context,name,junction(code)) */ }; any_constructor_code_value: empty_value /* optimized $var[] case */ | STRING /* optimized $var[STRING] case */ | constructor_code_value /* $var[something complex] */ ; constructor_code_value: constructor_code { $$=N(); OA(*$$, OP::OP_OBJECT_POOL, $1); /* stack: empty write context */ /* some code that writes to that context */ /* context=pop; stack: context.value() */ }; constructor_code: codes__excluding_sole_str_literal; codes__excluding_sole_str_literal: action | code codes { $$=$1; P(*$$, *$2); }; /* call */ call: call_value { size_t count=$1->count(); #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR if(count) #endif { $$=$1; /* stack: value */ if(!change_first(*$$, OP::OP_CONSTRUCT_OBJECT, /*=>*/ OP::OP_CONSTRUCT_OBJECT__WRITE)) change_or_append(*$$, count-2 /* second last */, OP::OP_CALL, /*=>*/ OP::OP_CALL__WRITE, /*or */ OP::OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ } }; call_value: '^' { PC.in_call_value=true; } call_name { PC.in_call_value=false; } store_params EON { /* ^field.$method{vasya} */ #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT const String* operator_name=LA2S(*$3, 0, OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR); #else const String* operator_name=LA2S(*$3, 1); #endif if(operator_name && SYMBOLS_EQ(*operator_name,REM_SYMBOL)){ $$=N(); } else #endif { YYSTYPE params_code=$5; if(params_code->count()==3) { // probably [] case. [OP::OP_VALUE+origin+Void] if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value? if(const String * string=value->get_string()) if(string->is_empty()) // value is empty string? params_code=0; // ^zzz[] case. don't append lone empty param. } /* stack: context, method_junction */ YYSTYPE var_code=$3; if( var_code->count()==8 && ( (*var_code)[0].code==OP::OP_VALUE__GET_CLASS || (*var_code)[0].code==OP::OP_VALUE__GET_BASE_CLASS ) && (*var_code)[3].code==OP::OP_PREPARE_TO_CONSTRUCT_OBJECT && (*var_code)[4].code==OP::OP_VALUE #ifdef FEATURE_GET_ELEMENT4CALL && (*var_code)[7].code==OP::OP_GET_ELEMENT4CALL #else && (*var_code)[7].code==OP::OP_GET_ELEMENT #endif ){ $$=N(); O(*$$, OP::OP_CONSTRUCT_OBJECT); P(*$$, *var_code, 1/*offset*/, 2/*limit*/); // class name P(*$$, *var_code, 5/*offset*/, 2/*limit*/); // constructor name OA(*$$, params_code); } else { $$=var_code; /* with_xxx,diving code; stack: context,method_junction */ OA(*$$, OP::OP_CALL, params_code); // method_frame=make frame(pop junction); ncontext=pop; call(ncontext,method_frame) stack: value } } }; call_name: name_without_curly_rdive { #ifdef FEATURE_GET_ELEMENT4CALL size_t count=$1->count(); if(count){ $$=$1; #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT !(count==5 && change_first(*$$, OP::OP_GET_OBJECT_ELEMENT, OP::OP_GET_OBJECT_ELEMENT4CALL)) && #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT !(count==5 && change_first(*$$, OP::OP_GET_OBJECT_VAR_ELEMENT, OP::OP_GET_OBJECT_VAR_ELEMENT4CALL)) && #endif !change(*$$, count-1, OP::OP_GET_ELEMENT, OP::OP_GET_ELEMENT4CALL); } #endif }; store_params: store_param | store_params store_param { $$=$1; P(*$$, *$2); }; store_param: store_square_param | store_round_param | store_curly_param ; store_square_param: '[' { // allow ^call[ letters here any time ] *reinterpret_cast(&$$)=PC.explicit_result; PC.explicit_result=false; } store_code_param_parts { PC.explicit_result=*reinterpret_cast(&$2); } ']' {$$=$3;}; store_round_param: '(' store_expr_param_parts ')' {$$=$2;}; store_curly_param: '{' store_curly_param_parts '}' {$$=$2;}; store_code_param_parts: store_code_param_part | store_code_param_parts ';' store_code_param_part { $$=$1; P(*$$, *$3); } ; store_expr_param_parts: store_expr_param_part | store_expr_param_parts ';' store_expr_param_part { $$=$1; P(*$$, *$3); } ; store_curly_param_parts: store_curly_param_part | store_curly_param_parts ';' store_curly_param_part { $$=$1; P(*$$, *$3); } ; store_code_param_part: code_param_value { $$=$1; }; store_expr_param_part: expr_value { YYSTYPE expr_code=$1; if(expr_code->count()==3 && (*expr_code)[0].code==OP::OP_VALUE) { // optimizing (double/bool/incidently 'string' too) case. [OP::OP_VALUE+origin+Double]. no evaluating $$=expr_code; } else { YYSTYPE code=N(); P(*code, *expr_code); O(*code, OP::OP_WRITE_EXPR_RESULT); $$=N(); OA(*$$, OP::OP_EXPR_CODE__STORE_PARAM, code); } }; store_curly_param_part: maybe_codes { $$=N(); OA(*$$, OP::OP_CURLY_CODE__STORE_PARAM, $1); }; code_param_value: empty_value /* optimized [;...] case */ | STRING /* optimized [STRING] case */ | constructor_code_value /* [something complex] */ ; /* name */ name_expr_dive_code: name_expr_value | name_path name_expr_value { $$=$1; P(*$$, *$2); }; name_path: name_step | name_path name_step { $$=$1; P(*$$, *$2); }; name_step: name_advance1 '.'; name_advance1: name_expr_value { // we know that name_advance1 not called from ^xxx context // so we'll not check for operator call possibility as we do in name_advance2 /* stack: context */ $$=$1; /* stack: context,name */ #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL O(*$$, is_special_element(*$$) ? OP::OP_GET_ELEMENT__SPECIAL : OP::OP_GET_ELEMENT); #else O(*$$, OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ #endif }; name_advance2: name_expr_value { /* stack: context */ $$=$1; /* stack: context,name */ #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL O(*$$, is_special_element(*$$) ? OP::OP_GET_ELEMENT__SPECIAL : OP::OP_GET_ELEMENT); #else O(*$$, OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ #endif } | STRING BOGUS ; name_expr_value: STRING /* subname_is_const */ | name_expr_subvar_value /* $subname_is_var_value */ | name_expr_with_subvar_value /* xxx$part_of_subname_is_var_value */ | name_square_code_value /* [codes] */ | name_round_expr_value /* (expr) */ ; name_expr_subvar_value: '$' subvar_ref_name_rdive { $$=$2; O(*$$, OP::OP_GET_ELEMENT); }; name_expr_with_subvar_value: STRING subvar_get_writes { YYSTYPE code; { change_string_literal_to_write_string_literal(*(code=$1)); P(*code, *$2); } $$=N(); OA(*$$, OP::OP_STRING_POOL, code); }; name_square_code_value: '[' { // allow $result_or_other_variable[ letters here any time ] *reinterpret_cast(&$$)=PC.explicit_result; PC.explicit_result=false; } codes { PC.explicit_result=*reinterpret_cast(&$2); } ']' { $$=N(); #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL if(!maybe_append_simple_diving_code(*$$, *$3)) #endif { OA(*$$, OP::OP_OBJECT_POOL, $3); /* stack: empty write context */ /* some code that writes to that context */ /* context=pop; stack: context.value() */ } }; name_round_expr_value: '(' expr_value ')' { $$ = N(); P(*$$, *$2); }; subvar_ref_name_rdive: STRING { $$=N(); O(*$$, OP::OP_WITH_READ); P(*$$, *$1); }; subvar_get_writes: subvar__get_write | subvar_get_writes subvar__get_write { $$=$1; P(*$$, *$2); }; subvar__get_write: '$' subvar_ref_name_rdive { $$=$2; O(*$$, OP::OP_GET_ELEMENT__WRITE); }; class_prefix: class_static_prefix | class_constructor_prefix ; class_static_prefix: STRING ':' { $$=$1; // stack: class name string OP::OPCODE code = OP::OP_VALUE__GET_CLASS; if(*LA2S(*$$) == BASE_NAME) { // pseudo BASE class if(VStateless_class* base=PC.cclass->base_class()) { change_string_literal_value(*$$, *new String(base->type())); } else { YYERROR1("no base class declared"); } code = OP::OP_VALUE__GET_BASE_CLASS; } else { // can't use get_class because it will call @autouse[] if the class wasn't loaded VStateless_class* base=PC.request.classes().get(*LA2S(*$$)); if(base && PC.cclass->derived_from(*base)) code = OP::OP_VALUE__GET_BASE_CLASS; } // optimized OP_VALUE+origin+string+OP_GET_CLASS => OP_VALUE__GET_CLASS+origin+string change_first(*$$, OP::OP_VALUE, code); }; class_constructor_prefix: class_static_prefix ':' { $$=$1; if(!PC.in_call_value) YYERROR1(":: not allowed here"); O(*$$, OP::OP_PREPARE_TO_CONSTRUCT_OBJECT); }; /* expr */ expr_value: expr; expr: double_or_STRING | true_value | false_value | get_value | call_value | '"' string_inside_quotes_value '"' { $$ = $2; } | '\'' string_inside_quotes_value '\'' { $$ = $2; } | '(' expr ')' { $$ = $2; } /* stack: operand // stack: @operand */ | '-' expr %prec NUNARY { $$=$2; O(*$$, OP::OP_NEG); } | '+' expr %prec NUNARY { $$=$2; } | '~' expr { $$=$2; O(*$$, OP::OP_INV); } | '!' expr { $$=$2; O(*$$, OP::OP_NOT); } | "def" expr { $$=$2; O(*$$, OP::OP_DEF); } | "in" expr { $$=$2; O(*$$, OP::OP_IN); } | "-f" expr { $$=$2; O(*$$, OP::OP_FEXISTS); } | "-d" expr { $$=$2; O(*$$, OP::OP_DEXISTS); } /* stack: a,b // stack: a@b */ | expr '-' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_SUB); } | expr '+' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_ADD); } | expr '*' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_MUL); } | expr '/' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_DIV); } | expr '%' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_MOD); } | expr '\\' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_INTDIV); } | expr "<<" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_BIN_SL); } | expr ">>" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_BIN_SR); } | expr '&' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_BIN_AND); } | expr '|' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_BIN_OR); } | expr "!|" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_BIN_XOR); } | expr "&&" expr { $$=$1; OA(*$$, OP::OP_NESTED_CODE, $3); O(*$$, OP::OP_LOG_AND); } | expr "||" expr { $$=$1; OA(*$$, OP::OP_NESTED_CODE, $3); O(*$$, OP::OP_LOG_OR); } | expr "!||" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_LOG_XOR); } | expr '<' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_LT); } | expr '>' expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_GT); } | expr "<=" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_LE); } | expr ">=" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_GE); } | expr "==" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_EQ); } | expr "!=" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_NUM_NE); } | expr "lt" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_LT); } | expr "gt" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_GT); } | expr "le" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_LE); } | expr "ge" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_GE); } | expr "eq" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_EQ); } | expr "ne" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_STR_NE); } | expr "is" expr { $$=$1; P(*$$, *$3); O(*$$, OP::OP_IS); } ; double_or_STRING: STRING { // optimized OP_STRING => OP_VALUE for doubles maybe_change_string_literal_to_double_literal(*($$=$1)); }; string_inside_quotes_value: maybe_codes { #ifdef OPTIMIZE_BYTECODE_STRING_POOL // it brakes ^if(" 09 "){...} YYSTYPE code=$1; $$=N(); if(code->count()==3 && change_first(*code, OP::OP_STRING__WRITE, OP::OP_VALUE)){ // optimized OP_STRING__WRITE+origin+value => OP_VALUE+origin+value without starting OP_STRING_POOL P(*$$, *code); } else { OA(*$$, OP::OP_STRING_POOL, code); /* stack: empty write context */ } #else $$=N(); OA(*$$, OP::OP_STRING_POOL, $1); /* stack: empty write context */ #endif /* some code that writes to that context */ /* context=pop; stack: context.get_string() */ }; /* basics */ write_string: STRING { // optimized OP_STRING+OP_WRITE_VALUE => OP_STRING__WRITE change_string_literal_to_write_string_literal(*($$=$1)); }; empty_value: /* empty */ { $$=VL(/*we know that we will not change it*/const_cast(&vempty), 0, 0, 0); } true_value: "true" { $$ = VL(/*we know that we will not change it*/const_cast(&vtrue), 0, 0, 0); } false_value: "false" { $$ = VL(/*we know that we will not change it*/const_cast(&vfalse), 0, 0, 0); } empty: /* empty */ { $$=N(); }; %% #endif /* 000$111(2222)00 000$111{3333}00 $,^: push,=0 1:( { break=pop 2:( ) pop 3:{ } pop 000^111(2222)4444{33333}4000 $,^: push,=0 1:( { break=pop 2:( )=4 3:{ }=4 4:[^({]=pop */ inline void ungetc(Parse_control& pc, uint last_line_end_col) { pc.source--; if(pc.pos.col==0) { --pc.pos.line; pc.pos.col=last_line_end_col; } else --pc.pos.col; } static int yylex(YYSTYPE *lvalp, void *apc) { Parse_control& pc=*static_cast(apc); #define lexical_brackets_nestage pc.brackets_nestages[pc.ls_sp] #define RC {result=c; goto break2; } int c; int result; if(pc.pending_state) { result=pc.pending_state; pc.pending_state=0; return result; } const char *begin=pc.source; Pos begin_pos=pc.pos; const char *end; int skip_analized=0; while(true) { c=*(end=(pc.source++)); // fprintf(stderr, "\nchar: %c %02X; nestage: %d, sp=%d", c, c, lexical_brackets_nestage, pc.sp); if(c=='\n') pc.pos_next_line(); else pc.pos_next_c(c); // fprintf(stderr, "\nchar: %c file(%d:%d)", c, pc.pos.line, pc.pos.col); if(pc.pos.col==0+1 && c=='@') { if(pc.ls==LS_DEF_SPECIAL_BODY) { // @SPECIAL // ... // @punctuation begin_pos=pc.pos; // skip over _ after ^ pc.source++; pc.pos.col++; // skip analysis = forced literal continue; // converting ^#HH into char(hex(HH)) case '#': if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till ^ pc.string.append_strdup_know_length(begin, end-begin); } // #HH ? if(pc.source[1] && isxdigit(pc.source[1]) && pc.source[2] && isxdigit(pc.source[2])) { char c=(char)( hex_value[(unsigned char)pc.source[1]]*0x10+ hex_value[(unsigned char)pc.source[2]]); if(c==0) { result=BAD_HEX_LITERAL; goto break2; // wrong hex value[no ^#00 chars allowed]: bail out } // append char(hex(HH)) pc.string.append(c); // skip over ^#HH pc.source+=3; pc.pos.col+=3; // reset piece 'begin' position & line begin=pc.source; // ->after ^#HH begin_pos=pc.pos; // skip analysis = forced literal continue; } // just escaped char // reset piece 'begin' position & line begin=pc.source; begin_pos=pc.pos; // skip over _ after ^ pc.source++; pc.pos.col++; // skip analysis = forced literal continue; } break; } } // #comment start skipping if(c=='#' && pc.pos.col==1) { if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till # pc.string.append_strdup_know_length(begin, end-begin); } // fall into COMMENT lexical state [wait for \n] push_LS(pc, LS_USER_COMMENT); continue; } switch(pc.ls) { // USER'S = NOT OURS case LS_USER: case LS_NAME_SQUARE_PART: // name.[here].xxx if(pc.trim_bof) switch(c) { case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; // skip it default: pc.trim_bof=false; } switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ']': if(pc.ls==LS_NAME_SQUARE_PART) if(--lexical_brackets_nestage==0) {// $name.[co<]?>de<]?> pop_LS(pc); // $name.[co<]>de<]!> RC; } break; case '[': // $name.[co<[>de] if(pc.ls==LS_NAME_SQUARE_PART) lexical_brackets_nestage++; break; } if(pc.explicit_result && c) switch(c) { default: pc.string.append(c); case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; } break; // #COMMENT case LS_USER_COMMENT: if(c=='\n') { // skip comment begin=pc.source; begin_pos=pc.pos; pop_LS(pc); continue; } break; // STRING IN EXPRESSION case LS_EXPRESSION_STRING_QUOTED: case LS_EXPRESSION_STRING_APOSTROFED: switch(c) { case '"': case '\'': if( (pc.ls == LS_EXPRESSION_STRING_QUOTED && c=='"') || (pc.ls == LS_EXPRESSION_STRING_APOSTROFED && c=='\'') ) { pop_LS(pc); //"abc". | 'abc'. RC; } break; case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; } break; // METHOD DEFINITION case LS_DEF_NAME: switch(c) { case '[': pc.ls=LS_DEF_PARAMS; RC; case '\n': pc.ls=LS_DEF_SPECIAL_BODY; RC; } break; case LS_DEF_PARAMS: switch(c) { case '$': // common error result=BAD_METHOD_PARAMETER_NAME_CHARACTER; goto break2; case ';': RC; case ']': pc.ls=*pc.source=='['?LS_DEF_LOCALS:LS_DEF_COMMENT; RC; case '\n': // wrong. bailing out pop_LS(pc); RC; } break; case LS_DEF_LOCALS: switch(c) { case '[': case ';': RC; case ']': pc.ls=LS_DEF_COMMENT; RC; case '\n': // wrong. bailing out pop_LS(pc); RC; } break; case LS_DEF_COMMENT: if(c=='\n') { pop_LS(pc); RC; } break; case LS_DEF_SPECIAL_BODY: if(c=='\n') RC; break; // (EXPRESSION) case LS_VAR_ROUND: case LS_METHOD_ROUND: switch(c) { case ')': if(--lexical_brackets_nestage==0) { if(pc.ls==LS_METHOD_ROUND) // method round param ended pc.ls=LS_METHOD_AFTER; // look for method end else // pc.ls==LS_VAR_ROUND // variable constructor ended pop_LS(pc); // return to normal life } RC; case '#': // comment start skipping if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till # pc.string.append_strdup_know_length(begin, end-begin); } // fall into COMMENT lexical state [wait for \n] push_LS(pc, LS_EXPRESSION_COMMENT); lexical_brackets_nestage=1; continue; case '$': push_LS(pc, LS_EXPRESSION_VAR_NAME_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case '(': lexical_brackets_nestage++; RC; case '-': switch(*pc.source) { case 'f': // -f skip_analized=1; result=FEXISTS; goto break2; case 'd': // -d skip_analized=1; result=DEXISTS; goto break2; default: // minus result=c; goto break2; } goto break2; case '+': case '*': case '/': case '%': case '\\': case '~': case ';': RC; case '&': case '|': if(*pc.source==c) { // && || result=c=='&'?LAND:LOR; skip_analized=1; } else result=c; goto break2; case '!': switch(pc.source[0]) { case '|': // !| !|| skip_analized=1; if(pc.source[1]=='|') { skip_analized++; result=LXOR; } else result=NXOR; goto break2; case '=': // != skip_analized=1; result=NNE; goto break2; } RC; case '<': // <<, <=, < switch(*pc.source) { case '<': // <[<] skip_analized=1; result=NSL; break; case '=': // <[=] skip_analized=1; result=NLE; break; default: // <[] result=c; break; } goto break2; case '>': // >>, >=, > switch(*pc.source) { case '>': // >[>] skip_analized=1; result=NSR; break; case '=': // >[=] skip_analized=1; result=NGE; break; default: // >[] result=c; break; } goto break2; case '=': // == switch(*pc.source) { case '=': // =[=] skip_analized=1; result=NEQ; break; default: // =[] result=c; break; // not used now } goto break2; case '"': push_LS(pc, LS_EXPRESSION_STRING_QUOTED); RC; case '\'': push_LS(pc, LS_EXPRESSION_STRING_APOSTROFED); RC; case 'l': case 'g': case 'e': case 'n': if(end==begin) // right after whitespace if(isspace(pc.source[1])) { switch(*pc.source) { // case '?': // ok [and bad cases, yacc would bark at them] case 't': // lt gt [et nt] result=c=='l'?SLT:c=='g'?SGT:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; case 'e': // le ge ne [ee] result=c=='l'?SLE:c=='g'?SGE:c=='n'?SNE:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; case 'q': // eq [lq gq nq] result=c=='e'?SEQ:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; } } break; case 'i': if(end==begin) // right after whitespace if(isspace(pc.source[1])) { switch(pc.source[0]) { case 'n': // in skip_analized=1; result=IN; goto break2; case 's': // is skip_analized=1; result=IS; goto break2; } } break; case 'd': if(end==begin) // right after whitespace if(pc.source[0]=='e' && pc.source[1]=='f') { // def switch(pc.source[2]){ case ' ': case '\t': case '\n': case '"': case '\'': case '^': case '$': // non-quoted string without whitespace after 'def' is not allowed skip_analized=2; result=DEF; goto break2; } // error: incorrect char after 'def' } break; case 't': if(end==begin) // right after whitespace if(pc.source[0]=='r' && pc.source[1]=='u' && pc.source[2]=='e') { // true skip_analized=3; result=LITERAL_TRUE; goto break2; } break; case 'f': if(end==begin) // right after whitespace if(pc.source[0]=='a' && pc.source[1]=='l' && pc.source[2]=='s' && pc.source[3]=='e') { // false skip_analized=4; result=LITERAL_FALSE; goto break2; } break; case ' ': case '\t': case '\n': if(end!=begin) { // there were a string after previous operator? result=0; // return that string goto break2; } // that's a leading|traling space or after-operator-space // ignoring it // reset piece 'begin' position & line begin=pc.source; // after whitespace char begin_pos=pc.pos; continue; } break; case LS_EXPRESSION_COMMENT: if(c=='(') lexical_brackets_nestage++; switch(*pc.source) { case '\n': case ')': if(*pc.source==')') if(--lexical_brackets_nestage!=0) continue; // skip comment begin=pc.source; begin_pos=pc.pos; pop_LS(pc); continue; } break; // VARIABLE GET/PUT/WITH case LS_VAR_NAME_SIMPLE_WITH_COLON: case LS_VAR_NAME_SIMPLE_WITHOUT_COLON: case LS_EXPRESSION_VAR_NAME_WITH_COLON: case LS_EXPRESSION_VAR_NAME_WITHOUT_COLON: if( pc.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON || pc.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) { // name in expr ends also before switch(c) { // expression minus case '-': // expression integer division case '\\': pop_LS(pc); pc.ungetc(); result=EON; goto break2; } } if( pc.ls==LS_VAR_NAME_SIMPLE_WITHOUT_COLON || pc.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) { // name already has ':', stop before next switch(c) { case ':': pop_LS(pc); pc.ungetc(); result=EON; goto break2; } } switch(c) { case 0: case ' ': case '\t': case '\n': case ';': case ']': case '}': case ')': case '"': case '\'': case '<': case '>': // these stand for HTML brackets AND expression binary ops case '+': case '*': case '/': case '\\': case '%': case '&': case '|': case '=': case '!': // common delimiters case ',': case '?': case '#': // mysql column separators case '`': // before call case '^': pop_LS(pc); pc.ungetc(); result=EON; goto break2; case '[': // $name.<[>code] if( end[-1]=='$' /* was start of get */ || end[-1]==':' /* was class name delim */ || end[-1]=='.' /* was name delim */ ) { push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; } pc.ls=LS_VAR_SQUARE; lexical_brackets_nestage=1; RC; case '{': if(end[-1]=='$') { // ${name}, no need of EON, switching LS, not begin==end as $[a]{$b} will fit pc.ls=LS_VAR_NAME_CURLY; } else { pc.ls=LS_VAR_CURLY; lexical_brackets_nestage=1; } RC; case '(': // $name.<(>expr) if( // end[-1]=='$' /* $() excluded */ || end[-1]==':' /* was class name delim */ || end[-1]=='.' /* was name delim */ ) { push_LS(pc, LS_VAR_ROUND); lexical_brackets_nestage=1; RC; } pc.ls=LS_VAR_ROUND; lexical_brackets_nestage=1; RC; case '.': // name part delim case '$': // name part subvar case ':': // class<:>name // go to _WITHOUT_COLON state variant... if(pc.ls==LS_VAR_NAME_SIMPLE_WITH_COLON) pc.ls=LS_VAR_NAME_SIMPLE_WITHOUT_COLON; else if(pc.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON) pc.ls=LS_EXPRESSION_VAR_NAME_WITHOUT_COLON; // ...stop before next ':' RC; } break; case LS_VAR_NAME_CURLY: switch(c) { case '[': // ${name.<[>code]} push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; case '(': // ${name.<(>expr)} push_LS(pc, LS_VAR_ROUND); lexical_brackets_nestage=1; RC; case '}': // ${name} finished, restoring LS pop_LS(pc); RC; case '.': // name part delim case '$': // name part subvar case ':': // ':name' or 'class:name' RC; } break; case LS_VAR_SQUARE: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ']': if(--lexical_brackets_nestage==0) { pop_LS(pc); RC; } break; case ';': // operator_or_fmt;value delim RC; case '[': lexical_brackets_nestage++; break; } break; case LS_VAR_CURLY: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case '}': if(--lexical_brackets_nestage==0) { pop_LS(pc); RC; } break; case '{': lexical_brackets_nestage++; break; } break; // METHOD CALL case LS_METHOD_NAME: switch(c) { case '[': // ^name.<[>code] if( // end[-1]=='^' /* never, ^[ is literal */ || end[-1]==':' /* was class name delim */ || end[-1]=='.' /* was name delim */ ) { push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; } pc.ls=LS_METHOD_SQUARE; lexical_brackets_nestage=1; RC; case '{': pc.ls=LS_METHOD_CURLY; lexical_brackets_nestage=1; RC; case '(': // ^name.<(>expr) if( // end[-1]=='^' /* never, ^( is literal */ || end[-1]==':' /* was class name delim */ || end[-1]=='.' /* was name delim */ ) { push_LS(pc, LS_VAR_ROUND); lexical_brackets_nestage=1; RC; } pc.ls=LS_METHOD_ROUND; lexical_brackets_nestage=1; RC; case '.': // name part delim case '$': // name part subvar case ':': // ':name' or 'class:name' case '^': // ^abc^xxx wrong. bailing out case ']': case '}': case ')': // ^abc]}) wrong. bailing out case ' ': // ^if ( wrong. bailing out RC; } break; case LS_METHOD_SQUARE: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ';': // param delim RC; case ']': if(--lexical_brackets_nestage==0) { pc.ls=LS_METHOD_AFTER; RC; } break; case '[': lexical_brackets_nestage++; break; } break; case LS_METHOD_CURLY: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ';': // param delim RC; case '}': if(--lexical_brackets_nestage==0) { pc.ls=LS_METHOD_AFTER; RC; } break; case '{': lexical_brackets_nestage++; break; } if(pc.explicit_result && c) switch(c) { default: pc.string.append(c); case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; } break; case LS_METHOD_AFTER: if(c=='[') {/* ][ }[ )[ */ pc.ls=LS_METHOD_SQUARE; lexical_brackets_nestage=1; RC; } if(c=='{') {/* ]{ }{ ){ */ pc.ls=LS_METHOD_CURLY; lexical_brackets_nestage=1; RC; } if(c=='(') {/* ]( }( )( */ pc.ls=LS_METHOD_ROUND; lexical_brackets_nestage=1; RC; } pop_LS(pc); pc.ungetc(); result=EON; goto break2; } if(c==0) { result=-1; break; } } break2: if(end!=begin) { // there is last piece? if(c=='@' || c==0) // we are before LS_DEF_NAME or EOF? while(end!=begin && end[-1]=='\n') // trim all empty lines before LS_DEF_NAME and EOF end--; if(end!=begin && pc.ls!=LS_USER_COMMENT) { // last piece still alive and not comment? if(!pc.string_start) pc.string_start=begin_pos; // append it pc.string.append_strdup_know_length(begin, end-begin); } } if(!pc.string.is_empty()) { // something accumulated? // create STRING value: array of OP_VALUE+origin+vstring #ifdef SYMBOLS_CACHING Value *lookup=symbols->get(pc.string); #else Value *lookup=0; #endif *lvalp=VL(lookup ? lookup : new VString(*new String(pc.string, String::L_CLEAN)), pc.file_no, pc.string_start.line, pc.string_start.col); // new pieces storage pc.string.clear(); pc.string_start.clear(); // make current result be pending for next call, return STRING for now pc.pending_state=result; result=STRING; } if(skip_analized) { pc.source+=skip_analized; pc.pos.col+=skip_analized; } return result; } static int real_yyerror(Parse_control *pc, const char *s) { // Called by yyparse on error PC.error=pa_strdup(s); return 1; } static void yyprint(FILE *file, int type, YYSTYPE value) { if(type==STRING) fprintf(file, " \"%s\"", LA2S(*value)->cstr()); } parser-3.5.1/src/main/pa_uue.C0000644000076400007640000000504214712042465013050 00000000000000/** @file Parser: uuencoding impl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian @todo setrlimit */ #include "pa_config_includes.h" #include "pa_uue.h" #include "pa_memory.h" volatile const char * IDENT_PA_UUE_C="$Id: pa_uue.C,v 1.21 2024/11/04 03:53:25 moko Exp $" IDENT_PA_UUE_H; static unsigned char uue_table[64] = { '`', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\',']', '^', '_' }; const char* pa_uuencode(const unsigned char* in, size_t in_size, const char* file_name) { int count=45; size_t new_size = ((in_size / 3 + 1) * 4); new_size += 2 * new_size / (count / 3 * 4) /*chars in line + new lines*/ + 2; new_size += strlen(file_name) + 11/*header*/ + 6/*footer*/ + 1/*zero terminator*/; const char* result=new(PointerFreeGC) char[new_size]; char* optr=(char*)result; //header optr += sprintf(optr, "begin 644 %s\n", file_name); //body for(const unsigned char *itemp=in; itemp<(in+in_size); itemp+=count) { int index; if((itemp+count)>(in+in_size)) count=in_size-(itemp-in); /* * for UU and XX, encode the number of bytes as first character */ *optr++ = uue_table[count]; for (index=0; index<=count-3; index+=3) { *optr++ = uue_table[itemp[index] >> 2]; *optr++ = uue_table[((itemp[index ] & 0x03) << 4) | (itemp[index+1] >> 4)]; *optr++ = uue_table[((itemp[index+1] & 0x0f) << 2) | (itemp[index+2] >> 6)]; *optr++ = uue_table[ itemp[index+2] & 0x3f]; } /* * Special handlitempg for itempcomplete litempes */ if (index != count) { if (count - index == 2) { *optr++ = uue_table[itemp[index] >> 2]; *optr++ = uue_table[((itemp[index ] & 0x03) << 4) | ( itemp[index+1] >> 4)]; *optr++ = uue_table[((itemp[index+1] & 0x0f) << 2)]; *optr++ = uue_table[0]; } else if (count - index == 1) { *optr++ = uue_table[ itemp[index] >> 2]; *optr++ = uue_table[(itemp[index] & 0x03) << 4]; *optr++ = uue_table[0]; *optr++ = uue_table[0]; } } /* * end of line */ *optr++ = '\n'; } //footer optr += sprintf(optr, "`\nend\n"); //throw Exception(PARSER_RUNTIME, 0, "%d %d %d", in_size, new_size, (size_t)(optr-result)); assert((size_t)(optr-result) < new_size); return result; } parser-3.5.1/src/main/pa_exception.C0000644000076400007640000000317214712042465014252 00000000000000/** @file Parser: exception class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_common.h" #include "pa_exception.h" #include "pa_sapi.h" #include "pa_globals.h" volatile const char * IDENT_PA_EXCEPTION_C="$Id: pa_exception.C,v 1.63 2024/11/04 03:53:25 moko Exp $" IDENT_PA_EXCEPTION_H; // methods Exception::Exception(): ftype(0), fproblem_source(0), fcomment(0) {} Exception::Exception(const Exception& src): ftype(src.ftype), fproblem_source(src.fproblem_source), fcomment(src.fcomment) { } Exception& Exception::operator =(const Exception& src) { ftype=src.ftype; fproblem_source=src.fproblem_source; fcomment=src.fcomment; return *this; } Exception::Exception(const char* atype, const String* aproblem_source, const char* comment_fmt, ...) { ftype=atype; fproblem_source=aproblem_source ? new String(*aproblem_source) : 0; if(!comment_fmt) { fcomment=0; } else if (!strcmp(comment_fmt, "%s")) { // to avoid MAX_STRING limit va_list args; va_start(args, comment_fmt); fcomment=va_arg(args, const char *); fcomment=fcomment ? pa_strdup(fcomment) : 0; va_end(args); } else { char comment[MAX_STRING]; va_list args; va_start(args, comment_fmt); fcomment=pa_strdup(comment, vsnprintf(comment, MAX_STRING, comment_fmt, args)); va_end(args); } } void Exception::add_comment(const char* acomment) { if(acomment) fcomment=pa_strcat(fcomment, acomment); } const String* Exception::problem_source() const { return fproblem_source && !fproblem_source->is_empty() ? fproblem_source : 0; } parser-3.5.1/src/main/pa_os.C0000644000076400007640000000600214712204302012656 00000000000000/** @file Parser: commonly functions. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #include "pa_os.h" volatile const char * IDENT_PA_OS_C="$Id: pa_os.C,v 1.25 2024/11/04 17:47:46 moko Exp $" IDENT_PA_OS_H; unsigned int pa_lock_attempts=PA_LOCK_ATTEMPTS; #ifdef _MSC_VER #include #define PA_SH_LOCK 2 #define PA_EX_LOCK 1 #define PA_ULOCK 0 #define FLOCK(operation) int status=pa_flock(fd, operation); #define ERRNO pa_errno() int pa_flock(int fd, int operation) { HANDLE hFile = (HANDLE)_get_osfhandle(fd); if (hFile == INVALID_HANDLE_VALUE) { return -1; } OVERLAPPED overlapped = {0}; if (operation == PA_ULOCK) { return UnlockFileEx(hFile, 0, MAXDWORD, MAXDWORD, &overlapped) ? 0 : -1; } else { DWORD flags = LOCKFILE_FAIL_IMMEDIATELY; if (operation == PA_EX_LOCK) { flags |= LOCKFILE_EXCLUSIVE_LOCK; } return LockFileEx(hFile, flags, 0, MAXDWORD, MAXDWORD, &overlapped) ? 0 : -1; } } int pa_errno() { switch(GetLastError()) { case ERROR_LOCK_VIOLATION: // real case: returning the same error as with _locking return EACCES; case ERROR_IO_PENDING: return EAGAIN; case ERROR_INVALID_HANDLE: return EBADF; case ERROR_NOT_LOCKED: return ENOLCK; } return EACCES; } #else #define ERRNO errno #ifdef HAVE_FLOCK #define PA_SH_LOCK LOCK_SH|LOCK_NB #define PA_EX_LOCK LOCK_EX|LOCK_NB #define PA_ULOCK LOCK_UN #define FLOCK(operation) int status=flock(fd, operation); #else #ifdef HAVE_FCNTL #define PA_SH_LOCK F_RDLCK #define PA_EX_LOCK F_WRLCK #define PA_ULOCK F_UNLCK #define FLOCK(operation) struct flock ls={operation, SEEK_SET}; int status=fcntl(fd, F_SETLK, &ls); #else #ifdef HAVE_LOCKF #define PA_SH_LOCK F_TLOCK #define PA_EX_LOCK F_TLOCK #define PA_ULOCK F_ULOCK #define FLOCK(operation) lseek(fd, 0, SEEK_SET); int status=lockf(fd, operation, 1); #else #error unable to find file locking func #endif #endif #endif #endif int pa_lock(int fd, int attempts, int operation){ while(true){ FLOCK(operation); if(status==0) return 0; if(--attempts<=0) return ERRNO; pa_sleep(PA_LOCK_WAIT_TIMEOUT_SECS, PA_LOCK_WAIT_TIMEOUT_USECS); } }; int pa_lock_shared_blocking(int fd) { return pa_lock(fd, pa_lock_attempts, PA_SH_LOCK); } int pa_lock_exclusive_blocking(int fd) { return pa_lock(fd, pa_lock_attempts, PA_EX_LOCK); } int pa_lock_exclusive_nonblocking(int fd) { return pa_lock(fd, 1, PA_EX_LOCK); } int pa_unlock(int fd) { return pa_lock(fd, 1, PA_ULOCK); } int pa_sleep(unsigned long secs, unsigned long usecs) { if(usecs >= 1000000){ secs += usecs/1000000; usecs = usecs%1000000; } #ifdef _MSC_VER Sleep(secs * 1000 + usecs / 1000); return 0; #else struct timeval t; t.tv_sec = secs; t.tv_usec = usecs; return (select(0, NULL, NULL, NULL, &t)<0 ? errno : 0); #endif } parser-3.5.1/src/main/Makefile.in0000644000076400007640000006313414740273416013544 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/main ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmain_la_LIBADD = am_libmain_la_OBJECTS = pa_pool.lo pa_os.lo pa_threads.lo pa_common.lo \ pa_base64.lo compile.tab.lo compile.lo compile_tools.lo \ execute.lo pa_cache_managers.lo pa_exception.lo \ pa_xml_exception.lo pa_globals.lo pa_xml_io.lo pa_memory.lo \ pa_request.lo pa_string.lo pa_table.lo untaint.lo pa_dir.lo \ pa_exec.lo pa_socks.lo pa_dictionary.lo pa_charset.lo \ pa_charsets.lo pa_uue.lo pa_sql_driver_manager.lo \ pa_stylesheet_manager.lo pa_stylesheet_connection.lo \ pa_http.lo pa_random.lo pa_symbols.lo libmain_la_OBJECTS = $(am_libmain_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/compile.Plo \ ./$(DEPDIR)/compile.tab.Plo ./$(DEPDIR)/compile_tools.Plo \ ./$(DEPDIR)/execute.Plo ./$(DEPDIR)/pa_base64.Plo \ ./$(DEPDIR)/pa_cache_managers.Plo ./$(DEPDIR)/pa_charset.Plo \ ./$(DEPDIR)/pa_charsets.Plo ./$(DEPDIR)/pa_common.Plo \ ./$(DEPDIR)/pa_dictionary.Plo ./$(DEPDIR)/pa_dir.Plo \ ./$(DEPDIR)/pa_exception.Plo ./$(DEPDIR)/pa_exec.Plo \ ./$(DEPDIR)/pa_globals.Plo ./$(DEPDIR)/pa_http.Plo \ ./$(DEPDIR)/pa_memory.Plo ./$(DEPDIR)/pa_os.Plo \ ./$(DEPDIR)/pa_pool.Plo ./$(DEPDIR)/pa_random.Plo \ ./$(DEPDIR)/pa_request.Plo ./$(DEPDIR)/pa_socks.Plo \ ./$(DEPDIR)/pa_sql_driver_manager.Plo \ ./$(DEPDIR)/pa_string.Plo \ ./$(DEPDIR)/pa_stylesheet_connection.Plo \ ./$(DEPDIR)/pa_stylesheet_manager.Plo \ ./$(DEPDIR)/pa_symbols.Plo ./$(DEPDIR)/pa_table.Plo \ ./$(DEPDIR)/pa_threads.Plo ./$(DEPDIR)/pa_uue.Plo \ ./$(DEPDIR)/pa_xml_exception.Plo ./$(DEPDIR)/pa_xml_io.Plo \ ./$(DEPDIR)/untaint.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libmain_la_SOURCES) DIST_SOURCES = $(libmain_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I../types -I../classes -I../sql -I../lib/punycode $(INCLTDL) @PCRE_INCLUDES@ @XML_INCLUDES@ noinst_HEADERS = compile_tools.h utf8-to-lower.inc utf8-to-upper.inc noinst_LTLIBRARIES = libmain.la libmain_la_SOURCES = pa_pool.C pa_os.C pa_threads.C pa_common.C pa_base64.C compile.tab.C compile.C compile_tools.C execute.C pa_cache_managers.C pa_exception.C pa_xml_exception.C pa_globals.C pa_xml_io.C pa_memory.C pa_request.C pa_string.C pa_table.C untaint.C pa_dir.C pa_exec.C pa_socks.C pa_dictionary.C pa_charset.C pa_charsets.C pa_uue.C pa_sql_driver_manager.C pa_stylesheet_manager.C pa_stylesheet_connection.C pa_http.C pa_random.C pa_symbols.C EXTRA_DIST = compile.y main.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/main/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/main/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libmain.la: $(libmain_la_OBJECTS) $(libmain_la_DEPENDENCIES) $(EXTRA_libmain_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libmain_la_OBJECTS) $(libmain_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile.tab.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compile_tools.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execute.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_base64.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_cache_managers.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_charset.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_charsets.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_common.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_dictionary.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_dir.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_exception.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_exec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_globals.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_http.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_memory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_os.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_pool.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_random.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_request.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_socks.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_sql_driver_manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_string.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_stylesheet_connection.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_stylesheet_manager.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_symbols.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_table.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_threads.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_uue.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_xml_exception.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_xml_io.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/untaint.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .C.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/compile.Plo -rm -f ./$(DEPDIR)/compile.tab.Plo -rm -f ./$(DEPDIR)/compile_tools.Plo -rm -f ./$(DEPDIR)/execute.Plo -rm -f ./$(DEPDIR)/pa_base64.Plo -rm -f ./$(DEPDIR)/pa_cache_managers.Plo -rm -f ./$(DEPDIR)/pa_charset.Plo -rm -f ./$(DEPDIR)/pa_charsets.Plo -rm -f ./$(DEPDIR)/pa_common.Plo -rm -f ./$(DEPDIR)/pa_dictionary.Plo -rm -f ./$(DEPDIR)/pa_dir.Plo -rm -f ./$(DEPDIR)/pa_exception.Plo -rm -f ./$(DEPDIR)/pa_exec.Plo -rm -f ./$(DEPDIR)/pa_globals.Plo -rm -f ./$(DEPDIR)/pa_http.Plo -rm -f ./$(DEPDIR)/pa_memory.Plo -rm -f ./$(DEPDIR)/pa_os.Plo -rm -f ./$(DEPDIR)/pa_pool.Plo -rm -f ./$(DEPDIR)/pa_random.Plo -rm -f ./$(DEPDIR)/pa_request.Plo -rm -f ./$(DEPDIR)/pa_socks.Plo -rm -f ./$(DEPDIR)/pa_sql_driver_manager.Plo -rm -f ./$(DEPDIR)/pa_string.Plo -rm -f ./$(DEPDIR)/pa_stylesheet_connection.Plo -rm -f ./$(DEPDIR)/pa_stylesheet_manager.Plo -rm -f ./$(DEPDIR)/pa_symbols.Plo -rm -f ./$(DEPDIR)/pa_table.Plo -rm -f ./$(DEPDIR)/pa_threads.Plo -rm -f ./$(DEPDIR)/pa_uue.Plo -rm -f ./$(DEPDIR)/pa_xml_exception.Plo -rm -f ./$(DEPDIR)/pa_xml_io.Plo -rm -f ./$(DEPDIR)/untaint.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/compile.Plo -rm -f ./$(DEPDIR)/compile.tab.Plo -rm -f ./$(DEPDIR)/compile_tools.Plo -rm -f ./$(DEPDIR)/execute.Plo -rm -f ./$(DEPDIR)/pa_base64.Plo -rm -f ./$(DEPDIR)/pa_cache_managers.Plo -rm -f ./$(DEPDIR)/pa_charset.Plo -rm -f ./$(DEPDIR)/pa_charsets.Plo -rm -f ./$(DEPDIR)/pa_common.Plo -rm -f ./$(DEPDIR)/pa_dictionary.Plo -rm -f ./$(DEPDIR)/pa_dir.Plo -rm -f ./$(DEPDIR)/pa_exception.Plo -rm -f ./$(DEPDIR)/pa_exec.Plo -rm -f ./$(DEPDIR)/pa_globals.Plo -rm -f ./$(DEPDIR)/pa_http.Plo -rm -f ./$(DEPDIR)/pa_memory.Plo -rm -f ./$(DEPDIR)/pa_os.Plo -rm -f ./$(DEPDIR)/pa_pool.Plo -rm -f ./$(DEPDIR)/pa_random.Plo -rm -f ./$(DEPDIR)/pa_request.Plo -rm -f ./$(DEPDIR)/pa_socks.Plo -rm -f ./$(DEPDIR)/pa_sql_driver_manager.Plo -rm -f ./$(DEPDIR)/pa_string.Plo -rm -f ./$(DEPDIR)/pa_stylesheet_connection.Plo -rm -f ./$(DEPDIR)/pa_stylesheet_manager.Plo -rm -f ./$(DEPDIR)/pa_symbols.Plo -rm -f ./$(DEPDIR)/pa_table.Plo -rm -f ./$(DEPDIR)/pa_threads.Plo -rm -f ./$(DEPDIR)/pa_uue.Plo -rm -f ./$(DEPDIR)/pa_xml_exception.Plo -rm -f ./$(DEPDIR)/pa_xml_io.Plo -rm -f ./$(DEPDIR)/untaint.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile compile.tab.C: compile.y bison -v compile.y -o $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/main/compile.C0000644000076400007640000000205014712042465013216 00000000000000/** @file Parser: compiler part of request class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ volatile const char * IDENT_COMPILE_C="$Id: compile.C,v 1.89 2024/11/04 03:53:25 moko Exp $"; #include "pa_request.h" #include "compile_tools.h" extern int yydebug; extern int yyparse (Parse_control *); ArrayClass& Request::compile(VStateless_class* aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset) { // prepare to parse Parse_control pc(*this, aclass, source, main_alias, file_no, line_no_offset); // parse=compile! //yydebug=1; if(yyparse(&pc)) { // error? pc.pos_prev_c(); if(!pc.explicit_result) if(pc.pos.col==0) // expecting something after EOL means they've expected it BEFORE pc.pos_prev_c(); exception_trace.push(Trace(0, Operation::Origin::create(file_no, pc.pos.line, pc.pos.col))); throw Exception("parser.compile", 0, "%s", pc.error); } // result return *pc.cclasses; } parser-3.5.1/src/main/pa_xml_io.C0000644000076400007640000001250514712042465013543 00000000000000/** @file Parser: plugins to xml library, controlling i/o; implementation Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_xml_io.h" #ifdef XML volatile const char * IDENT_PA_XML_IO_C="$Id: pa_xml_io.C,v 1.45 2024/11/04 03:53:25 moko Exp $" IDENT_PA_XML_IO_H; #include "libxslt/extensions.h" #include "pa_threads.h" #include "pa_globals.h" #include "pa_request.h" THREAD_LOCAL HashStringBool* xml_dependencies = NULL; // every TLS should be referenced elsewhere, or GC will collect it static void add_dependency(const String::Body url) { if(xml_dependencies) // do we need to monitor now? xml_dependencies->put(url, true); } HashStringBool* pa_xmlStartMonitoringDependencies() { return xml_dependencies=new HashStringBool; // to keep another reference on TLS } void pa_xmlStopMonitoringDependencies() { xml_dependencies=NULL; } HashStringBool* pa_xmlGetDependencies() { HashStringBool* result=xml_dependencies; xml_dependencies=NULL; return result; } #ifndef DOXYGEN struct MemoryStream : public PA_Allocated { const char* m_buf; size_t m_size; size_t m_position; MemoryStream(const char *a_buf) : m_buf(a_buf), m_size(strlen(m_buf)), m_position(0) {} int read(char* a_buffer, size_t a_size) { size_t left=m_size-m_position; if(!left) return 0; size_t to_read=min(a_size, left); memcpy(a_buffer, m_buf+m_position, to_read); m_position+=to_read; return to_read; } }; #endif static int xmlFileMatchMonitor(const char* /*file_spec_cstr*/) { return 1; // always intercept, causing xmlFileOpenMonitor to be called } /** * xmlFileOpenMonitor: * afilename: the URI for matching * * http://localhost/abc -> $ENV{DOCUMENT_ROOT}/abc | ./abc * * Returns an I/O context or NULL in case of error */ static void *xmlFileOpenMonitor(const char* afilename) { #ifdef PA_SAFE_MODE //copied from libxml/catalog.c # define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog" // disable attempts to consult default catalog [usually, that file belongs to other user/group] if(strcmp(afilename, XML_XML_DEFAULT_CATALOG)==0) return 0; #endif Request& r=pa_thread_request(); if(!strncmp(afilename, "http://localhost", 16)) { const char* document_root=r.request_info.document_root; if(!document_root) document_root="."; afilename=pa_strcat(document_root, &afilename[16]); } else { if(!strstr(afilename, "http://")) { if(strstr(afilename, "file://")) { afilename+=7 /*strlen("file://")*/; #ifdef WIN32 if(afilename[0]=='/' && afilename[1] && afilename[2]==':' && afilename[3]=='/') { // skip leading slash for absolute path file:///C:/path/to/file afilename++; } #endif } else if(afilename[0] && afilename[1]!=':' && strstr(afilename, "://")) { pa_xmlStopMonitoringDependencies(); return 0; // plug out [do not handle other prefixes] } } afilename=pa_strdup(afilename); } add_dependency(afilename); const char *buf; try { buf=file_load_text(r, *new String(afilename), true /*fail_on_read_problem*/, 0 /*params*/, false /*don't transcode result because it must be fit with @encoding value!*/); } catch(const Exception& e) { if(strcmp(e.type(), "file.missing")==0) return 0; // let the library try that and report an error properly buf=e.comment(); } catch(...) { buf="xmlFileOpen_ReadIntoStream: unknown error"; } return (void *)new MemoryStream(buf); } static int xmlFileMatchMethod(const char* filename) { return !strncmp(filename, "parser://", 9 /*strlen("parser://"), and check xmlFileOpenMethod*/); } /// parser://method/param/here -> ^MAIN:method[/params/here] static void *xmlFileOpenMethod (const char* afilename) { const char* buf; try { Request& r=pa_thread_request(); char* s=pa_strdup(afilename+9 /*strlen("parser://")*/); const char* method_cstr=lsplit(&s, '/'); const String* method=new String(method_cstr); String::Body param_body("/"); if(s) param_body.append_know_length(s, strlen(s)); const String *body=r.execute_method(r.main_class, *method, new VString(*new String(param_body, String::L_TAINTED))); if(!body) throw Exception(0, new String(afilename), "'%s' method not found in %s class", method_cstr, MAIN_CLASS_NAME); buf=body->untaint_cstr(String::L_XML); } catch(const Exception& e) { buf=e.comment(); } catch(...) { buf="xmlFileOpenLocalhost: unknown error"; } return (void *)new MemoryStream(buf); } /** * pa_xmlFileReadMethod: * @context: the I/O context * @buffer: where to drop data * @len: number of bytes to write * * Read @len bytes to @buffer from the I/O channel. * * Returns the number of bytes written */ static int pa_xmlFileReadMethod (void* context, char* buffer, int len){ MemoryStream& stream=*static_cast(context); return stream.read(buffer, len); } static int pa_xmlFileCloseMethod (void* /*context*/) { return 0; } void pa_xml_io_init() { // file open monitorer [for xslt cacher] // safe mode checker, always fail match, but checks non-"://" there xmlRegisterInputCallbacks(xmlFileMatchMonitor, xmlFileOpenMonitor, pa_xmlFileReadMethod, pa_xmlFileCloseMethod); // parser://method/param/here -> ^MAIN:method[/params/here] - should be last to be called first xmlRegisterInputCallbacks(xmlFileMatchMethod, xmlFileOpenMethod, pa_xmlFileReadMethod, pa_xmlFileCloseMethod); } #endif parser-3.5.1/src/main/utf8-to-lower.inc0000644000076400007640000003214710562132322014612 00000000000000/* some char's commented because of parser have a problem while changing case if from-char and to-char have different length */ {0x0041, 0x0061}, {0x0042, 0x0062}, {0x0043, 0x0063}, {0x0044, 0x0064}, {0x0045, 0x0065}, {0x0046, 0x0066}, {0x0047, 0x0067}, {0x0048, 0x0068}, {0x0049, 0x0069}, {0x004A, 0x006A}, {0x004B, 0x006B}, {0x004C, 0x006C}, {0x004D, 0x006D}, {0x004E, 0x006E}, {0x004F, 0x006F}, {0x0050, 0x0070}, {0x0051, 0x0071}, {0x0052, 0x0072}, {0x0053, 0x0073}, {0x0054, 0x0074}, {0x0055, 0x0075}, {0x0056, 0x0076}, {0x0057, 0x0077}, {0x0058, 0x0078}, {0x0059, 0x0079}, {0x005A, 0x007A}, /* {0x00B5, 0x03BC}, */{0x00C0, 0x00E0}, {0x00C1, 0x00E1}, {0x00C2, 0x00E2}, {0x00C3, 0x00E3}, {0x00C4, 0x00E4}, {0x00C5, 0x00E5}, {0x00C6, 0x00E6}, {0x00C7, 0x00E7}, {0x00C8, 0x00E8}, {0x00C9, 0x00E9}, {0x00CA, 0x00EA}, {0x00CB, 0x00EB}, {0x00CC, 0x00EC}, {0x00CD, 0x00ED}, {0x00CE, 0x00EE}, {0x00CF, 0x00EF}, {0x00D0, 0x00F0}, {0x00D1, 0x00F1}, {0x00D2, 0x00F2}, {0x00D3, 0x00F3}, {0x00D4, 0x00F4}, {0x00D5, 0x00F5}, {0x00D6, 0x00F6}, {0x00D8, 0x00F8}, {0x00D9, 0x00F9}, {0x00DA, 0x00FA}, {0x00DB, 0x00FB}, {0x00DC, 0x00FC}, {0x00DD, 0x00FD}, {0x00DE, 0x00FE}, {0x0100, 0x0101}, {0x0102, 0x0103}, {0x0104, 0x0105}, {0x0106, 0x0107}, {0x0108, 0x0109}, {0x010A, 0x010B}, {0x010C, 0x010D}, {0x010E, 0x010F}, {0x0110, 0x0111}, {0x0112, 0x0113}, {0x0114, 0x0115}, {0x0116, 0x0117}, {0x0118, 0x0119}, {0x011A, 0x011B}, {0x011C, 0x011D}, {0x011E, 0x011F}, {0x0120, 0x0121}, {0x0122, 0x0123}, {0x0124, 0x0125}, {0x0126, 0x0127}, {0x0128, 0x0129}, {0x012A, 0x012B}, {0x012C, 0x012D}, {0x012E, 0x012F}, /*{0x0130, 0x0069}, */{0x0132, 0x0133}, {0x0134, 0x0135}, {0x0136, 0x0137}, {0x0139, 0x013A}, {0x013B, 0x013C}, {0x013D, 0x013E}, {0x013F, 0x0140}, {0x0141, 0x0142}, {0x0143, 0x0144}, {0x0145, 0x0146}, {0x0147, 0x0148}, {0x014A, 0x014B}, {0x014C, 0x014D}, {0x014E, 0x014F}, {0x0150, 0x0151}, {0x0152, 0x0153}, {0x0154, 0x0155}, {0x0156, 0x0157}, {0x0158, 0x0159}, {0x015A, 0x015B}, {0x015C, 0x015D}, {0x015E, 0x015F}, {0x0160, 0x0161}, {0x0162, 0x0163}, {0x0164, 0x0165}, {0x0166, 0x0167}, {0x0168, 0x0169}, {0x016A, 0x016B}, {0x016C, 0x016D}, {0x016E, 0x016F}, {0x0170, 0x0171}, {0x0172, 0x0173}, {0x0174, 0x0175}, {0x0176, 0x0177}, /*{0x0178, 0x00FF}, */{0x0179, 0x017A}, {0x017B, 0x017C}, {0x017D, 0x017E}, /*{0x017F, 0x0073}, */{0x0181, 0x0253}, {0x0182, 0x0183}, {0x0184, 0x0185}, {0x0186, 0x0254}, {0x0187, 0x0188}, {0x0189, 0x0256}, {0x018A, 0x0257}, {0x018B, 0x018C}, {0x018E, 0x01DD}, {0x018F, 0x0259}, {0x0190, 0x025B}, {0x0191, 0x0192}, {0x0193, 0x0260}, {0x0194, 0x0263}, {0x0196, 0x0269}, {0x0197, 0x0268}, {0x0198, 0x0199}, {0x019C, 0x026F}, {0x019D, 0x0272}, {0x019F, 0x0275}, {0x01A0, 0x01A1}, {0x01A2, 0x01A3}, {0x01A4, 0x01A5}, {0x01A6, 0x0280}, {0x01A7, 0x01A8}, {0x01A9, 0x0283}, {0x01AC, 0x01AD}, {0x01AE, 0x0288}, {0x01AF, 0x01B0}, {0x01B1, 0x028A}, {0x01B2, 0x028B}, {0x01B3, 0x01B4}, {0x01B5, 0x01B6}, {0x01B7, 0x0292}, {0x01B8, 0x01B9}, {0x01BC, 0x01BD}, {0x01C4, 0x01C6}, {0x01C5, 0x01C6}, {0x01C7, 0x01C9}, {0x01C8, 0x01C9}, {0x01CA, 0x01CC}, {0x01CB, 0x01CC}, {0x01CD, 0x01CE}, {0x01CF, 0x01D0}, {0x01D1, 0x01D2}, {0x01D3, 0x01D4}, {0x01D5, 0x01D6}, {0x01D7, 0x01D8}, {0x01D9, 0x01DA}, {0x01DB, 0x01DC}, {0x01DE, 0x01DF}, {0x01E0, 0x01E1}, {0x01E2, 0x01E3}, {0x01E4, 0x01E5}, {0x01E6, 0x01E7}, {0x01E8, 0x01E9}, {0x01EA, 0x01EB}, {0x01EC, 0x01ED}, {0x01EE, 0x01EF}, {0x01F1, 0x01F3}, {0x01F2, 0x01F3}, {0x01F4, 0x01F5}, {0x01F6, 0x0195}, {0x01F7, 0x01BF}, {0x01F8, 0x01F9}, {0x01FA, 0x01FB}, {0x01FC, 0x01FD}, {0x01FE, 0x01FF}, {0x0200, 0x0201}, {0x0202, 0x0203}, {0x0204, 0x0205}, {0x0206, 0x0207}, {0x0208, 0x0209}, {0x020A, 0x020B}, {0x020C, 0x020D}, {0x020E, 0x020F}, {0x0210, 0x0211}, {0x0212, 0x0213}, {0x0214, 0x0215}, {0x0216, 0x0217}, {0x0218, 0x0219}, {0x021A, 0x021B}, {0x021C, 0x021D}, {0x021E, 0x021F}, {0x0220, 0x019E}, {0x0222, 0x0223}, {0x0224, 0x0225}, {0x0226, 0x0227}, {0x0228, 0x0229}, {0x022A, 0x022B}, {0x022C, 0x022D}, {0x022E, 0x022F}, {0x0230, 0x0231}, {0x0232, 0x0233}, {0x0345, 0x03B9}, {0x0386, 0x03AC}, {0x0388, 0x03AD}, {0x0389, 0x03AE}, {0x038A, 0x03AF}, {0x038C, 0x03CC}, {0x038E, 0x03CD}, {0x038F, 0x03CE}, {0x0391, 0x03B1}, {0x0392, 0x03B2}, {0x0393, 0x03B3}, {0x0394, 0x03B4}, {0x0395, 0x03B5}, {0x0396, 0x03B6}, {0x0397, 0x03B7}, {0x0398, 0x03B8}, {0x0399, 0x03B9}, {0x039A, 0x03BA}, {0x039B, 0x03BB}, {0x039C, 0x03BC}, {0x039D, 0x03BD}, {0x039E, 0x03BE}, {0x039F, 0x03BF}, {0x03A0, 0x03C0}, {0x03A1, 0x03C1}, {0x03A3, 0x03C3}, {0x03A4, 0x03C4}, {0x03A5, 0x03C5}, {0x03A6, 0x03C6}, {0x03A7, 0x03C7}, {0x03A8, 0x03C8}, {0x03A9, 0x03C9}, {0x03AA, 0x03CA}, {0x03AB, 0x03CB}, {0x03C2, 0x03C3}, {0x03D0, 0x03B2}, {0x03D1, 0x03B8}, {0x03D5, 0x03C6}, {0x03D6, 0x03C0}, {0x03D8, 0x03D9}, {0x03DA, 0x03DB}, {0x03DC, 0x03DD}, {0x03DE, 0x03DF}, {0x03E0, 0x03E1}, {0x03E2, 0x03E3}, {0x03E4, 0x03E5}, {0x03E6, 0x03E7}, {0x03E8, 0x03E9}, {0x03EA, 0x03EB}, {0x03EC, 0x03ED}, {0x03EE, 0x03EF}, {0x03F0, 0x03BA}, {0x03F1, 0x03C1}, {0x03F4, 0x03B8}, {0x03F5, 0x03B5}, {0x03F7, 0x03F8}, {0x03F9, 0x03F2}, {0x03FA, 0x03FB}, {0x0400, 0x0450}, {0x0401, 0x0451}, {0x0402, 0x0452}, {0x0403, 0x0453}, {0x0404, 0x0454}, {0x0405, 0x0455}, {0x0406, 0x0456}, {0x0407, 0x0457}, {0x0408, 0x0458}, {0x0409, 0x0459}, {0x040A, 0x045A}, {0x040B, 0x045B}, {0x040C, 0x045C}, {0x040D, 0x045D}, {0x040E, 0x045E}, {0x040F, 0x045F}, {0x0410, 0x0430}, {0x0411, 0x0431}, {0x0412, 0x0432}, {0x0413, 0x0433}, {0x0414, 0x0434}, {0x0415, 0x0435}, {0x0416, 0x0436}, {0x0417, 0x0437}, {0x0418, 0x0438}, {0x0419, 0x0439}, {0x041A, 0x043A}, {0x041B, 0x043B}, {0x041C, 0x043C}, {0x041D, 0x043D}, {0x041E, 0x043E}, {0x041F, 0x043F}, {0x0420, 0x0440}, {0x0421, 0x0441}, {0x0422, 0x0442}, {0x0423, 0x0443}, {0x0424, 0x0444}, {0x0425, 0x0445}, {0x0426, 0x0446}, {0x0427, 0x0447}, {0x0428, 0x0448}, {0x0429, 0x0449}, {0x042A, 0x044A}, {0x042B, 0x044B}, {0x042C, 0x044C}, {0x042D, 0x044D}, {0x042E, 0x044E}, {0x042F, 0x044F}, {0x0460, 0x0461}, {0x0462, 0x0463}, {0x0464, 0x0465}, {0x0466, 0x0467}, {0x0468, 0x0469}, {0x046A, 0x046B}, {0x046C, 0x046D}, {0x046E, 0x046F}, {0x0470, 0x0471}, {0x0472, 0x0473}, {0x0474, 0x0475}, {0x0476, 0x0477}, {0x0478, 0x0479}, {0x047A, 0x047B}, {0x047C, 0x047D}, {0x047E, 0x047F}, {0x0480, 0x0481}, {0x048A, 0x048B}, {0x048C, 0x048D}, {0x048E, 0x048F}, {0x0490, 0x0491}, {0x0492, 0x0493}, {0x0494, 0x0495}, {0x0496, 0x0497}, {0x0498, 0x0499}, {0x049A, 0x049B}, {0x049C, 0x049D}, {0x049E, 0x049F}, {0x04A0, 0x04A1}, {0x04A2, 0x04A3}, {0x04A4, 0x04A5}, {0x04A6, 0x04A7}, {0x04A8, 0x04A9}, {0x04AA, 0x04AB}, {0x04AC, 0x04AD}, {0x04AE, 0x04AF}, {0x04B0, 0x04B1}, {0x04B2, 0x04B3}, {0x04B4, 0x04B5}, {0x04B6, 0x04B7}, {0x04B8, 0x04B9}, {0x04BA, 0x04BB}, {0x04BC, 0x04BD}, {0x04BE, 0x04BF}, {0x04C1, 0x04C2}, {0x04C3, 0x04C4}, {0x04C5, 0x04C6}, {0x04C7, 0x04C8}, {0x04C9, 0x04CA}, {0x04CB, 0x04CC}, {0x04CD, 0x04CE}, {0x04D0, 0x04D1}, {0x04D2, 0x04D3}, {0x04D4, 0x04D5}, {0x04D6, 0x04D7}, {0x04D8, 0x04D9}, {0x04DA, 0x04DB}, {0x04DC, 0x04DD}, {0x04DE, 0x04DF}, {0x04E0, 0x04E1}, {0x04E2, 0x04E3}, {0x04E4, 0x04E5}, {0x04E6, 0x04E7}, {0x04E8, 0x04E9}, {0x04EA, 0x04EB}, {0x04EC, 0x04ED}, {0x04EE, 0x04EF}, {0x04F0, 0x04F1}, {0x04F2, 0x04F3}, {0x04F4, 0x04F5}, {0x04F8, 0x04F9}, {0x0500, 0x0501}, {0x0502, 0x0503}, {0x0504, 0x0505}, {0x0506, 0x0507}, {0x0508, 0x0509}, {0x050A, 0x050B}, {0x050C, 0x050D}, {0x050E, 0x050F}, {0x0531, 0x0561}, {0x0532, 0x0562}, {0x0533, 0x0563}, {0x0534, 0x0564}, {0x0535, 0x0565}, {0x0536, 0x0566}, {0x0537, 0x0567}, {0x0538, 0x0568}, {0x0539, 0x0569}, {0x053A, 0x056A}, {0x053B, 0x056B}, {0x053C, 0x056C}, {0x053D, 0x056D}, {0x053E, 0x056E}, {0x053F, 0x056F}, {0x0540, 0x0570}, {0x0541, 0x0571}, {0x0542, 0x0572}, {0x0543, 0x0573}, {0x0544, 0x0574}, {0x0545, 0x0575}, {0x0546, 0x0576}, {0x0547, 0x0577}, {0x0548, 0x0578}, {0x0549, 0x0579}, {0x054A, 0x057A}, {0x054B, 0x057B}, {0x054C, 0x057C}, {0x054D, 0x057D}, {0x054E, 0x057E}, {0x054F, 0x057F}, {0x0550, 0x0580}, {0x0551, 0x0581}, {0x0552, 0x0582}, {0x0553, 0x0583}, {0x0554, 0x0584}, {0x0555, 0x0585}, {0x0556, 0x0586}, {0x1E00, 0x1E01}, {0x1E02, 0x1E03}, {0x1E04, 0x1E05}, {0x1E06, 0x1E07}, {0x1E08, 0x1E09}, {0x1E0A, 0x1E0B}, {0x1E0C, 0x1E0D}, {0x1E0E, 0x1E0F}, {0x1E10, 0x1E11}, {0x1E12, 0x1E13}, {0x1E14, 0x1E15}, {0x1E16, 0x1E17}, {0x1E18, 0x1E19}, {0x1E1A, 0x1E1B}, {0x1E1C, 0x1E1D}, {0x1E1E, 0x1E1F}, {0x1E20, 0x1E21}, {0x1E22, 0x1E23}, {0x1E24, 0x1E25}, {0x1E26, 0x1E27}, {0x1E28, 0x1E29}, {0x1E2A, 0x1E2B}, {0x1E2C, 0x1E2D}, {0x1E2E, 0x1E2F}, {0x1E30, 0x1E31}, {0x1E32, 0x1E33}, {0x1E34, 0x1E35}, {0x1E36, 0x1E37}, {0x1E38, 0x1E39}, {0x1E3A, 0x1E3B}, {0x1E3C, 0x1E3D}, {0x1E3E, 0x1E3F}, {0x1E40, 0x1E41}, {0x1E42, 0x1E43}, {0x1E44, 0x1E45}, {0x1E46, 0x1E47}, {0x1E48, 0x1E49}, {0x1E4A, 0x1E4B}, {0x1E4C, 0x1E4D}, {0x1E4E, 0x1E4F}, {0x1E50, 0x1E51}, {0x1E52, 0x1E53}, {0x1E54, 0x1E55}, {0x1E56, 0x1E57}, {0x1E58, 0x1E59}, {0x1E5A, 0x1E5B}, {0x1E5C, 0x1E5D}, {0x1E5E, 0x1E5F}, {0x1E60, 0x1E61}, {0x1E62, 0x1E63}, {0x1E64, 0x1E65}, {0x1E66, 0x1E67}, {0x1E68, 0x1E69}, {0x1E6A, 0x1E6B}, {0x1E6C, 0x1E6D}, {0x1E6E, 0x1E6F}, {0x1E70, 0x1E71}, {0x1E72, 0x1E73}, {0x1E74, 0x1E75}, {0x1E76, 0x1E77}, {0x1E78, 0x1E79}, {0x1E7A, 0x1E7B}, {0x1E7C, 0x1E7D}, {0x1E7E, 0x1E7F}, {0x1E80, 0x1E81}, {0x1E82, 0x1E83}, {0x1E84, 0x1E85}, {0x1E86, 0x1E87}, {0x1E88, 0x1E89}, {0x1E8A, 0x1E8B}, {0x1E8C, 0x1E8D}, {0x1E8E, 0x1E8F}, {0x1E90, 0x1E91}, {0x1E92, 0x1E93}, {0x1E94, 0x1E95}, {0x1E9B, 0x1E61}, {0x1EA0, 0x1EA1}, {0x1EA2, 0x1EA3}, {0x1EA4, 0x1EA5}, {0x1EA6, 0x1EA7}, {0x1EA8, 0x1EA9}, {0x1EAA, 0x1EAB}, {0x1EAC, 0x1EAD}, {0x1EAE, 0x1EAF}, {0x1EB0, 0x1EB1}, {0x1EB2, 0x1EB3}, {0x1EB4, 0x1EB5}, {0x1EB6, 0x1EB7}, {0x1EB8, 0x1EB9}, {0x1EBA, 0x1EBB}, {0x1EBC, 0x1EBD}, {0x1EBE, 0x1EBF}, {0x1EC0, 0x1EC1}, {0x1EC2, 0x1EC3}, {0x1EC4, 0x1EC5}, {0x1EC6, 0x1EC7}, {0x1EC8, 0x1EC9}, {0x1ECA, 0x1ECB}, {0x1ECC, 0x1ECD}, {0x1ECE, 0x1ECF}, {0x1ED0, 0x1ED1}, {0x1ED2, 0x1ED3}, {0x1ED4, 0x1ED5}, {0x1ED6, 0x1ED7}, {0x1ED8, 0x1ED9}, {0x1EDA, 0x1EDB}, {0x1EDC, 0x1EDD}, {0x1EDE, 0x1EDF}, {0x1EE0, 0x1EE1}, {0x1EE2, 0x1EE3}, {0x1EE4, 0x1EE5}, {0x1EE6, 0x1EE7}, {0x1EE8, 0x1EE9}, {0x1EEA, 0x1EEB}, {0x1EEC, 0x1EED}, {0x1EEE, 0x1EEF}, {0x1EF0, 0x1EF1}, {0x1EF2, 0x1EF3}, {0x1EF4, 0x1EF5}, {0x1EF6, 0x1EF7}, {0x1EF8, 0x1EF9}, {0x1F08, 0x1F00}, {0x1F09, 0x1F01}, {0x1F0A, 0x1F02}, {0x1F0B, 0x1F03}, {0x1F0C, 0x1F04}, {0x1F0D, 0x1F05}, {0x1F0E, 0x1F06}, {0x1F0F, 0x1F07}, {0x1F18, 0x1F10}, {0x1F19, 0x1F11}, {0x1F1A, 0x1F12}, {0x1F1B, 0x1F13}, {0x1F1C, 0x1F14}, {0x1F1D, 0x1F15}, {0x1F28, 0x1F20}, {0x1F29, 0x1F21}, {0x1F2A, 0x1F22}, {0x1F2B, 0x1F23}, {0x1F2C, 0x1F24}, {0x1F2D, 0x1F25}, {0x1F2E, 0x1F26}, {0x1F2F, 0x1F27}, {0x1F38, 0x1F30}, {0x1F39, 0x1F31}, {0x1F3A, 0x1F32}, {0x1F3B, 0x1F33}, {0x1F3C, 0x1F34}, {0x1F3D, 0x1F35}, {0x1F3E, 0x1F36}, {0x1F3F, 0x1F37}, {0x1F48, 0x1F40}, {0x1F49, 0x1F41}, {0x1F4A, 0x1F42}, {0x1F4B, 0x1F43}, {0x1F4C, 0x1F44}, {0x1F4D, 0x1F45}, {0x1F59, 0x1F51}, {0x1F5B, 0x1F53}, {0x1F5D, 0x1F55}, {0x1F5F, 0x1F57}, {0x1F68, 0x1F60}, {0x1F69, 0x1F61}, {0x1F6A, 0x1F62}, {0x1F6B, 0x1F63}, {0x1F6C, 0x1F64}, {0x1F6D, 0x1F65}, {0x1F6E, 0x1F66}, {0x1F6F, 0x1F67}, {0x1F88, 0x1F80}, {0x1F89, 0x1F81}, {0x1F8A, 0x1F82}, {0x1F8B, 0x1F83}, {0x1F8C, 0x1F84}, {0x1F8D, 0x1F85}, {0x1F8E, 0x1F86}, {0x1F8F, 0x1F87}, {0x1F98, 0x1F90}, {0x1F99, 0x1F91}, {0x1F9A, 0x1F92}, {0x1F9B, 0x1F93}, {0x1F9C, 0x1F94}, {0x1F9D, 0x1F95}, {0x1F9E, 0x1F96}, {0x1F9F, 0x1F97}, {0x1FA8, 0x1FA0}, {0x1FA9, 0x1FA1}, {0x1FAA, 0x1FA2}, {0x1FAB, 0x1FA3}, {0x1FAC, 0x1FA4}, {0x1FAD, 0x1FA5}, {0x1FAE, 0x1FA6}, {0x1FAF, 0x1FA7}, {0x1FB8, 0x1FB0}, {0x1FB9, 0x1FB1}, {0x1FBA, 0x1F70}, {0x1FBB, 0x1F71}, {0x1FBC, 0x1FB3}, {0x1FBE, 0x03B9}, {0x1FC8, 0x1F72}, {0x1FC9, 0x1F73}, {0x1FCA, 0x1F74}, {0x1FCB, 0x1F75}, {0x1FCC, 0x1FC3}, {0x1FD8, 0x1FD0}, {0x1FD9, 0x1FD1}, {0x1FDA, 0x1F76}, {0x1FDB, 0x1F77}, {0x1FE8, 0x1FE0}, {0x1FE9, 0x1FE1}, {0x1FEA, 0x1F7A}, {0x1FEB, 0x1F7B}, {0x1FEC, 0x1FE5}, {0x1FF8, 0x1F78}, {0x1FF9, 0x1F79}, {0x1FFA, 0x1F7C}, {0x1FFB, 0x1F7D}, {0x1FFC, 0x1FF3}, {0x2126, 0x03C9}, /*{0x212A, 0x006B}, {0x212B, 0x00E5}, */{0x2160, 0x2170}, {0x2161, 0x2171}, {0x2162, 0x2172}, {0x2163, 0x2173}, {0x2164, 0x2174}, {0x2165, 0x2175}, {0x2166, 0x2176}, {0x2167, 0x2177}, {0x2168, 0x2178}, {0x2169, 0x2179}, {0x216A, 0x217A}, {0x216B, 0x217B}, {0x216C, 0x217C}, {0x216D, 0x217D}, {0x216E, 0x217E}, {0x216F, 0x217F}, {0x24B6, 0x24D0}, {0x24B7, 0x24D1}, {0x24B8, 0x24D2}, {0x24B9, 0x24D3}, {0x24BA, 0x24D4}, {0x24BB, 0x24D5}, {0x24BC, 0x24D6}, {0x24BD, 0x24D7}, {0x24BE, 0x24D8}, {0x24BF, 0x24D9}, {0x24C0, 0x24DA}, {0x24C1, 0x24DB}, {0x24C2, 0x24DC}, {0x24C3, 0x24DD}, {0x24C4, 0x24DE}, {0x24C5, 0x24DF}, {0x24C6, 0x24E0}, {0x24C7, 0x24E1}, {0x24C8, 0x24E2}, {0x24C9, 0x24E3}, {0x24CA, 0x24E4}, {0x24CB, 0x24E5}, {0x24CC, 0x24E6}, {0x24CD, 0x24E7}, {0x24CE, 0x24E8}, {0x24CF, 0x24E9}, {0xFF21, 0xFF41}, {0xFF22, 0xFF42}, {0xFF23, 0xFF43}, {0xFF24, 0xFF44}, {0xFF25, 0xFF45}, {0xFF26, 0xFF46}, {0xFF27, 0xFF47}, {0xFF28, 0xFF48}, {0xFF29, 0xFF49}, {0xFF2A, 0xFF4A}, {0xFF2B, 0xFF4B}, {0xFF2C, 0xFF4C}, {0xFF2D, 0xFF4D}, {0xFF2E, 0xFF4E}, {0xFF2F, 0xFF4F}, {0xFF30, 0xFF50}, {0xFF31, 0xFF51}, {0xFF32, 0xFF52}, {0xFF33, 0xFF53}, {0xFF34, 0xFF54}, {0xFF35, 0xFF55}, {0xFF36, 0xFF56}, {0xFF37, 0xFF57}, {0xFF38, 0xFF58}, {0xFF39, 0xFF59}, {0xFF3A, 0xFF5A} parser-3.5.1/src/main/pa_string.C0000644000076400007640000006437414714767120013601 00000000000000/** @file Parser: string class. @see untalength_t.C. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_string.h" #include "pa_exception.h" #include "pa_table.h" #include "pa_dictionary.h" #include "pa_charset.h" #include "pa_vregex.h" volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.281 2024/11/13 00:09:52 moko Exp $" IDENT_PA_STRING_H; const String String::Empty; #define COMPILE_ASSERT(x) extern int assert_checker[(x) ? 1 : -1] COMPILE_ASSERT(sizeof(String::Languages) == sizeof(CORD)); // pa_atoui is based on Manuel Novoa III _strto_l for uClibc template inline T pa_ato_any(const char *str, int base, const String* problem_source,const T max){ T result = 0; const char *pos = str; while (isspace(*pos)) /* skip leading whitespace */ ++pos; if (base == 16 && *pos == '0') { /* handle option prefix */ ++pos; if (*pos == 'x' || *pos == 'X') { ++pos; } } if (base == 0) { /* dynamic base */ base = 10; /* default is 10 */ if (*pos == '0') { ++pos; if (*pos == 'x' || *pos == 'X'){ ++pos; base=16; } } } if (base < 2 || base > 16) /* illegal base */ throw Exception(PARSER_RUNTIME, 0, "base to must be an integer from 2 to 16"); if (*pos == '-') throw Exception("number.format", problem_source, problem_source ? "out of range (negative)" : "'%s' is out if range (negative)", str); T cutoff = max / base; int cutoff_digit = (int)(max - cutoff * base); while(true) { int digit; if ((*pos >= '0') && (*pos <= '9')) { digit = (*pos - '0'); } else if (*pos >= 'a') { digit = (*pos - 'a' + 10); } else if (*pos >= 'A') { digit = (*pos - 'A' + 10); } else break; if (digit >= base) { break; } ++pos; /* adjust number, with overflow check */ if ((result > cutoff) || ((result == cutoff) && (digit > cutoff_digit))) { throw Exception("number.format", problem_source, problem_source ? "out of range (int)" : "'%s' is out of range (int)", str); } else { result = result * base + digit; } } while(char c=*pos++) if(!isspace(c)) throw Exception("number.format", problem_source, problem_source ? "invalid number (int)" : "'%s' is an invalid number (int)", str); return result; } unsigned int pa_atoui(const char *str, int base, const String* problem_source){ if(!str) return 0; return pa_ato_any(str, base, problem_source, UINT_MAX); } uint64_t pa_atoul(const char *str, int base, const String* problem_source){ if(!str) return 0; return pa_ato_any(str, base, problem_source, ULLONG_MAX); } int pa_atoi(const char* str, int base, const String* problem_source) { if(!str) return 0; while(isspace(*str)) str++; if(!*str) return 0; const char *str_copy=str; bool negative=false; if(str[0]=='-') { negative=true; str++; if(!*str || isspace(*str)) throw Exception("number.format", problem_source, problem_source ? "invalid number (int)" : "'%s' is an invalid number (int)", str_copy); } else if(str[0]=='+') { str++; if(!*str || isspace(*str)) throw Exception("number.format", problem_source, problem_source ? "invalid number (int)" : "'%s' is an invalid number (int)", str_copy); } unsigned int result=pa_atoui(str, base, problem_source); if(negative && result <= ((unsigned int)(-(1+INT_MIN)))+1) return -(int)result; if(result<=INT_MAX) return (int)result; throw Exception("number.format", problem_source, problem_source ? "out of range (int)" : "'%s' is out of range (int)", str_copy); } double pa_atod(const char* str, const String* problem_source /* never null */) { if(!str) return 0; while(isspace(*str)) str++; if(!*str) return 0; bool negative=false; if(str[0]=='-') { negative=true; str++; if(!*str || isspace(*str)) throw Exception("number.format", problem_source, "invalid number (double)"); } else if(str[0]=='+') { str++; if(!*str || isspace(*str)) throw Exception("number.format", problem_source, "invalid number (double)"); } double result; if(str[0]=='0') { if(str[1]=='x' || str[1]=='X') { // 0xABC result=(double)pa_atoul(str, 0, problem_source); return negative ? -result : result; } else { // skip leading 0000, to disable octal interpretation do str++; while(*str=='0'); } } char *error_pos; result=strtod(str, &error_pos); while(const char c=*error_pos++) if(!isspace(c)) throw Exception("number.format", problem_source, "invalid number (double)"); return negative ? -result : result; } // cord lib extension #ifndef DOXYGEN typedef struct { ssize_t countdown; int target; /* Character we're looking for */ } chr_data; #endif static int CORD_range_contains_chr_greater_then_proc(char c, size_t size, void* client_data) { chr_data * d = (chr_data *)client_data; if (d -> countdown<=0) return(2); d -> countdown -= size; if (c > d -> target) return(1); return(0); } int CORD_range_contains_chr_greater_then(CORD x, size_t i, size_t n, int c) { chr_data d; d.countdown = n; d.target = c; return(CORD_block_iter(x, i, CORD_range_contains_chr_greater_then_proc, &d) == 1/*alternatives: 0 normally ended, 2=struck 'n'*/); } static int CORD_block_count_proc(char /*c*/, size_t /*size*/, void* client_data) { int* result=(int*)client_data; (*result)++; return(0); // 0=continue } size_t CORD_block_count(CORD x) { size_t result=0; CORD_block_iter(x, 0, CORD_block_count_proc, &result); return result; } // helpers /// String::match uses this as replace & global search table columns const int MAX_MATCH_GROUPS=100; class String_match_table_template_columns: public ArrayString { public: String_match_table_template_columns() { *this+=new String("prematch"); *this+=new String("match"); *this+=new String("postmatch"); for(int i=0; iisUTF8()){ const char* pos=chars; while(unsigned char c=*pos++) if(c>127){ fast=false; break; } } size_t start=0; size_t end=our_length; if(!chars) chars=" \t\r\n"; // white space if(fast){ // from left... if(kind!=TRIM_END) { CORD_pos pos; set_pos(pos, 0); while(true) { char c=CORD_pos_fetch(pos); if(strchr(chars, c)) { if(++start==our_length) return 0; // all chars are empty, just return empty string } else break; CORD_next(pos); } } // from right.. if(kind!=TRIM_START) { CORD_pos pos; set_pos(pos, end-1); while(true) { char c=CORD_pos_fetch(pos); if(strchr(chars, c)) { if(--end==0) // optimization: NO need to check for 'end>=start', that's(<) impossible return 0; // all chars are empty, just return empty string } else break; CORD_prev(pos); } } } else { const XMLByte* src_begin=(const XMLByte*)cstr(); const XMLByte* src_end=src_begin+our_length; // from left... if(kind!=TRIM_END) { while(src_begin127 && *src_begin<0xC0)) char_length++; bool found=false; for(const char* chars_byte=chars; chars_byte=strchr(chars_byte, *ptr); chars_byte++) if(strncmp(chars_byte, (const char*)ptr, char_length)==0){ found=true; break; } if(found){ start+=char_length; if(start==our_length) return 0; // all chars are empty, just return empty string } else break; } } // from right.. if(kind!=TRIM_START) { while(src_begin127 && *src_end<0xC0)) char_length++; bool found=false; for(const char* chars_byte=chars; chars_byte=strchr(chars_byte, *src_end); chars_byte++) if(strncmp(chars_byte, (const char*)src_end, char_length)==0){ found=true; break; } if(found){ end-=char_length; if(end==0) return 0; // all chars are empty, just return empty string } else break; } } } if(start==0 && end==our_length) // nobody moved a thing return *this; if(out_start) *out_start=start; size_t new_length=end-start; if(out_length) *out_length=new_length; return mid(start, new_length); } static int CORD_batched_iter_fn_generic_hash_code(char c, void * client_data) { uint& result=*static_cast(client_data); generic_hash_code(result, c); return 0; } static int CORD_batched_iter_fn_generic_hash_code(const char* s, void * client_data) { uint& result=*static_cast(client_data); generic_hash_code(result, s); return 0; } uint String::Body::get_hash_code() const { #ifdef HASH_CODE_CACHING if(hash_code) return hash_code; #else uint hash_code=0; #endif if (body && CORD_IS_STRING(body)){ generic_hash_code(hash_code, (const char *)body); } else { CORD_iter5(body, 0, CORD_batched_iter_fn_generic_hash_code, CORD_batched_iter_fn_generic_hash_code, &hash_code); } return hash_code; } struct CORD_pos_info { const char* chars; size_t left; size_t pos; }; // can be called only for IS_FUNCTION(CORD) which is used in String::Body::strrpbrk static int CORD_iter_fn_rpos(char c, CORD_pos_info* info) { if(info->pos < info->left){ info->pos=STRING_NOT_FOUND; return 1; } if(strchr(info->chars, c)) return 1; --(info->pos); return 0; } size_t String::Body::strrpbrk(const char* chars, size_t left, size_t right) const { if(is_empty() || !chars || !strlen(chars)) return STRING_NOT_FOUND; CORD_pos_info info={chars, left, right}; if(CORD_riter4(body, right, (CORD_iter_fn)CORD_iter_fn_rpos, &info)) return info.pos; else return STRING_NOT_FOUND; } // can be called only for IS_FUNCTION(CORD) which is used in String::Body::rskipchars static int CORD_iter_fn_rskip(char c, CORD_pos_info* info) { if(info->pos < info->left) { info->pos=STRING_NOT_FOUND; return 1; } if(!strchr(info->chars, c)) return 1; --(info->pos); return 0; } size_t String::Body::rskipchars(const char* chars, size_t left, size_t right) const { if(is_empty() || !chars || !strlen(chars)) return STRING_NOT_FOUND; CORD_pos_info info={chars, left, right}; if(CORD_riter4(body, right, (CORD_iter_fn)CORD_iter_fn_rskip, &info)) return info.pos; else return STRING_NOT_FOUND; } // String methods String& String::append_know_length(const char* str, size_t known_length, Language lang) { if(!known_length) return *this; // first: langs langs.append(body, lang, known_length); // next: letters themselves body.append_know_length(str, known_length); ASSERT_STRING_INVARIANT(*this); return *this; } String& String::append_help_length(const char* str, size_t helper_length, Language lang) { if(!str) return *this; size_t known_length=helper_length?helper_length:strlen(str); if(!known_length) return *this; return append_know_length(str, known_length, lang); } String::String(int value, const char *format) : langs(L_CLEAN){ char buf[MAX_NUMBER]; body.append_strdup_know_length(buf, snprintf(buf, MAX_NUMBER, format, value)); } String& String::append_strdup(const char* str, size_t helper_length, Language lang) { size_t known_length=helper_length?helper_length:strlen(str); if(!known_length) return *this; // first: langs langs.append(body, lang, known_length); // next: letters themselves body.append_strdup_know_length(str, known_length); ASSERT_STRING_INVARIANT(*this); return *this; } struct CORD_length_info { size_t len; size_t skip; }; int CORD_batched_len(const char* s, CORD_length_info* info){ info->len += lengthUTF8( (const XMLByte *)s, (const XMLByte *)s+strlen(s)); return 0; } // can be called only for IS_FUNCTION(CORD) which are used in large String::Body::mid int CORD_batched_len(const char c, CORD_length_info* info){ if (info->skip==0){ info->len++; info->skip = lengthUTF8Char(c)-1; } else { info->skip--; } return 0; } size_t String::length(Charset& charset) const { if(charset.isUTF8()){ CORD_length_info info = {0, 0}; body.for_each(CORD_batched_len, CORD_batched_len, &info); return info.len; } else return body.length(); } /// @todo check in doc: whether it documents NOW bad situation "abc".mid(-1, 3) =were?="ab" String& String::mid(size_t substr_begin, size_t substr_end) const { String& result=*new String; size_t self_length=length(); substr_begin=min(substr_begin, self_length); substr_end=min(max(substr_end, substr_begin), self_length); size_t substr_length=substr_end-substr_begin; if(!substr_length) return result; // first: their langs result.langs.append(result.body, langs, substr_begin, substr_length); // next: letters themselves result.body=body.mid(substr_begin, substr_length); ASSERT_STRING_INVARIANT(result); return result; } // from, to and helper_length in characters, not in bytes (it's important for utf-8) String& String::mid(Charset& charset, size_t from, size_t to, size_t helper_length) const { String& result=*new String; size_t self_length=helper_length ? helper_length : length(charset); if(!self_length) return result; from=min(min(to, from), self_length); to=min(max(to, from), self_length); size_t substr_length=to-from; if(!substr_length) return result; if(charset.isUTF8()){ const XMLByte* src_begin=(const XMLByte*)cstr(); const XMLByte* src_end=src_begin+body.length(); // convert 'from' and 'substr_length' from 'characters' to 'bytes' from=getUTF8BytePos(src_begin, src_end, from); substr_length=getUTF8BytePos(src_begin+from, src_end, substr_length); if(!substr_length) return result; } // first: their langs result.langs.append(result.body, langs, from, substr_length); // next: letters themselves result.body=body.mid(from, substr_length); ASSERT_STRING_INVARIANT(result); return result; } size_t String::pos(const String::Body substr, size_t this_offset, Language lang) const { size_t substr_length=substr.length(); while(true) { size_t substr_begin=body.pos(substr, this_offset); if(substr_begin==CORD_NOT_FOUND) return STRING_NOT_FOUND; if(langs.check_lang(lang, substr_begin, substr_length)) return substr_begin; this_offset=substr_begin+substr_length; } } size_t String::pos(const String& substr, size_t this_offset, Language lang) const { return pos(substr.body, this_offset, lang); } size_t String::pos(Charset& charset, const String& substr, size_t this_offset, Language lang) const { if(charset.isUTF8()){ const XMLByte* srcPtr=(const XMLByte*)cstr(); const XMLByte* srcEnd=srcPtr+body.length(); // convert 'this_offset' from 'characters' to 'bytes' this_offset=getUTF8BytePos(srcPtr, srcEnd, this_offset); size_t result=pos(substr.body, this_offset, lang); return (result==CORD_NOT_FOUND) ? STRING_NOT_FOUND : getUTF8CharPos(srcPtr, srcEnd, result); // convert 'result' from 'bytes' to 'characters' } else { size_t result=pos(substr.body, this_offset, lang); return (result==CORD_NOT_FOUND) ? STRING_NOT_FOUND : result; } } void String::split(ArrayString& result, size_t pos_after, const char* delim, Language lang) const { if(is_empty()) return; size_t self_length=length(); if(size_t delim_length=strlen(delim)) { size_t pos_before; // while we have 'delim'... while((pos_before=pos(delim, pos_after, lang))!=STRING_NOT_FOUND) { result+=&mid(pos_after, pos_before); pos_after=pos_before+delim_length; } // last piece if(pos_afterinfo(); // I have no idea what does it for? bool need_pre_post_match=vregex->is_pre_post_match_needed(); bool global=vregex->is_global_search(); const char* subject=cstr(); size_t subject_length=length(); const int ovector_size=(1/*match*/+MAX_MATCH_GROUPS)*3; /* 1/3 is used as workspace by pcre_exec() */ int ovector[ovector_size]; Table::Action_options table_options; Table& table=*new Table(string_match_table_template(), table_options); int prestart=0; int poststart=0; int postfinish=length(); int action_was_executed=-1; while(true) { int exec_result=vregex->exec(subject, subject_length, ovector, ovector_size, prestart); if(exec_result<0) // only PCRE_ERROR_NOMATCH might be here, other negative results cause an exception break; int prefinish=ovector[0]; poststart=ovector[1]; if (prestart==poststart && action_was_executed==1){ prestart++; action_was_executed=0; continue; } ArrayString* row=new ArrayString(3); if(need_pre_post_match) { *row+=&mid(0, prefinish); // .prematch column value *row+=&mid(prefinish, poststart); // .match *row+=&mid(poststart, postfinish); // .postmatch } else { *row+=&Empty; // .prematch column value *row+=&Empty; // .match *row+=&Empty; // .postmatch } for(int i=1; i=0 && ovector[i*2+1]>0)?&mid(ovector[i*2+0], ovector[i*2+1]):new String; // .i column value } matches_count++; row_action(table, row, prestart - !action_was_executed, prefinish, poststart, postfinish, info); if(!global || (size_t)poststart>=subject_length) // last step, avoid prestart++ after last char break; prestart=poststart; action_was_executed=1; } row_action(table, 0/*last time, no raw*/, 0, 0, poststart, postfinish, info); return vregex->is_just_count() ? 0 : &table; } String& String::change_case(Charset& source_charset, Change_case_kind kind) const { String& result=*new String(); if(is_empty()) return result; char* new_cstr=cstrm(); if(source_charset.isUTF8()) { size_t new_cstr_len=length(); switch(kind) { case CC_UPPER: change_case_UTF8((const XMLByte*)new_cstr, new_cstr_len, (XMLByte*)new_cstr, new_cstr_len, UTF8CaseToUpper); break; case CC_LOWER: change_case_UTF8((const XMLByte*)new_cstr, new_cstr_len, (XMLByte*)new_cstr, new_cstr_len, UTF8CaseToLower); break; default: assert(!"unknown change case kind"); break; // never } } else { const unsigned char *tables=source_charset.pcre_tables; const unsigned char *a; const unsigned char *b; switch(kind) { case CC_UPPER: a=tables+lcc_offset; b=tables+fcc_offset; break; case CC_LOWER: a=tables+lcc_offset; b=0; break; default: assert(!"unknown change case kind"); a=b=0; // calm, compiler break; // never } char *dest=new_cstr; unsigned char index; for(const char* current=new_cstr; (index=(unsigned char)*current); current++) { unsigned char c=a[index]; if(b) c=b[c]; *dest++=(char)c; } } result.langs=langs; result.body=new_cstr; return result; } const String& String::escape(Charset& source_charset) const { if(is_empty()) return *this; return Charset::escape(*this, source_charset); } #define STRING_APPEND(result, from_cstr, langs, langs_offset, length) \ result.langs.append(result.body, langs, langs_offset, length); \ result.body.append_strdup_know_length(from_cstr, length); const String& String::replace(const Dictionary& dict) const { if(!dict.count() || is_empty()) return *this; String& result=*new String(); const char* old_cstr=cstr(); const char* prematch_begin=old_cstr; if(dict.count()==1) { // optimized simple case Dictionary::Subst subst=dict.get(0); while(const char* p=strstr(prematch_begin, subst.from)) { // prematch if(size_t prematch_length=p-prematch_begin) { STRING_APPEND(result, prematch_begin, langs, prematch_begin-old_cstr, prematch_length) } // match prematch_begin=p+subst.from_length; if(const String* b=subst.to) // are there any b? result<<*b; } } else { const char* current=old_cstr; while(*current) { if(Dictionary::Subst subst=dict.first_that_begins(current)) { // prematch if(size_t prematch_length=current-prematch_begin) { STRING_APPEND(result, prematch_begin, langs, prematch_begin-old_cstr, prematch_length) } // match // skip 'a' in 'current'; move prematch_begin current+=subst.from_length; prematch_begin=current; if(const String* b=subst.to) // are there any b? result<<*b; } else // simply advance current++; } } if(prematch_begin==old_cstr) // not modified return *this; // postmatch if(size_t postmatch_length=old_cstr+length()-prematch_begin) { STRING_APPEND(result, prematch_begin, langs, prematch_begin-old_cstr, postmatch_length) } ASSERT_STRING_INVARIANT(result); return result; } static int serialize_body_char(char c, char** cur) { *((*cur)++)=c; return 0; // 0=continue } static int serialize_body_piece(const char* s, char** cur) { size_t length=strlen(s); memcpy(*cur, s, length); *cur+=length; return 0; // 0=continue } static int serialize_lang_piece(char alang, size_t asize, char** cur) { // lang **cur=alang; (*cur)++; // length [WARNING: not cast, addresses must be %4=0 on sparc] memcpy(*cur, &asize, sizeof(asize)); *cur+=sizeof(asize); return 0; // 0=continue } String::Cm String::serialize(size_t prolog_length) const { size_t fragments_count=langs.count(); size_t body_length=body.length(); size_t buf_length= prolog_length //1 +sizeof(size_t) //2 +body_length //3 +1 // 4 for zero terminator used in deserialize +sizeof(size_t) //5 +fragments_count*(sizeof(char)+sizeof(size_t)); //6 String::Cm result(new(PointerFreeGC) char[buf_length], buf_length); // 1: prolog char *cur=result.str+prolog_length; // 2: chars.count [WARNING: not cast, addresses must be %4=0 on sparc] memcpy(cur, &body_length, sizeof(body_length)); cur+=sizeof(body_length); // 3: letters body.for_each(serialize_body_char, serialize_body_piece, &cur); // 4: zero terminator *cur++=0; // 5: langs.count [WARNING: not cast, addresses must be %4=0 on sparc] memcpy(cur, &fragments_count, sizeof(fragments_count)); cur+=sizeof(fragments_count); // 6: lang info langs.for_each(body, serialize_lang_piece, &cur); return result; } bool String::deserialize(size_t prolog_size, void *buf, size_t buf_size) { size_t in_buf=buf_size; if(in_buf<=prolog_size) return false; in_buf-=prolog_size; // 1: prolog const char* cur=(const char* )buf+prolog_size; // 2: chars.count size_t body_length; if(in_bufbody_length) return false; // file curruption // uchar needed to prevent propagating 0x80 bit to upper bytes langs.append(total_length, (String::Language)(uchar)lang, fragment_length); total_length=combined_length; in_buf-=piece_length; } if(total_length!=body_length) // length(all language fragments) vs length(letters) return false; } if(in_buf!=0) // some strange extra bytes return false; ASSERT_STRING_INVARIANT(*this); return true; } void String::Body::dump() const { CORD_dump(body); } const char* String::Languages::visualize() const { if(opt.is_not_just_lang) return CORD_to_const_char_star(langs, 0); else return 0; } void String::Languages::dump() const { if(opt.is_not_just_lang) CORD_dump(langs); else puts((const char*)&langs); } void String::dump() const { body.dump(); langs.dump(); } static char *n_chars(char c, size_t length){ char *result=(char *)pa_malloc_atomic(length+1); memset(result, c, length); result[length] = '\0'; return result; } char* String::visualize_langs() const { return is_not_just_lang() ? pa_strdup(langs.visualize()) : n_chars((char)just_lang(), length()); } const String& String::trim(String::Trim_kind kind, const char* chars, Charset* source_charset) const { if(is_empty()) return *this; size_t substr_begin, substr_length; Body new_body=body.trim(kind, chars, &substr_begin, &substr_length, source_charset); if(new_body==body) // we received unchanged pointer, do likewise return *this; // new_body differs from body, adjust langs along String& result=*new String; if(!new_body) // body.trim produced empty result return result; // body.trim produced nonempty result // first: their langs result.langs.append(result.body, langs, substr_begin, substr_length); // next: letters themselves result.body=new_body; ASSERT_STRING_INVARIANT(result); return result; } parser-3.5.1/src/main/pa_stylesheet_manager.C0000644000076400007640000001035014712042465016133 00000000000000/** @file Parser: sql driver manager implementation. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #ifdef XML #include "pa_stylesheet_manager.h" #include "pa_exception.h" #include "pa_common.h" #include "pa_threads.h" #include "pa_stack.h" #include "pa_vhash.h" #include "pa_vtable.h" volatile const char * IDENT_PA_STYLESHEET_MANAGER_C="$Id: pa_stylesheet_manager.C,v 1.37 2024/11/04 03:53:25 moko Exp $" IDENT_PA_STYLESHEET_MANAGER_H; // globals Stylesheet_manager* stylesheet_manager=0; // consts const time_t EXPIRE_UNUSED_CONNECTION_SECONDS=5*60; const time_t CHECK_EXPIRED_CONNECTION_SECONDS=EXPIRE_UNUSED_CONNECTION_SECONDS*2; // helpers static void expire_connection(Stylesheet_connection& connection, time_t older_dies) { if(connection.connected() && connection.expired(older_dies)) connection.disconnect(); } static void expire_connections(Stylesheet_manager::connection_cache_type::key_type /*key*/, Stylesheet_manager::connection_cache_type::value_type stack, time_t older_dies) { for(size_t i=0; itop_index(); i++) expire_connection(*stack->get(i), older_dies); } // Stylesheet_connection methods void Stylesheet_connection::close() { stylesheet_manager->close_connection(ffile_spec, *this); } // Stylesheet_manager methods Stylesheet_manager::Stylesheet_manager(): prev_expiration_pass_time(0) { } Stylesheet_manager::~Stylesheet_manager() { connection_cache.for_each(expire_connections, time(0)+(time_t)10/*=in future=expire all*/); } Stylesheet_connection* Stylesheet_manager::get_connection(String::Body file_spec) { Stylesheet_connection* result=get_connection_from_cache(file_spec); return result ? result : new Stylesheet_connection(file_spec); } void Stylesheet_manager::close_connection(String::Body file_spec, Stylesheet_connection& connection) { put_connection_to_cache(file_spec, connection); } // stylesheet cache /// @todo get rid of memory spending Stack [zeros deep inside got accumulated] Stylesheet_connection* Stylesheet_manager::get_connection_from_cache(String::Body file_spec) { SYNCHRONIZED; if(connection_cache_type::value_type connections=connection_cache.get(file_spec)) while(!connections->is_empty()) { // there are cached stylesheets to that 'file_spec' Stylesheet_connection* result=connections->pop(); if(result->connected()) // not expired? return result; } return 0; } void Stylesheet_manager::put_connection_to_cache(String::Body file_spec, Stylesheet_connection& connection) { SYNCHRONIZED; connection_cache_type::value_type connections=connection_cache.get(file_spec); if(!connections) { // there are no cached stylesheets to that 'file_spec' yet? connections=new connection_cache_value_type; connection_cache.put(file_spec, connections); } connections->push(&connection); } void Stylesheet_manager::maybe_expire_cache() { time_t now=time(0); if(prev_expiration_pass_time(expire_connections, now-EXPIRE_UNUSED_CONNECTION_SECONDS); prev_expiration_pass_time=now; } } static void add_connection_to_status_cache_table(Stylesheet_connection& connection, Table* table) { if(connection.connected()) { ArrayString& row=*new ArrayString; // file row+=new String(connection.file_spec(), String::L_AS_IS); // time time_t time_used=connection.get_time_used(); row+=new String(pa_strdup(ctime(&time_used))); *table+=&row; } } static void add_connections_to_status_cache_table(Stylesheet_manager::connection_cache_type::key_type /*key*/, Stylesheet_manager::connection_cache_type::value_type stack, Table* table) { for(Array_iterator i(*stack); i; ) add_connection_to_status_cache_table(*i.next(), table); } Value* Stylesheet_manager::get_status() { VHash* result=new VHash; // cache { ArrayString& columns=*new ArrayString; columns+=new String("file"); columns+=new String("time"); Table& table=*new Table(&columns, connection_cache.count()); connection_cache.for_each(add_connections_to_status_cache_table, &table); result->get_hash()->put(*new String("cache"), new VTable(&table)); } return result; } #endif parser-3.5.1/src/main/Makefile.am0000644000076400007640000000136013764677577013551 00000000000000AM_CPPFLAGS = -I../types -I../classes -I../sql -I../lib/punycode $(INCLTDL) @PCRE_INCLUDES@ @XML_INCLUDES@ noinst_HEADERS = compile_tools.h utf8-to-lower.inc utf8-to-upper.inc noinst_LTLIBRARIES = libmain.la libmain_la_SOURCES = pa_pool.C pa_os.C pa_threads.C pa_common.C pa_base64.C compile.tab.C compile.C compile_tools.C execute.C pa_cache_managers.C pa_exception.C pa_xml_exception.C pa_globals.C pa_xml_io.C pa_memory.C pa_request.C pa_string.C pa_table.C untaint.C pa_dir.C pa_exec.C pa_socks.C pa_dictionary.C pa_charset.C pa_charsets.C pa_uue.C pa_sql_driver_manager.C pa_stylesheet_manager.C pa_stylesheet_connection.C pa_http.C pa_random.C pa_symbols.C compile.tab.C: compile.y bison -v compile.y -o $@ EXTRA_DIST = compile.y main.vcproj parser-3.5.1/src/main/pa_dir.C0000644000076400007640000000636614712042465013042 00000000000000/** @file Parser: directory scanning for different OS-es. Copyright (c) 2000-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_common.h" #include "pa_dir.h" #include "pa_request.h" #include "pa_convert_utf.h" volatile const char * IDENT_PA_DIR_C="$Id: pa_dir.C,v 1.33 2024/11/04 03:53:25 moko Exp $" IDENT_PA_DIR_H; #ifdef _MSC_VER const UTF16* pa_utf16_encode(const char* in, Charset& source_charset); const char* pa_utf16_decode(const UTF16* in, Charset& asked_charset); #define TICKS_PER_SECOND 10000000ULL #define EPOCH_DIFFERENCE 11644473600ULL time_t filetime_to_timet(FILETIME const& ft){ ULARGE_INTEGER ull; ull.LowPart = ft.dwLowDateTime; ull.HighPart = ft.dwHighDateTime; long long secs=(ull.QuadPart / TICKS_PER_SECOND - EPOCH_DIFFERENCE); time_t t =(time_t)secs; return (secs == (long long)t) ? t : 0; } bool findfirst(const char* _pathname, struct ffblk *_ffblk, int /*_attrib*/) { char mask[MAXPATH]; snprintf(mask, MAXPATH, "%s/*.*", _pathname); const UTF16* utf16mask=pa_utf16_encode(mask, pa_thread_request().charsets.source()); _ffblk->handle=FindFirstFileW((const wchar_t *)utf16mask, &_ffblk->stat); return _ffblk->handle==INVALID_HANDLE_VALUE; } bool findnext(struct ffblk *_ffblk) { return !FindNextFileW(_ffblk->handle, &_ffblk->stat); } void findclose(struct ffblk *_ffblk) { FindClose(_ffblk->handle); } const char *ffblk::name() { return pa_utf16_decode((const UTF16*)stat.cFileName, pa_thread_request().charsets.source()); } bool ffblk::is_dir(bool) { return (stat.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; } double ffblk::size() { ULARGE_INTEGER ull; ull.LowPart = stat.nFileSizeLow; ull.HighPart = stat.nFileSizeHigh; return (double)ull.QuadPart; } time_t ffblk::c_timestamp() { return filetime_to_timet(stat.ftCreationTime); } time_t ffblk::m_timestamp() { return filetime_to_timet(stat.ftLastWriteTime); } time_t ffblk::a_timestamp() { return filetime_to_timet(stat.ftLastAccessTime); } #else bool findfirst(const char* _pathname, struct ffblk *_ffblk, int /*_attrib*/) { _ffblk->filePath=_pathname; if(!(_ffblk->dir=opendir(_ffblk->filePath))) return true; return findnext(_ffblk); } bool findnext(struct ffblk *_ffblk) { while(true) { struct dirent *entry=readdir(_ffblk->dir); if(!entry) return true; pa_strncpy(_ffblk->ff_name, entry->d_name, sizeof(_ffblk->ff_name)); #ifdef HAVE_STRUCT_DIRENT_D_TYPE // http://www.gnu.org/software/libc/manual/html_node/Directory-Entries.html _ffblk->_d_type=entry->d_type; #endif return false; } } void findclose(struct ffblk *_ffblk) { closedir(_ffblk->dir); } void ffblk::stat_file() { char fileSpec[MAXPATH]; snprintf(fileSpec, MAXPATH, "%s/%s", filePath, ff_name); if(pa_stat(fileSpec, &_st) != 0) { memset(&_st,0,sizeof(_st)); } } bool ffblk::is_dir(bool stat) { #ifdef HAVE_STRUCT_DIRENT_D_TYPE if(!stat && _d_type != DT_UNKNOWN) return _d_type == DT_DIR; #endif stat_file(); return S_ISDIR(_st.st_mode) != 0; } double ffblk::size() { return (double)_st.st_size; } time_t ffblk::c_timestamp() { return _st.st_ctime; } time_t ffblk::m_timestamp() { return _st.st_mtime; } time_t ffblk::a_timestamp() { return _st.st_atime; } #endif parser-3.5.1/src/main/pa_base64.C0000644000076400007640000001754314732404263013347 00000000000000/** @file Parser: base64 functions impl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_base64.h" #include "pa_common.h" volatile const char * IDENT_PA_BASE64_C="$Id: pa_base64.C,v 1.14 2024/12/23 16:59:17 moko Exp $" IDENT_PA_BASE64_H; /* * BASE64 part inspired by g_mime_utils * Authors: Michael Zucchi * Jeffrey Stedfast * * Copyright 2000-2004 Ximian, Inc. (www.ximian.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. * */ static const char *base64_alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static const char *base64_alphabet_url_safe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; Base64Options::Base64Options(bool awrap): strict(false), wrap(awrap), pad(true), abc(base64_alphabet) {} void Base64Options::set_url_safe_abc() { abc = base64_alphabet_url_safe; } #define BASE64_GROUPS_IN_LINE 19 static size_t pa_base64_encode(const uchar *in, size_t inlen, uchar *out, Base64Options options) { const uchar *inptr = in; uchar *outptr = out; const uchar *abc = (const uchar *)options.abc; if (inlen > 2) { const uchar *inend = in + inlen - 2; int already=0; while (inptr < inend) { int c1 = *inptr++; int c2 = *inptr++; int c3 = *inptr++; *outptr++ = abc[c1 >> 2]; *outptr++ = abc[(c2 >> 4) | ((c1 & 0x3) << 4)]; *outptr++ = abc[((c2 & 0x0f) << 2) | (c3 >> 6)]; *outptr++ = abc[c3 & 0x3f]; if ((++already) >= BASE64_GROUPS_IN_LINE && options.wrap) { *outptr++ = '\n'; already = 0; } } inlen = 2 - (inptr - inend); } if (inlen == 2) { int c1 = *inptr++; int c2 = *inptr++; outptr[0] = abc[c1 >> 2]; outptr[1] = abc[c2 >> 4 | ((c1 & 0x3) << 4)]; outptr[2] = abc[(c2 & 0x0f) << 2]; if(options.pad) { outptr[3] = '='; outptr += 4; } else { outptr += 3; } } else if (inlen == 1) { int c1 = *inptr++; outptr[0] = abc[c1 >> 2]; outptr[1] = abc[(c1 & 0x3) << 4]; if(options.pad) { outptr[2] = '='; outptr[3] = '='; outptr += 4; } else { outptr += 2; } } *outptr='\0'; return outptr - out; } static uchar gmime_base64_rank[256] = { 255,255,255,255,255,255,255,255,255,254,254,255,255,254,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 254,255,255,255,255,255,255,255,255,255,255, 62,255,255,255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,255,255,255,253,255,255, 255, 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,255,255,255,255,255, 255, 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,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, }; static uchar gmime_base64_rank_url_safe[256] = { 255,255,255,255,255,255,255,255,255,254,254,255,255,254,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 254,255,255,255,255,255,255,255,255,255,255,255,255, 62,255,255, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,255,255,255,253,255,255, 255, 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,255,255,255,255, 63, 255, 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,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, }; size_t pa_base64_decode(const uchar *in, size_t inlen, uchar *out, Base64Options options) { const uchar *inptr = in; uchar *outptr = out; const uchar *inend = in + inlen; int saved = 0; int state = 0; uchar *abc_rank = options.abc == base64_alphabet ? gmime_base64_rank : gmime_base64_rank_url_safe; /* convert 4 base64 bytes to 3 normal bytes */ while (inptr < inend) { uchar c = abc_rank[*inptr++]; switch(c) { case 255: // non-base64 and non-whitespace chars. not allowed in strict mode if(options.strict) throw Exception(BASE64_FORMAT, 0, "Invalid base64 char on position %d is detected", inptr - in - 1); case 254: // whitespace chars 0x09, 0x0A, 0x0D, 0x20 are allowed in any mode break; case 253: // = if(state < 2) { if(options.strict) throw Exception(BASE64_FORMAT, 0, "Unexpected '=' on position %d is detected", inptr - in - 1); break; } if(state == 2) { // double '=' if(inptr == inend) { if(options.strict) throw Exception(BASE64_FORMAT, 0, "Unexpected end of chars"); break; } if(*inptr != '=') { if(options.strict) throw Exception(BASE64_FORMAT, 0, "Unexpected '=' on position %d is detected", inptr - in - 1); break; } inptr++; *outptr++ = (uchar)(saved >> 4); } else { // single '=' *outptr++ = (uchar)(saved >> 10); *outptr++ = (uchar)(saved >> 2); } state = 0; break; default: saved = (saved << 6) | c; state++; if (state == 4) { *outptr++ = (uchar)(saved >> 16); *outptr++ = (uchar)(saved >> 8); *outptr++ = (uchar)(saved); state = 0; } } } if(state > 0) { if(state > 1) { if(options.pad && options.strict) throw Exception(BASE64_FORMAT, 0, "Unexpected end of chars"); if(state == 2) { *outptr++ = (uchar)(saved >> 4); } else { *outptr++ = (uchar)(saved >> 10); *outptr++ = (uchar)(saved >> 2); } } else { if(options.strict) throw Exception(BASE64_FORMAT, 0, "Unexpected end of chars"); } } *outptr='\0'; // for text files return outptr - out; } char* pa_base64_encode(const char *in, size_t in_size, Base64Options options) { size_t new_size = ((in_size / 3 + 1) * 4); if (options.wrap) new_size += new_size / (BASE64_GROUPS_IN_LINE * 4) /*new lines*/; char* result = new(PointerFreeGC) char[new_size + 1 /*zero terminator*/]; PA_UNUSED size_t filled = pa_base64_encode((const uchar*)in, in_size, (uchar*)result, options); assert(filled <= new_size); return result; } size_t pa_base64_decode(const char *in, size_t in_size, char*& result, Base64Options options) { // every 4 base64 bytes are converted into 3 normal bytes size_t new_size = (in_size + 3) / 4 * 3; result = new(PointerFreeGC) char[new_size + 1 /*terminator*/]; return pa_base64_decode((const uchar*)in, in_size, (uchar*)result, options); } parser-3.5.1/src/main/execute.C0000644000076400007640000012630414732404263013241 00000000000000/** @file Parser: executor part of request class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_opcode.h" #include "pa_array.h" #include "pa_request.h" #include "pa_vstring.h" #include "pa_vhash.h" #include "pa_vvoid.h" #include "pa_vcode_frame.h" #include "pa_vmethod_frame.h" #include "pa_vobject.h" #include "pa_vdouble.h" #include "pa_vbool.h" #include "pa_vtable.h" #include "pa_vfile.h" #include "pa_vimage.h" #include "pa_varray.h" #include "pa_wwrapper.h" volatile const char * IDENT_EXECUTE_C="$Id: execute.C,v 1.426 2024/12/23 16:59:17 moko Exp $" IDENT_PA_OPCODE_H IDENT_PA_OPERATION_H IDENT_PA_VCODE_FRAME_H IDENT_PA_WWRAPPER_H; //#define DEBUG_EXECUTE #ifdef DEBUG_EXECUTE const char *opcode_name[]={ // literals "VALUE", "CURLY_CODE__STORE_PARAM", "EXPR_CODE__STORE_PARAM", "NESTED_CODE", // actions "WITH_ROOT", "WITH_SELF", "WITH_READ", "WITH_WRITE", "VALUE__GET_CLASS", "VALUE__GET_BASE_CLASS", "CONSTRUCT_VALUE", "CONSTRUCT_EXPR", "CURLY_CODE__CONSTRUCT", "CONSTRUCT_ARRAY", "WRITE_VALUE", "WRITE_EXPR_RESULT", "STRING__WRITE", #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT "VALUE__GET_ELEMENT_OR_OPERATOR", #else "GET_ELEMENT_OR_OPERATOR", #endif "GET_ELEMENT", "GET_ELEMENT__WRITE", #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT "VALUE__GET_ELEMENT", "VALUE__GET_ELEMENT__WRITE", "WITH_ROOT__VALUE__GET_ELEMENT", #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT "GET_OBJECT_ELEMENT", "GET_OBJECT_ELEMENT__WRITE", #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT "GET_OBJECT_VAR_ELEMENT", "GET_OBJECT_VAR_ELEMENT__WRITE", #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT "WITH_SELF__VALUE__GET_ELEMENT", "WITH_SELF__VALUE__GET_ELEMENT__WRITE", #endif #ifdef FEATURE_GET_ELEMENT4CALL "GET_ELEMENT4CALL", #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT "GET_OBJECT_ELEMENT4CALL", #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT "GET_OBJECT_VAR_ELEMENT4CALL", #endif #endif // FEATURE_GET_ELEMENT4CALL "OBJECT_POOL", "STRING_POOL", "PREPARE_TO_CONSTRUCT_OBJECT", "CONSTRUCT_OBJECT", "CONSTRUCT_OBJECT__WRITE", "CALL", "CALL__WRITE", #ifdef OPTIMIZE_BYTECODE_CONSTRUCT "WITH_ROOT__VALUE__CONSTRUCT_EXPR", "WITH_ROOT__VALUE__CONSTRUCT_VALUE", "WITH_WRITE__VALUE__CONSTRUCT_EXPR", "WITH_WRITE__VALUE__CONSTRUCT_VALUE", "WITH_SELF__VALUE__CONSTRUCT_EXPR", "WITH_SELF__VALUE__CONSTRUCT_VALUE", #endif #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL "GET_ELEMENT__SPECIAL", "GET_ELEMENT__SPECIAL__WRITE", #endif // expression ops: unary "NEG", "INV", "NOT", "DEF", "IN", "FEXISTS", "DEXISTS", // expression ops: binary "SUB", "ADD", "MUL", "DIV", "MOD", "INTDIV", "BIN_SL", "BIN_SR", "BIN_AND", "BIN_OR", "BIN_XOR", "LOG_AND", "LOG_OR", "LOG_XOR", "NUM_LT", "NUM_GT", "NUM_LE", "NUM_GE", "NUM_EQ", "NUM_NE", "STR_LT", "STR_GT", "STR_LE", "STR_GE", "STR_EQ", "STR_NE", "IS" }; const char* debug_value_to_cstr(Value& value){ const String* string=value.get_string(); if(string) return string->cstr(); else if(value.is_bool()) return value.as_bool() ? "" : ""; else return ""; } void va_debug_printf(SAPI_Info& sapi_info, const char* fmt,va_list args) { char buf[MAX_STRING]; vsnprintf(buf, MAX_STRING, fmt, args); SAPI::log(sapi_info, "%s", buf); } void debug_printf(SAPI_Info& sapi_info, const char* fmt, ...) { va_list args; va_start(args, fmt); va_debug_printf(sapi_info, fmt, args); va_end(args); } void debug_dump(SAPI_Info& sapi_info, int level, ArrayOperation& ops) { for(Array_iterator i(ops); i;) { OP::OPCODE opcode=i.next().code; #if defined(OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT) || defined(OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT) if( 1==0 #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT || opcode==OP::OP_GET_OBJECT_ELEMENT || opcode==OP::OP_GET_OBJECT_ELEMENT__WRITE #ifdef FEATURE_GET_ELEMENT4CALL || opcode==OP::OP_GET_OBJECT_ELEMENT4CALL #endif #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT || opcode==OP::OP_GET_OBJECT_VAR_ELEMENT || opcode==OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE #ifdef FEATURE_GET_ELEMENT4CALL || opcode==OP::OP_GET_OBJECT_VAR_ELEMENT4CALL #endif #endif ){ i.next(); // skip origin Value& value1=*i.next().value; i.next(); // skip origin Value& value2=*i.next().value; debug_printf(sapi_info, "%*s%s \"%s\" \"%s\"", level*4, "", opcode_name[opcode], debug_value_to_cstr(value1), debug_value_to_cstr(value2)); continue; } #endif if( opcode==OP::OP_CONSTRUCT_OBJECT || opcode==OP::OP_CONSTRUCT_OBJECT__WRITE ){ i.next(); // skip origin Value& value1=*i.next().value; i.next(); // skip origin Value& value2=*i.next().value; debug_printf(sapi_info, "%*s%s" " \"%s\" \"%s\"", level*4, "", opcode_name[opcode], debug_value_to_cstr(value1), debug_value_to_cstr(value2)); if(ArrayOperation* local_ops=i.next().ops) debug_dump(sapi_info, level+1, *local_ops); continue; } if( opcode==OP::OP_VALUE || opcode==OP::OP_STRING__WRITE || opcode==OP::OP_VALUE__GET_CLASS || opcode==OP::OP_VALUE__GET_BASE_CLASS #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT || opcode==OP::OP_VALUE__GET_ELEMENT || opcode==OP::OP_VALUE__GET_ELEMENT__WRITE || opcode==OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR || opcode==OP::OP_WITH_ROOT__VALUE__GET_ELEMENT #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT || opcode==OP::OP_WITH_SELF__VALUE__GET_ELEMENT || opcode==OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE #endif #ifdef OPTIMIZE_BYTECODE_CONSTRUCT || opcode==OP::OP_WITH_ROOT__VALUE__CONSTRUCT_EXPR || opcode==OP::OP_WITH_ROOT__VALUE__CONSTRUCT_VALUE || opcode==OP::OP_WITH_WRITE__VALUE__CONSTRUCT_EXPR || opcode==OP::OP_WITH_WRITE__VALUE__CONSTRUCT_VALUE || opcode==OP::OP_WITH_SELF__VALUE__CONSTRUCT_EXPR || opcode==OP::OP_WITH_SELF__VALUE__CONSTRUCT_VALUE #endif ) { Operation::Origin origin=i.next().origin; Value& value=*i.next().value; debug_printf(sapi_info, "%*s%s" " \"%s\" %s", level*4, "", opcode_name[opcode], debug_value_to_cstr(value), value.type()); continue; } debug_printf(sapi_info, "%*s%s", level*4, "", opcode_name[opcode]); switch(opcode) { case OP::OP_CURLY_CODE__STORE_PARAM: case OP::OP_EXPR_CODE__STORE_PARAM: case OP::OP_CURLY_CODE__CONSTRUCT: case OP::OP_NESTED_CODE: case OP::OP_OBJECT_POOL: case OP::OP_STRING_POOL: case OP::OP_CONSTRUCT_ARRAY: case OP::OP_CALL: case OP::OP_CALL__WRITE: if(ArrayOperation* local_ops=i.next().ops) debug_dump(sapi_info, level+1, *local_ops); } } } #define DEBUG_PRINT_STR(str) debug_printf(sapi_info, str); #define DEBUG_PRINT_STRING(value) debug_printf(sapi_info, " \"%s\" ", value.cstr()); #define DEBUG_PRINT_VALUE_AND_TYPE(value) debug_printf(sapi_info, " \"%s\" %s", debug_value_to_cstr(value), value.type()); #define DEBUG_PRINT_OPS(local_ops) \ debug_printf(sapi_info, \ " (%d)\n", local_ops?local_ops->count():0); \ if(local_ops) debug_dump(sapi_info, 1, *local_ops); #else #define DEBUG_PRINT_STR(str) #define DEBUG_PRINT_STRING(value) #define DEBUG_PRINT_VALUE_AND_TYPE(value) #define DEBUG_PRINT_OPS(local_ops) #endif // Request void Request::execute(ArrayOperation& ops) { Stack& stack=this->stack; // helps a lot on MSVC: 'esi' const String* debug_name=0; Operation::Origin debug_origin={0, 0, 0}; try{ #ifdef DEBUG_EXECUTE debug_printf(sapi_info, "source----------------------------\n"); debug_dump(sapi_info, 0, ops); debug_printf(sapi_info, "execution-------------------------\n"); #endif for(Array_iterator i(ops); i; ) { OP::OPCODE opcode=i.next().code; #ifdef DEBUG_EXECUTE debug_printf(sapi_info, "%d:%s", stack.top_index()+1, opcode_name[opcode]); #endif switch(opcode) { // param in next instruction case OP::OP_VALUE: { debug_origin=i.next().origin; Value& value=*i.next().value; DEBUG_PRINT_VALUE_AND_TYPE(value) stack.push(value); break; } case OP::OP_VALUE__GET_CLASS: { debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) stack.push(get_class_ref(name)); break; } case OP::OP_VALUE__GET_BASE_CLASS: { // ^class:method[] call debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) stack.push(*new VBaseClassWrapper(get_class_ref(name), get_self())); break; } #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL case OP::OP_GET_ELEMENT__SPECIAL: case OP::OP_GET_ELEMENT__SPECIAL__WRITE: { const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); Value* value=0; if(VStateless_class* vclass=ncontext.get_class()){ if(SYMBOLS_EQ(name,CLASS_SYMBOL)){ value=vclass; } else if(SYMBOLS_EQ(name,CLASS_NAME_SYMBOL)){ value=new VString(*new String(vclass->type())); } } else { // VJunction is without class, returning self if(SYMBOLS_EQ(name,CLASS_SYMBOL)){ value=&ncontext; } else if(SYMBOLS_EQ(name,CLASS_NAME_SYMBOL)){ value=new VString(*new String(ncontext.type())); } } if(opcode==OP::OP_GET_ELEMENT__SPECIAL){ stack.push(*value); } else { write(*value); } break; } #endif // OP_WITH case OP::OP_WITH_ROOT: { stack.push(*method_frame); break; } case OP::OP_WITH_SELF: { stack.push(get_self()); break; } case OP::OP_WITH_READ: { stack.push(*rcontext); break; } case OP::OP_WITH_WRITE: { if(wcontext==method_frame) throw Exception(PARSER_RUNTIME, 0, "$.name outside of $name[...]"); stack.push(*wcontext); break; } // OTHER ACTIONS BUT WITHs #ifdef OPTIMIZE_BYTECODE_CONSTRUCT #define DO_CONSTRUCT(context, vvalue) { \ debug_origin=i.next().origin; \ const String& name=*i.next().value->get_string(); debug_name=&name; \ DEBUG_PRINT_STRING(name) \ Value& value=stack.pop().value(); \ put_element( context, name, vvalue ); \ goto check_skip; \ } #define DO_CONSTRUCT_VALUE(context) DO_CONSTRUCT(context, &value) #define DO_CONSTRUCT_EXPR(context) { \ DO_CONSTRUCT(context, &value.as_expr_result()) \ } case OP::OP_WITH_WRITE__VALUE__CONSTRUCT_EXPR: { if(wcontext==method_frame) throw Exception(PARSER_RUNTIME, 0, "$.name outside of $name[...]"); DO_CONSTRUCT_EXPR(*wcontext) } case OP::OP_WITH_WRITE__VALUE__CONSTRUCT_VALUE: { if(wcontext==method_frame) throw Exception(PARSER_RUNTIME, 0, "$.name outside of $name[...]"); DO_CONSTRUCT_VALUE(*wcontext) } case OP::OP_WITH_ROOT__VALUE__CONSTRUCT_EXPR: DO_CONSTRUCT_EXPR(*method_frame) case OP::OP_WITH_ROOT__VALUE__CONSTRUCT_VALUE: DO_CONSTRUCT_VALUE(*method_frame) case OP::OP_WITH_SELF__VALUE__CONSTRUCT_EXPR: DO_CONSTRUCT_EXPR(get_self()) case OP::OP_WITH_SELF__VALUE__CONSTRUCT_VALUE: DO_CONSTRUCT_VALUE(get_self()) #endif // OPTIMIZE_BYTECODE_CONSTRUCT case OP::OP_CONSTRUCT_VALUE: { #ifdef OPTIMIZE_BYTECODE_CONSTRUCT const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); Value& value=stack.pop().value(); #else Value& value=stack.pop().value(); const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); #endif put_element(ncontext, name, &value); goto check_skip; } case OP::OP_CONSTRUCT_EXPR: { #ifdef OPTIMIZE_BYTECODE_CONSTRUCT const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); Value& expr=stack.pop().value(); #else Value& expr=stack.pop().value(); const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); #endif Value& value=expr.as_expr_result(); put_element(ncontext, name, &value); goto check_skip; } case OP::OP_CURLY_CODE__CONSTRUCT: { ArrayOperation& local_ops=*i.next().ops; DEBUG_PRINT_OPS((&local_ops)) VJunction& value=*new VJunction( get_self(), 0, method_frame, rcontext, wcontext, &local_ops); wcontext->attach_junction(&value); const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); if(ncontext.put_element(name, &value)) throw Exception(PARSER_RUNTIME, 0, "property value cannot be code, use [] or () brackets"); break; } case OP::OP_CONSTRUCT_ARRAY: { ArrayOperation* local_ops=i.next().ops; DEBUG_PRINT_OPS(local_ops) DEBUG_PRINT_STR("->\n") size_t first = stack.top_index(); execute(*local_ops); Value *value=new VArray(stack.top_index()-first, (Value**)stack.ptr(first)); stack.set_top_index(first); #ifdef OPTIMIZE_BYTECODE_CONSTRUCT const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); #else const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); #endif put_element(ncontext, name, value); DEBUG_PRINT_STR("<-returned") goto check_skip; } case OP::OP_NESTED_CODE: { ArrayOperation& local_ops=*i.next().ops; DEBUG_PRINT_OPS((&local_ops)) stack.push(local_ops); break; } case OP::OP_WRITE_VALUE: { Value& value=stack.pop().value(); write(value); break; } case OP::OP_WRITE_EXPR_RESULT: { Value& value=stack.pop().value(); wcontext->write(value.as_expr_result()); break; } case OP::OP_STRING__WRITE: { i.next(); // ignore origin Value* value=i.next().value; const String& string_value=*value->get_string(); DEBUG_PRINT_STRING(string_value) write(string_value); break; } #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT case OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR: { debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) if(Method* method=main_class.get_method(name)){ // looking operator of that name FIRST if(!method->junction_template) method->junction_template=new VJunction(main_class, method); stack.push(*method->junction_template); break; } Value& value=get_element(*rcontext, name); stack.push(value); goto check_skip; } #else case OP::OP_GET_ELEMENT_OR_OPERATOR: { const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); if(Method* method=main_class.get_method(name)){ // looking operator of that name FIRST if(!method->junction_template) method->junction_template=new VJunction(main_class, method); stack.push(*method->junction_template); break; } Value& value=get_element(ncontext, name); stack.push(value); goto check_skip; } #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT #define DO_GET_OBJECT_ELEMENT(code) {\ debug_origin=i.next().origin; \ const String& context_name=*i.next().value->get_string(); debug_name=&context_name; \ DEBUG_PRINT_STRING(context_name) \ Value& object=get_element(*rcontext, context_name); \ debug_origin=i.next().origin; \ const String& field_name=*i.next().value->get_string(); debug_name=&field_name; \ DEBUG_PRINT_STRING(field_name) \ code; \ goto check_skip; \ } case OP::OP_GET_OBJECT_ELEMENT: DO_GET_OBJECT_ELEMENT({ Value& value=get_element(object, field_name); stack.push(value); }) case OP::OP_GET_OBJECT_ELEMENT__WRITE: DO_GET_OBJECT_ELEMENT({ Value& value=get_element(object, field_name); write(value); }) #ifdef FEATURE_GET_ELEMENT4CALL case OP::OP_GET_OBJECT_ELEMENT4CALL: DO_GET_OBJECT_ELEMENT({ Value& value=get_element4call(object, field_name); stack.push(value); }) #endif #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT #define DO_GET_OBJECT_VAR_ELEMENT(code) {\ debug_origin=i.next().origin; \ const String& context_name=*i.next().value->get_string(); debug_name=&context_name; \ DEBUG_PRINT_STRING(context_name) \ Value& object=get_element(*rcontext, context_name); \ debug_origin=i.next().origin; \ const String& var_name=*i.next().value->get_string(); debug_name=&var_name; \ DEBUG_PRINT_STRING(var_name) \ const String* field=&get_element(*rcontext, var_name).as_string(); \ code; \ goto check_skip; \ } case OP::OP_GET_OBJECT_VAR_ELEMENT: DO_GET_OBJECT_VAR_ELEMENT({ Value& value=get_element(object, *field); stack.push(value); }) case OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE: DO_GET_OBJECT_VAR_ELEMENT({ Value& value=get_element(object, *field); write(value); }) #ifdef FEATURE_GET_ELEMENT4CALL case OP::OP_GET_OBJECT_VAR_ELEMENT4CALL: DO_GET_OBJECT_VAR_ELEMENT({ Value& value=get_element4call(object, *field); stack.push(value); }) #endif #endif case OP::OP_GET_ELEMENT: { const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); Value& value=get_element(ncontext, name); stack.push(value); goto check_skip; } #ifdef FEATURE_GET_ELEMENT4CALL case OP::OP_GET_ELEMENT4CALL: { const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); Value& value=get_element4call(ncontext, name); stack.push(value); goto check_skip; } #endif case OP::OP_GET_ELEMENT__WRITE: { const String& name=stack.pop().string(); debug_name=&name; Value& ncontext=stack.pop().value(); Value& value=get_element(ncontext, name); write(value); goto check_skip; } #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT case OP::OP_VALUE__GET_ELEMENT: { debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) Value& value=get_element(*rcontext, name); stack.push(value); goto check_skip; } case OP::OP_VALUE__GET_ELEMENT__WRITE: { debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) Value& value=get_element(*rcontext, name); write(value); goto check_skip; } case OP::OP_WITH_ROOT__VALUE__GET_ELEMENT: { debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) Value& value=get_element(*method_frame, name); stack.push(value); goto check_skip; } #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT case OP::OP_WITH_SELF__VALUE__GET_ELEMENT: case OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE: { debug_origin=i.next().origin; const String& name=*i.next().value->get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) Value& value=get_element(get_self(), name); if(opcode==OP::OP_WITH_SELF__VALUE__GET_ELEMENT){ stack.push(value); } else { write(value); } goto check_skip; } #endif case OP::OP_OBJECT_POOL: { debug_name=0; ArrayOperation& local_ops=*i.next().ops; WContext *saved_wcontext=wcontext; #ifdef OPTIMIZE_SINGLE_STRING_WRITE WObjectPoolWrapper local(wcontext); #else WWrapper local(wcontext); #endif wcontext=&local; execute(local_ops); stack.push((Value&)wcontext->result()); wcontext=saved_wcontext; goto check_skip; } case OP::OP_STRING_POOL: { ArrayOperation& local_ops=*i.next().ops; WContext *saved_wcontext=wcontext; WWrapper local(wcontext); wcontext=&local; execute(local_ops); // from "$a $b" part of expression taking only string value, // ignoring any other content of wcontext const String* string=wcontext->get_string(); Value* value=string ? new VString(*string) : new VString(); stack.push(*value); wcontext=saved_wcontext; goto check_skip; } // CALL case OP::OP_CURLY_CODE__STORE_PARAM: case OP::OP_EXPR_CODE__STORE_PARAM: { // code ArrayOperation& local_ops=*i.next().ops; DEBUG_PRINT_OPS((&local_ops)) // when they evaluate expression parameter, // the object expression result // does not need to be written into calling frame // it must go into any expressions using that parameter // hence, we zero junction.wcontext here, and later // in .process we would test that field // in decision "which wwrapper to use" VJunction& value=*new VJunction( get_self(), 0, method_frame, rcontext, opcode==OP::OP_EXPR_CODE__STORE_PARAM?0:wcontext, &local_ops); #ifndef USE_DESTRUCTORS if (opcode!=OP::OP_EXPR_CODE__STORE_PARAM) wcontext->attach_junction(&value); #endif // store param stack.push(value); break; } #define METHOD_PARAMS_ACTION(action) \ if(local_ops){ \ size_t first = stack.top_index(); \ execute(*local_ops); \ if(!fskip){ \ frame.store_params((Value**)stack.ptr(first), stack.top_index()-first); \ action; \ } \ stack.set_top_index(first); \ } else { \ frame.empty_params(); \ action; \ } case OP::OP_CALL: { ArrayOperation* local_ops=i.next().ops; DEBUG_PRINT_OPS(local_ops) DEBUG_PRINT_STR("->\n") Value& value=stack.pop().value(); Junction* junction=value.get_junction(); if(!junction) { if(dynamic_cast(&value)) throw Exception(PARSER_RUNTIME, 0, "undefined method"); else throw Exception(PARSER_RUNTIME, 0, "is '%s', not a method or junction, cannot call it", value.type()); } Value *result; { EXPRESSION_FRAME_ACTION(*junction->method, method_frame, junction->self, { METHOD_PARAMS_ACTION(call(frame)); result=&frame.result(); // desctructor deletes junctions in stack params here }); } stack.push(*result); DEBUG_PRINT_STR("<-returned") goto check_skip; } case OP::OP_CALL__WRITE: { ArrayOperation* local_ops=i.next().ops; DEBUG_PRINT_OPS(local_ops) DEBUG_PRINT_STR("->\n") Value& value=stack.pop().value(); Junction* junction=value.get_junction(); if(!junction) { if(dynamic_cast(&value)) throw Exception(PARSER_RUNTIME, 0, "undefined method"); else throw Exception(PARSER_RUNTIME, 0, "is '%s', not a method or junction, cannot call it", value.type()); } const Method& method=*junction->method; #ifdef OPTIMIZE_CALL if(method.call_optimization==Method::CO_WITHOUT_FRAME){ if(local_ops){ // store param code goes here size_t first = stack.top_index(); execute(*local_ops); if(!fskip){ MethodParams method_params; method_params.store_params((Value**)stack.ptr(first), stack.top_index()-first); method.check_actual_numbered_params(junction->self, &method_params); method.native_code(*this, method_params); // execute it } stack.set_top_index(first); } else { MethodParams method_params; method.check_actual_numbered_params(junction->self, &method_params); method.native_code(*this, method_params); // execute it } } else if(method.call_optimization==Method::CO_WITHOUT_WCONTEXT){ METHOD_FRAME_ACTION(method, method_frame, junction->self, { METHOD_PARAMS_ACTION(call_write(frame)) }); } else #endif // OPTIMIZE_CALL { METHOD_FRAME_ACTION(method, method_frame, junction->self, { METHOD_PARAMS_ACTION(call(frame)); write(frame.result()); }); } DEBUG_PRINT_STR("<-returned") goto check_skip; } case OP::OP_CONSTRUCT_OBJECT: case OP::OP_CONSTRUCT_OBJECT__WRITE: { debug_origin=i.next().origin; Value& vclass_name=*i.next().value; const String& class_name=*vclass_name.get_string(); debug_name=&class_name; DEBUG_PRINT_STRING(class_name) VStateless_class& vclass=get_class_ref(class_name); debug_origin=i.next().origin; Value& vconstructor_name=*i.next().value; const String& constructor_name=*vconstructor_name.get_string(); debug_name=&constructor_name; DEBUG_PRINT_STRING(constructor_name) // not get_element4call for better error reporting Junction* constructor_junction=get_element(vclass, constructor_name).get_junction(); if(!constructor_junction) throw Exception(PARSER_RUNTIME, &constructor_name, "%s constructor not found", vclass.type()); ArrayOperation* local_ops=i.next().ops; DEBUG_PRINT_OPS(local_ops) DEBUG_PRINT_STR("->\n") Value *result; { Value& object=construct(vclass, *constructor_junction->method); CONSTRUCTOR_FRAME_ACTION(*constructor_junction->method, method_frame, object, { METHOD_PARAMS_ACTION(call(frame)); object.enable_default_setter(); result=&frame.result(); // desctructor deletes junctions in stack params here }); } if(opcode==OP::OP_CONSTRUCT_OBJECT) stack.push(*result); else write(*result); DEBUG_PRINT_STR("<-returned") goto check_skip; } // expression ops: unary case OP::OP_NEG: { Value& a=stack.pop().value(); Value& value=*new VDouble(-a.as_double()); stack.push(value); break; } case OP::OP_INV: { Value& a=stack.pop().value(); Value& value=*new VDouble(~a.as_int()); stack.push(value); break; } case OP::OP_NOT: { Value& a=stack.pop().value(); Value& value=VBool::get(!a.as_bool()); stack.push(value); break; } case OP::OP_DEF: { Value& a=stack.pop().value(); Value& value=VBool::get(a.is_defined()); stack.push(value); break; } case OP::OP_IN: { Value& a=stack.pop().value(); const String& path=a.as_string(); Value& value=VBool::get(request_info.uri && *request_info.uri && path.this_starts(request_info.uri)); stack.push(value); break; } case OP::OP_FEXISTS: { Value& a=stack.pop().value(); Value& value=VBool::get(file_exist(full_disk_path(a.as_string()))); stack.push(value); break; } case OP::OP_DEXISTS: { Value& a=stack.pop().value(); Value& value=VBool::get(dir_exists(full_disk_path(a.as_string()))); stack.push(value); break; } // expression ops: binary case OP::OP_SUB: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=*new VDouble(a_double - b_double); stack.push(value); break; } case OP::OP_ADD: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=*new VDouble(a_double + b_double); stack.push(value); break; } case OP::OP_MUL: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=*new VDouble(a_double * b_double); stack.push(value); break; } case OP::OP_DIV: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); if(b_double == 0) { //const String* problem_source=b.as_string(); throw Exception("number.zerodivision", 0, "Division by zero"); } Value& value=*new VDouble(a_double / b_double); stack.push(value); break; } case OP::OP_MOD: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); if(b_double == 0) { //const String* problem_source=b.as_string(); throw Exception("number.zerodivision", 0, "Modulus by zero"); } Value& value=*new VDouble(fmod(a_double, b_double)); stack.push(value); break; } case OP::OP_INTDIV: { int b_int=stack.pop().value().as_int(); int a_int=stack.pop().value().as_int(); if(b_int == 0) { //const String* problem_source=b.as_string(); throw Exception("number.zerodivision", 0, "Division by zero"); } Value& value=*new VInt(a_int / b_int); stack.push(value); break; } case OP::OP_BIN_SL: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VInt( a.as_int() << b.as_int()); stack.push(value); break; } case OP::OP_BIN_SR: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VInt( a.as_int() >> b.as_int()); stack.push(value); break; } case OP::OP_BIN_AND: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VInt( a.as_int() & b.as_int()); stack.push(value); break; } case OP::OP_BIN_OR: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VInt( a.as_int() | b.as_int()); stack.push(value); break; } case OP::OP_BIN_XOR: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=*new VInt( a.as_int() ^ b.as_int()); stack.push(value); break; } case OP::OP_LOG_AND: { ArrayOperation& local_ops=stack.pop().ops(); Value& a=stack.pop().value(); bool result; if(a.as_bool()) { execute(local_ops); Value& b=stack.pop().value(); result=b.as_bool(); } else result=false; Value& value=VBool::get(result); stack.push(value); goto check_skip; } case OP::OP_LOG_OR: { ArrayOperation& local_ops=stack.pop().ops(); Value& a=stack.pop().value(); bool result; if(a.as_bool()) result=true; else { execute(local_ops); Value& b=stack.pop().value(); result=b.as_bool(); } Value& value=VBool::get(result); stack.push(value); goto check_skip; } case OP::OP_LOG_XOR: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_bool() ^ b.as_bool()); stack.push(value); break; } case OP::OP_NUM_LT: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=VBool::get(a_doubleb_double); stack.push(value); break; } case OP::OP_NUM_LE: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=VBool::get(a_double<=b_double); stack.push(value); break; } case OP::OP_NUM_GE: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=VBool::get(a_double>=b_double); stack.push(value); break; } case OP::OP_NUM_EQ: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=VBool::get(a_double==b_double); stack.push(value); break; } case OP::OP_NUM_NE: { volatile double b_double=stack.pop().value().as_double(); volatile double a_double=stack.pop().value().as_double(); Value& value=VBool::get(a_double!=b_double); stack.push(value); break; } case OP::OP_STR_LT: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() < b.as_string()); stack.push(value); break; } case OP::OP_STR_GT: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() > b.as_string()); stack.push(value); break; } case OP::OP_STR_LE: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() <= b.as_string()); stack.push(value); break; } case OP::OP_STR_GE: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() >= b.as_string()); stack.push(value); break; } case OP::OP_STR_EQ: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() == b.as_string()); stack.push(value); break; } case OP::OP_STR_NE: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.as_string() != b.as_string()); stack.push(value); break; } case OP::OP_IS: { Value& b=stack.pop().value(); Value& a=stack.pop().value(); Value& value=VBool::get(a.is(b.as_string().cstr())); stack.push(value); break; } default: { throw Exception(0, 0, "invalid opcode %d", opcode); } check_skip: { if(fskip){ if(fskip==Request::SKIP_INTERRUPTED){ set_skip(Request::SKIP_NOTHING); throw Exception("parser.interrupted", 0, "execution stopped"); } return; } break; } } } } catch(const Exception&) { // record it to stack trace if(debug_name) exception_trace.push(Trace(debug_name, debug_origin)); rethrow; } } #define SAVE_CONTEXT \ VMethodFrame *saved_method_frame=method_frame; \ Value* saved_rcontext=rcontext; \ WContext *saved_wcontext=wcontext; #define RESTORE_CONTEXT \ wcontext=saved_wcontext; \ rcontext=saved_rcontext; \ method_frame=saved_method_frame; Value& Request::construct(VStateless_class &called_class, const Method &method){ if(method.call_type!=Method::CT_STATIC) { // this is a constructor call if(Value* result=called_class.create_new_value(fpool)) { // some stateless_class creatable derivates return *result; } else throw Exception(PARSER_RUNTIME, method.name, "is not a constructor, system class '%s' can be constructed only implicitly", called_class.type()); } else throw Exception(PARSER_RUNTIME, method.name, "method of '%s' is static and cannot be used as constructor", called_class.type()); } Value& Request::get_element(Value& ncontext, const String& name) { Value* value=ncontext.get_element(name); return *(value ? &process(*value) : VVoid::get()); } #ifdef FEATURE_GET_ELEMENT4CALL Value& Request::get_element4call(Value& ncontext, const String& name) { Value* value=ncontext.get_element4call(name); return *(value ? &process(*value) : VVoid::get()); } #endif void Request::put_element(Value& ncontext, const String& name, Value* value) { // put_element can return property-setting-junction if(const VJunction* vjunction=ncontext.put_element(name, value)) { const Junction& junction = vjunction->junction(); int param_count=junction.method->params_count; if(junction.auto_name) { // default setter if(param_count!=2) throw Exception(PARSER_RUNTIME, 0, "default setter method must have TWO parameters (has %d parameters)", param_count); Value* params[2] = { new VString(*junction.auto_name), value }; CONSTRUCTOR_FRAME_ACTION(*junction.method, method_frame /*caller*/, junction.self, { frame.store_params(params, 2); Temp_disable_default_setter temp(junction.self); call(frame); }); } else { // setter if(param_count!=1) throw Exception(PARSER_RUNTIME, 0, "setter method must have ONE parameter (has %d parameters)", param_count); CONSTRUCTOR_FRAME_ACTION(*junction.method, method_frame /*caller*/, junction.self, { frame.store_params(&value, 1); call(frame); }); } } } Value& Request::process_getter(Junction& junction) { int param_count=junction.method->params_count; if(junction.auto_name){ // default getter if(param_count>1) throw Exception(PARSER_RUNTIME, 0, "default getter method can't have more than 1 parameter (has %d parameters)", param_count); Value *param; METHOD_FRAME_ACTION(*junction.method, method_frame/*caller*/, junction.self, { if(param_count){ param=new VString(*junction.auto_name); frame.store_params(¶m, 1); } // no need for else frame.empty_params() Temp_disable_default_getter temp(junction.self); call(frame); return frame.result(); }); } else { // getter if(param_count>0) throw Exception(PARSER_RUNTIME, 0, "getter method must have no parameters (has %d parameters)", param_count); METHOD_FRAME_ACTION(*junction.method, method_frame/*caller*/, junction.self, { // no need for frame.empty_params() call(frame); return frame.result(); }); } } Value& Request::process(Value& input_value) { Junction* junction=input_value.get_junction(); if(junction) { if(junction->is_getter) { // is it a getter-junction? return process(process_getter(*junction)); } if(junction->code) { // is it a code-junction? // process it ValueRef result; DEBUG_PRINT_STR("ja->\n") if(!junction->method_frame) throw Exception(PARSER_RUNTIME, 0, "junction used outside of context"); SAVE_CONTEXT method_frame=junction->method_frame; rcontext=junction->rcontext; // for code in [] and () wcontext is set 0 // using the fact in decision "which wrapper to use" if(junction->wcontext) { // {} code wrapper VCodeFrame local(*junction->wcontext); wcontext=&local; // execute it recursion_checked_execute(*junction->code); result=wcontext->result(); } else { // [] or () code wrapper WWrapper local(wcontext); wcontext=&local; // execute it recursion_checked_execute(*junction->code); result=wcontext->result(); } RESTORE_CONTEXT DEBUG_PRINT_STR("<-ja returned") return result; } // then it is a method-junction, do not explode it // just return it as we do for usual objects } return input_value; } void Request::process_write(Value& input_value) { Junction* junction=input_value.get_junction(); if(junction) { // no getter-junction check as process_write is called // to process method arguments, not from get_element if(junction->code) { // is it a code-junction? // process it DEBUG_PRINT_STR("ja->\n") if(!junction->method_frame) throw Exception(PARSER_RUNTIME, 0, "junction used outside of context"); SAVE_CONTEXT method_frame=junction->method_frame; rcontext=junction->rcontext; // for code in [] and () wcontext is set 0 // using the fact in decision "which wwrapper to use" #ifdef OPTIMIZE_CALL if(wcontext==junction->wcontext){ // no wrappers for wcontext recursion_checked_execute(*junction->code); RESTORE_CONTEXT } else #endif if(junction->wcontext) { // {} code wrapper VCodeFrame local(*junction->wcontext); wcontext=&local; // execute it recursion_checked_execute(*junction->code); RESTORE_CONTEXT write(local.result()); } else { // [] or () code wrapper WWrapper local(wcontext); wcontext=&local; // execute it recursion_checked_execute(*junction->code); RESTORE_CONTEXT write(local.result()); } DEBUG_PRINT_STR("<-ja returned") return; } // then it is a method-junction, do not explode it // just return it as we do for usual objects } write(input_value); } const String* Request::execute_method(VStateless_class& aclass, const String& method_name, Value* optional_param) { if(const Method *method=aclass.get_method(method_name)){ METHOD_FRAME_ACTION(*method, method_frame/*caller*/, aclass, { if(optional_param && method->params_count>0) { frame.store_params(&optional_param, 1); } else { frame.empty_params(); } // prevent non-string writes for better error reporting frame.write(frame); call(frame); Value &result=frame.result(); if(const String* sresult=result.get_string()){ return sresult; } result.bark("is '%s', it has no string representation", &method_name); }); } return 0; } bool Request::execute_method_if_exists(VStateless_class& aclass, const String& method_name, Value* optional_param) { if(const Method *method=aclass.get_method(method_name)){ METHOD_FRAME_ACTION(*method, method_frame/*caller*/, aclass, { if(optional_param && method->params_count>0) { frame.store_params(&optional_param, 1); } else { frame.empty_params(); } call(frame); }); return true; } return false; } bool Request::execute_auto_method_if_exists(VStateless_class& aclass, const String& method_name, Value* optional_param) { if(const Method *method=aclass.get_method(method_name)){ METHOD_FRAME_ACTION(*method, method_frame/*caller*/, aclass, { Value* two_params[2]; if (optional_param && method->params_count>1) { two_params[0] = optional_param; two_params[1] = new VString(*new String(aclass.type())); frame.store_params(two_params, 2); } else if (optional_param && method->params_count>0) { frame.store_params(&optional_param, 1); } else { frame.empty_params(); } call(frame); }); return true; } return false; } const String* Request::get_method_filespec(const Method* method){ Operation::Origin origin=get_method_origin(method); return origin.file_no ? get_used_filespec(origin.file_no) : NULL; } const Operation::Origin Request::get_method_origin(const Method* method){ Operation::Origin origin={0, 0, 0}; if(ArrayOperation* code=method->parser_code) if(code){ for(Array_iterator i(*code); i; ){ switch( i.next().code ){ case OP::OP_CURLY_CODE__STORE_PARAM: case OP::OP_EXPR_CODE__STORE_PARAM: case OP::OP_CURLY_CODE__CONSTRUCT: case OP::OP_NESTED_CODE: case OP::OP_OBJECT_POOL: case OP::OP_STRING_POOL: case OP::OP_CALL: case OP::OP_CALL__WRITE: { i.next(); // skip local ops i.next(); // skip next opcode // continue execution } case OP::OP_CONSTRUCT_OBJECT: case OP::OP_CONSTRUCT_OBJECT__WRITE: case OP::OP_VALUE: case OP::OP_STRING__WRITE: case OP::OP_VALUE__GET_CLASS: case OP::OP_VALUE__GET_BASE_CLASS: #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT case OP::OP_GET_OBJECT_ELEMENT: case OP::OP_GET_OBJECT_ELEMENT__WRITE: #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT case OP::OP_GET_OBJECT_VAR_ELEMENT: case OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE: #endif #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT case OP::OP_VALUE__GET_ELEMENT: case OP::OP_VALUE__GET_ELEMENT__WRITE: case OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR: case OP::OP_WITH_ROOT__VALUE__GET_ELEMENT: #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT case OP::OP_WITH_SELF__VALUE__GET_ELEMENT: case OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE: #endif #ifdef FEATURE_GET_ELEMENT4CALL case OP::OP_GET_ELEMENT4CALL: #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT case OP::OP_GET_OBJECT_ELEMENT4CALL: #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT case OP::OP_GET_OBJECT_VAR_ELEMENT4CALL: #endif #endif // FEATURE_GET_ELEMENT4CALL #ifdef OPTIMIZE_BYTECODE_CONSTRUCT case OP::OP_WITH_ROOT__VALUE__CONSTRUCT_EXPR: case OP::OP_WITH_ROOT__VALUE__CONSTRUCT_VALUE: case OP::OP_WITH_WRITE__VALUE__CONSTRUCT_EXPR: case OP::OP_WITH_WRITE__VALUE__CONSTRUCT_VALUE: case OP::OP_WITH_SELF__VALUE__CONSTRUCT_EXPR: case OP::OP_WITH_SELF__VALUE__CONSTRUCT_VALUE: #endif { origin=i.next().origin; break; } default: break; } if(origin.file_no) return origin; } } return origin; } parser-3.5.1/src/main/utf8-to-upper.inc0000644000076400007640000003133710562132322014615 00000000000000/* some char's commented because of parser have a problem while changing case if from-char and to-char have different length */ {0x0061, 0x0041}, {0x0062, 0x0042}, {0x0063, 0x0043}, {0x0064, 0x0044}, {0x0065, 0x0045}, {0x0066, 0x0046}, {0x0067, 0x0047}, {0x0068, 0x0048}, {0x0069, 0x0049}, {0x006A, 0x004A}, {0x006B, 0x004B}, {0x006C, 0x004C}, {0x006D, 0x004D}, {0x006E, 0x004E}, {0x006F, 0x004F}, {0x0070, 0x0050}, {0x0071, 0x0051}, {0x0072, 0x0052}, {0x0073, 0x0053}, {0x0074, 0x0054}, {0x0075, 0x0055}, {0x0076, 0x0056}, {0x0077, 0x0057}, {0x0078, 0x0058}, {0x0079, 0x0059}, {0x007A, 0x005A}, {0x00E0, 0x00C0}, {0x00E1, 0x00C1}, {0x00E2, 0x00C2}, {0x00E3, 0x00C3}, {0x00E4, 0x00C4}, {0x00E5, 0x00C5}, {0x00E6, 0x00C6}, {0x00E7, 0x00C7}, {0x00E8, 0x00C8}, {0x00E9, 0x00C9}, {0x00EA, 0x00CA}, {0x00EB, 0x00CB}, {0x00EC, 0x00CC}, {0x00ED, 0x00CD}, {0x00EE, 0x00CE}, {0x00EF, 0x00CF}, {0x00F0, 0x00D0}, {0x00F1, 0x00D1}, {0x00F2, 0x00D2}, {0x00F3, 0x00D3}, {0x00F4, 0x00D4}, {0x00F5, 0x00D5}, {0x00F6, 0x00D6}, {0x00F8, 0x00D8}, {0x00F9, 0x00D9}, {0x00FA, 0x00DA}, {0x00FB, 0x00DB}, {0x00FC, 0x00DC}, {0x00FD, 0x00DD}, {0x00FE, 0x00DE}, /*{0x00FF, 0x0178}, */{0x0101, 0x0100}, {0x0103, 0x0102}, {0x0105, 0x0104}, {0x0107, 0x0106}, {0x0109, 0x0108}, {0x010B, 0x010A}, {0x010D, 0x010C}, {0x010F, 0x010E}, {0x0111, 0x0110}, {0x0113, 0x0112}, {0x0115, 0x0114}, {0x0117, 0x0116}, {0x0119, 0x0118}, {0x011B, 0x011A}, {0x011D, 0x011C}, {0x011F, 0x011E}, {0x0121, 0x0120}, {0x0123, 0x0122}, {0x0125, 0x0124}, {0x0127, 0x0126}, {0x0129, 0x0128}, {0x012B, 0x012A}, {0x012D, 0x012C}, {0x012F, 0x012E}, /*{0x0131, 0x0049}, */{0x0133, 0x0132}, {0x0135, 0x0134}, {0x0137, 0x0136}, {0x013A, 0x0139}, {0x013C, 0x013B}, {0x013E, 0x013D}, {0x0140, 0x013F}, {0x0142, 0x0141}, {0x0144, 0x0143}, {0x0146, 0x0145}, {0x0148, 0x0147}, {0x014B, 0x014A}, {0x014D, 0x014C}, {0x014F, 0x014E}, {0x0151, 0x0150}, {0x0153, 0x0152}, {0x0155, 0x0154}, {0x0157, 0x0156}, {0x0159, 0x0158}, {0x015B, 0x015A}, {0x015D, 0x015C}, {0x015F, 0x015E}, {0x0161, 0x0160}, {0x0163, 0x0162}, {0x0165, 0x0164}, {0x0167, 0x0166}, {0x0169, 0x0168}, {0x016B, 0x016A}, {0x016D, 0x016C}, {0x016F, 0x016E}, {0x0171, 0x0170}, {0x0173, 0x0172}, {0x0175, 0x0174}, {0x0177, 0x0176}, {0x017A, 0x0179}, {0x017C, 0x017B}, {0x017E, 0x017D}, {0x0183, 0x0182}, {0x0185, 0x0184}, {0x0188, 0x0187}, {0x018C, 0x018B}, {0x0192, 0x0191}, {0x0195, 0x01F6}, {0x0199, 0x0198}, {0x019E, 0x0220}, {0x01A1, 0x01A0}, {0x01A3, 0x01A2}, {0x01A5, 0x01A4}, {0x01A8, 0x01A7}, {0x01AD, 0x01AC}, {0x01B0, 0x01AF}, {0x01B4, 0x01B3}, {0x01B6, 0x01B5}, {0x01B9, 0x01B8}, {0x01BD, 0x01BC}, {0x01BF, 0x01F7}, {0x01C6, 0x01C4}, {0x01C9, 0x01C7}, {0x01CC, 0x01CA}, {0x01CE, 0x01CD}, {0x01D0, 0x01CF}, {0x01D2, 0x01D1}, {0x01D4, 0x01D3}, {0x01D6, 0x01D5}, {0x01D8, 0x01D7}, {0x01DA, 0x01D9}, {0x01DC, 0x01DB}, {0x01DD, 0x018E}, {0x01DF, 0x01DE}, {0x01E1, 0x01E0}, {0x01E3, 0x01E2}, {0x01E5, 0x01E4}, {0x01E7, 0x01E6}, {0x01E9, 0x01E8}, {0x01EB, 0x01EA}, {0x01ED, 0x01EC}, {0x01EF, 0x01EE}, {0x01F3, 0x01F1}, {0x01F5, 0x01F4}, {0x01F9, 0x01F8}, {0x01FB, 0x01FA}, {0x01FD, 0x01FC}, {0x01FF, 0x01FE}, {0x0201, 0x0200}, {0x0203, 0x0202}, {0x0205, 0x0204}, {0x0207, 0x0206}, {0x0209, 0x0208}, {0x020B, 0x020A}, {0x020D, 0x020C}, {0x020F, 0x020E}, {0x0211, 0x0210}, {0x0213, 0x0212}, {0x0215, 0x0214}, {0x0217, 0x0216}, {0x0219, 0x0218}, {0x021B, 0x021A}, {0x021D, 0x021C}, {0x021F, 0x021E}, {0x0223, 0x0222}, {0x0225, 0x0224}, {0x0227, 0x0226}, {0x0229, 0x0228}, {0x022B, 0x022A}, {0x022D, 0x022C}, {0x022F, 0x022E}, {0x0231, 0x0230}, {0x0233, 0x0232}, {0x0253, 0x0181}, {0x0254, 0x0186}, {0x0256, 0x0189}, {0x0257, 0x018A}, {0x0259, 0x018F}, {0x025B, 0x0190}, {0x0260, 0x0193}, {0x0263, 0x0194}, {0x0268, 0x0197}, {0x0269, 0x0196}, {0x026F, 0x019C}, {0x0272, 0x019D}, {0x0275, 0x019F}, {0x0280, 0x01A6}, {0x0283, 0x01A9}, {0x0288, 0x01AE}, {0x028A, 0x01B1}, {0x028B, 0x01B2}, {0x0292, 0x01B7}, {0x03AC, 0x0386}, {0x03AD, 0x0388}, {0x03AE, 0x0389}, {0x03AF, 0x038A}, {0x03B1, 0x0391}, {0x03B2, 0x0392}, {0x03B3, 0x0393}, {0x03B4, 0x0394}, {0x03B5, 0x0395}, {0x03B6, 0x0396}, {0x03B7, 0x0397}, {0x03B8, 0x0398}, {0x03B9, 0x0345}, {0x03BA, 0x039A}, {0x03BB, 0x039B}, /*{0x03BC, 0x00B5}, */{0x03BD, 0x039D}, {0x03BE, 0x039E}, {0x03BF, 0x039F}, {0x03C0, 0x03A0}, {0x03C1, 0x03A1}, {0x03C3, 0x03A3}, {0x03C4, 0x03A4}, {0x03C5, 0x03A5}, {0x03C6, 0x03A6}, {0x03C7, 0x03A7}, {0x03C8, 0x03A8}, {0x03C9, 0x03A9}, {0x03CA, 0x03AA}, {0x03CB, 0x03AB}, {0x03CC, 0x038C}, {0x03CD, 0x038E}, {0x03CE, 0x038F}, {0x03D9, 0x03D8}, {0x03DB, 0x03DA}, {0x03DD, 0x03DC}, {0x03DF, 0x03DE}, {0x03E1, 0x03E0}, {0x03E3, 0x03E2}, {0x03E5, 0x03E4}, {0x03E7, 0x03E6}, {0x03E9, 0x03E8}, {0x03EB, 0x03EA}, {0x03ED, 0x03EC}, {0x03EF, 0x03EE}, {0x03F2, 0x03F9}, {0x03F8, 0x03F7}, {0x03FB, 0x03FA}, {0x0430, 0x0410}, {0x0431, 0x0411}, {0x0432, 0x0412}, {0x0433, 0x0413}, {0x0434, 0x0414}, {0x0435, 0x0415}, {0x0436, 0x0416}, {0x0437, 0x0417}, {0x0438, 0x0418}, {0x0439, 0x0419}, {0x043A, 0x041A}, {0x043B, 0x041B}, {0x043C, 0x041C}, {0x043D, 0x041D}, {0x043E, 0x041E}, {0x043F, 0x041F}, {0x0440, 0x0420}, {0x0441, 0x0421}, {0x0442, 0x0422}, {0x0443, 0x0423}, {0x0444, 0x0424}, {0x0445, 0x0425}, {0x0446, 0x0426}, {0x0447, 0x0427}, {0x0448, 0x0428}, {0x0449, 0x0429}, {0x044A, 0x042A}, {0x044B, 0x042B}, {0x044C, 0x042C}, {0x044D, 0x042D}, {0x044E, 0x042E}, {0x044F, 0x042F}, {0x0450, 0x0400}, {0x0451, 0x0401}, {0x0452, 0x0402}, {0x0453, 0x0403}, {0x0454, 0x0404}, {0x0455, 0x0405}, {0x0456, 0x0406}, {0x0457, 0x0407}, {0x0458, 0x0408}, {0x0459, 0x0409}, {0x045A, 0x040A}, {0x045B, 0x040B}, {0x045C, 0x040C}, {0x045D, 0x040D}, {0x045E, 0x040E}, {0x045F, 0x040F}, {0x0461, 0x0460}, {0x0463, 0x0462}, {0x0465, 0x0464}, {0x0467, 0x0466}, {0x0469, 0x0468}, {0x046B, 0x046A}, {0x046D, 0x046C}, {0x046F, 0x046E}, {0x0471, 0x0470}, {0x0473, 0x0472}, {0x0475, 0x0474}, {0x0477, 0x0476}, {0x0479, 0x0478}, {0x047B, 0x047A}, {0x047D, 0x047C}, {0x047F, 0x047E}, {0x0481, 0x0480}, {0x048B, 0x048A}, {0x048D, 0x048C}, {0x048F, 0x048E}, {0x0491, 0x0490}, {0x0493, 0x0492}, {0x0495, 0x0494}, {0x0497, 0x0496}, {0x0499, 0x0498}, {0x049B, 0x049A}, {0x049D, 0x049C}, {0x049F, 0x049E}, {0x04A1, 0x04A0}, {0x04A3, 0x04A2}, {0x04A5, 0x04A4}, {0x04A7, 0x04A6}, {0x04A9, 0x04A8}, {0x04AB, 0x04AA}, {0x04AD, 0x04AC}, {0x04AF, 0x04AE}, {0x04B1, 0x04B0}, {0x04B3, 0x04B2}, {0x04B5, 0x04B4}, {0x04B7, 0x04B6}, {0x04B9, 0x04B8}, {0x04BB, 0x04BA}, {0x04BD, 0x04BC}, {0x04BF, 0x04BE}, {0x04C2, 0x04C1}, {0x04C4, 0x04C3}, {0x04C6, 0x04C5}, {0x04C8, 0x04C7}, {0x04CA, 0x04C9}, {0x04CC, 0x04CB}, {0x04CE, 0x04CD}, {0x04D1, 0x04D0}, {0x04D3, 0x04D2}, {0x04D5, 0x04D4}, {0x04D7, 0x04D6}, {0x04D9, 0x04D8}, {0x04DB, 0x04DA}, {0x04DD, 0x04DC}, {0x04DF, 0x04DE}, {0x04E1, 0x04E0}, {0x04E3, 0x04E2}, {0x04E5, 0x04E4}, {0x04E7, 0x04E6}, {0x04E9, 0x04E8}, {0x04EB, 0x04EA}, {0x04ED, 0x04EC}, {0x04EF, 0x04EE}, {0x04F1, 0x04F0}, {0x04F3, 0x04F2}, {0x04F5, 0x04F4}, {0x04F9, 0x04F8}, {0x0501, 0x0500}, {0x0503, 0x0502}, {0x0505, 0x0504}, {0x0507, 0x0506}, {0x0509, 0x0508}, {0x050B, 0x050A}, {0x050D, 0x050C}, {0x050F, 0x050E}, {0x0561, 0x0531}, {0x0562, 0x0532}, {0x0563, 0x0533}, {0x0564, 0x0534}, {0x0565, 0x0535}, {0x0566, 0x0536}, {0x0567, 0x0537}, {0x0568, 0x0538}, {0x0569, 0x0539}, {0x056A, 0x053A}, {0x056B, 0x053B}, {0x056C, 0x053C}, {0x056D, 0x053D}, {0x056E, 0x053E}, {0x056F, 0x053F}, {0x0570, 0x0540}, {0x0571, 0x0541}, {0x0572, 0x0542}, {0x0573, 0x0543}, {0x0574, 0x0544}, {0x0575, 0x0545}, {0x0576, 0x0546}, {0x0577, 0x0547}, {0x0578, 0x0548}, {0x0579, 0x0549}, {0x057A, 0x054A}, {0x057B, 0x054B}, {0x057C, 0x054C}, {0x057D, 0x054D}, {0x057E, 0x054E}, {0x057F, 0x054F}, {0x0580, 0x0550}, {0x0581, 0x0551}, {0x0582, 0x0552}, {0x0583, 0x0553}, {0x0584, 0x0554}, {0x0585, 0x0555}, {0x0586, 0x0556}, {0x1E01, 0x1E00}, {0x1E03, 0x1E02}, {0x1E05, 0x1E04}, {0x1E07, 0x1E06}, {0x1E09, 0x1E08}, {0x1E0B, 0x1E0A}, {0x1E0D, 0x1E0C}, {0x1E0F, 0x1E0E}, {0x1E11, 0x1E10}, {0x1E13, 0x1E12}, {0x1E15, 0x1E14}, {0x1E17, 0x1E16}, {0x1E19, 0x1E18}, {0x1E1B, 0x1E1A}, {0x1E1D, 0x1E1C}, {0x1E1F, 0x1E1E}, {0x1E21, 0x1E20}, {0x1E23, 0x1E22}, {0x1E25, 0x1E24}, {0x1E27, 0x1E26}, {0x1E29, 0x1E28}, {0x1E2B, 0x1E2A}, {0x1E2D, 0x1E2C}, {0x1E2F, 0x1E2E}, {0x1E31, 0x1E30}, {0x1E33, 0x1E32}, {0x1E35, 0x1E34}, {0x1E37, 0x1E36}, {0x1E39, 0x1E38}, {0x1E3B, 0x1E3A}, {0x1E3D, 0x1E3C}, {0x1E3F, 0x1E3E}, {0x1E41, 0x1E40}, {0x1E43, 0x1E42}, {0x1E45, 0x1E44}, {0x1E47, 0x1E46}, {0x1E49, 0x1E48}, {0x1E4B, 0x1E4A}, {0x1E4D, 0x1E4C}, {0x1E4F, 0x1E4E}, {0x1E51, 0x1E50}, {0x1E53, 0x1E52}, {0x1E55, 0x1E54}, {0x1E57, 0x1E56}, {0x1E59, 0x1E58}, {0x1E5B, 0x1E5A}, {0x1E5D, 0x1E5C}, {0x1E5F, 0x1E5E}, {0x1E61, 0x1E60}, {0x1E63, 0x1E62}, {0x1E65, 0x1E64}, {0x1E67, 0x1E66}, {0x1E69, 0x1E68}, {0x1E6B, 0x1E6A}, {0x1E6D, 0x1E6C}, {0x1E6F, 0x1E6E}, {0x1E71, 0x1E70}, {0x1E73, 0x1E72}, {0x1E75, 0x1E74}, {0x1E77, 0x1E76}, {0x1E79, 0x1E78}, {0x1E7B, 0x1E7A}, {0x1E7D, 0x1E7C}, {0x1E7F, 0x1E7E}, {0x1E81, 0x1E80}, {0x1E83, 0x1E82}, {0x1E85, 0x1E84}, {0x1E87, 0x1E86}, {0x1E89, 0x1E88}, {0x1E8B, 0x1E8A}, {0x1E8D, 0x1E8C}, {0x1E8F, 0x1E8E}, {0x1E91, 0x1E90}, {0x1E93, 0x1E92}, {0x1E95, 0x1E94}, {0x1EA1, 0x1EA0}, {0x1EA3, 0x1EA2}, {0x1EA5, 0x1EA4}, {0x1EA7, 0x1EA6}, {0x1EA9, 0x1EA8}, {0x1EAB, 0x1EAA}, {0x1EAD, 0x1EAC}, {0x1EAF, 0x1EAE}, {0x1EB1, 0x1EB0}, {0x1EB3, 0x1EB2}, {0x1EB5, 0x1EB4}, {0x1EB7, 0x1EB6}, {0x1EB9, 0x1EB8}, {0x1EBB, 0x1EBA}, {0x1EBD, 0x1EBC}, {0x1EBF, 0x1EBE}, {0x1EC1, 0x1EC0}, {0x1EC3, 0x1EC2}, {0x1EC5, 0x1EC4}, {0x1EC7, 0x1EC6}, {0x1EC9, 0x1EC8}, {0x1ECB, 0x1ECA}, {0x1ECD, 0x1ECC}, {0x1ECF, 0x1ECE}, {0x1ED1, 0x1ED0}, {0x1ED3, 0x1ED2}, {0x1ED5, 0x1ED4}, {0x1ED7, 0x1ED6}, {0x1ED9, 0x1ED8}, {0x1EDB, 0x1EDA}, {0x1EDD, 0x1EDC}, {0x1EDF, 0x1EDE}, {0x1EE1, 0x1EE0}, {0x1EE3, 0x1EE2}, {0x1EE5, 0x1EE4}, {0x1EE7, 0x1EE6}, {0x1EE9, 0x1EE8}, {0x1EEB, 0x1EEA}, {0x1EED, 0x1EEC}, {0x1EEF, 0x1EEE}, {0x1EF1, 0x1EF0}, {0x1EF3, 0x1EF2}, {0x1EF5, 0x1EF4}, {0x1EF7, 0x1EF6}, {0x1EF9, 0x1EF8}, {0x1F00, 0x1F08}, {0x1F01, 0x1F09}, {0x1F02, 0x1F0A}, {0x1F03, 0x1F0B}, {0x1F04, 0x1F0C}, {0x1F05, 0x1F0D}, {0x1F06, 0x1F0E}, {0x1F07, 0x1F0F}, {0x1F10, 0x1F18}, {0x1F11, 0x1F19}, {0x1F12, 0x1F1A}, {0x1F13, 0x1F1B}, {0x1F14, 0x1F1C}, {0x1F15, 0x1F1D}, {0x1F20, 0x1F28}, {0x1F21, 0x1F29}, {0x1F22, 0x1F2A}, {0x1F23, 0x1F2B}, {0x1F24, 0x1F2C}, {0x1F25, 0x1F2D}, {0x1F26, 0x1F2E}, {0x1F27, 0x1F2F}, {0x1F30, 0x1F38}, {0x1F31, 0x1F39}, {0x1F32, 0x1F3A}, {0x1F33, 0x1F3B}, {0x1F34, 0x1F3C}, {0x1F35, 0x1F3D}, {0x1F36, 0x1F3E}, {0x1F37, 0x1F3F}, {0x1F40, 0x1F48}, {0x1F41, 0x1F49}, {0x1F42, 0x1F4A}, {0x1F43, 0x1F4B}, {0x1F44, 0x1F4C}, {0x1F45, 0x1F4D}, {0x1F51, 0x1F59}, {0x1F53, 0x1F5B}, {0x1F55, 0x1F5D}, {0x1F57, 0x1F5F}, {0x1F60, 0x1F68}, {0x1F61, 0x1F69}, {0x1F62, 0x1F6A}, {0x1F63, 0x1F6B}, {0x1F64, 0x1F6C}, {0x1F65, 0x1F6D}, {0x1F66, 0x1F6E}, {0x1F67, 0x1F6F}, {0x1F70, 0x1FBA}, {0x1F71, 0x1FBB}, {0x1F72, 0x1FC8}, {0x1F73, 0x1FC9}, {0x1F74, 0x1FCA}, {0x1F75, 0x1FCB}, {0x1F76, 0x1FDA}, {0x1F77, 0x1FDB}, {0x1F78, 0x1FF8}, {0x1F79, 0x1FF9}, {0x1F7A, 0x1FEA}, {0x1F7B, 0x1FEB}, {0x1F7C, 0x1FFA}, {0x1F7D, 0x1FFB}, {0x1F80, 0x1F88}, {0x1F81, 0x1F89}, {0x1F82, 0x1F8A}, {0x1F83, 0x1F8B}, {0x1F84, 0x1F8C}, {0x1F85, 0x1F8D}, {0x1F86, 0x1F8E}, {0x1F87, 0x1F8F}, {0x1F90, 0x1F98}, {0x1F91, 0x1F99}, {0x1F92, 0x1F9A}, {0x1F93, 0x1F9B}, {0x1F94, 0x1F9C}, {0x1F95, 0x1F9D}, {0x1F96, 0x1F9E}, {0x1F97, 0x1F9F}, {0x1FA0, 0x1FA8}, {0x1FA1, 0x1FA9}, {0x1FA2, 0x1FAA}, {0x1FA3, 0x1FAB}, {0x1FA4, 0x1FAC}, {0x1FA5, 0x1FAD}, {0x1FA6, 0x1FAE}, {0x1FA7, 0x1FAF}, {0x1FB0, 0x1FB8}, {0x1FB1, 0x1FB9}, {0x1FB3, 0x1FBC}, {0x1FC3, 0x1FCC}, {0x1FD0, 0x1FD8}, {0x1FD1, 0x1FD9}, {0x1FE0, 0x1FE8}, {0x1FE1, 0x1FE9}, {0x1FE5, 0x1FEC}, {0x1FF3, 0x1FFC}, {0x2170, 0x2160}, {0x2171, 0x2161}, {0x2172, 0x2162}, {0x2173, 0x2163}, {0x2174, 0x2164}, {0x2175, 0x2165}, {0x2176, 0x2166}, {0x2177, 0x2167}, {0x2178, 0x2168}, {0x2179, 0x2169}, {0x217A, 0x216A}, {0x217B, 0x216B}, {0x217C, 0x216C}, {0x217D, 0x216D}, {0x217E, 0x216E}, {0x217F, 0x216F}, {0x24D0, 0x24B6}, {0x24D1, 0x24B7}, {0x24D2, 0x24B8}, {0x24D3, 0x24B9}, {0x24D4, 0x24BA}, {0x24D5, 0x24BB}, {0x24D6, 0x24BC}, {0x24D7, 0x24BD}, {0x24D8, 0x24BE}, {0x24D9, 0x24BF}, {0x24DA, 0x24C0}, {0x24DB, 0x24C1}, {0x24DC, 0x24C2}, {0x24DD, 0x24C3}, {0x24DE, 0x24C4}, {0x24DF, 0x24C5}, {0x24E0, 0x24C6}, {0x24E1, 0x24C7}, {0x24E2, 0x24C8}, {0x24E3, 0x24C9}, {0x24E4, 0x24CA}, {0x24E5, 0x24CB}, {0x24E6, 0x24CC}, {0x24E7, 0x24CD}, {0x24E8, 0x24CE}, {0x24E9, 0x24CF}, {0xFF41, 0xFF21}, {0xFF42, 0xFF22}, {0xFF43, 0xFF23}, {0xFF44, 0xFF24}, {0xFF45, 0xFF25}, {0xFF46, 0xFF26}, {0xFF47, 0xFF27}, {0xFF48, 0xFF28}, {0xFF49, 0xFF29}, {0xFF4A, 0xFF2A}, {0xFF4B, 0xFF2B}, {0xFF4C, 0xFF2C}, {0xFF4D, 0xFF2D}, {0xFF4E, 0xFF2E}, {0xFF4F, 0xFF2F}, {0xFF50, 0xFF30}, {0xFF51, 0xFF31}, {0xFF52, 0xFF32}, {0xFF53, 0xFF33}, {0xFF54, 0xFF34}, {0xFF55, 0xFF35}, {0xFF56, 0xFF36}, {0xFF57, 0xFF37}, {0xFF58, 0xFF38}, {0xFF59, 0xFF39}, {0xFF5A, 0xFF3A} parser-3.5.1/src/main/main.vcproj0000644000076400007640000002216114705200531013630 00000000000000 parser-3.5.1/src/main/pa_stylesheet_connection.C0000644000076400007640000000341114712042465016660 00000000000000/** @file Parser: Stylesheet connection implementation. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #ifdef XML #include "pa_stylesheet_connection.h" #include "pa_xml_exception.h" volatile const char * IDENT_PA_STYLESHEET_CONNECTION_C="$Id: pa_stylesheet_connection.C,v 1.15 2024/11/04 03:53:25 moko Exp $" IDENT_PA_STYLESHEET_CONNECTION_H; void Stylesheet_connection::load(time_t new_disk_time) { xsltStylesheet *nstylesheet; { dependencies=pa_xmlStartMonitoringDependencies(); // just to reference TLS variable { int saved=xmlDoValidityCheckingDefaultValue; xmlDoValidityCheckingDefaultValue=0; nstylesheet=xsltParseStylesheetFile(BAD_CAST ffile_spec.cstr()); xmlDoValidityCheckingDefaultValue = saved; } dependencies=pa_xmlGetDependencies(); } if(xmlHaveGenericErrors()) throw XmlException(new String(ffile_spec, String::L_TAINTED), pa_thread_request()); if(!nstylesheet) throw Exception("file.missing", new String(ffile_spec, String::L_TAINTED), "stylesheet failed to load"); xsltFreeStylesheet(fstylesheet); fstylesheet=nstylesheet; prev_disk_time=new_disk_time; // note: 0 for the first fime, cache works only from second hit } static void update_max_mtime(HashStringValue::key_type stat_file_spec_cstr, bool /*value*/, time_t* max) { uint64_t size; time_t atime, mtime, ctime; file_stat(*new String(stat_file_spec_cstr, String::L_AS_IS), size, atime, mtime, ctime, true/*exception on error*/); if(mtime>*max) *max=mtime; } time_t Stylesheet_connection::get_disk_time() { assert(dependencies); time_t result=0; dependencies->for_each(update_max_mtime, &result); return result; } #endif parser-3.5.1/src/main/pa_globals.C0000644000076400007640000002213414732404263013676 00000000000000/** @file Parser: globals. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" #ifdef XML #include "libxml/xmlversion.h" #include "libxslt/extensions.h" #include "libxslt/xsltutils.h" extern "C" { #include "libexslt/exslt.h" } #endif #include "pa_globals.h" #include "pa_socks.h" #include "pa_sapi.h" #include "pa_xml_io.h" #include "pa_common.h" #include "pa_symbols.h" #include "pa_cache_managers.h" #include "ltdl.h" #include "pa_vregex.h" volatile const char * IDENT_PA_GLOBALS_C="$Id: pa_globals.C,v 1.217 2024/12/23 16:59:17 moko Exp $" IDENT_PA_GLOBALS_H IDENT_PA_SAPI_H; // defines //#define PA_DEBUG_XML_GC_MEMORY // globals short hex_value[0x100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; THREAD_LOCAL Request* thread_request=NULL; // every TLS should be referenced elsewhere, or GC will collect it void pa_register_thread_request(Request& r) { thread_request=&r; } /// retrives request set by pa_set_request function, useful in contextless places [slow] Request& pa_thread_request() { if(!thread_request) throw Exception(0, 0, "request is not initialized"); return *thread_request; } #ifdef XML class XML_Generic_error_info { public:/*internal, actually*/ char buf[MAX_STRING*5]; size_t used; public: XML_Generic_error_info() { buf[used=0]=0; } const char* get() { return used? buf: 0; } }; THREAD_LOCAL XML_Generic_error_info* xml_generic_error_info = NULL; static void xmlParserGenericErrorFunc(void * /*ctx*/, const char* msg, ...) { XML_Generic_error_info* p; if(!(p=xml_generic_error_info)) // occupy empty one p=xml_generic_error_info=new(PointerFreeGC) XML_Generic_error_info; va_list args; va_start(args, msg); p->used+=vsnprintf(p->buf+p->used, sizeof(p->buf)-p->used, msg, args); va_end(args); } bool xmlHaveGenericErrors() { return xml_generic_error_info!=0; } const char* xmlGenericErrors() { if(XML_Generic_error_info *p=xml_generic_error_info) { xml_generic_error_info=0; return p->get(); } return 0; // no errors for our thread_id registered } #endif // XML #ifdef XML static char *pa_GC_strdup(const char *s) { if(!s) return 0; size_t size=strlen(s)+1; char *result=(char *)GC_MALLOC_ATOMIC(size); if(!result) pa_fail_alloc("duplicate XML string",size); memcpy(result, s, size); #ifdef PA_DEBUG_XML_GC_MEMORY fprintf(stderr, "pa_GC_strdup(%p=%s, length=%d)=0x%p\n", s, s, size, result); #endif return result; } #ifdef PA_DEBUG_XML_GC_MEMORY static void* pa_gc_malloc_log(size_t size){ void *p=GC_MALLOC(size); fprintf(stderr, "pa_gc_malloc_log(%d)=0x%p\n", size, p); return p; } static void* pa_gc_malloc_atomic_log(size_t size){ void *p=GC_MALLOC_ATOMIC(size); fprintf(stderr, "pa_gc_malloc_atomic_log(%d)=0x%p\n", size, p); return p; } static void* pa_gc_realloc_log(void *ptr, size_t size){ void *p=GC_REALLOC(ptr, size); fprintf(stderr, "pa_gc_realloc_log(0x%p, %d)=0x%p\n", ptr, size, p); return p; } static void pa_gc_free_log(void *p){ fprintf(stderr, "pa_gc_free_log(0x%p)\n", p); GC_FREE(p); } #else inline void *check(void *result, const char *where, size_t size) { if(!result) pa_fail_alloc(where, size); return result; } static void* pa_gc_malloc_nonull(size_t size) { return check(GC_MALLOC(size), "allocate XML compsite memory", size); } static void* pa_gc_malloc_atomic_nonull(size_t size) { return check(GC_MALLOC_ATOMIC(size), "allocate XML atomic memory", size); } static void* pa_gc_realloc_nonull(void* ptr, size_t size) { return check(GC_REALLOC(ptr, size), "reallocate XML memory", size); } static void pa_gc_free_maybeignore(void* ptr) { GC_FREE(ptr); } #endif #endif // XML #ifdef HAVE_PCRE2 pcre2_general_context* VRegex::fgen_ctxt; static void* pa_pcre_malloc(size_t size, void *){ return pa_malloc(size); } static void pa_pcre_free(void *ptr, void *){ pa_free(ptr); } #endif void pa_CORD_oom_fn(void) { pa_fail_alloc("expand string", 0); } /** @todo gc: libltdl: substitute lt_dlmalloc & co */ static void gc_substitute_memory_management_functions() { // in libxml & libxslt #ifdef XML // asking to use GC memory #ifdef PA_DEBUG_XML_GC_MEMORY xmlGcMemSetup( /*xmlFreeFunc */pa_gc_free_log, /*xmlMallocFunc */pa_gc_malloc_log, /*xmlMallocFunc */pa_gc_malloc_atomic_log, /*xmlReallocFunc */pa_gc_realloc_log, /*xmlStrdupFunc */pa_GC_strdup); #else xmlGcMemSetup( /*xmlFreeFunc */pa_gc_free_maybeignore, /*xmlMallocFunc */pa_gc_malloc_nonull, /*xmlMallocFunc */pa_gc_malloc_atomic_nonull, /*xmlReallocFunc */pa_gc_realloc_nonull, /*xmlStrdupFunc */pa_GC_strdup); #endif #endif // pcre #ifdef HAVE_PCRE2 VRegex::fgen_ctxt=pcre2_general_context_create(pa_pcre_malloc, pa_pcre_free, NULL); #else pcre_malloc=pa_malloc; pcre_free=pa_free; #endif // cord CORD_oom_fn=pa_CORD_oom_fn; } /** @test hint on one should call this for each thread xmlSubstituteEntitiesDefault(1); */ void pa_globals_init() { #ifndef PA_DEBUG_DISABLE_GC // Dont collect unless explicitly requested. This is quicker (~30% ), // but less memory-efficient(~8%), so deciding for speed. GC_disable(); // as we log allocation errors, we don't need default gc warnings (without timestamp and URI) GC_set_warn_proc(GC_ignore_warn_proc); #endif // init socks pa_socks_init(); // global variables cache_managers=new Cache_managers; // in various libraries gc_substitute_memory_management_functions(); #ifdef SYMBOLS_CACHING // symbols cache Symbols::init(); #endif #ifdef XML // initializing xml libs // Register the EXSLT extensions and the test module exsltRegisterAll(); xsltRegisterTestModule(); xmlDefaultSAXHandlerInit(); // disable CDATA from being built in the document tree // never added yet xmlDefaultSAXHandler.cdataBlock = NULL; // Initialization function for the XML parser. This is not reentrant. // Call once before processing in case of use in multithreaded programs. xmlInitParser(); // 1. this is needed for proper parsing of stylesheets // there were a situation where honest entity ruined innocent xpath compilation // doc says "you sould turn it on on stylesheet load" without deepening into details // 2. when dom tree with entites goes under transform text nodes // got [erroreosly] cut on first entity occurance // -- // that is why this is: xmlSubstituteEntitiesDefault(1); // Bit in the loadsubset context field to tell to do ID/REFs lookups xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS; // Bit in the loadsubset context field to tell to do complete the elements attributes lists // with the ones defaulted from the DTDs xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS; // validate each document after load/create (?) // xmlDoValidityCheckingDefaultValue = 1; // regretfully this not only replaces entities on parse, but also on generate xmlSubstituteEntitiesDefault(1); // never switched this on xmlIndentTreeOutput=1; xmlSetGenericErrorFunc(0, xmlParserGenericErrorFunc); xsltSetGenericErrorFunc(0, xmlParserGenericErrorFunc); // FILE *f=fopen("xslt.log", "wt"); // xsltSetGenericDebugFunc(f/*stderr*/, 0); pa_xml_io_init(); #endif // init *_class variables methoded_array(); } static bool is_dlinited=false; void pa_globals_done() { delete cache_managers; cache_managers=0; if(is_dlinited) lt_dlexit(); pa_socks_done(); } void pa_dlinit() { if(!is_dlinited){ if(lt_dlinit()) throw Exception(0,0,"preparation for dynamic library loading failed, %s", lt_dlerror()); is_dlinited=true; } } #ifdef _MSC_VER #define PREFIX "../../../../win32/" #ifdef _DEBUG #define CONFIGURATION "Debug" #else #define CONFIGURATION "Release" #endif #ifdef _WIN64 #define PLATFORM_64 "x64/" #define PLATFORM_32 "" #else #define PLATFORM_64 "" #define PLATFORM_32 "win32/" #endif #pragma comment(lib, PREFIX "pcre/" PLATFORM_64 CONFIGURATION "/pcre.lib") #ifndef PA_DEBUG_DISABLE_GC #pragma comment(lib, PREFIX "gc/" PLATFORM_64 CONFIGURATION "/gc.lib") #endif // PA_DEBUG_DISABLE_GC #ifdef XML #define GNOME_LIBS PREFIX "gnome" #define LIB_XML PREFIX "gnome/libxml2-x.x.x/" PLATFORM_64 PLATFORM_32 CONFIGURATION "/lib/" #define LIB_XSLT PREFIX "gnome/libxslt-x.x.x/" PLATFORM_64 PLATFORM_32 CONFIGURATION "/lib/" #ifdef XML_STATIC #pragma comment(lib, LIB_XML "libxml2_a.lib") #pragma comment(lib, LIB_XSLT "libxslt_a.lib") #pragma comment(lib, LIB_XSLT "libexslt_a.lib") #else #pragma comment(lib, LIB_XML "libxml2.lib") #pragma comment(lib, LIB_XSLT "libxslt.lib") #pragma comment(lib, LIB_XSLT "libexslt.lib") #endif #endif // XML // defines for VS2015 to link with gc/xml libs compiled in the previous VS versions #if _MSC_VER >= 1900 #pragma comment(lib,"legacy_stdio_definitions.lib") #endif #endif // _MSC_VER parser-3.5.1/src/main/pa_socks.C0000644000076400007640000000332614712042465013377 00000000000000/** @file Parser: socks initialization/finalization. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ volatile const char * IDENT_PA_SOCKS_C="$Id: pa_socks.C,v 1.34 2024/11/04 03:53:25 moko Exp $"; #include "pa_config_includes.h" #ifdef _MSC_VER #include "pa_exception.h" #include "pa_socks.h" #include "pa_string.h" #include WSADATA wsaData; void pa_socks_init() { WORD wVersionRequested; int err; wVersionRequested = MAKEWORD( 1, 1 ); err = WSAStartup( wVersionRequested, &wsaData ); if ( err != 0 ) { /* Tell the user that we could not find a usable */ throw Exception(0, 0, "cannot WSAStartup, err=%d", err); } } void pa_socks_done() { /* Confirm that the WinSock DLL supports 2.2.*/ /* Note that if the DLL supports versions greater */ /* than 2.2 in addition to 2.2, it will still return */ /* 2.2 in wVersion since that is the version we */ /* requested. */ if ( LOBYTE( wsaData.wVersion ) == 2 || HIBYTE( wsaData.wVersion ) == 2 ) { WSACleanup(); return; } } const char* pa_socks_strerr(int no) { char buf[MAX_STRING]; buf[0]=0; size_t error_size=FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, no, 0, // Default language (LPTSTR) &buf, sizeof(buf), NULL ); if(error_size>3) // ".\r\n" buf[error_size-3]=0; return buf[0]? pa_strdup(buf): "unknown error"; } int pa_socks_errno() { return WSAGetLastError(); } #else void pa_socks_init() {} void pa_socks_done() {} const char* pa_socks_strerr(int no) { return strerror(no); } int pa_socks_errno() { return errno; } #endif parser-3.5.1/src/main/pa_table.C0000644000076400007640000000642214716005001013331 00000000000000/** @file Parser: table class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_table.h" volatile const char * IDENT_PA_TABLE_C="$Id: pa_table.C,v 1.78 2024/11/16 02:57:05 moko Exp $" IDENT_PA_TABLE_H; #include "pa_exception.h" Table::Table(columns_type acolumns, size_t initial_rows): Array(initial_rows), fcurrent(0), fcolumns(acolumns), name2number(NULL){ column_names_init(); } void Table::column_names_init(){ if(fcolumns){ name2number = new name2number_hash_class; size_t number=1; for(ArrayString::Iterator i(*fcolumns); i; ) { const String& name=*i.next(); name2number->put(name, number++); } } } static void append_row(Table& src, Table* dest) { Table::element_type src_row(src[src.current()]); Table::element_type row(new ArrayString(src_row->count())); row->append(*src_row); *dest+=row; } Table::Table(const Table& src, Action_options& options) : Array(options.limit > src.count() ? src.count() : options.limit), fcurrent(0), fcolumns(src.fcolumns), name2number(src.name2number) { ((Table &)src).table_for_each(append_row, this, options); } size_t Table::max_cells() const { size_t result=0; for(size_t i=0; icount()>result) result=row->count(); } return result; } int Table::column_name2index(const String& column_name, bool bark) const { if(fcolumns) {// named int result=name2number->get(column_name)-1; // -1 = column not found if(bark && result<0) throw Exception(PARSER_RUNTIME, &column_name, "column not found"); return result; } else // nameless return column_name.as_int(); } const String* Table::item(size_t column) { if(valid(fcurrent)) { element_type row=get(fcurrent); if(columncount()) // proper index? return row->get(column); } return 0; // it's OK we don't have row|column, just return nothing } void Table::put_item(size_t column, const String* value) { if(!valid(fcurrent)) { throw Exception(PARSER_RUNTIME, 0, "invalid current row"); } element_type row=get(fcurrent); while(row->count()<=column){ *row+=&String::Empty; } row->put(column, value); } void Table::remove_current(){ if(!valid(fcurrent)) { throw Exception(PARSER_RUNTIME, 0, "invalid current row"); } remove(fcurrent); if(fcurrent>=count() && count()>0){ fcurrent--; } } #ifndef DOXYGEN struct Locate_int_string_info { int column; const String* value; }; #endif bool locate_int_string(Table& self, Locate_int_string_info* info) { const String *item_value=self.item(info->column); return item_value && *item_value==*info->value; } bool Table::locate(int column, const String& value, Table::Action_options& options) { Locate_int_string_info info={column, &value}; return table_first_that(locate_int_string, &info, options); } bool Table::locate(const String& column, const String& value, Table::Action_options& options) { return locate(column_name2index(column, true), value, options); } void Table::offset(bool absolute, int offset) { // not +lcount, but "if either operand is unsigned, the other shall be converted to unsigned" C++ rule works here if(size_t lcount=count()) fcurrent=((absolute?0:fcurrent)+offset+lcount)%lcount; } parser-3.5.1/src/main/pa_cache_managers.C0000644000076400007640000000214114712042465015167 00000000000000/** @file Parser: status press center implementation. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_cache_managers.h" volatile const char * IDENT_PA_CACHE_MANAGERS_C="$Id: pa_cache_managers.C,v 1.24 2024/11/04 03:53:25 moko Exp $" IDENT_PA_CACHE_MANAGERS_H; #include "pa_sql_driver_manager.h" #ifdef XML #include "pa_stylesheet_manager.h" #endif // globals Cache_managers* cache_managers=0; Cache_managers::Cache_managers() { put("sql", (SQL_driver_manager=new SQL_Driver_manager)); #ifdef XML put("stylesheet", (stylesheet_manager=new Stylesheet_manager)); #endif } static void delete_one(Cache_managers::key_type /*akey*/, Cache_managers::value_type avalue, int) { delete avalue; } Cache_managers::~Cache_managers() { for_each(delete_one, 0); } // methods static void maybe_expire_one(Cache_managers::key_type /*akey*/, Cache_managers::value_type avalue, int) { avalue->maybe_expire_cache(); } void Cache_managers::maybe_expire() { for_each(maybe_expire_one, 0); } parser-3.5.1/src/main/pa_charsets.C0000644000076400007640000000337714714213537014101 00000000000000/** @file Parser: sql driver manager implementation. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_charsets.h" volatile const char * IDENT_PA_CHARSETS_C="$Id: pa_charsets.C,v 1.28 2024/11/10 20:28:15 moko Exp $" IDENT_PA_CHARSETS_H; // defines for globals #define CHARSET_UTF8_NAME "UTF-8" // globals static String charset_utf8_name(CHARSET_UTF8_NAME); Charset pa_UTF8_charset(0, charset_utf8_name, 0/*no file=system*/); Charsets pa_charsets; // methods Charsets::Charsets() { put(pa_UTF8_charset.NAME(), &pa_UTF8_charset); } Charset& Charsets::get(String::Body ANAME) { ANAME=str_upper(ANAME.cstr(), ANAME.length()); if(Charset* result=HashString::get(ANAME)) return *result; else throw Exception(PARSER_RUNTIME, new String(ANAME, String::L_TAINTED), "unknown charset"); } Charset& Charsets::get_direct(const char *ANAME) { if(Charset* result=HashString::get(ANAME)) return *result; else throw Exception(PARSER_RUNTIME, new String(ANAME, String::L_TAINTED), "unknown charset"); } Charset* Charsets::checkBOM(char *&body,size_t &body_size, Charset* enforced_charset){ if((!enforced_charset || enforced_charset->isUTF8()) && (body_size>=3 && strncmp(body, "\xEF\xBB\xBF", 3)==0)){ // skip UTF-8 signature (BOM code) body+=3; body_size-=3; return &pa_UTF8_charset; } return enforced_charset; } void Charsets::load_charset(Request_charsets& charsets, String::Body ANAME, const String& afile_spec) { ANAME=str_upper(ANAME.cstr(), ANAME.length()); //we know that charset? if(HashString::get(ANAME)) return; // don't load it then put(ANAME, new Charset(&charsets, ANAME, &afile_spec)); } parser-3.5.1/src/main/pa_request.C0000644000076400007640000010455714732404263013755 00000000000000/** @file Parser: request class main part. @see compile.C and execute.C. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_sapi.h" #include "pa_common.h" #include "pa_os.h" #include "pa_request.h" #include "pa_wwrapper.h" #include "pa_vclass.h" #include "pa_globals.h" #include "pa_vint.h" #include "pa_vmethod_frame.h" #include "pa_types.h" #include "pa_venv.h" #include "pa_vmath.h" #include "pa_vstatus.h" #include "pa_vrequest.h" #include "pa_vtable.h" #include "pa_vfile.h" #include "pa_dictionary.h" #include "pa_charset.h" #include "pa_charsets.h" #include "pa_cache_managers.h" #include "pa_http.h" #include "pa_vmail.h" #include "pa_vform.h" #include "pa_vcookie.h" #include "pa_vresponse.h" #include "pa_vmemory.h" #include "pa_vconsole.h" #include "pa_vdate.h" #include "pa_varray.h" volatile const char * IDENT_PA_REQUEST_C="$Id: pa_request.C,v 1.432 2024/12/23 18:30:55 moko Exp $" IDENT_PA_REQUEST_H IDENT_PA_REQUEST_CHARSETS_H IDENT_PA_REQUEST_INFO_H IDENT_PA_VCONSOLE_H; // consts #define UNHANDLED_EXCEPTION_METHOD_NAME "unhandled_exception" /// content type of response when no $MAIN:defaults.content-type defined const char* DEFAULT_CONTENT_TYPE="text/html"; const uint LOOP_LIMIT=100000; const uint ARRAY_LIMIT=1000000; const uint EXECUTE_RECURSION_LIMIT=1000; const uint HTTPD_TIMEOUT=4; const size_t FILE_SIZE_LIMIT=512*1024*1024; // defines for globals #define MAIN_METHOD_NAME "main" #define AUTO_METHOD_NAME "auto" #define USE_METHOD_NAME "use" #define AUTOUSE_METHOD_NAME "autouse" #define EXCEPTION_TYPE_PART_NAME "type" #define EXCEPTION_SOURCE_PART_NAME "source" #define EXCEPTION_COMMENT_PART_NAME "comment" #define ORIGIN_KEY "origin" // globals const String main_method_name(MAIN_METHOD_NAME); const String auto_method_name(AUTO_METHOD_NAME); static const String use_method_name(USE_METHOD_NAME); static const String autouse_method_name(AUTOUSE_METHOD_NAME); const String exception_type_part_name(EXCEPTION_TYPE_PART_NAME); const String exception_source_part_name(EXCEPTION_SOURCE_PART_NAME); const String exception_comment_part_name(EXCEPTION_COMMENT_PART_NAME); const String exception_handled_part_name(EXCEPTION_HANDLED_PART_NAME); static const String origin_key(ORIGIN_KEY); int pa_loop_limit=LOOP_LIMIT; int pa_array_limit=ARRAY_LIMIT; int pa_execute_recursion_limit=EXECUTE_RECURSION_LIMIT; int pa_httpd_timeout=HTTPD_TIMEOUT; size_t pa_file_size_limit=FILE_SIZE_LIMIT; // defines for statics #define MIME_TYPES_NAME "MIME-TYPES" #define CLASS_PATH_NAME "CLASS_PATH" #define DOWNLOAD_NAME_UPPER "DOWNLOAD" #define BODY_NAME_UPPER "BODY" // statics static const String main_class_name(MAIN_CLASS_NAME); static const String mime_types_name(MIME_TYPES_NAME); static const String class_path_name(CLASS_PATH_NAME); static const String charsets_name("CHARSETS"); static const String strict_vars_name("STRICT-VARS"); static const String prototype_name("OBJECT-PROTOTYPE"); static const String getter_protected_name("CLASS-GETTER-PROTECTED"); static const String locals_name("LOCALS"); static const String limits_name("LIMITS"); static const String loop_limit_name("max_loop"); static const String array_limit_name("max_array_size"); static const String recursion_limit_name("max_recursion"); static const String file_size_limit_name("max_file_size"); static const String lock_wait_timeout_name("lock_wait_timeout"); static const String httpd_name("HTTPD"); static const String httpd_timeout_name("timeout"); static const String httpd_mode_name("mode"); static const String conf_method_name("conf"); static const String post_process_method_name("postprocess"); static const String response_body_file_name("file"); static const String download_name_upper(DOWNLOAD_NAME_UPPER); static const String body_name_upper(BODY_NAME_UPPER); // more static static const String content_type_name_upper(HTTP_CONTENT_TYPE_UPPER); static const String content_disposition_name_upper(CONTENT_DISPOSITION_UPPER); static const String content_disposition_inline(CONTENT_DISPOSITION_INLINE); static const String content_disposition_attachment(CONTENT_DISPOSITION_ATTACHMENT); const String content_disposition_filename_name(CONTENT_DISPOSITION_FILENAME_NAME); const String content_disposition_filename_name_asterisk("filename*"); // defines #define CHARSET_NAME_UPPER "CHARSET" #define LAST_MODIFIED_NAME_UPPER "LAST-MODIFIED" // op.C VStateless_class& VClassMAIN_create(); // Request::Request(SAPI_Info& asapi_info, Request_info& arequest_info, String::Language adefault_lang): // private anti_endless_execute_recursion(0), // public allow_class_replace(false), method_frame(0), rcontext(0), wcontext(0), flang(adefault_lang), fconnection(0), fin_cycle(0), fskip(SKIP_NOTHING), // public request_info(arequest_info), sapi_info(asapi_info), charsets(pa_UTF8_charset, pa_UTF8_charset, pa_UTF8_charset), // default charsets main_class(VClassMAIN_create()), form(*new VForm(charsets, arequest_info)), mail(*new VMail), response(*new VResponse(arequest_info, charsets)), cookie(*new VCookie(charsets, arequest_info)), console(*new VConsole), // private configure_admin_done(false), // private defaults fdefault_lang(adefault_lang), // private mime types mime_types(0) { pa_register_thread_request(*this); // file_no=0 => unknown file_list+="UNKNOWN"; file_list+="-body of process-"; // pseudo_file_no__process // maybe expire old caches cache_managers->maybe_expire(); /// directly used // MAIN class, operators put_class(&main_class); // classes: // table, file, random, mail, image, ... methoded_array().register_directly_used(*this); /// methodless // env class put_class(new VEnv(asapi_info)); // status class put_class(new VStatus()); // request class put_class(new VRequest(arequest_info, charsets, form, asapi_info)); // cookie class put_class(&cookie); // console class put_class(&console); /// methoded // response class put_class(&response); // form class put_class(&form); // mail class put_class(&mail); // math class put_class(new VMath); // memory class put_class(new VMemory); } Request::~Request() { #ifdef XML // if for some strange reason xml generic errors failed to be reported, free them up if(const char* xml_generic_errors=xmlGenericErrors()) { SAPI::log(sapi_info, "warning: unreported xmlGenericErrors: %s", xml_generic_errors); pa_free((void *)xml_generic_errors); } #endif } Value& Request::get_self() { return method_frame/*always have!*/->self(); } VStateless_class* Request::get_class(const String& name){ VStateless_class* result=classes().get(name); if(!result) if(const Method *method=main_class.get_element_method(autouse_method_name)){ Value *vname=new VString(name); CONSTRUCTOR_FRAME_ACTION(*method, 0 /*no parent*/, main_class, { frame.store_params(&vname, 1); // we don't need the result call(frame); }); result=classes().get(name); } return result; } VStateless_class& Request::get_class_ref(const String& name){ VStateless_class* result=get_class(name); if(!result) throw Exception(PARSER_RUNTIME, &name, "class is undefined"); return *result; } bool Request::add_class(const char* atype, VStateless_class *aclass){ if(!allow_class_replace){ if(!classes().put_dont_replace(atype, aclass)) return true; if(strcmp(atype, VARRAY_TYPE)) return false; } classes().put(atype, aclass); return true; } static void load_charset(HashStringValue::key_type akey, HashStringValue::value_type avalue, Request_charsets* charsets) { pa_charsets.load_charset(*charsets, akey, avalue->as_string()); } #define CONF_OPTION(config, name, code, exception_name) \ if(config) \ if(Value* option=config->get_element(name)) { \ if(option->is_evaluated_expr()) { \ code; \ } else \ throw Exception(PARSER_RUNTIME, 0, "$MAIN:" exception_name, name.cstr()); \ } void Request::configure_admin(VStateless_class& conf_class) { if(configure_admin_done) throw Exception(PARSER_RUNTIME, 0, "parser already configured"); configure_admin_done=true; // charsets must only be specified in method_frame config // so that users would not interfere /* $MAIN:CHARSETS[ $.charsetname1[/full/path/to/charset/file.cfg] ... ] */ if(Value* vcharsets=conf_class.get_element(charsets_name)) { if(!vcharsets->is_string()) { if(HashStringValue* charsets=vcharsets->get_hash()) charsets->for_each(load_charset, &this->charsets); else throw Exception(PARSER_RUNTIME, 0, "$MAIN:%s must be hash", charsets_name.cstr()); } } #ifdef STRICT_VARS VVoid::strict_vars=false; if(Value* strict_vars=conf_class.get_element(strict_vars_name)) { if(strict_vars->is_bool()) VVoid::strict_vars=strict_vars->as_bool(); else throw Exception(PARSER_RUNTIME, 0, "$MAIN:%s must be bool", strict_vars_name.cstr()); } #endif #ifdef OBJECT_PROTOTYPE VClass::prototype=true; if(Value* prototype=conf_class.get_element(prototype_name)) { if(prototype->is_bool()) VClass::prototype=prototype->as_bool(); else throw Exception(PARSER_RUNTIME, 0, "$MAIN:%s must be bool", prototype_name.cstr()); } #endif #ifdef CLASS_GETTER_UNPROTECTED VClass::getter_protected=true; if(Value* getter_protected=conf_class.get_element(getter_protected_name)) { if(getter_protected->is_bool()) VClass::getter_protected=getter_protected->as_bool(); else throw Exception(PARSER_RUNTIME, 0, "$MAIN:%s must be bool", getter_protected_name.cstr()); } #endif VStateless_class::gall_vars_local=false; if(Value* locals=conf_class.get_element(locals_name)) { if(locals->is_bool()){ VStateless_class::gall_vars_local=locals->as_bool(); main_class.set_all_vars_local(); } else throw Exception(PARSER_RUNTIME, 0, "$MAIN:%s must be bool", locals_name.cstr()); } Value* limits=conf_class.get_element(limits_name); pa_loop_limit=LOOP_LIMIT; CONF_OPTION(limits, loop_limit_name, { pa_loop_limit=option->as_int(); if(pa_loop_limit==0) pa_loop_limit=INT_MAX; }, "LIMITS.%s must be int"); pa_array_limit=ARRAY_LIMIT; CONF_OPTION(limits, array_limit_name, { pa_array_limit=option->as_int(); if(pa_array_limit==0) pa_array_limit=INT_MAX; }, "LIMITS.%s must be int"); pa_execute_recursion_limit=EXECUTE_RECURSION_LIMIT; CONF_OPTION(limits, recursion_limit_name, { pa_execute_recursion_limit=option->as_int(); if(pa_execute_recursion_limit==0) pa_execute_recursion_limit=INT_MAX; }, "LIMITS.%s must be int"); pa_file_size_limit=FILE_SIZE_LIMIT; CONF_OPTION(limits, file_size_limit_name, { double limit=option->as_double(); if(limit >= (double)SSIZE_MAX) throw Exception(PARSER_RUNTIME, 0, "$MAIN:LIMITS.%s must be less than %.15g", file_size_limit_name.cstr(), (double)SSIZE_MAX); pa_file_size_limit=(size_t)limit; if(pa_file_size_limit==0) pa_file_size_limit=SSIZE_MAX; }, "LIMITS.%s must be number"); pa_lock_attempts=PA_LOCK_ATTEMPTS; CONF_OPTION(limits, lock_wait_timeout_name, { double limit=option->as_double(); if(limit >= 3600*24) throw Exception(PARSER_RUNTIME, 0, "$MAIN:LIMITS.%s must be less than %d", lock_wait_timeout_name.cstr(), 3600*24); pa_lock_attempts=(unsigned int)(limit*2)+1; }, "LIMITS.%s must be number"); Value* httpd=conf_class.get_element(httpd_name); pa_httpd_timeout=HTTPD_TIMEOUT; CONF_OPTION(httpd, httpd_timeout_name, { pa_httpd_timeout=option->as_int(); if(pa_httpd_timeout==0) pa_httpd_timeout=INT_MAX; }, "HTTPD.%s must be int"); if(httpd) if(Value* option=httpd->get_element( httpd_mode_name)) { if(option->get_junction()) throw Exception(PARSER_RUNTIME, 0, "$MAIN:HTTPD:mode must be string"); HTTPD_Server::set_mode(option->as_string()); } // configure method_frame options // until someone with less privileges have overriden them methoded_array().configure_admin(*this); } const char* Request::get_exception_cstr(const Exception& e, Request::Exception_details& details) { #define PA_URI_FORMAT "%s: " #define PA_COMMENT_TYPE_FORMAT "%s [%s]" #define PA_ORIGIN_FILE_POS_FORMAT "%s(%d:%d): " #define PA_SOURCE_FORMAT "'%s' " #define PA_ORIGIN_FILE_POS_VALUE file_list[details.origin.file_no].cstr(), 1+details.origin.line, 1+details.origin.col, #define PA_SOURCE_VALUE details.problem_source->cstr(), #define EXCEPTION_CSTR(f1,v1,f2,v2) \ snprintf(result, MAX_STRING, \ PA_URI_FORMAT \ f1 f2 \ PA_COMMENT_TYPE_FORMAT, \ request_info.uri, \ v1 v2 \ e.comment(), e.type() \ ); char* result=new(PointerFreeGC) char[MAX_STRING]; if(details.problem_source) { // do we know the guy? if(details.origin.file_no) // do whe know where he came from? EXCEPTION_CSTR(PA_ORIGIN_FILE_POS_FORMAT, PA_ORIGIN_FILE_POS_VALUE, PA_SOURCE_FORMAT, PA_SOURCE_VALUE) else EXCEPTION_CSTR(PA_SOURCE_FORMAT, PA_SOURCE_VALUE,,) } else { if(details.origin.file_no) // do whe know where he came from? EXCEPTION_CSTR(PA_ORIGIN_FILE_POS_FORMAT, PA_ORIGIN_FILE_POS_VALUE,,) else EXCEPTION_CSTR(,,,) } return result; } Table &Request::Exception_trace::table(Request &r){ // $stack[^table::create{name file lineno colno}] Table::columns_type stack_trace_columns(new ArrayString); *stack_trace_columns+=new String("name"); *stack_trace_columns+=new String("file"); *stack_trace_columns+=new String("lineno"); *stack_trace_columns+=new String("colno"); Table& stack_trace=*new Table(stack_trace_columns); if(!is_empty()/*signed!*/) for(size_t i=bottom_index(); iget_table()) mime_types=table; } /** load MAIN class, execute @main. MAIN class consists of all the auto.p files we'd manage to find plus the file user requested us to process all located classes become children of one another, composing class we name 'MAIN' @test log stack trace */ void Request::core(const char* config_filespec, bool header_only, const String &amain_method_name, const String* amain_class_name) { try { // loading config if(config_filespec) use_file_directly(*new String(config_filespec)); // filling mail received mail.fill_received(*this); try { // compile requested file if(request_info.path_translated) use_file_directly(*new String(request_info.path_translated, String::L_TAINTED), true, true /* load auto.p files */); configure(); } catch(...) { configure(); // configure anyway, useful in @unhandled_exception [say, if they would want to mail by SMTP something] rethrow; } VStateless_class& main = amain_class_name ? get_class_ref(*amain_class_name) : main_class; // execute @main[] const String* body_string=amain_method_name.is_empty() ? &String::Empty : execute_method(main, amain_method_name); if(!body_string) throw Exception(PARSER_RUNTIME, &amain_method_name, "method not found in class %s", main.type()); // extract response body Value* body_value=response.fields().get(download_name_upper); // $response:download? bool as_attachment=body_value!=0; if(!body_value) body_value=response.fields().get(body_name_upper); // $response:body if(!body_value) body_value=new VString(*body_string); // just result of ^main[] // @postprocess if(const Method *method=main_class.get_method(post_process_method_name)) { METHOD_FRAME_ACTION(*method, 0 /*no parent*/, main_class, { frame.store_params(&body_value, 1); call(frame); body_value=&frame.result(); }); } // can throw exceptions while handling $response:download[] output_result(body_value->as_vfile(flang, &charsets), header_only, as_attachment); } catch(const Exception& e) { // request handling problem // we're returning not result, but error explanation Request::Exception_details details=get_details(e); const char* exception_cstr=get_exception_cstr(e, details); // reset language to default flang=fdefault_lang; // reset response response.fields().clear(); SAPI::clear_headers(sapi_info); // this is what we'd return in $response:body const String* body_string=0; try { // maybe we'd be lucky enough as to report an error in a gracefull way... if(const Method *method=main_class.get_method(*new String(UNHANDLED_EXCEPTION_METHOD_NAME))) { // preparing parameters to @unhandled_exception[exception;stack] Table& stack_trace=exception_trace.table(*this); exception_trace.clear(); // forget all about previous life, in case there would be error inside of this method, error handled would not be mislead by old stack contents (see extract_origin) Value *params[]={&details.vhash, new VTable(&stack_trace)}; METHOD_FRAME_ACTION(*method, 0 /*no caller*/, main_class, { frame.store_params(params, 2); call(frame); body_string=&frame.result().as_string(); }); } // conditionally log it Value* vhandled=details.vhash.hash().get(exception_handled_part_name); if(!vhandled || !vhandled->as_bool()) { SAPI::log(sapi_info, "%s", exception_cstr); } } catch(const Exception& e) { // exception in @unhandled_exception Request::Exception_details details=get_details(e); // logging both initial and new exceptions SAPI::log(sapi_info, "%s", exception_cstr); SAPI::log(sapi_info, "Exception in @unhandled_exception at %s", get_exception_cstr(e, details)); SAPI::send_error(sapi_info, "Exception in @unhandled_exception, details are available in Parser error log."); return; } if(body_string) { // could report an error beautifully? VString body_vstring(*body_string); output_result(body_vstring.as_vfile(flang, &charsets), header_only, false); } else { // doing that ugly SAPI::send_error(sapi_info, exception_cstr, strcmp(e.type(), "file.missing") ? "500" : "404"); } } } uint Request::register_file(String::Body file_spec) { file_list+=file_spec; return file_list.count()-1; } void Request::use_file_directly(const String& file_spec, bool fail_on_file_absence, bool with_auto_p) { // cyclic dependence check if(used_files.get(file_spec)) return; used_files.put(file_spec, true); if(!fail_on_file_absence && !entry_exists(file_spec)) // ignore file absence if asked for return; if(with_auto_p) { // loading auto.p files from document_root/.. // to the one beside requested file. // all assigned bases from upper dir const char* target=file_spec.cstr(); // all relative paths are calculated from main document request_info.path_translated=target; const char* after=target; size_t drlen=strlen(request_info.document_root); if(memcmp(after, request_info.document_root, drlen)==0) { after+=drlen; if(after[-1]=='/') --after; } while(const char* before=strchr(after, '/')) { String& sfile_spec=*new String; if(after!=target) { sfile_spec.append_strdup(target, before-target, String::L_CLEAN); sfile_spec << "/" AUTO_FILE_NAME; use_file_directly(sfile_spec, false /*ignore absence, sole user*/); } for(after=before+1;*after=='/';after++); } } if(const char* source=file_read_text(charsets, file_spec, true)) use_buf(main_class, source, 0, register_file(file_spec)); } void Request::use_file(const String& file_name, const String* use_filespec/*absolute*/, bool with_auto_p) { if(file_name.is_empty()) throw Exception(PARSER_RUNTIME, 0, "usage failed - no filename was specified"); const String* filespec=0; if(file_name.first_char()=='/') //absolute path? [no need to scan MAIN:CLASS_PATH] filespec=&full_disk_path(file_name); else if(use_filespec){ // search in current dir first size_t last_slash_pos=use_filespec->strrpbrk("/"); if(last_slash_pos!=STRING_NOT_FOUND) filespec=file_exist(use_filespec->mid(0, last_slash_pos), file_name); // found in current dir? } if(!filespec){ // prevent multiple scan CLASS_PATH for searching one file if(searched_along_class_path.get(file_name)) return; searched_along_class_path.put(file_name, true); if(Value* element=main_class.get_element(class_path_name)) { if(element->is_string()) { filespec=file_exist(full_disk_path(element->as_string()), file_name); // found at class_path? } else if(Table *table=element->get_table()) { for(size_t i=table->count(); i--; ) { const String& path=*(*table->get(i))[0]; if(filespec=file_exist(full_disk_path(path), file_name)) break; // found along class_path } } else throw Exception(PARSER_RUNTIME, 0, "$" CLASS_PATH_NAME " must be string or table"); if(!filespec) throw Exception(PARSER_RUNTIME, &file_name, "not found along $MAIN:" CLASS_PATH_NAME); } else throw Exception(PARSER_RUNTIME, &file_name, "usage failed - no $MAIN:" CLASS_PATH_NAME " were specified"); } use_file_directly(*filespec, true, with_auto_p); } void Request::use_file(const String& file_name, const String* use_filespec/*absolute*/, Operation::Origin origin) { static String use("USE"); try { static VHash* voptions=new VHash(); if(const Method *method=main_class.get_method(use_method_name)){ Value *params[]={new VString(file_name), voptions}; voptions->hash().put(origin_key, new VString(*use_filespec)); CONSTRUCTOR_FRAME_ACTION(*method, 0 /*no parent*/, main_class, { frame.store_params(params, 2); // we don't need the result call(frame); }); } } catch (...) { exception_trace.push(Trace(&use, origin)); rethrow; } } void Request::use_buf(VStateless_class& aclass, const char* source, const String* main_alias, uint file_no, int line_no_offset) { // temporary zero @conf to avoid it second execution Temp_method temp_method_conf(aclass, conf_method_name, 0); // temporary zero @auto to avoid it second execution Temp_method temp_method_auto(aclass, auto_method_name, 0); // compile loaded classes ArrayClass& cclasses=compile(&aclass, source, main_alias, file_no, line_no_offset); VString* vfilespec= new VString(*new String(file_list[file_no], String::L_TAINTED)); for(size_t i=0; iname*/); // locate and execute possible @auto[] static execute_auto_method_if_exists(cclass, auto_method_name, vfilespec); cclass.enable_default_setter(); } } const String& Request::relative(const char* apath, const String& relative_name) { char *hpath=pa_strdup(apath); String& result=*new String; if(rsplit(hpath, '/')) // if something/splitted result << hpath << "/"; result << relative_name; return result; } const String& Request::full_disk_path(const String& relative_name) { if(relative_name.first_char()=='/') { String& result=*new String(pa_strdup(request_info.document_root)); result << relative_name; return result; } if(relative_name.starts_with("http://") || relative_name.starts_with("parser://") #ifdef WIN32 || relative_name.pos(":")==1 // DRIVE: || relative_name.starts_with("\\\\") // UNC1 || relative_name.starts_with("//") // UNC2 #endif ) return relative_name; return relative(request_info.path_translated ? request_info.path_translated : request_info.document_root, relative_name); } #ifndef DOXYGEN class Add_header_attribute_info { public: Add_header_attribute_info(Request& ar) : r(ar), add_last_modified(true) {} Request& r; bool add_last_modified; }; #endif static void add_header_attribute(HashStringValue::key_type name, HashStringValue::value_type value, Add_header_attribute_info* info) { if(name==BODY_NAME_UPPER || name==DOWNLOAD_NAME_UPPER || name==CHARSET_NAME_UPPER) return; if(name==LAST_MODIFIED_NAME_UPPER) info->add_last_modified=false; const char* aname=String(name, String::L_URI).untaint_and_transcode_cstr(String::L_URI, &info->r.charsets); SAPI::add_header_attribute(info->r.sapi_info, aname, attributed_meaning_to_string(*value, String::L_URI, false).untaint_and_transcode_cstr(String::L_URI, &info->r.charsets) ); } static void output_sole_piece(Request& r, bool header_only, VFile& body_file, Value* body_file_content_type) { // transcode text body when "text/*" or simple result String::C output(body_file.value_ptr(), body_file.value_size()); if(!body_file_content_type/*vstring.as_vfile*/ || body_file_content_type->as_string().pos("text/")==0) output=Charset::transcode(output, r.charsets.source(), r.charsets.client()); // prepare header: Content-Length SAPI::add_header_attribute(r.sapi_info, HTTP_CONTENT_LENGTH, pa_uitoa(output.length)); // send header SAPI::send_headers(r.sapi_info); // send body if(!header_only) SAPI::send_body(r.sapi_info, output.str, output.length); } #ifndef DOXYGEN struct Range { uint64_t start; uint64_t end; }; #endif #define UNSET ((uint64_t)-1) static void parse_range(const String* s, Array &ar) { const char *p = s->cstr(); if(s->starts_with("bytes=")) p += 6; Range r; while(*p){ r.start = UNSET; r.end = UNSET; while(*p==' ' || *p=='\t') p++; if(*p >= '0' && *p <= '9'){ const char *n=p; while(*p>='0' && *p<='9') p++; r.start = pa_atoul(pa_strdup(n, p-n)); } while(*p==' ' || *p=='\t') p++; if(*p++ != '-') break; while(*p==' ' || *p=='\t') p++; if(*p >= '0' && *p <= '9'){ const char *n=p; while(*p>='0' && *p<='9') p++; r.end = pa_atoul(pa_strdup(n, p-n)); } while(*p==' ' || *p=='\t') p++; if(*p) if(*p++ != ',') break; ar += r; } } struct Send_range_action_info { Request *r; uint64_t offset; uint64_t part_length; }; static void send_range(struct stat& /*finfo*/, int f, const String& /*file_spec*/, void *context){ Send_range_action_info &info = *(Send_range_action_info*)context; SAPI::send_headers(info.r->sapi_info); pa_lseek(f, info.offset, SEEK_SET); char buf[FILE_BUFFER_SIZE]; do{ size_t to_read = info.part_length < FILE_BUFFER_SIZE ? (size_t)info.part_length : FILE_BUFFER_SIZE; size_t to_write = file_block_read(f, buf, to_read); if(to_write == 0) break; size_t size = SAPI::send_body(info.r->sapi_info, buf, to_write); if(size != to_write) break; info.part_length -= to_write; } while (info.part_length); } static void output_pieces(Request& r, bool header_only, const String& filename, uint64_t content_length, Value& date, bool add_last_modified) { SAPI::add_header_attribute(r.sapi_info, "accept-ranges", "bytes"); const char *range = SAPI::Env::get(r.sapi_info, "HTTP_RANGE"); uint64_t offset=0; uint64_t part_length=content_length; if(range && content_length){ Array ar; parse_range(new String(range), ar); int count = ar.count(); if(count == 1){ Range &rg = ar.get_ref(0); if(rg.start == UNSET && rg.end == UNSET) return SAPI::send_error(r.sapi_info, "", "416"); if(rg.start == UNSET && rg.end != UNSET){ if(rg.end > content_length) rg.end = content_length; rg.start = content_length - rg.end; rg.end = content_length-1; } else if(rg.start != UNSET && rg.end == UNSET){ if(rg.start >= content_length) return SAPI::send_error(r.sapi_info, "", "416"); rg.end = content_length-1; } else { if(rg.start >= content_length || rg.start > rg.end) return SAPI::send_error(r.sapi_info, "", "416"); if(rg.end >= content_length) rg.end = content_length-1; } offset = rg.start; part_length = rg.end-rg.start+1; char buf[MAX_STRING]; snprintf(buf, MAX_STRING, "bytes %.15g-%.15g/%.15g", (double)rg.start, (double)rg.end, (double)content_length); SAPI::add_header_attribute(r.sapi_info, HTTP_STATUS, "206"); SAPI::add_header_attribute(r.sapi_info, "content-range", buf); } else { return SAPI::send_error(r.sapi_info, count ? "Multiple ranges are not supported" : "Invalid range", count ? "501" : "400"); } } SAPI::add_header_attribute(r.sapi_info, HTTP_CONTENT_LENGTH, pa_uitoa(part_length)); if(add_last_modified) SAPI::add_header_attribute(r.sapi_info, "last-modified", attributed_meaning_to_string(date, String::L_AS_IS, true).cstr()); if(header_only){ SAPI::send_headers(r.sapi_info); } else { Send_range_action_info info = { &r, offset, part_length}; file_read_action_under_lock(r.full_disk_path(filename), "send", send_range, &info); } } void Request::output_result(VFile* body_file, bool header_only, bool as_attachment) { // header: cookies cookie.output_result(sapi_info); // $.file and $.name (when body is real vfile) Value* vfile = body_file->fields().get(response_body_file_name); Value* vname = body_file->fields().get(name_name); const String* sfile = vfile ? &vfile->as_string() : NULL; const String* sname = vname ? &vname->as_string() : NULL; if(sname && *sname == NONAME_DAT) sname = NULL; // Content-Disposition, use $.name[] to avoid const String* disposition_name = sname ? sname->is_empty() ? NULL : sname : sfile; if(disposition_name) { String& filename = *new String(pa_filename(disposition_name->cstr()), String::L_URI); String& filename_asterisk = *new String(charsets.client().NAME(), String::L_CLEAN) << (*new String("''")) << filename; VHash& hash=*new VHash(); hash.hash().put(value_name, new VString(as_attachment ? content_disposition_attachment : content_disposition_inline)); hash.hash().put(content_disposition_filename_name, new VString(filename)); hash.hash().put(content_disposition_filename_name_asterisk, new VString(filename_asterisk)); response.fields().put(content_disposition_name_upper, &hash); } // _file_ content-type might be specified Value* body_file_content_type = body_file->fields().get(content_type_name); if(!body_file_content_type){ const String* scontent_name = sname && !sname->is_empty() ? sname : sfile; if(scontent_name) body_file_content_type = new VString(mime_type_of(scontent_name->cstr())); } // set Content-Type if(body_file_content_type) { // body file content type response.fields().put(content_type_name_upper, body_file_content_type); } else { // default content type response.fields().put_dont_replace(content_type_name_upper, new VString(*new String(DEFAULT_CONTENT_TYPE))); } // prepare header: $response:fields without :body, :download and :charset Add_header_attribute_info info(*this); response.fields().for_each(add_header_attribute, &info); if(sfile) { // $response:[download|body][$.file[filespec]] -- optput specified file uint64_t content_length=0; time_t atime=0, mtime=0, ctime=0; file_stat(full_disk_path(*sfile), content_length, atime, mtime, ctime); VDate* vdate=0; if(Value* v=body_file->fields().get("mdate")) { vdate=dynamic_cast(v); if(!vdate) throw Exception(PARSER_RUNTIME, 0, "mdate must be a date"); } if(!vdate) vdate=new VDate((pa_time_t)mtime); output_pieces(*this, header_only, *sfile, content_length, *vdate, info.add_last_modified); } else { if(body_file_content_type) if(HashStringValue *hash=body_file_content_type->get_hash()) body_file_content_type=hash->get(value_name); output_sole_piece(*this, header_only, *body_file, body_file_content_type); } } const String& Request::mime_type_of(const String* file_name) { return mime_type_of(file_name?file_name->taint_cstr(String::L_FILE_SPEC):0); } const String& Request::mime_type_of(const char* user_file_name_cstr) { if(mime_types) if(const char* cext=strrchr(user_file_name_cstr, '.')) { String sext(++cext); Table::Action_options options; if(mime_types->locate(0, sext.change_case(charsets.source(), String::CC_LOWER), options)) { if(const String* result=mime_types->item(1)) return *result; else throw Exception(PARSER_RUNTIME, 0, MIME_TYPES_NAME " table column elements must not be empty"); } } return *new String("application/octet-stream"); } const String* Request::get_used_filespec(uint file_no){ if(file_no < file_list.count()) return new String(file_list[file_no], String::L_TAINTED); return 0; } #ifdef XML xmlChar* Request::transcode(const String& s) { return charsets.source().transcode(s); } xmlChar* Request::transcode(const String::Body s) { return charsets.source().transcode(s); } const String& Request::transcode(const xmlChar* s) { return charsets.source().transcode(s); } #endif Request::Exception_details Request::get_details(const Exception& e) { const String* problem_source=e.problem_source(); VHash& vhash=*new VHash; HashStringValue& hash=vhash.hash(); Operation::Origin origin={0, 0, 0}; if(!exception_trace.is_empty()) { Trace bottom=exception_trace.bottom_value(); origin=bottom.origin(); if(!problem_source) { // we don't know who trigged the bug problem_source=bottom.name(); // we usually know source of next-from-throw-point exception did that exception_trace.set_bottom_index(exception_trace.bottom_index()+1); } else if (bottom.name()==problem_source) { // it is that same guy? exception_trace.set_bottom_index(exception_trace.bottom_index()+1); // throw away that trace } else { // stack top contains not us, leaving intact to help ^throw } } // $.type if(const char* type=e.type(true)) hash.put(exception_type_part_name, new VString(*new String(type))); // $.source if(problem_source) hash.put(exception_source_part_name, new VString(*new String(*problem_source, String::L_TAINTED))); // $.file $.lineno $.colno if(origin.file_no){ hash.put("file", new VString(*new String(file_list[origin.file_no], String::L_TAINTED))); hash.put("lineno", new VInt(1+origin.line)); hash.put("colno", new VInt(1+origin.col)); } // $.comment if(const char* comment=e.comment(true)) hash.put(exception_comment_part_name, new VString(*new String(comment, String::L_TAINTED))); // $.handled(0) hash.put(exception_handled_part_name, &VBool::get(false)); return Request::Exception_details(origin, problem_source, vhash); } Temp_value_element::Temp_value_element(Request& arequest, Value& awhere, const String& aname, Value* awhat) : frequest(arequest), fwhere(awhere), fname(aname), saved(awhere.get_element(aname)) { Junction* junction; if(saved && (junction=saved->get_junction()) && junction->is_getter) saved=0; frequest.put_element(fwhere, aname, awhat); } Temp_value_element::~Temp_value_element() { frequest.put_element(fwhere, fname, saved ? saved : VVoid::get()); } parser-3.5.1/src/main/pa_threads.C0000644000076400007640000000211514712042465013702 00000000000000/** @file Parser: simple Mutex realization class. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_threads.h" volatile const char * IDENT_PA_THREADS_C="$Id: pa_threads.C,v 1.10 2024/11/04 03:53:25 moko Exp $" IDENT_PA_THREADS_H; Mutex global_mutex; #ifdef _MSC_VER uint pa_get_thread_id() { return GetCurrentThreadId(); } Mutex::Mutex() : handle(CreateMutex(NULL, FALSE, 0)) { } Mutex::~Mutex() { CloseHandle(handle); } void Mutex::acquire() { WaitForSingleObject(handle, INFINITE); } void Mutex::release() { ReleaseMutex(handle); } #else #include #ifdef HAVE_GETTID #include #endif uint pa_get_thread_id() { #ifdef HAVE_GETTID return syscall(__NR_gettid); #else return getpid(); #endif } Mutex::Mutex() { pthread_mutex_init(&handle, NULL); } Mutex::~Mutex() { pthread_mutex_destroy(&handle); } void Mutex::acquire() { pthread_mutex_lock(&handle); } void Mutex::release() { pthread_mutex_unlock(&handle); } #endif parser-3.5.1/src/main/compile_tools.C0000644000076400007640000001046314712042465014445 00000000000000/** @file Parser: compiler support helper functions. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "compile_tools.h" #include "pa_string.h" #include "pa_array.h" #include "pa_exception.h" #include "pa_vstring.h" #include "pa_vdouble.h" #include "pa_vmethod_frame.h" volatile const char * IDENT_COMPILE_TOOLS_C="$Id: compile_tools.C,v 1.83 2024/11/04 03:53:25 moko Exp $" IDENT_COMPILE_TOOLS_H; Value* LA2V(ArrayOperation& literal_string_array, int offset, OP::OPCODE code) { return literal_string_array[offset+0].code==code?literal_string_array[offset+2/*skip opcode&origin*/].value :0; } void maybe_change_string_literal_to_double_literal(ArrayOperation& literal_array) { assert(literal_array[0].code==OP::OP_VALUE); VString& vstring=*static_cast(literal_array[2/*opcode+origin*/].value); if(isdigit(vstring.string().first_char())) literal_array.put(2/*opcode+origin*/, &vstring.as_expr_result()); } void change_string_literal_value(ArrayOperation& literal_string_array, const String& new_value) { assert(literal_string_array[0].code==OP::OP_VALUE); static_cast(literal_string_array[2/*opcode+origin*/].value)->set_string(new_value); } bool change_first(ArrayOperation& opcodes, OP::OPCODE find, OP::OPCODE replace) { Operation& op=opcodes.get_ref(0); if(op.code!=find) return false; op.code=replace; return true; } // OP_VALUE+origin+self+OP_GET_ELEMENT+OP_VALUE+origin+value+OP_GET_ELEMENT => OP_WITH_SELF__VALUE__GET_ELEMENT+origin+value bool maybe_make_self(ArrayOperation& opcodes, ArrayOperation& diving_code, size_t diving_count){ const String* first_name=LA2S(diving_code); if(first_name && SYMBOLS_EQ(*first_name,SELF_SYMBOL)){ #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT if( diving_count>=8 && diving_code[3].code==OP::OP_GET_ELEMENT && diving_code[4].code==OP::OP_VALUE && diving_code[7].code==OP::OP_GET_ELEMENT ){ // optimization for $self.field and ^self.method O(opcodes, OP::OP_WITH_SELF__VALUE__GET_ELEMENT); P(opcodes, diving_code, 5 /*offset*/, 2 /*limit*/); // copy second origin+value. we know that the first one is "self" if(diving_count>8) P(opcodes, diving_code, 8 /*offset*/); // copy tail } else #endif { // self.xxx... => xxx... // OP_VALUE+origin+string+OP_GET_ELEMENT+... -> OP_WITH_SELF+... O(opcodes, OP::OP_WITH_SELF); /* stack: starting context */ P(opcodes, diving_code, diving_count >=4 ? 4 /*OP::OP_VALUE+origin+string+OP::OP_GET_ELEMENTx*/ : 3 /*OP::OP_+origin+string*/); } return true; } return false; } #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL bool maybe_append_simple_diving_code(ArrayOperation& code, ArrayOperation& diving_code){ if( diving_code.count()==3 && diving_code[0].code==OP::OP_STRING__WRITE ){ O(code, OP::OP_VALUE); P(code, diving_code, 1/*offset*/, 2/*limit*/); /*copy origin+value*/ return true; } else { return false; } } bool is_special_element(ArrayOperation& opcodes){ const String* name=LA2S(opcodes); return name && ( SYMBOLS_EQ(*name,CLASS_SYMBOL) || SYMBOLS_EQ(*name,CLASS_NAME_SYMBOL) ); } #endif Method::Call_type GetMethodCallType(Parse_control& pc, ArrayOperation& literal_array) { const String* full_name=LA2S(literal_array); int pos=full_name->pos(':'); if(pos > 0) { const String call_type=full_name->mid(0, pos); if(call_type!=Symbols::STATIC_SYMBOL) throw Exception("parser.compile", &call_type, "incorrect method call type. the only valid call type method prefix is 'static'"); const String *sole_name=&full_name->mid(pos+1, full_name->length()); // replace full method name (static:method) by sole method name (method). it will be used later. change_string_literal_value(literal_array, *sole_name); return Method::CT_STATIC; } return pc.get_methods_call_type(); } void push_LS(Parse_control& pc, lexical_state new_state) { if(pc.ls_sp=0) pc.ls=pc.ls_stack[pc.ls_sp]; else throw Exception(0, 0, "pop_LS: ls_stack underflow"); } const String& Parse_control::alias_method(const String& name) { return (main_alias && name==main_method_name)?*main_alias:name; } parser-3.5.1/src/main/pa_charset.C0000644000076400007640000011142614726405317013713 00000000000000/** @file Parser: Charset connection implementation. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_charset.h" #include "pa_charsets.h" // we are using some pcre_internal.h stuff as well #include "../lib/pcre/pa_pcre_internal.h" volatile const char * IDENT_PA_CHARSET_C="$Id: pa_charset.C,v 1.115 2024/12/11 21:57:35 moko Exp $" IDENT_PA_CHARSET_H; #ifdef XML #include "libxml/xmlmemory.h" #include "libxml/encoding.h" #endif //#define PA_PATCHED_LIBXML_BACKWARD // reduce memory usage by pre-calculation utf-8 string length #define PRECALCULATE_DEST_LENGTH // globals Charset::UTF8CaseTable::Rec UTF8CaseToUpperRecords[]={ #include "utf8-to-upper.inc" }; Charset::UTF8CaseTable UTF8CaseToUpper={ sizeof(UTF8CaseToUpperRecords)/sizeof(Charset::UTF8CaseTable::Rec), UTF8CaseToUpperRecords}; Charset::UTF8CaseTable::Rec UTF8CaseToLowerRecords[]={ #include "utf8-to-lower.inc" }; Charset::UTF8CaseTable UTF8CaseToLower={ sizeof(UTF8CaseToLowerRecords)/sizeof(Charset::UTF8CaseTable::Rec), UTF8CaseToLowerRecords}; // helpers inline void prepare_case_tables(unsigned char *tables) { unsigned char *lcc_table=tables+lcc_offset; unsigned char *fcc_table=tables+fcc_offset; for(int i=0; i<0x100; i++) lcc_table[i]=fcc_table[i]=(unsigned char)i; } inline void cstr2ctypes(unsigned char *tables, const unsigned char *cstr, unsigned char bit) { unsigned char *ctypes_table=tables+ctypes_offset; ctypes_table[0]=bit; for(; *cstr; cstr++) { unsigned char c=*cstr; ctypes_table[c]|=bit; } } inline unsigned int to_wchar_code(const char* cstr) { if(!cstr || !*cstr) return 0; if(cstr[1]==0) return(unsigned int)(unsigned char)cstr[0]; return pa_atoui(cstr,0); } inline bool to_bool(const char* cstr) { return cstr && *cstr!=0; } static void element2ctypes(unsigned char c, bool belongs, unsigned char *tables, unsigned char bit, int group_offset=-1) { if(!belongs) return; unsigned char *ctypes_table=tables+ctypes_offset; ctypes_table[c]|=bit; if(group_offset>=0) tables[cbits_offset+group_offset+c/8] |= 1<<(c%8); } static void element2case(unsigned char from, unsigned char to, unsigned char *tables) { if(!to) return; unsigned char *lcc_table=tables+lcc_offset; unsigned char *fcc_table=tables+fcc_offset; lcc_table[from]=to; fcc_table[from]=to; fcc_table[to]=from; } inline XMLByte *append_hex_8(XMLByte *dest, unsigned char c, const char* prefix=0) { if(prefix) { strcpy((char *)dest, prefix); dest+=strlen(prefix); } *dest++=hex_digits[c >> 4]; *dest++=hex_digits[c & 0x0F]; return dest; } inline XMLByte *append_hex_16(XMLByte *dest, unsigned int c, const char* prefix=0) { if(prefix) { strcpy((char *)dest, prefix); dest+=strlen(prefix); } *dest++=hex_digits[(c >> 12) & 0x0F]; *dest++=hex_digits[(c >> 8) & 0x0F]; *dest++=hex_digits[(c >> 4) & 0x0F]; *dest++=hex_digits[(c) & 0x0F]; return dest; } // methods Charset::Charset(Request_charsets* acharsets, const String::Body ANAME, const String* afile_spec): FNAME(ANAME), FNAME_CSTR(ANAME.cstrm()) { if(afile_spec) { fisUTF8=false; load_definition(*acharsets, *afile_spec); #ifdef XML addEncoding(FNAME_CSTR); #endif } else { fisUTF8=true; // grab default onces [for UTF-8 so to be able to make a-z =>A-Z memcpy(pcre_tables, pa_pcre_default_tables, sizeof(pcre_tables)); } #ifdef XML initTranscoder(FNAME, FNAME_CSTR); #endif } void Charset::load_definition(Request_charsets& acharsets, const String& afile_spec) { // pcre_tables // lowcase, flipcase, bits digit+word+whitespace, masks // must not move this inside of prepare_case_tables // don't know the size there memset(pcre_tables, 0, sizeof(pcre_tables)); prepare_case_tables(pcre_tables); cstr2ctypes(pcre_tables,(const unsigned char *)"*+?{^.$|()[", ctype_meta); // charset memset(&tables, 0, sizeof(tables)); // loading text char *data=file_read_text(acharsets, afile_spec); // ignore header getrow(&data); // parse cells char *row; while((row=getrow(&data))) { // remove empty&comment lines if(!*row || *row=='#') continue; // char white-space digit hex-digit letter word lowercase unicode1 unicode2 unsigned char c=0; char *cell; for(int column=0; (cell=lsplit(&row, '\t')); column++) { switch(column) { case 0: c=(unsigned char)to_wchar_code(cell); break; // pcre_tables case 1: element2ctypes(c, to_bool(cell), pcre_tables, ctype_space, cbit_space); break; case 2: element2ctypes(c, to_bool(cell), pcre_tables, ctype_digit, cbit_digit); break; case 3: element2ctypes(c, to_bool(cell), pcre_tables, ctype_xdigit); break; case 4: element2ctypes(c, to_bool(cell), pcre_tables, ctype_letter); break; case 5: element2ctypes(c, to_bool(cell), pcre_tables, ctype_word, cbit_word); break; case 6: element2case(c, (unsigned char)to_wchar_code(cell), pcre_tables); break; case 7: case 8: // charset if(tables.toTableSize>MAX_CHARSET_UNI_CODES) throw Exception(PARSER_RUNTIME, &afile_spec, "charset must contain not more than %d unicode values", MAX_CHARSET_UNI_CODES); XMLCh unicode=(XMLCh)to_wchar_code(cell); if(!unicode && column==7/*unicode1 column*/) unicode=(XMLCh)c; if(unicode) { if(!tables.fromTable[c]) tables.fromTable[c]=unicode; tables.toTable[tables.toTableSize].intCh=unicode; tables.toTable[tables.toTableSize].extCh=(XMLByte)c; tables.toTableSize++; } break; } } }; // parser charset tables declare only white-space before 0x20, thus adding the missing chars for(uint i=0; i<0x20; i++) if(!tables.fromTable[i]){ tables.fromTable[i]=i; tables.toTable[tables.toTableSize].intCh=i; tables.toTable[tables.toTableSize].extCh=(XMLByte)i; tables.toTableSize++; } // sort by the Unicode code point sort_ToTable(); } static int sort_cmp_Trans_rec_intCh(const void *a, const void *b) { return static_cast(a)->intCh- static_cast(b)->intCh; } void Charset::sort_ToTable() { qsort(tables.toTable, tables.toTableSize, sizeof(*tables.toTable), sort_cmp_Trans_rec_intCh); } // @todo: precache for spedup searching static XMLByte xlatOneTo(const XMLCh toXlat, const Charset::Tables& tables, XMLByte not_found) { int lo = 0; int hi = tables.toTableSize - 1; while(lo<=hi) { // Calc the mid point of the low and high offset. const unsigned int i = (lo + hi) / 2; XMLCh cur=tables.toTable[i].intCh; if(toXlat==cur) return tables.toTable[i].extCh; if(toXlat>cur) lo = i+1; else hi = i-1; } return not_found; } String::C Charset::transcode(const String::C src, const Charset& source_charset, const Charset& dest_charset) { if(!src.length) return String::C("", 0); switch((source_charset.isUTF8()?0x10:0x00)|(dest_charset.isUTF8()?0x01:0x00)) { default: // 0x00 return source_charset.transcodeToCharset(src, dest_charset); case 0x01: return source_charset.transcodeToUTF8(src); case 0x10: return dest_charset.transcodeFromUTF8(src); case 0x11: return src; } } // --------------------------------------------------------------------------- // Local static data // // gUTFBytes // A list of counts of trailing bytes for each initial byte in the input. // // gUTFOffsets // A list of values to offset each result char type, according to how // many source bytes when into making it. // // gFirstByteMark // A list of values to mask onto the first byte of an encoded sequence, // indexed by the number of bytes used to create the sequence. // --------------------------------------------------------------------------- static const XMLByte gUTFBytes[0x100] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 , 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5 }; static const uint gUTFOffsets[6] = { 0, 0x3080, 0xE2080, 0x3C82080, 0xFA082080, 0x82082080 }; static const XMLByte gFirstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; static int transcodeToUTF8(const XMLByte* srcData, int& srcLen, XMLByte *toFill, int& toFillLen, const Charset::Tables& tables) { const XMLByte* srcPtr=srcData; const XMLByte* srcEnd=srcData+srcLen; XMLByte* outPtr=toFill; XMLByte* outEnd=toFill+toFillLen; while(srcPtr outEnd) break; // We can do it, so update the source index srcPtr++; // And spit out the bytes. We spit them out in reverse order // here, so bump up the output pointer and work down as we go. outPtr+= encodedBytes; switch(encodedBytes) { case 6: *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal>>= 6; case 5: *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal>>= 6; case 4: *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal>>= 6; case 3: *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal>>= 6; case 2: *--outPtr = XMLByte((curVal | 0x80UL) & 0xBFUL); curVal>>= 6; case 1: *--outPtr = XMLByte(curVal | gFirstByteMark[encodedBytes]); } // Add the encoded bytes back in again to indicate we've eaten them outPtr+= encodedBytes; } // Update the bytes eaten srcLen = srcPtr - srcData; // Return the characters read toFillLen = outPtr - toFill; //return srcPtr==srcEnd?(int)toFillLen:-1; /* xmlCharEncodingInputFunc Returns : the number of byte written, or -1 by lack of space, or -2 if the transcoding failed. The value of inlen after return is the number of octets consumed as the return value is positive, else unpredictiable. The value of outlen after return is the number of ocetes consumed. */ return 0; } /// @todo digital entites only when xml/html output [at output in html/xml mode, in html part of a letter] static int transcodeFromUTF8(const XMLByte* srcData, int& srcLen, XMLByte* toFill, int& toFillLen, const Charset::Tables& tables) { const XMLByte* srcPtr=srcData; const XMLByte* srcEnd=srcData+srcLen; XMLByte* outPtr=toFill; XMLByte* outEnd=toFill+toFillLen; // We now loop until we either run out of input data, or room to store while ((srcPtr < srcEnd) && (outPtr < outEnd)) { // Get the next leading byte out const XMLByte firstByte =* srcPtr; // Special-case ASCII, which is a leading byte value of<= 127 if(firstByte<=127) { *outPtr++= firstByte; srcPtr++; continue; } // See how many trailing src bytes this sequence is going to require const unsigned int trailingBytes = gUTFBytes[firstByte]; // If there are not enough source bytes to do this one, then we // are done. Note that we done>= here because we are implicitly // counting the 1 byte we get no matter what. if(srcPtr+trailingBytes>= srcEnd) break; // Looks ok, so lets build up the value uint tmpVal=0; switch(trailingBytes) { case 5: tmpVal+=*srcPtr++; tmpVal<<=6; case 4: tmpVal+=*srcPtr++; tmpVal<<=6; case 3: tmpVal+=*srcPtr++; tmpVal<<=6; case 2: tmpVal+=*srcPtr++; tmpVal<<=6; case 1: tmpVal+=*srcPtr++; tmpVal<<=6; case 0: tmpVal+=*srcPtr++; break; default: throw Exception(0, 0, "transcodeFromUTF8 error: wrong trailingBytes value(%d)", trailingBytes); // never } tmpVal-=gUTFOffsets[trailingBytes]; // If it will fit into a single char, then put it in. Otherwise // fail [*encode it as a surrogate pair. If its not valid, use the // replacement char.*] if(!(tmpVal & 0xFFFF0000)) { if(XMLByte xlat=xlatOneTo(tmpVal, tables, 0)) *outPtr++=xlat; else { outPtr+=sprintf((char *)outPtr, "&#%u;", tmpVal); // &#decimal; } } else { const XMLByte* recoverPtr=srcPtr-trailingBytes-1; for(uint i=0; i<=trailingBytes; i++) outPtr+=sprintf((char*)outPtr, "%%%02X", *recoverPtr++); } } // Update the bytes eaten srcLen = srcPtr - srcData; // Return the characters read toFillLen = outPtr - toFill; //return srcPtr==srcEnd?(int)toFillLen:-1; /* xmlCharEncodingOutputFunc Returns : the number of byte written, or -1 by lack of space, or -2 if the transcoding failed. The value of inlen after return is the number of octets consumed as the return value is positive, else unpredictiable. The value of outlen after return is the number of ocetes consumed. */ return 0; } static bool need_escape(XMLByte c){ return !( (c<=127) && ( pa_isalnum((unsigned char)c) || strchr("*@-_+./", c)!=0 ) ); } // read one UTF8 char and return length of this char (in bytes) static unsigned int readUTF8Char(const XMLByte*& srcPtr, const XMLByte* srcEnd, XMLByte& firstByte, XMLCh& UTF8Char){ if(!srcPtr || !*srcPtr || srcPtr>=srcEnd) return 0; firstByte=*srcPtr; if(firstByte<=127){ UTF8Char=firstByte; srcPtr++; return 1; } unsigned int trailingBytes=gUTFBytes[firstByte]; if(srcPtr+trailingBytes>=srcEnd){ return 0; // not enough bytes in source string for reading } uint tmpVal=0; switch(trailingBytes){ case 5: tmpVal+=*srcPtr++; tmpVal<<=6; case 4: tmpVal+=*srcPtr++; tmpVal<<=6; case 3: tmpVal+=*srcPtr++; tmpVal<<=6; case 2: tmpVal+=*srcPtr++; tmpVal<<=6; case 1: tmpVal+=*srcPtr++; tmpVal<<=6; case 0: tmpVal+=*srcPtr++; } tmpVal-=gUTFOffsets[trailingBytes]; UTF8Char=tmpVal; return trailingBytes+1; } // skip UTF8 char and return length of this char (in bytes) static unsigned int skipUTF8Char(const XMLByte*& srcPtr, const XMLByte* srcEnd){ if(!srcPtr || !*srcPtr || srcPtr>=srcEnd) return 0; unsigned int trailingBytes=gUTFBytes[*srcPtr]+1; srcPtr+=trailingBytes; return trailingBytes; } // read non-UTF8 char, and return number of bytes needed for storing this char in UTF8 static unsigned int readChar(const XMLByte*& srcPtr, const XMLByte* srcEnd, XMLByte& firstByte, XMLCh& UTF8Char, const Charset::Tables& tables){ if(!srcPtr || !*srcPtr || srcPtr>=srcEnd) return 0; firstByte=*srcPtr++; UTF8Char=tables.fromTable[firstByte]; if(UTF8Char<0x80) return 1; else if(UTF8Char<0x800) return 2; else if(UTF8Char<0x10000) return 3; else if(UTF8Char<0x200000) return 4; else if(UTF8Char<0x4000000) return 5; else if(UTF8Char<= 0x7FFFFFFF) return 6; // will use the replacement character '?' firstByte=0; return 1; } size_t Charset::calc_escaped_length_UTF8(XMLByte* src, size_t src_length){ size_t dest_length=0; for(UTF8_string_iterator i(src, src_length); i.has_next(); ){ if(i.getCharSize()==1) dest_length+=!need_escape(i.getFirstByte())?1/*as-is*/:3/*%XX*/; else dest_length+=6; // %uXXXX } return dest_length; } size_t Charset::calc_escaped_length(const XMLByte* src, size_t src_length, const Charset::Tables& tables){ const XMLByte* src_end=src+src_length; XMLByte first_byte; XMLCh UTF8_char; size_t dest_length=0; while(uint char_size=readChar(src, src_end, first_byte, UTF8_char, tables)){ if(char_size==1) dest_length+=(!first_byte/*replacement char '?'*/ || !need_escape(first_byte))?1:3/*'%XX'*/; else dest_length+=6; // %uXXXX } return dest_length; } size_t Charset::calc_escaped_length(const String::C src, const Charset& source_charset){ if(!src.length) return 0; #ifdef PRECALCULATE_DEST_LENGTH if(source_charset.isUTF8()) return calc_escaped_length_UTF8((XMLByte *)src.str, src.length); else return calc_escaped_length((XMLByte *)src.str, src.length, source_charset.tables); #else return src_length*6; // enough for %uXXXX but too memory-hungry #endif } #define escape_char(dest_ptr, char_size, first_byte, UTF8_char) \ if(char_size==1) \ if(first_byte){ \ if(need_escape(first_byte)) \ dest_ptr=append_hex_8(dest_ptr, first_byte, "%"); /* %XX */ \ else \ *dest_ptr++=first_byte; /*as is*/ \ } else \ *dest_ptr++='?'; /* replacement char '?' */ \ else \ dest_ptr=append_hex_16(dest_ptr, UTF8_char, "%u"); /* %uXXXX */ size_t Charset::escape_UTF8(const XMLByte* src, size_t src_length, XMLByte* dest) { XMLByte* dest_ptr=dest; // loop until we either run out of input data for(UTF8_string_iterator i((XMLByte *)src, src_length); i.has_next(); ) escape_char(dest_ptr, i.getCharSize(), i.getFirstByte(), i.next()) return dest_ptr - dest; } size_t Charset::escape(const XMLByte* src, size_t src_length, XMLByte* dest, const Charset::Tables& tables) { const XMLByte* src_end=src+src_length; XMLByte* dest_ptr=dest; XMLByte first_byte; XMLCh UTF8_char; uint char_size; while(char_size=readChar(src, src_end, first_byte, UTF8_char, tables)) escape_char(dest_ptr, char_size, first_byte, UTF8_char) return dest_ptr - dest; } String::C Charset::escape(const String::C src, const Charset& source_charset){ if(!src.length) return String::C("", 0); size_t dest_calculated_length=calc_escaped_length(src, source_charset); XMLByte *dest_body=new(PointerFreeGC) XMLByte[dest_calculated_length+1/*terminator*/]; size_t dest_length; if(source_charset.isUTF8()) dest_length=escape_UTF8((XMLByte *)src.str, src.length, dest_body); else dest_length=escape((XMLByte *)src.str, src.length, dest_body, source_charset.tables); if(dest_length>dest_calculated_length) throw Exception(0, 0, "Charset::escape buffer overflow"); dest_body[dest_length]=0; // terminator return String::C((char*)dest_body, dest_length); } String::Body Charset::escape(const String::Body src, const Charset& source_charset) { String::C dest=Charset::escape(String::C(src.cstr(), src.length()), source_charset); return String::Body(dest.length ? dest.str:0); } String& Charset::escape(const String& src, const Charset& source_charset) { if(src.is_empty()) return *new String(); return *new String(escape((String::Body)src, source_charset), String::L_CLEAN); } inline bool need_json_escape(unsigned char c){ return strchr("\n\"\\/\t\r\b\f", c)!=0; } size_t Charset::calc_JSON_escaped_length_UTF8(XMLByte* src, size_t src_length){ size_t dest_length=0; for(UTF8_string_iterator i(src, src_length); i.has_next(); ){ if(i.getCharSize()==1){ XMLByte first_byte=i.getFirstByte(); dest_length+=need_json_escape(first_byte) ? 2 : (first_byte < 0x20 && first_byte /* 0 replacement char is '?' */) ? 6 : 1; } else dest_length+=6; // \uXXXX } return dest_length; } size_t Charset::calc_JSON_escaped_length(const XMLByte* src, size_t src_length, const Charset::Tables& tables){ const XMLByte* src_end=src+src_length; XMLByte first_byte; XMLCh UTF8_char; size_t dest_length=0; while(uint char_size=readChar(src, src_end, first_byte, UTF8_char, tables)){ if(char_size==1) dest_length+=need_json_escape(first_byte) ? 2 : (first_byte < 0x20 && first_byte /* 0 replacement char is '?' */) ? 6 : 1; else dest_length+=6; // \uXXXX } return dest_length; } size_t Charset::calc_JSON_escaped_length(const String::C src, const Charset& source_charset){ if(!src.length) return 0; #ifdef PRECALCULATE_DEST_LENGTH if(source_charset.isUTF8()) return calc_JSON_escaped_length_UTF8((XMLByte *)src.str, src.length); else return calc_JSON_escaped_length((XMLByte *)src.str, src.length, source_charset.tables); #else return src_length*6; // enough for \uXXXX but too memory-hungry #endif } #define escape_char_JSON(dest_ptr, char_size, first_byte, UTF8_char) \ if(char_size==1) \ switch(first_byte){ \ case '\n': *dest_ptr++='\\'; *dest_ptr++='n'; break; \ case '"' : *dest_ptr++='\\'; *dest_ptr++='"'; break; \ case '\\': *dest_ptr++='\\'; *dest_ptr++='\\'; break; \ case '/' : *dest_ptr++='\\'; *dest_ptr++='/'; break; \ case '\t': *dest_ptr++='\\'; *dest_ptr++='t'; break; \ case '\r': *dest_ptr++='\\'; *dest_ptr++='r'; break; \ case '\b': *dest_ptr++='\\'; *dest_ptr++='b'; break; \ case '\f': *dest_ptr++='\\'; *dest_ptr++='f'; break; \ case 0 : *dest_ptr++='?'; break; /*replacement char*/ \ default : if(first_byte < 0x20) dest_ptr=append_hex_16(dest_ptr, UTF8_char, "\\u"); \ else *dest_ptr++=first_byte; \ } \ else \ dest_ptr=append_hex_16(dest_ptr, UTF8_char, "\\u"); // \uXXXX size_t Charset::escape_JSON_UTF8(const XMLByte* src, size_t src_length, XMLByte* dest) { XMLByte* dest_ptr=dest; // loop until we either run out of input data for(UTF8_string_iterator i((XMLByte *)src, src_length); i.has_next(); ) escape_char_JSON(dest_ptr, i.getCharSize(), i.getFirstByte(), i.next()) return dest_ptr - dest; } size_t Charset::escape_JSON(const XMLByte* src, size_t src_length, XMLByte* dest, const Charset::Tables& tables) { const XMLByte* src_end=src+src_length; XMLByte* dest_ptr=dest; XMLByte first_byte; XMLCh UTF8_char; uint char_size; while(char_size=readChar(src, src_end, first_byte, UTF8_char, tables)) escape_char_JSON(dest_ptr, char_size, first_byte, UTF8_char) return dest_ptr - dest; } String::C Charset::escape_JSON(const String::C src, const Charset& source_charset){ if(!src.length) return String::C("", 0); size_t dest_calculated_length=calc_JSON_escaped_length(src, source_charset); XMLByte *dest_body=new(PointerFreeGC) XMLByte[dest_calculated_length+1/*terminator*/]; size_t dest_length; if(source_charset.isUTF8()) dest_length=escape_JSON_UTF8((XMLByte *)src.str, src.length, dest_body); else dest_length=escape_JSON((XMLByte *)src.str, src.length, dest_body, source_charset.tables); if(dest_length>dest_calculated_length) throw Exception(0, 0, "Charset::escape_JSON buffer overflow"); dest_body[dest_length]=0; // terminator return String::C((char*)dest_body, dest_length); } String::Body Charset::escape_JSON(const String::Body src, const Charset& source_charset) { String::C dest=Charset::escape_JSON(String::C(src.cstr(), src.length()), source_charset); return String::Body(dest.length ? dest.str:0); } String& Charset::escape_JSON(const String& src, const Charset& source_charset) { if(src.is_empty()) return *new String(); return *new String(escape_JSON((String::Body)src, source_charset), String::L_CLEAN); } const String::C Charset::transcodeToUTF8(const String::C src) const { int src_length=src.length; #ifdef PRECALCULATE_DEST_LENGTH int dest_length=0; const XMLByte* srcPtr=(XMLByte*)src.str; const XMLByte* srcEnd=srcPtr+src_length; XMLByte firstByte; XMLCh UTF8Char; while(uint charSize=readChar(srcPtr, srcEnd, firstByte, UTF8Char, tables)) dest_length+=charSize; #else int dest_length=src_length*6; // so that surly enough (max utf8 seq len=6) but too memory-hungry #endif #ifndef NDEBUG int saved_dest_length=dest_length; #endif XMLByte *dest_body=new(PointerFreeGC) XMLByte[dest_length+1/*for terminator*/]; if(::transcodeToUTF8( (XMLByte *)src.str, src_length, dest_body, dest_length, tables)<0) throw Exception(0, 0, "Charset::transcodeToUTF8 buffer overflow"); assert(dest_length<=saved_dest_length); dest_body[dest_length]=0; // terminator return String::C((char*)dest_body, dest_length); } static XMLCh change_case_UTF8(const XMLCh src, const Charset::UTF8CaseTable& table) { int lo = 0; int hi = table.size - 1; while(lo<=hi) { // Calc the mid point of the low and high offset. const unsigned int i = (lo + hi) / 2; XMLCh cur=table.records[i].from; if(src==cur) return table.records[i].to; if(src>cur) lo = i+1; else hi = i-1; } // not found return src; } static void store_UTF8(XMLCh src, XMLByte*& outPtr){ if(!src) { // use the replacement character *outPtr++= '?'; return; } // Figure out how many bytes we need unsigned int encodedBytes; if(src<0x80) encodedBytes = 1; else if(src<0x800) encodedBytes = 2; else if(src<0x10000) encodedBytes = 3; else if(src<0x200000) encodedBytes = 4; else if(src<0x4000000) encodedBytes = 5; else if(src<= 0x7FFFFFFF) encodedBytes = 6; else { // use the replacement character *outPtr++= '?'; return; } // And spit out the bytes. We spit them out in reverse order // here, so bump up the output pointer and work down as we go. outPtr+= encodedBytes; switch(encodedBytes) { case 6: *--outPtr = XMLByte((src | 0x80UL) & 0xBFUL); src>>= 6; case 5: *--outPtr = XMLByte((src | 0x80UL) & 0xBFUL); src>>= 6; case 4: *--outPtr = XMLByte((src | 0x80UL) & 0xBFUL); src>>= 6; case 3: *--outPtr = XMLByte((src | 0x80UL) & 0xBFUL); src>>= 6; case 2: *--outPtr = XMLByte((src | 0x80UL) & 0xBFUL); src>>= 6; case 1: *--outPtr = XMLByte(src | gFirstByteMark[encodedBytes]); } // Add the encoded bytes back in again to indicate we've eaten them outPtr+= encodedBytes; } static void change_case_UTF8(XMLCh src, XMLByte*& outPtr, const Charset::UTF8CaseTable& table) { store_UTF8(change_case_UTF8(src, table), outPtr); } void change_case_UTF8(const XMLByte* srcData, size_t srcLen, XMLByte* toFill, size_t toFillLen, const Charset::UTF8CaseTable& table) { const XMLByte* srcPtr=srcData; const XMLByte* srcEnd=srcData+srcLen; XMLByte* outPtr=toFill; XMLByte* outEnd=toFill+toFillLen; // We now loop until we either run out of input data, or room to store while ((srcPtr < srcEnd) && (outPtr < outEnd)) { // Get the next leading byte out const XMLByte firstByte =* srcPtr; if(firstByte<=127) { change_case_UTF8(firstByte, outPtr, table); srcPtr++; continue; } // See how many trailing src bytes this sequence is going to require const unsigned int trailingBytes = gUTFBytes[firstByte]; // Looks ok, so lets build up the value uint tmpVal=0; switch(trailingBytes) { case 5: tmpVal+=*srcPtr++; tmpVal<<=6; case 4: tmpVal+=*srcPtr++; tmpVal<<=6; case 3: tmpVal+=*srcPtr++; tmpVal<<=6; case 2: tmpVal+=*srcPtr++; tmpVal<<=6; case 1: tmpVal+=*srcPtr++; tmpVal<<=6; case 0: tmpVal+=*srcPtr++; break; default: throw Exception(0, 0, "change_case_UTF8 error: wrong trailingBytes value(%d)", trailingBytes); } tmpVal-=gUTFOffsets[trailingBytes]; // If it will fit into a single char, then put it in. Otherwise // fail [*encode it as a surrogate pair. If its not valid, use the // replacement char.*] if(!(tmpVal & 0xFFFF0000)) change_case_UTF8(tmpVal, outPtr, table); else throw Exception(0, 0, "change_case_UTF8 error: too big tmpVal(0x%08X)", tmpVal); } if(srcPtr!=outPtr) throw Exception(0, 0, "change_case_UTF8 error: end pointers do not match"); } static size_t getDecNumLength(XMLCh UTF8Char){ return (UTF8Char < 100) ?2 :(UTF8Char < 1000) ?3 :(UTF8Char < 10000) ?4 :5; } const String::C Charset::transcodeFromUTF8(const String::C src) const { int src_length=src.length; #ifdef PRECALCULATE_DEST_LENGTH int dest_length=0; for(UTF8_string_iterator i((XMLByte *)src.str, src_length); i.has_next(); ){ dest_length += ( i.next() & 0xFFFF0000 ) ? 3*i.getCharSize() // %XX for each byte : ( xlatOneTo(i.next(), tables, 0) != 0 ) ? 1 // can convert it to a single char : 3+getDecNumLength( i.next() ); // print char as &#XX;, &#XXX;, &#XXXX; or &#XXXXX; } #else // so that surly enough, "&#XXX;" has max ratio (huh? 8 bytes needed for '&#XXXXX;') int dest_length=src_length*6; #endif #ifndef NDEBUG int saved_dest_length=dest_length; #endif XMLByte *dest_body=new(PointerFreeGC) XMLByte[dest_length+1/*for terminator*/]; if(::transcodeFromUTF8( (XMLByte *)src.str, src_length, dest_body, dest_length, tables)<0) throw Exception(0, 0, "Charset::transcodeFromUTF8 buffer overflow"); assert(dest_length<=saved_dest_length); dest_body[dest_length]=0; // terminator return String::C((char*)dest_body, dest_length); } /// transcode using both charsets const String::C Charset::transcodeToCharset(const String::C src, const Charset& dest_charset) const { if(&dest_charset==this) return src; else { size_t dest_length=src.length; XMLByte* dest_body=new(PointerFreeGC) XMLByte[dest_length+1/*for terminator*/]; XMLByte* output=dest_body; const XMLByte* input=(XMLByte *)src.str; while(XMLCh c=*input++) { XMLCh curVal = tables.fromTable[c]; *output++=curVal? xlatOneTo(curVal, dest_charset.tables, '?') // OK :'?'; // use the replacement character } dest_body[dest_length]=0; // terminator return String::C((char*)dest_body, dest_length); } } void Charset::store_Char(XMLByte*& outPtr, XMLCh src, XMLByte not_found){ if(isUTF8()) store_UTF8(src, outPtr); else if(char ch=xlatOneTo(src, tables, not_found)) *outPtr++=ch; } #ifdef XML static const Charset::Tables* tables[MAX_CHARSETS]; static xmlCharEncodingHandler xml_encoding_handlers[MAX_CHARSETS]; #ifdef PA_PATCHED_LIBXML_BACKWARD #define declareXml256ioFuncs(i) \ static int xml256CharEncodingInputFunc##i( \ unsigned char *out, int *outlen, \ const unsigned char *in, int *inlen, void*) { \ return transcodeToUTF8( \ in, *inlen, \ out, *outlen, \ *tables[i]); \ } \ static int xml256CharEncodingOutputFunc##i( \ unsigned char *out, int *outlen, \ const unsigned char *in, int *inlen, void*) { \ return transcodeFromUTF8( \ in, *inlen, \ out, *outlen, \ *tables[i]); \ } #else #define declareXml256ioFuncs(i) \ static int xml256CharEncodingInputFunc##i( \ unsigned char *out, int *outlen, \ const unsigned char *in, int *inlen) { \ return transcodeToUTF8( \ in, *inlen, \ out, *outlen, \ *tables[i]); \ } \ static int xml256CharEncodingOutputFunc##i( \ unsigned char *out, int *outlen, \ const unsigned char *in, int *inlen) { \ return transcodeFromUTF8( \ in, *inlen, \ out, *outlen, \ *tables[i]); \ } #endif declareXml256ioFuncs(0) declareXml256ioFuncs(1) declareXml256ioFuncs(2) declareXml256ioFuncs(3) declareXml256ioFuncs(4) declareXml256ioFuncs(5) declareXml256ioFuncs(6) declareXml256ioFuncs(7) declareXml256ioFuncs(8) declareXml256ioFuncs(9) static xmlCharEncodingInputFunc inputFuncs[MAX_CHARSETS]={ xml256CharEncodingInputFunc0, xml256CharEncodingInputFunc1, xml256CharEncodingInputFunc2, xml256CharEncodingInputFunc3, xml256CharEncodingInputFunc4, xml256CharEncodingInputFunc5, xml256CharEncodingInputFunc6, xml256CharEncodingInputFunc7, xml256CharEncodingInputFunc8, xml256CharEncodingInputFunc9 }; static xmlCharEncodingOutputFunc outputFuncs[MAX_CHARSETS]={ xml256CharEncodingOutputFunc0, xml256CharEncodingOutputFunc1, xml256CharEncodingOutputFunc2, xml256CharEncodingOutputFunc3, xml256CharEncodingOutputFunc4, xml256CharEncodingOutputFunc5, xml256CharEncodingOutputFunc6, xml256CharEncodingOutputFunc7, xml256CharEncodingOutputFunc8, xml256CharEncodingOutputFunc9 }; static size_t handlers_count=0; void Charset::addEncoding(char *name_cstr) { if(handlers_count==MAX_CHARSETS) throw Exception(0, 0, "already allocated %d handlers, no space for new encoding '%s'", MAX_CHARSETS, name_cstr); xmlCharEncodingHandler* handler=&xml_encoding_handlers[handlers_count]; { handler->name=name_cstr; handler->input=inputFuncs[handlers_count]; handler->output=outputFuncs[handlers_count]; ::tables[handlers_count]=&tables; handlers_count++; } xmlRegisterCharEncodingHandler(handler); } void Charset::initTranscoder(const String::Body NAME, const char* name_cstr) { ftranscoder=xmlFindCharEncodingHandler(name_cstr); transcoder(NAME); // check right way } xmlCharEncodingHandler& Charset::transcoder(const String::Body NAME) { if(!ftranscoder) throw Exception(PARSER_RUNTIME, new String(NAME, String::L_TAINTED), "unsupported encoding"); return *ftranscoder; } String::C Charset::transcode_cstr(const xmlChar* s) { if(!s) return String::C("", 0); int inlen=strlen((const char*)s); int outlen=inlen*6/*strlen("ÿ")*/; // max #ifndef NDEBUG int saved_outlen=outlen; #endif char *out=new(PointerFreeGC) char[outlen+1]; int error; if(xmlCharEncodingOutputFunc output=transcoder(FNAME).output) { error=output( (unsigned char*)out, &outlen, (const unsigned char*)s, &inlen #ifdef PA_PATCHED_LIBXML_BACKWARD ,0 #endif ); } else { memcpy(out, s, outlen=inlen); error=0; } if(error<0) throw Exception(0, 0, "transcode_cstr failed (%d)", error); assert(outlen<=saved_outlen); out[outlen]=0; return String::C(out, outlen); } const String& Charset::transcode(const xmlChar* s) { String::C cstr=transcode_cstr(s); return *new String(cstr.str, String::L_TAINTED); } /// @test less memory using -maybe- xmlParserInputBufferCreateMem xmlChar* Charset::transcode_buf2xchar(const char* buf, size_t buf_size) { xmlChar* out; int outlen; int error; #ifndef NDEBUG int saved_outlen; #endif if(xmlCharEncodingInputFunc input=transcoder(FNAME).input) { outlen=buf_size*6/*max UTF8 bytes per char*/; #ifndef NDEBUG saved_outlen=outlen; #endif out=(xmlChar*)xmlMalloc(outlen+1); error=input( out, &outlen, (const unsigned char*)buf, (int*)&buf_size #ifdef PA_PATCHED_LIBXML_BACKWARD ,0 #endif ); } else { outlen=buf_size; #ifndef NDEBUG saved_outlen=outlen; #endif out=(xmlChar*)xmlMalloc(outlen+1); memcpy(out, buf, outlen); error=0; } if(error<0) throw Exception(0, 0, "transcode_buf failed (%d)", error); assert(outlen<=saved_outlen); out[outlen]=0; return out; } xmlChar* Charset::transcode(const String& s) { String::Body sbody=s.cstr_to_string_body_untaint(String::L_AS_IS); return transcode_buf2xchar(sbody.cstr(), sbody.length()); } xmlChar* Charset::transcode(const String::Body s) { return transcode_buf2xchar(s.cstr(), s.length()); } #endif String::Body Charset::transcode(const String::Body src, const Charset& source_transcoder, const Charset& dest_transcoder) { return String::Body(Charset::transcode(String::C(src.cstr(), src.length()), source_transcoder, dest_transcoder)); } String& Charset::transcode(const String& src, const Charset& source_transcoder, const Charset& dest_transcoder) { if(src.is_empty()) return *new String(); return *new String(transcode((String::Body)src, source_transcoder, dest_transcoder), String::L_CLEAN); } void Charset::transcode(ArrayString& src, const Charset& source_transcoder, const Charset& dest_transcoder) { for(size_t i=0; isource_transcoder, *info->dest_transcoder); } void Charset::transcode(HashStringString& src, const Charset& source_transcoder, const Charset& dest_transcoder) { Transcode_pair_info info={&source_transcoder, &dest_transcoder}; src.for_each_ref(transcode_pair, &info); } size_t getUTF8BytePos(const XMLByte* srcBegin, const XMLByte* srcEnd, size_t charPos){ const XMLByte* ptr=srcBegin; while(charPos-- && skipUTF8Char(ptr, srcEnd)); return ptr-srcBegin; } size_t getUTF8CharPos(const XMLByte* srcBegin, const XMLByte* srcEnd, size_t bytePos){ size_t charPos=0; const XMLByte* ptr=srcBegin; const XMLByte* ptrEnd=srcBegin+bytePos; while(skipUTF8Char(ptr, srcEnd)){ if(ptr>ptrEnd) return charPos; charPos++; } // scan till end but position in bytes still too low throw Exception(0, 0, "Error conversion byte pos to char pos"); } size_t lengthUTF8(const XMLByte* srcBegin, const XMLByte* srcEnd){ size_t size=0; while(skipUTF8Char(srcBegin, srcEnd)) size++; return size; } unsigned int lengthUTF8Char(const XMLByte c){ return gUTFBytes[c]+1; } const char *fixUTF8(const char *src){ if(src && *src){ size_t length=strlen(src); int error_offset; if(pa_pcre_valid_utf((unsigned char *)src, length, &error_offset)){ char *result=(char *)pa_malloc_atomic(length+1); char *dst=result; do { if(error_offset){ memcpy(dst, src, error_offset); dst+=error_offset; src+=error_offset; length-=error_offset; } *dst++='?'; src++; length--; } while (length && pa_pcre_valid_utf((unsigned char *)src, length, &error_offset)); if(length){ strcpy(dst, src); } else { *dst='\0'; } return result; } } return src; } bool UTF8_string_iterator::has_next(){ fcharSize=readUTF8Char(fsrcPtr, fsrcEnd, ffirstByte, fUTF8Char); return fcharSize!=0; } parser-3.5.1/src/main/compile_tools.h0000644000076400007640000002540714712042465014516 00000000000000/** @file Parser: compiler support helper functions decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #ifndef COMPILE_TOOLS #define COMPILE_TOOLS #define IDENT_COMPILE_TOOLS_H "$Id: compile_tools.h,v 1.121 2024/11/04 03:53:25 moko Exp $" #include "pa_opcode.h" #include "pa_types.h" #include "pa_vstring.h" #include "pa_request.h" /// used to track source column number #define TAB_SIZE 8 enum lexical_state { LS_USER, LS_NAME_SQUARE_PART, LS_USER_COMMENT, LS_DEF_NAME, LS_DEF_PARAMS, LS_DEF_LOCALS, LS_DEF_COMMENT, LS_DEF_SPECIAL_BODY, LS_EXPRESSION_STRING_QUOTED, LS_EXPRESSION_STRING_APOSTROFED, LS_EXPRESSION_VAR_NAME_WITH_COLON, LS_EXPRESSION_VAR_NAME_WITHOUT_COLON, LS_EXPRESSION_COMMENT, LS_VAR_NAME_SIMPLE_WITH_COLON, LS_VAR_NAME_SIMPLE_WITHOUT_COLON, LS_VAR_NAME_CURLY, LS_VAR_ROUND, LS_VAR_SQUARE, LS_VAR_CURLY, LS_METHOD_NAME, LS_METHOD_SQUARE, LS_METHOD_CURLY, LS_METHOD_ROUND, LS_METHOD_AFTER }; struct Pos { int line; int col; Pos(int aline, int acol): line(aline), col(acol) {} Pos(): line(0), col(0) {} void clear() { line=col=0; } operator bool() { return col!=0; } }; /// compiler status class Parse_control { const String* main_alias; uint last_line_end_col; public: const String& alias_method(const String& name); //@{ /// @name input Request& request; VStateless_class* cclass; VStateless_class* cclass_new; ArrayClass* cclasses; const char* source; uint file_no; Pos pos; //@} //@{ /// @name state; initially bool trim_bof; int pending_state; ///< i=0 String::Body string; ///< lexical string accumulator Pos string_start; #define MAX_LEXICAL_STATES 100 enum lexical_state ls; ///< =LS_USER; int ls_sp; ///< =0 enum lexical_state ls_stack[MAX_LEXICAL_STATES]; int brackets_nestages[MAX_LEXICAL_STATES]; ///< brackets nestage on each state bool in_call_value; bool explicit_result; bool append; bool array; //@} /// output: filled input 'methods' and 'error' if any const char *error; Parse_control(Request& arequest, VStateless_class* aclass, const char* asource, const String* amain_alias, uint afile_no, int line_no_offset): main_alias(amain_alias), last_line_end_col(0), request(arequest), // input // we were told the class to compile to? cclass(aclass), // until changed with @CLASS would consider operators loading cclass_new(0), cclasses(new ArrayClass(1)), source(asource), file_no(afile_no), pos(line_no_offset, 0), // initialize state trim_bof(true), pending_state(0), ls(LS_USER), ls_sp(0), in_call_value(false), explicit_result(false), append(false), array(false), error("") { *cclasses+=aclass; } /// false if exception should be rised bool class_add(){ if(cclass_new){ cclass=cclass_new; *cclasses+=cclass; cclass_new=0; append=false; // append to request's classes return request.add_class(cclass->type(), cclass); } return true; } VStateless_class* get_existed_class(VStateless_class* aclass){ // checking existence of the class during processing @OPTIONS\npartial // can't use get_class because it will call @autouse[] if the class wasn't loaded if(aclass) return request.classes().get(aclass->type()); return 0; } bool reuse_existed_class(VStateless_class* aclass){ if(aclass->is_partial()){ cclass=aclass; cclass_new=0; append=true; return true; } else { return false; } } void set_all_vars_local(){ (cclass_new ? cclass_new : cclass)->set_all_vars_local(); } void set_methods_call_type(Method::Call_type call_type){ (cclass_new ? cclass_new : cclass)->set_methods_call_type(call_type); } Method::Call_type get_methods_call_type(){ return (cclass_new ? cclass_new : cclass)->get_methods_call_type(); } void pos_next_line() { pos.line++; last_line_end_col=pos.col; pos.col=0; } void pos_next_c(int c) { if(c=='\t') pos.col=(pos.col+TAB_SIZE)&~(TAB_SIZE-1); else pos.col++; } /// not precise in case of \t in the middle of the text void pos_prev_c() { if(pos.col==0) { --pos.line; pos.col=last_line_end_col; } else --pos.col; } void ungetc() { source--; pos_prev_c(); } }; /// New array // return empty array inline ArrayOperation* N() { return new ArrayOperation; } /// Assembler instruction // append ordinary instruction to ops inline void O(ArrayOperation& result, OP::OPCODE code) { result+=Operation(code); } /// aPpend 'code_array' to 'result' inline void P(ArrayOperation& result, ArrayOperation& code_array) { result.append(code_array); } /// aPpend part of 'code_array', starting from offset, to 'result' inline void P(ArrayOperation& result, ArrayOperation& code_array, int offset) { result.append(code_array, offset); } /// aPpend part of 'code_array', starting from offset, to 'result' inline void P(ArrayOperation& result, ArrayOperation& code_array, int offset, int limit) { result.append(code_array, offset, limit); } /// append cOde Array inline void OA(ArrayOperation& result, ArrayOperation* code_array) { result+=Operation(code_array); // append 'code_array' } inline void OA(ArrayOperation& result, OP::OPCODE code, ArrayOperation* code_array) { result+=Operation(code); // append OP_CODE result+=Operation(code_array); // append 'code_array' } /** Value Literal // returns array with - first op: OP_VALUE instruction - second op: origin (debug information) - third op: string itself */ inline ArrayOperation* VL(Value* value, uint file_no, uint line, uint col) { // empty ops array ArrayOperation& result=*N(); // append 'value' to 'result' result+=Operation(OP::OP_VALUE); result+=Operation(file_no, line, col); // append origin result+=Operation(value); // append 'value' return &result; } /// Literal Array to(2) Value @return Value from literal Array OP+origin+Value Value* LA2V(ArrayOperation& literal_string_array, int offset=0, OP::OPCODE code=OP::OP_VALUE); /// Literal Array to(2) String @return String value from literal Array OP+origin+String array inline const String* LA2S(ArrayOperation& literal_string_array, int offset=0, OP::OPCODE code=OP::OP_VALUE) { if(Value* value=LA2V(literal_string_array, offset, code)) return value->get_string(); return 0; } inline void change_string_literal_to_write_string_literal(ArrayOperation& literal_string_array) { literal_string_array.put(0, OP::OP_STRING__WRITE); } void maybe_change_string_literal_to_double_literal(ArrayOperation& literal_string_array); void change_string_literal_value(ArrayOperation& literal_string_array, const String& new_value); inline bool change(ArrayOperation& opcodes, int pos, OP::OPCODE find, OP::OPCODE replace) { if(pos>=0) { Operation& op=opcodes.get_ref(pos); if(op.code==find) { op.code=replace; return true; } } return false; } inline void change_or_append(ArrayOperation& opcodes, int pos, OP::OPCODE find, OP::OPCODE replace, OP::OPCODE notfound) { if(change(opcodes, pos, find, replace)) return; opcodes+=Operation(notfound); } bool change_first(ArrayOperation& opcodes, OP::OPCODE find, OP::OPCODE replace); #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT // OP_VALUE+origin+value+OP_GET_ELEMENT+OP_VALUE+origin+value+OP_GET_ELEMENT => OP_GET_OBJECT_ELEMENT+origin+value+origin+value inline bool maybe_make_get_object_element(ArrayOperation& opcodes, ArrayOperation& diving_code, size_t diving_count){ if( diving_count>=8 && diving_code[0].code==OP::OP_VALUE && diving_code[3].code==OP::OP_GET_ELEMENT && diving_code[4].code==OP::OP_VALUE && diving_code[7].code==OP::OP_GET_ELEMENT ){ O(opcodes, OP::OP_GET_OBJECT_ELEMENT); P(opcodes, diving_code, 1 /*offset*/, 2 /*limit*/); // copy first origin+value P(opcodes, diving_code, 5, 2); // second origin+value if(diving_count>8) P(opcodes, diving_code, 8 /*offset*/); // tail return true; } return false; } #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT // OP_VALUE+origin+value+OP_GET_ELEMENT+OP_WITH_READ+OP_VALUE+origin+value+OP_GET_ELEMENT+OP_GET_ELEMENT => OP_GET_OBJECT_VAR_ELEMENT+origin+value+origin+value inline bool maybe_make_get_object_var_element(ArrayOperation& opcodes, ArrayOperation& diving_code, size_t diving_count){ if( diving_count==10 && diving_code[0].code==OP::OP_VALUE && diving_code[3].code==OP::OP_GET_ELEMENT && diving_code[4].code==OP::OP_WITH_READ && diving_code[5].code==OP::OP_VALUE && diving_code[8].code==OP::OP_GET_ELEMENT && diving_code[9].code==OP::OP_GET_ELEMENT ){ O(opcodes, OP::OP_GET_OBJECT_VAR_ELEMENT); P(opcodes, diving_code, 1 /*offset*/, 2 /*limit*/); // copy first origin+value P(opcodes, diving_code, 6, 2); // second origin+value return true; } return false; } #endif bool maybe_make_self(ArrayOperation& opcodes, ArrayOperation& diving_code, size_t diving_count); #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL bool maybe_append_simple_diving_code(ArrayOperation& code, ArrayOperation& diving_code); bool is_special_element(ArrayOperation& opcodes); #endif #ifdef OPTIMIZE_BYTECODE_CONSTRUCT inline bool maybe_optimize_construct(ArrayOperation& opcodes, ArrayOperation& var_ops, ArrayOperation& expr_ops){ size_t expr_count=expr_ops.count(); OP::OPCODE construct_op=expr_ops[expr_count-1].code; size_t construct=(construct_op==OP::OP_CONSTRUCT_VALUE)?0x01:(construct_op==OP::OP_CONSTRUCT_EXPR)?0x02:0x00; if(construct){ P(opcodes, expr_ops, 0/*offset*/, expr_count-1/*limit*/); // copy constructor body without CONSTRUCT_(VALUE|EXPR) size_t with=0x00; switch(var_ops[0].code){ case OP::OP_WITH_ROOT: { with=0x10; break; } case OP::OP_WITH_WRITE: { with=0x20; break; } case OP::OP_WITH_SELF: { with=0x30; break; } default: break; } if(with && var_ops[1].code==OP::OP_VALUE && var_ops.count()==4){ OP::OPCODE code=OP::OP_VALUE; // calm down compiler. will be reassigned for sure. switch( with | construct ) { case 0x11: { code=OP::OP_WITH_ROOT__VALUE__CONSTRUCT_VALUE; break; } case 0x12: { code=OP::OP_WITH_ROOT__VALUE__CONSTRUCT_EXPR; break; } case 0x21: { code=OP::OP_WITH_WRITE__VALUE__CONSTRUCT_VALUE; break; } case 0x22: { code=OP::OP_WITH_WRITE__VALUE__CONSTRUCT_EXPR; break; } case 0x31: { code=OP::OP_WITH_SELF__VALUE__CONSTRUCT_VALUE; break; } case 0x32: { code=OP::OP_WITH_SELF__VALUE__CONSTRUCT_EXPR; break; } } O(opcodes, code); P(opcodes, var_ops, 2/*offset*/, 2/*limit*/); // copy origin+value } else { P(opcodes, var_ops); O(opcodes, construct_op); } return true; } return false; } #endif Method::Call_type GetMethodCallType(Parse_control& pc, ArrayOperation& literal_string_array); void push_LS(Parse_control& pc, lexical_state new_state); void pop_LS(Parse_control& pc); #endif parser-3.5.1/src/main/pa_memory.C0000644000076400007640000000353514713715666013602 00000000000000/** @file Parser: memory reference counting classes. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_sapi.h" #include "pa_common.h" #include "pa_threads.h" volatile const char * IDENT_PA_MEMORY_C="$Id: pa_memory.C,v 1.22 2024/11/09 17:28:22 moko Exp $" IDENT_PA_MEMORY_H; void *pa_fail_alloc(const char* what, size_t size) { #ifdef PA_DEBUG_DISABLE_GC SAPI::die("out of memory (in pa_fail_alloc)"); #else SAPI::die("out of memory: failed to %s %u bytes. heap_used=%u, heap_free=%u, bytes_since_gc=%u, total_bytes=%u", what, size, GC_get_heap_size(), GC_get_free_bytes(), GC_get_bytes_since_gc(), GC_get_total_bytes()); #endif // never reached return 0; } #ifdef _MSC_VER // pa_fail_alloc referenced in function GC_default_on_abort in gc.lib(misc.c) and thus should be extern "C" extern "C" void *pa_fail_alloc(const char* what); void *pa_fail_alloc(const char* what) { SAPI::die("fatal memory error: %s. heap_used=%u, heap_free=%u, bytes_since_gc=%u, total_bytes=%u", what, GC_get_heap_size(), GC_get_free_bytes(), GC_get_bytes_since_gc(), GC_get_total_bytes()); // never reached return 0; } #endif int pa_free_space_divisor = 0; void pa_gc_collect(bool forced){ #ifndef PA_DEBUG_DISABLE_GC int divisor = pa_free_space_divisor; // as it can change during collect in multithreaded enviroment if(!divisor) GC_enable(); if(!divisor || forced) GC_gcollect(); if(!divisor) GC_disable(); #endif } void pa_gc_set_free_space_divisor(int divisor){ #ifndef PA_DEBUG_DISABLE_GC if(divisor != pa_free_space_divisor){ SYNCHRONIZED; if(pa_free_space_divisor){ if(!divisor) GC_disable(); } else { if(divisor) GC_enable(); } if(divisor) GC_set_free_space_divisor(divisor); pa_free_space_divisor = divisor; } #endif } parser-3.5.1/src/main/pa_random.C0000644000076400007640000002071114712042465013532 00000000000000/** @file Parser: random related functions. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ // includes #include "pa_common.h" #include "pa_random.h" #include "pa_exception.h" #include "pa_threads.h" volatile const char * IDENT_PA_RANDOM_C="$Id: pa_random.C,v 1.16 2024/11/04 03:53:25 moko Exp $" IDENT_PA_RANDOM_H; #ifdef _MSC_VER #include class Random_provider { HCRYPTPROV fhProv; void acquire() { SYNCHRONIZED; if(fhProv) return; if(!CryptAcquireContext(&fhProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) throw Exception(0, 0, "CryptAcquireContext failed"); } void release() { if(fhProv) CryptReleaseContext(fhProv, 0); } public: Random_provider(): fhProv(0) {} ~Random_provider() { release(); } void generate(void *buffer, size_t size) { acquire(); if(!CryptGenRandom(fhProv, size, (BYTE*)buffer)) throw Exception(0, 0, "CryptGenRandom failed"); } } random_provider; int gettimeofday(struct timeval * tp, void *); #else /// from gen_uuid.c static int get_random_fd(void) { struct timeval tv; static int fd = -2; int i; if (fd == -2) { gettimeofday(&tv, 0); fd = open("/dev/urandom", O_RDONLY); if (fd == -1) fd = open("/dev/random", O_RDONLY | O_NONBLOCK); srand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec); } /* Crank the random number generator a few times */ gettimeofday(&tv, 0); for (i = (tv.tv_sec ^ tv.tv_usec) & 0x1F; i > 0; i--) rand(); return fd; } /* * Generate a series of random bytes. Use /dev/urandom if possible, * and if not, use srandom/random. */ static void get_random_bytes(void *buf, int nbytes) { int i, fd = get_random_fd(); int lose_counter = 0; char *cp = (char *) buf; if (fd >= 0) { while (nbytes > 0) { i = read(fd, cp, nbytes); if (i <= 0) { if (lose_counter++ > 16) break; continue; } nbytes -= i; cp += i; lose_counter = 0; } } /* XXX put something better here if no /dev/random! */ for (i = 0; i < nbytes; i++) *cp++ = rand() & 0xFF; return; } #endif void random(void *buffer, size_t size) { #ifdef _MSC_VER random_provider.generate(buffer, size); #else get_random_bytes(buffer, size); #endif } /// to hell with extra bytes on 64bit platforms struct uuid { unsigned int time_low; unsigned short time_mid; unsigned short time_hi_and_version; unsigned short clock_seq; unsigned char node[6]; }; static uuid get_uuid() { // random uuid uuid; random(&uuid, sizeof(uuid)); // http://www.opengroup.org/onlinepubs/9629399/apdxa.htm#tagtcjh_35 // ~ // version = DCE Security version, with embedded POSIX UIDs. // variant = DCE // // DCE=Distributed Computing Environment // http://www.opengroup.org/dce/ // // they say this influences comparison&such, // but could not figure out how, hence structure layout specified strictly // anyhow, uuidgen on Win32 yield those values // // xxxxxxxx-xxxx-4xxx-{8,9,A,B}xxx-xxxxxxxxxxxx uuid.clock_seq = (uuid.clock_seq & 0x3FFF) | 0x8000; uuid.time_hi_and_version = (uuid.time_hi_and_version & 0x0FFF) | 0x4000; return uuid; } char *get_uuid_cstr(bool lower, bool solid) { uuid uuid=get_uuid(); const size_t bufsize=36+1/*zero-teminator*/+1/*for faulty snprintfs*/; char* cstr=new(PointerFreeGC) char[bufsize]; const char *format[] = { "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X", "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", "%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X", "%08x%04x%04x%02x%02x%02x%02x%02x%02x%02x%02x" }; snprintf(cstr, bufsize, format[(lower ? 1:0) + (solid ? 2:0)], uuid.time_low, uuid.time_mid, uuid.time_hi_and_version, uuid.clock_seq >> 8, uuid.clock_seq & 0xFF, uuid.node[0], uuid.node[1], uuid.node[2], uuid.node[3], uuid.node[4], uuid.node[5]); return cstr; } char *get_uuid_boundary() { uuid uuid=get_uuid(); const int boundary_bufsize=10+32+1/*for zero-teminator*/+1/*for faulty snprintfs*/; char* boundary=new(PointerFreeGC) char[boundary_bufsize]; snprintf(boundary, boundary_bufsize, "----------%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X", uuid.time_low, uuid.time_mid, uuid.time_hi_and_version, uuid.clock_seq >> 8, uuid.clock_seq & 0xFF, uuid.node[0], uuid.node[1], uuid.node[2], uuid.node[3], uuid.node[4], uuid.node[5]); return boundary; } // UUID version 7 // https://datatracker.ietf.org/doc/draft-ietf-uuidrev-rfc4122bis/ // // UUID version 7 features a time-ordered value field derived from the // widely implemented and well known Unix Epoch timestamp source, the // number of milliseconds since midnight 1 Jan 1970 UTC, leap seconds // excluded. UUIDv7 generally has improved entropy characteristics over // UUIDv1 or UUIDv6. // // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // | unix_ts_ms | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // | unix_ts_ms | ver | rand_a | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // |var| rand_b | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // | rand_b | // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ // // unix_ts_ms: // 48 bit big-endian unsigned number of Unix epoch timestamp in // milliseconds. Occupies bits 0 through 47 (octets 0-5). // ver: // The 4 bit version field, set to 0b0111 (7). // Occupies bits 48 through 51 of octet 6. // rand_a: // 12 bits pseudo-random data to provide uniqueness as per // Section 6.8 and/or optional constructs to guarantee additional // monotonicity. Occupies bits 52 through 63 (octets 6-7). // var: // The 2 bit variant field as defined by Section 4.1, set to 0b10. // Occupies bits 64 and 65 of octet 8. // rand_b: // The final 62 bits of pseudo-random data to provide uniqueness as // per Section 6.8 and/or an optional counter to guarantee additional // monotonicity. Occupies bits 66 through 127 (octets 8-15). char *get_uuid7_cstr(bool lower, bool solid) { unsigned char uuid[16]; random(&uuid[8], 8); struct timeval tv; gettimeofday(&tv, 0); // 48 bit big-endian unsigned number of Unix epoch timestamp in milliseconds uint64_t unix_ts_ms = (uint64_t)tv.tv_sec * 1000 + (uint64_t)tv.tv_usec / 1000; // 12 bit monotonicity counter static int seq = 0; static uint64_t ms_previous=0; if(unix_ts_ms == ms_previous){ seq++; unix_ts_ms += seq >> 12; } else { seq = 0; ms_previous = unix_ts_ms; } uuid[7] = (unsigned char) (seq); uuid[6] = (unsigned char) (seq >> 8); uuid[5] = (unsigned char) (unix_ts_ms); unix_ts_ms >>= 8; uuid[4] = (unsigned char) (unix_ts_ms); unix_ts_ms >>= 8; uuid[3] = (unsigned char) (unix_ts_ms); unix_ts_ms >>= 8; uuid[2] = (unsigned char) (unix_ts_ms); unix_ts_ms >>= 8; uuid[1] = (unsigned char) (unix_ts_ms); unix_ts_ms >>= 8; uuid[0] = (unsigned char) (unix_ts_ms); // Set magic numbers for a "version 7" UUID, see // https://www.ietf.org/archive/id/draft-ietf-uuidrev-rfc4122bis-00.html#name-uuid-version-7 uuid[6] = (uuid[6] & 0x0f) | 0x70; /* 4 bit version [0111] */ uuid[8] = (uuid[8] & 0x3f) | 0x80; /* 2 bit variant [10] */ const size_t bufsize=36+1/*zero-teminator*/+1/*for faulty snprintfs*/; char* cstr=new(PointerFreeGC) char[bufsize]; const char *format[] = { "%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X", "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", "%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", }; snprintf(cstr, bufsize, format[(lower ? 1:0) + (solid ? 2:0)], uuid[0], uuid[1], uuid[2], uuid[3], uuid[4], uuid[5], uuid[6], uuid[7], uuid[8], uuid[9], uuid[10], uuid[11], uuid[12], uuid[13], uuid[14], uuid[15] ); return cstr; } parser-3.5.1/src/main/pa_http.C0000644000076400007640000011210014732421571013224 00000000000000/** @file Parser: http support functions. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_http.h" #include "pa_common.h" #include "pa_base64.h" #include "pa_charsets.h" #include "pa_request_charsets.h" #include "pa_request.h" #include "pa_vfile.h" #include "pa_random.h" volatile const char * IDENT_PA_HTTP_C="$Id: pa_http.C,v 1.132 2024/12/24 02:58:47 moko Exp $" IDENT_PA_HTTP_H; // defines #define HTTP_METHOD_NAME "method" #define HTTP_FORM_NAME "form" #define HTTP_BODY_NAME "body" #define HTTP_TIMEOUT_NAME "timeout" #define HTTP_HEADERS_NAME "headers" #define HTTP_FORM_ENCTYPE_NAME "enctype" #define HTTP_ANY_STATUS_NAME "any-status" #define HTTP_OMIT_POST_CHARSET_NAME "omit-post-charset" // ^file::load[...;http://...;$.method[post]] by default adds charset to content-type #define HTTP_USER "user" #define HTTP_PASSWORD "password" #define HTTP_USER_AGENT "user-agent" #define DEFAULT_USER_AGENT "parser3" #ifndef INADDR_NONE #define INADDR_NONE ((ulong) -1) #endif #undef CRLF #define CRLF "\r\n" // helpers #ifdef HTTPD_DEBUG void pa_log(const char* fmt, ...); #define LOG(action) action #else #define LOG(action) #endif ssize_t pa_send(int sock, const char *buffer, size_t len){ size_t total_sent = 0; while (total_sent < len) { ssize_t bytes_sent=send(sock, buffer + total_sent, len - total_sent, 0); if (bytes_sent < 0) { return bytes_sent; } else if (bytes_sent == 0) { // Connection closed by the remote peer? break; } LOG( if(bytes_sent != len - total_sent) pa_log("httpd [%d] partial send %d of (%d)", sock, bytes_sent, len - total_sent) ); total_sent += bytes_sent; } return total_sent; } bool HTTP_Headers::add_header(const char *line){ const char *value=strchr(line, ':'); if(value && value != line){ // we need only headers, not the response code Header header(str_upper(line, value-line), String::Body(value+1).trim(String::TRIM_BOTH, " \t\n\r")); if(header.name == String::Body(HTTP_CONTENT_TYPE_UPPER) && content_type.is_empty()) content_type=header.value; if(header.name == String::Body("CONTENT-LENGTH") && content_length==0) ALTER_EXCEPTION_COMMENT(content_length=pa_atoul(header.value.cstr()), " for content-length"); headers+=header; return true; } return false; } class Cookies_table_template_columns: public ArrayString { public: Cookies_table_template_columns() { *this+=new String("name"); *this+=new String("value"); *this+=new String("expires"); *this+=new String("max-age"); *this+=new String("domain"); *this+=new String("path"); *this+=new String("httponly"); *this+=new String("secure"); } }; static bool set_addr(struct sockaddr_in *addr, const char* host, const short port){ memset(addr, 0, sizeof(*addr)); addr->sin_family=AF_INET; addr->sin_port=htons(port); if(host) { struct hostent *hostIP=gethostbyname(host); if(hostIP && hostIP->h_addrtype == AF_INET){ memcpy(&addr->sin_addr, hostIP->h_addr, hostIP->h_length); return true; } } return false; } class HTTP_response : public PA_Allocated { public: char *buf; size_t length; size_t buf_size; size_t body_offset; HTTP_Headers headers; HTTP_response() : buf(NULL), length(0), buf_size(0), body_offset(0){} void resize(size_t size){ buf_size=size; buf=(char *)pa_realloc(buf, size + 1); } bool read(SOCKET sock, size_t size){ if(length + size > buf_size) resize(buf_size * 2 + size); ssize_t received_size=recv(sock, buf + length, size, 0); if(received_size == 0) return false; if(received_size < 0) { if(int no = pa_socks_errno()) throw Exception("http.timeout", 0, "error receiving response: %s (%d)", pa_socks_strerr(no), no); return false; } length+=received_size; buf[length]='\0'; return true; } size_t first_line(){ char *header=strchr(buf, '\n'); if(!header) return false; return header-buf; } const char *status_code(char *status_line, int &result){ char* status_start = strchr(status_line, ' '); if(!(status_start++)) return status_line; char* status_end=strchr(status_start, ' '); if(!status_end) return status_line; if(status_end==status_start) return status_line; const char *result_str=pa_strdup(status_start, status_end-status_start); ALTER_EXCEPTION_COMMENT(result=pa_atoui(result_str), " for HTTP status"); return result_str; } bool body_start(){ char *p=buf; while((p=strchr(p, '\n'))) { if(p[1]=='\r' && p[2]=='\n'){ // \r\n\r\n *p='\0'; body_offset=p-buf+3; return true; } if(p[1]=='\n') { // \n\n *p='\0'; body_offset=p-buf+2; return true; } p++; } return false; } void parse_headers(){ const String header_block(buf, String::L_TAINTED); ArrayString aheaders; header_block.split(aheaders, 0, "\n"); ArrayString::Iterator i(aheaders); i.next(); // skipping status for(;i;){ const char *line=i.next()->cstr(); if(!headers.add_header(line)) throw Exception("http.response", 0, "bad response from host - bad header \"%s\"", line); } } int read_response(SOCKET sock, bool fail_on_status_ne_200); }; enum HTTP_response_state { HTTP_STATUS_CODE, HTTP_HEADERS, HTTP_BODY }; int HTTP_response::read_response(SOCKET sock, bool fail_on_status_ne_200) { HTTP_response_state state=HTTP_STATUS_CODE; int result=0; size_t chunk_size=0x400*16; resize(2*chunk_size); while(read(sock, chunk_size)){ switch(state){ case HTTP_STATUS_CODE: { size_t status_size=first_line(); if(!status_size) break; const char *status=status_code(pa_strdup(buf, status_size), result); if(!result || fail_on_status_ne_200 && result!=200) throw Exception("http.status", status ? new String(status) : &String::Empty, "invalid HTTP response status"); state=HTTP_HEADERS; } case HTTP_HEADERS: { if(!body_start()) break; parse_headers(); size_t content_length=check_file_size(headers.content_length, 0); if(content_length>0 && (content_length + body_offset) > length){ resize(content_length + body_offset + 0x400*64); } state=HTTP_BODY; break; } case HTTP_BODY: { chunk_size=0x400*64; break; } } } if(state==HTTP_STATUS_CODE) throw Exception("http.response", 0, "bad response from host - no status found (size=%u)", length); if(state==HTTP_HEADERS){ parse_headers(); body_offset=length; } return result; } /* ********************** request *************************** */ #if defined(SIGALRM) && defined(HAVE_SIGSETJMP) && defined(HAVE_SIGLONGJMP) # define PA_USE_ALARM #endif #ifdef PA_USE_ALARM static sigjmp_buf timeout_env; static void timeout_handler(int /*sig*/){ siglongjmp(timeout_env, 1); } #define PA_NO_THREADS (HTTPD_Server::mode != HTTPD_Server::MULTITHREADED) #define ALARM(value) if(PA_NO_THREADS) alarm(value) #else #define ALARM(value) #endif static int http_request(HTTP_response& response, const char* host, short port, const char* request, size_t request_size, int timeout_secs, bool fail_on_status_ne_200) { if(!host) throw Exception("http.host", 0, "zero hostname"); //never volatile SOCKET sock=INVALID_SOCKET; // to prevent makeing it register variable, because it will be clobbered by longjmp [thanks gcc warning] #ifdef PA_USE_ALARM if(PA_NO_THREADS) signal(SIGALRM, timeout_handler); if(PA_NO_THREADS && sigsetjmp(timeout_env, 1)) { // duplicating closesocket to make code more simple for old compilers if(sock != INVALID_SOCKET) closesocket(sock); throw Exception("http.timeout", 0, "timeout occurred while retrieving document"); return 0; // never } else #endif { ALARM(timeout_secs); try { int result; struct sockaddr_in dest; if(!set_addr(&dest, host, port)) throw Exception("http.host", 0, "cannot resolve hostname \"%s\"", host); if((sock=socket(AF_INET, SOCK_STREAM, IPPROTO_TCP/*0*/)) == INVALID_SOCKET) { int no=pa_socks_errno(); throw Exception("http.connect", 0, "cannot make socket: %s (%d)", pa_socks_strerr(no), no); } // To enable SO_DONTLINGER (that is, disable SO_LINGER) // l_onoff should be set to zero and setsockopt should be called linger dont_linger={0,0}; setsockopt(sock, SOL_SOCKET, SO_LINGER, (const char *)&dont_linger, sizeof(dont_linger)); #ifdef WIN32 // SO_*TIMEO can be defined in .h but not implemlemented in protocol, // failing subsequently with Option not supported by protocol (99) message // could not suppress that, so leaving this only for win32 int timeout_ms=timeout_secs*1000; setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (const char*)&timeout_ms, sizeof(timeout_ms)); setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (const char*)&timeout_ms, sizeof(timeout_ms)); #endif if(connect(sock, (struct sockaddr *)&dest, sizeof(dest))) { int no=pa_socks_errno(); throw Exception("http.connect", 0, "cannot connect to host \"%s\": %s (%d)", host, pa_socks_strerr(no), no); } if(pa_send(sock, request, request_size) < 0) { int no=pa_socks_errno(); throw Exception("http.timeout", 0, "error sending request: %s (%d)", pa_socks_strerr(no), no); } result=response.read_response(sock, fail_on_status_ne_200); closesocket(sock); ALARM(0); return result; } catch(...) { ALARM(0); if(sock != INVALID_SOCKET) closesocket(sock); rethrow; } } } #ifndef DOXYGEN struct Http_pass_header_info { Request_charsets* charsets; String* request; bool* user_agent_specified; bool* content_type_specified; bool* content_type_url_encoded; }; #endif char *pa_http_safe_header_name(const char *name) { char *result=pa_strdup(name); char *n=result; if(!pa_isalpha((unsigned char)*n)) *n++ = '_'; for(; *n; ++n) { if (!pa_isalnum((unsigned char)*n) && *n != '-' && *n != '_') *n = '_'; } return result; } static void http_pass_header(HashStringValue::key_type aname, HashStringValue::value_type avalue, Http_pass_header_info *info) { const char* name_cstr=aname.cstr(); if(strcasecmp(name_cstr, HTTP_CONTENT_LENGTH)==0) return; String name=String(pa_http_safe_header_name(capitalize(name_cstr)), String::L_AS_IS); String value=attributed_meaning_to_string(*avalue, String::L_HTTP_HEADER, true); *info->request << name << ": " << value << CRLF; if(strcasecmp(name_cstr, HTTP_USER_AGENT)==0) *info->user_agent_specified=true; if(strcasecmp(name_cstr, HTTP_CONTENT_TYPE)==0){ *info->content_type_specified=true; *info->content_type_url_encoded=pa_strncasecmp(value.cstr(), HTTP_CONTENT_TYPE_FORM_URLENCODED)==0; } } static void http_pass_cookie(HashStringValue::key_type name, HashStringValue::value_type value, Http_pass_header_info *info) { *info->request << String(name, String::L_HTTP_COOKIE) << "=" << attributed_meaning_to_string(*value, String::L_HTTP_COOKIE, true) << "; "; } static const String* basic_authorization_field(const char* user, const char* pass) { if(!user&& !pass) return 0; String combined; if(user) combined<key, *row->get(0), info->result); } static void form_value2string(HashStringValue::key_type key, HashStringValue::value_type value, String* result) { if(const String* svalue=value->get_string()) form_string_value2string(key, *svalue, *result); else if(Table* tvalue=value->get_table()) { Form_table_value2string_info info(key, *result); tvalue->for_each(form_table_value2string, &info); } else throw Exception(PARSER_RUNTIME, new String(key, String::L_TAINTED), "is %s, " HTTP_FORM_NAME " option value can be string or table only (file is allowed for $." HTTP_METHOD_NAME "[POST] + $." HTTP_FORM_ENCTYPE_NAME "[" HTTP_CONTENT_TYPE_MULTIPART_FORMDATA "])", value->type()); } const char* pa_form2string(HashStringValue& form, Request_charsets& charsets) { String string; form.for_each(form_value2string, &string); return string.untaint_and_transcode_cstr(String::L_URI, &charsets); } struct FormPart { Request* r; const char* boundary; String* string; Form_table_value2string_info* info; struct BinaryBlock{ const char* ptr; size_t length; BinaryBlock(String* astring, Request* r): ptr(astring->untaint_and_transcode_cstr(String::L_AS_IS, &r->charsets)), length(strlen(ptr)){} BinaryBlock(const char* aptr, size_t alength): ptr(aptr), length(alength){} }; Array blocks; FormPart(Request* ar, const char* aboundary): r(ar), boundary(aboundary), string(new String()){} const char *post(size_t &length){ if(blocks.count()){ blocks+=BinaryBlock(string, r); length=0; for(size_t i=0; imime_type_of(file_name); } *part.string << CRLF CRLF; } static void form_string_value2part(HashStringValue::key_type key, const String& value, FormPart& part) { form_part_boundary_header(part, key); *part.string << value << CRLF; } static void form_file_value2part(HashStringValue::key_type key, VFile& vfile, FormPart& part) { form_part_boundary_header(part, key, vfile.fields().get(name_name)->as_string().cstr()); part.blocks+=FormPart::BinaryBlock(part.string, part.r); part.blocks+=FormPart::BinaryBlock(vfile.value_ptr(), vfile.value_size()); part.string=new String(); *part.string << CRLF; } static void form_table_value2part(Table::element_type row, FormPart* part) { form_string_value2part(part->info->key, *row->get(0), *part); } static void form_value2part(HashStringValue::key_type key, HashStringValue::value_type value, FormPart& part) { if(const String* svalue=value->get_string()) form_string_value2part(key, *svalue, part); else if(Table* tvalue=value->get_table()) { Form_table_value2string_info info(key, *part.string); part.info = &info; tvalue->for_each(form_table_value2part, &part); } else if(VFile* vfile=dynamic_cast(value)){ form_file_value2part(key, *vfile, part); } else throw Exception(PARSER_RUNTIME, new String(key, String::L_TAINTED), "is %s, " HTTP_FORM_NAME " option value can be string, table or file only", value->type()); } const char* pa_form2string_multipart(HashStringValue& form, Request& r, const char* boundary, size_t& post_size){ FormPart formpart(&r, boundary); form.for_each(form_value2part, formpart); *formpart.string << "--" << boundary << "--"; // @todo: return binary blocks here to save memory in pa_internal_file_read_http return formpart.post(post_size); } // Set-Cookie: name=value; Domain=docs.foo.com; Path=/accounts; Expires=Wed, 13-Jan-2021 22:23:01 GMT; Secure; HttpOnly static ArrayString* parse_cookie(Request& r, const String& cookie) { char *current=pa_strdup(cookie.cstr()); const String* name=0; const String* value=&String::Empty; const String* expires=&String::Empty; const String* max_age=&String::Empty; const String* path=&String::Empty; const String* domain=&String::Empty; const String* httponly=&String::Empty; const String* secure=&String::Empty; bool first_pair=true; do { if(char *meaning=search_stop(current, ';')) if(char *attribute=search_stop(meaning, '=')) { const String* sname=new String(unescape_chars(attribute, strlen(attribute), &r.charsets.source(), true/*don't convert '"' to space*/), String::L_TAINTED); const String* smeaning=0; if(meaning) smeaning=new String(unescape_chars(meaning, strlen(meaning), &r.charsets.source(), true/*don't convert '"' to space*/), String::L_TAINTED); if(first_pair) { // name + value name=sname; if(smeaning) value=smeaning; first_pair=false; } else { const String& slower=sname->change_case(r.charsets.source(), String::CC_LOWER); if(slower == "expires") expires=smeaning; else if(slower == "max-age") max_age=smeaning; else if(slower == "domain") domain=smeaning; else if(slower == "path") path=smeaning; else if(slower == "httponly") httponly=new String("1", String::L_CLEAN); else if(slower == "secure") secure=new String("1", String::L_CLEAN); else { // todo@ ? } } } } while(current); if(!name) return 0; ArrayString* result=new ArrayString(8); *result+=name; *result+=value; *result+=expires; *result+=max_age; *result+=domain; *result+=path; *result+=httponly; *result+=secure; return result; } Table* parse_cookies(Request& r, Table *cookies){ Table& result=*new Table(new Cookies_table_template_columns); for(Array_iterator i(*cookies); i; ) if(ArrayString* row=parse_cookie(r, *i.next()->get(0))) result+=row; return &result; } void tables_update(HashStringValue& tables, const String::Body name, const String& value){ Table *table; if(Value *valready=tables.get(name)) { // second+ appearence table=valready->get_table(); } else { // first appearence Table::columns_type columns=new ArrayString(1); *columns+=new String("value"); table=new Table(columns); tables.put(name, new VTable(table)); } // this string becomes next row ArrayString& row=*new ArrayString(1); row+=&value; *table+=&row; } /// @todo build .cookies field. use ^file.tables.SET-COOKIES.menu{ for now File_read_http_result pa_internal_file_read_http(Request& r, const String& file_spec, bool as_text, HashStringValue *options, bool transcode_text_result) { File_read_http_result result; char host[MAX_STRING]; const char *idna_host; const char* uri; short port=80; const char* method="GET"; bool method_is_get=true; HashStringValue* form=0; int timeout_secs=2; bool fail_on_status_ne_200=true; bool omit_post_charset=false; Value* vheaders=0; Value* vcookies=0; Value* vbody=0; Charset* asked_remote_charset=0; Charset* real_remote_charset=0; const char* user_cstr=0; const char* password_cstr=0; const char* encode=0; bool multipart=false; if(options) { int valid_options=pa_get_valid_file_options_count(*options); if(Value* vmethod=options->get(HTTP_METHOD_NAME)) { valid_options++; method=vmethod->as_string().change_case(r.charsets.source(), String::CC_UPPER).cstr(); method_is_get=strcmp(method, "GET")==0; } if(Value* vencode=options->get(HTTP_FORM_ENCTYPE_NAME)) { valid_options++; encode=vencode->as_string().cstr(); } if(Value* vform=options->get(HTTP_FORM_NAME)) { valid_options++; form=vform->get_hash(); } if(vbody=options->get(HTTP_BODY_NAME)) { valid_options++; } if(Value* vtimeout=options->get(HTTP_TIMEOUT_NAME)) { valid_options++; timeout_secs=vtimeout->as_int(); } if(vheaders=options->get(HTTP_HEADERS_NAME)) { valid_options++; } if(vcookies=options->get(HTTP_COOKIES_NAME)) { valid_options++; } if(Value* vany_status=options->get(HTTP_ANY_STATUS_NAME)) { valid_options++; fail_on_status_ne_200=!vany_status->as_bool(); } if(Value* vomit_post_charset=options->get(HTTP_OMIT_POST_CHARSET_NAME)){ valid_options++; omit_post_charset=vomit_post_charset->as_bool(); } if(Value* vcharset_name=options->get(PA_CHARSET_NAME)) { asked_remote_charset=&pa_charsets.get(vcharset_name->as_string()); } if(Value* vresponse_charset_name=options->get(PA_RESPONSE_CHARSET_NAME)) { valid_options++; real_remote_charset=&pa_charsets.get(vresponse_charset_name->as_string()); } if(Value* vuser=options->get(HTTP_USER)) { valid_options++; user_cstr=vuser->as_string().cstr(); } if(Value* vpassword=options->get(HTTP_PASSWORD)) { valid_options++; password_cstr=vpassword->as_string().cstr(); } if(valid_options!=options->count()) throw Exception(PARSER_RUNTIME, 0, CALLED_WITH_INVALID_OPTION); } if(!asked_remote_charset) // defaulting to $request:charset asked_remote_charset=&(r.charsets).source(); if(encode){ if(method_is_get) throw Exception(PARSER_RUNTIME, 0, "you cannot use $." HTTP_FORM_ENCTYPE_NAME " option with method GET"); multipart=strcasecmp(encode, HTTP_CONTENT_TYPE_MULTIPART_FORMDATA)==0; if(!multipart && strcasecmp(encode, HTTP_CONTENT_TYPE_FORM_URLENCODED)!=0) throw Exception(PARSER_RUNTIME, 0, "$." HTTP_FORM_ENCTYPE_NAME " option value can be " HTTP_CONTENT_TYPE_FORM_URLENCODED " or " HTTP_CONTENT_TYPE_MULTIPART_FORMDATA " only"); } if(vbody){ if(method_is_get) throw Exception(PARSER_RUNTIME, 0, "you cannot use $." HTTP_BODY_NAME " option with method GET"); if(form) throw Exception(PARSER_RUNTIME, 0, "you cannot use options $." HTTP_BODY_NAME " and $." HTTP_FORM_NAME " together"); } //preparing request String& connect_string=*new String(file_spec); const char* request; size_t request_size; { // influence URLencoding of tainted pieces to String::L_URI lang Temp_client_charset temp(r.charsets, *asked_remote_charset); const char* connect_string_cstr=connect_string.untaint_and_transcode_cstr(String::L_URI, &(r.charsets)); const char* current=connect_string_cstr; if(strncmp(current, "http://", 7)!=0) throw Exception(PARSER_RUNTIME, &connect_string, "does not start with http://"); //never current+=7; pa_strncpy(host, current, sizeof(host)); char* host_uri=lsplit(host, '/'); uri=host_uri?current+(host_uri-1-host):"/"; char* port_cstr=lsplit(host, ':'); if (port_cstr){ char* error_pos=0; port=(short)strtol(port_cstr, &error_pos, 10); if(port==0 || *error_pos) throw Exception(PARSER_RUNTIME, &connect_string, "invalid port number '%s'", port_cstr); } idna_host=pa_idna_encode(host, r.charsets.source()); // making request head String head; head << method << " " << uri; if(method_is_get && form) head << (strchr(uri, '?')!=0?"&":"?") << pa_form2string(*form, r.charsets); head <<" HTTP/1.0" CRLF "Host: "<< idna_host; if (port != 80) head << ":" << port_cstr; head << CRLF; char* boundary= multipart ? get_uuid_boundary() : 0; String user_headers; bool user_agent_specified=false; bool content_type_specified=false; bool content_type_url_encoded=false; if(vheaders && !vheaders->is_string()) { // allow empty if(HashStringValue *headers=vheaders->get_hash()) { Http_pass_header_info info={ &(r.charsets), &user_headers, &user_agent_specified, &content_type_specified, &content_type_url_encoded}; headers->for_each(http_pass_header, &info); } else throw Exception(PARSER_RUNTIME, 0, "headers param must be hash"); }; const char* request_body=0; size_t post_size=0; if(form && !method_is_get) { head << "Content-Type: " << (multipart ? HTTP_CONTENT_TYPE_MULTIPART_FORMDATA : HTTP_CONTENT_TYPE_FORM_URLENCODED); if(!omit_post_charset) head << "; charset=" << asked_remote_charset->NAME_CSTR(); if(multipart) { head << "; boundary=" << boundary; request_body=pa_form2string_multipart(*form, r/*charsets & mime_type needed*/, boundary, post_size/*correct post_size returned here*/); } else { request_body=pa_form2string(*form, r.charsets); post_size=strlen(request_body); } head << CRLF; } else if(vbody) { // $.body was specified if(content_type_url_encoded){ // transcode + url-encode request_body=vbody->as_string().untaint_and_transcode_cstr(String::L_URI, &(r.charsets)); } else { // content-type != application/x-www-form-urlencoded -> transcode only, don't url-encode! const String &sbody=vbody->as_string(); request_body=Charset::transcode(String::C(sbody.cstr(), sbody.length()), r.charsets.source(), *asked_remote_charset).str; } post_size=strlen(request_body); } // http://www.ietf.org/rfc/rfc2617.txt if(const String* authorization_field_value=basic_authorization_field(user_cstr, password_cstr)) head << "Authorization: " << *authorization_field_value << CRLF; head << user_headers; if(!user_agent_specified) // defaulting head << "User-Agent: " DEFAULT_USER_AGENT CRLF; if(form && !method_is_get && content_type_specified) // POST + form + content-type was specified throw Exception(PARSER_RUNTIME, 0, "$.content-type can't be specified with method POST"); if(vcookies && !vcookies->is_string()){ // allow empty if(HashStringValue* cookies=vcookies->get_hash()) { head << "Cookie: "; Http_pass_header_info info={&(r.charsets), &head, 0, 0, 0}; cookies->for_each(http_pass_cookie, &info); head << CRLF; } else throw Exception(PARSER_RUNTIME, 0, "cookies param must be hash"); } if(request_body) head << "Content-Length: " << pa_uitoa(post_size) << CRLF; head << CRLF; const char *request_head=head.untaint_and_transcode_cstr(String::L_URI, &(r.charsets)); if(request_body){ size_t head_size = strlen(request_head); request_size=post_size + head_size; char *ptr=(char *)pa_malloc_atomic(request_size); memcpy(ptr, request_head, head_size); memcpy(ptr+head_size, request_body, post_size); request=ptr; } else { request_size=strlen(request_head); request=request_head; } } HTTP_response response; // sending request int status_code; ALTER_EXCEPTION_SOURCE(status_code=http_request(response, idna_host, port, request, request_size, timeout_secs, fail_on_status_ne_200), &connect_string); // processing results char* raw_body=response.buf + response.body_offset; size_t raw_body_size=response.length - response.body_offset; result.headers=new HashStringValue; VHash* vtables=new VHash; result.headers->put("tables", vtables); if (!real_remote_charset && !response.headers.content_type.is_empty()) real_remote_charset=detect_charset(response.headers.content_type.cstr()); if(as_text) real_remote_charset=pa_charsets.checkBOM(raw_body, raw_body_size, real_remote_charset); if (!real_remote_charset) real_remote_charset=asked_remote_charset; // never null for(Array_iterator i(response.headers.headers); i; ){ HTTP_Headers::Header header=i.next(); header.transcode(*real_remote_charset, r.charsets.source()); String &header_value=*new String(header.value, String::L_TAINTED); tables_update(vtables->hash(), header.name, header_value); result.headers->put(header.name, new VString(header_value)); } // filling $.cookies if(vcookies=vtables->hash().get("SET-COOKIE")) result.headers->put(HTTP_COOKIES_NAME, new VTable(parse_cookies(r, vcookies->get_table()))); // output response String::C real_body=String::C(raw_body, raw_body_size); if(as_text && transcode_text_result && raw_body_size) { // raw_body_size must be checked because transcode returns CONST string in case length==0, which contradicts hacking few lines below real_body=Charset::transcode(real_body, *real_remote_charset, r.charsets.source()); } result.str=const_cast(real_body.str); // hacking a little result.length=real_body.length; if(as_text && result.length) fix_line_breaks(result.str, result.length); result.headers->put(file_status_name, new VInt(status_code)); return result; } /* ********************** httpd *************************** */ enum EscapeState { Initial, Default, EscapeFirst, EscapeSecond }; static bool check_uri(const char *uri){ EscapeState state=Initial; uint escapedValue=0; const char *pattern="/../"; const char *pos=pattern; while(*uri){ uchar c=(uchar)*(uri++); switch(state) { case Initial: if(c!='/') return false; state=Default; break; case Default: if(c=='%'){ state=EscapeFirst; continue; } if(c=='?') return true; break; case EscapeFirst: if(isxdigit(c)){ state=EscapeSecond; escapedValue=hex_value[c] << 4; continue; } return false; case EscapeSecond: if(isxdigit(c)){ state=Default; c=(uchar)(escapedValue + hex_value[c]); // implementing Apache AllowEncodedSlashes Off just in case if(c=='/' || c=='\\') return false; break; } return false; } if(c==*pos || c=='\\' && *pos=='/'){ if(!*(++pos)) return false; } else { pos=pattern; } } return true; } class HTTPD_request : public HTTP_response { public: const char *method; const char *uri; HTTPD_request() : HTTP_response(), method(NULL), uri(NULL){}; ssize_t pa_recv(SOCKET sockfd, char *buf, size_t len); bool read(SOCKET sock, size_t size){ if(length + size > buf_size) resize(buf_size * 2 + size); ssize_t received_size=pa_recv(sock, buf + length, size); if(received_size == 0) return false; if(received_size < 0) { if(int no = pa_socks_errno()) throw Exception("httpd.read", 0, "error receiving request: %s (%d)", pa_socks_strerr(no), no); return false; } length+=received_size; buf[length]='\0'; return true; } const char *extract_method(char *method_line){ char* uri_start = strchr(method_line, ' '); if(!uri_start || uri_start == method_line) return NULL; char* uri_end=strchr(uri_start+1, ' '); if(!uri_end || uri_end == uri_start+1) return NULL; uri=pa_strdup(uri_start+1, uri_end-uri_start-1); if(!check_uri(uri)) throw Exception("httpd.request", 0, "invalid uri '%s'", uri); return str_upper(method_line, uri_start-method_line); } bool read_header(SOCKET); size_t read_post(SOCKET, char *, size_t); }; enum HTTPD_request_state { HTTPD_METHOD, HTTPD_HEADERS }; ssize_t HTTPD_request::pa_recv(SOCKET sockfd, char *buffer, size_t len){ LOG(pa_log("httpd [%d] recv %d appending to %d ...", sockfd, len, length)); #ifdef PA_USE_ALARM if(PA_NO_THREADS) signal(SIGALRM, timeout_handler); if(PA_NO_THREADS && sigsetjmp(timeout_env, 1)) { LOG(pa_log("httpd [%d] recv got %d sec timeout", sockfd, pa_httpd_timeout)); if(length) // timeout on "void" connection is normal throw Exception("httpd.timeout", 0, "timeout occurred while receiving request"); return 0; } else #endif { ALARM(pa_httpd_timeout); ssize_t result=recv(sockfd, buffer, len, 0); ALARM(0); LOG(pa_log("httpd [%d] recv got %d bytes", sockfd, result)); LOG(pa_log("httpd [%d] %s", sockfd, buffer)); return result; } } static bool valid_http_method(const char * method){ return method && ( !strcmp(method, "GET") || !strcmp(method, "HEAD") || !strcmp(method, "POST") || !strcmp(method, "PUT") || !strcmp(method, "DELETE") || !strcmp(method, "CONNECT") || !strcmp(method, "OPTIONS") || !strcmp(method, "TRACE") || !strcmp(method, "PATCH") ); } bool HTTPD_request::read_header(SOCKET sock) { enum HTTPD_request_state state = HTTPD_METHOD; size_t chunk_size = 0x400*4; resize(chunk_size); while(read(sock, chunk_size)){ switch(state){ case HTTPD_METHOD: { size_t method_size = first_line(); if(!method_size) break; char *method_line = pa_strdup(buf, method_size); method = extract_method(method_line); if(!valid_http_method(method)) throw Exception("httpd.method", new String(method ? method : method_line), "invalid request method"); state = HTTPD_HEADERS; } case HTTPD_HEADERS: { if(!body_start()) break; parse_headers(); return true; } } } if(!length){ // browsers open connections in advance and they will be empty unless user requests more pages LOG(pa_log("httpd [%d] void request", sock)); return false; } if(state == HTTPD_METHOD) throw Exception("httpd.request", 0, "bad request from host - no method found (size=%u)", length); if(state == HTTPD_HEADERS){ parse_headers(); body_offset=length; } return true; } size_t HTTPD_request::read_post(SOCKET sock, char *body, size_t max_bytes) { size_t total_read = min(length - body_offset, max_bytes); memcpy(body, buf + body_offset, total_read); while (total_read < max_bytes){ ssize_t received_size = pa_recv(sock, body + total_read, max_bytes - total_read); if(received_size == 0) return total_read; if(received_size < 0) { if(int no = pa_socks_errno()) throw Exception("httpd.read", new String(uri), "error receiving request body: %s (%d)", pa_socks_strerr(no), no); return total_read; } total_read += received_size; } return total_read; } /* ********************************************************** */ Array &HTTPD_Connection::headers() { return request->headers.headers; } const char *HTTPD_Connection::method() { return request->method; } const char *HTTPD_Connection::uri() { return request->uri; } const char *HTTPD_Connection::content_type() { return request->headers.content_type.cstr(); } uint64_t HTTPD_Connection::content_length(){ return request->headers.content_length; } bool HTTPD_Connection::read_header(){ request = new HTTPD_request(); bool result = request->read_header(sock); LOG(if(result){ pa_log("httpd [%d] got %s \"%s\"", sock, method(), uri()); }) return result; } size_t HTTPD_Connection::read_post(char *body, size_t max_bytes) { return request->read_post(sock, body, max_bytes); } size_t HTTPD_Connection::send_body(const void *buf, size_t size) { LOG(pa_log("httpd [%d] response %d bytes", sock, size)); LOG(pa_log("httpd [%d] %s", sock, buf)); ssize_t result=pa_send(sock, (const char*)buf, size); if(result < 0) { int no=pa_socks_errno(); throw Exception("httpd.write", 0, "error sending response: %s (%d)", pa_socks_strerr(no), no); } return result; } HTTPD_Connection::~HTTPD_Connection(){ if(sock != INVALID_SOCKET){ LOG(pa_log("httpd [%d] closed", sock)); closesocket(sock); } } static int sock_ready(SOCKET fd, int timeout_value){ struct timeval timeout = {0, timeout_value * 1000}; fd_set fds; FD_ZERO(&fds); FD_SET(fd, &fds); int nfds = (int)fd + 1; /* typecast as nfds is ignored in MSVC anyway */ return select(nfds, &fds, NULL, NULL, &timeout)>0; /* read */ } bool HTTPD_Connection::accept(SOCKET server_sock, int timeout_value) { int ready = sock_ready(server_sock, timeout_value); if (ready < 0) { int no=pa_socks_errno(); if(no == EINTR) return false; throw Exception("httpd.accept", 0, "error waiting for connection: %s (%d)", pa_socks_strerr(no), no); } if (ready == 0) return false; /* Timeout */ struct sockaddr_in addr; socklen_t sock_addr_len = sizeof(struct sockaddr_in); memset(&addr, 0, sock_addr_len); sock = ::accept(server_sock, (struct sockaddr *)&addr, &sock_addr_len); if(sock == INVALID_SOCKET){ int no=pa_socks_errno(); throw Exception("httpd.accept", 0, "error accepting connection: %s (%d)", pa_socks_strerr(no), no); } // Has no positive performance effect, requires include // static int sock_on=1; // setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&sock_on, sizeof(sock_on)); remote_addr = pa_strdup(inet_ntoa(addr.sin_addr)); LOG(pa_log("httpd [%d] accepted from %s", sock, remote_addr)); return true; } HTTPD_Server::HTTPD_MODE HTTPD_Server::mode = HTTPD_Server::SEQUENTIAL; const char *HTTPD_Server::port=NULL; void HTTPD_Server::set_mode(const String &value){ if(value == "sequental") mode = SEQUENTIAL; #ifdef HAVE_TLS else if (value == "threaded") mode = MULTITHREADED; #endif #ifdef _MSC_VER else throw Exception("httpd.mode", &value, "$MAIN:HTTPD.mode must be 'sequental' or 'threaded'"); #else else if (value == "parallel") mode = PARALLEL; else throw Exception("httpd.mode", &value, "$MAIN:HTTPD.mode must be 'sequental', 'parallel' or 'threaded'"); #endif } SOCKET HTTPD_Server::bind(const char *host_port){ struct sockaddr_in me; port = strchr(host_port, ':'); const char *host = NULL; if(port){ if(port > host_port) host = pa_strdup(host_port, port - host_port); port += 1; } else { port = host_port; } if(!set_addr(&me, host, (short)pa_atoui(port))){ if (host) throw Exception("httpd.bind", 0, "cannot resolve hostname \"%s\"", host); me.sin_addr.s_addr=INADDR_ANY; } SOCKET sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP/*0*/); if(sock == INVALID_SOCKET){ int no=pa_socks_errno(); throw Exception("httpd.bind", 0, "cannot make socket: %s (%d)", pa_socks_strerr(no), no); } static int sock_on = 1; if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&sock_on, sizeof(sock_on)) || setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (char *)&sock_on, sizeof(sock_on)) || ::bind(sock, (struct sockaddr*)&me, sizeof(me)) || listen(sock, 16)) { closesocket(sock); int no = pa_socks_errno(); throw Exception("httpd.bind", 0, "cannot bind socket: %s (%d)", pa_socks_strerr(no), no); } return sock; } parser-3.5.1/src/main/compile.tab.C0000644000076400007640000034665014723502357014007 00000000000000/* A Bison parser, made by GNU Bison 3.3.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Undocumented macros, especially those whose name start with YY_, are private implementation details. Do not rely on them. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.3.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* First part of user prologue. */ #line 1 "compile.y" /* yacc.c:337 */ /** @file Parser: compiler(lexical parser and grammar). Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ volatile const char * IDENT_COMPILE_Y = "$Id: compile.tab.C,v 1.190 2024/12/03 04:11:27 moko Exp $"; /** @todo parser4: - cache compiled code from request to request. to do that... -#: make method definitions, @CLASS, @BASE, @USE instructions, which would be executed afterwards, and actions now performed at compile time would be delayed to run time. -#: make cache expiration on time and on disk-change of class source -#: in apache use subpools for compiled class storage -#: in iis make up specialized Pool object for that */ #define YYSTYPE ArrayOperation* #define YYDEBUG 1 #define YYERROR_VERBOSE 1 #define yyerror(pc, msg) real_yyerror(pc, msg) #define YYPRINT(file, type, value) yyprint(file, type, value) #define YYMALLOC pa_malloc #define YYFREE pa_free // includes #include "compile_tools.h" #include "pa_value.h" #include "pa_request.h" #include "pa_vobject.h" #include "pa_vdouble.h" #include "pa_globals.h" #include "pa_vmethod_frame.h" // defines #define CLASS_NAME "CLASS" #define USE_CONTROL_METHOD_NAME "USE" #define OPTIONS_CONTROL_METHOD_NAME "OPTIONS" // forwards static int real_yyerror(Parse_control* pc, const char* s); static void yyprint(FILE* file, int type, YYSTYPE value); static int yylex(YYSTYPE* lvalp, void* pc); static const VBool vfalse(false); static const VBool vtrue(true); static const VString vempty; // local convinient inplace typecast & var #undef PC #define PC (*pc) #undef POOL #define POOL (*PC.pool) #ifndef DOXYGEN #define CLASS_ADD if(!PC.class_add()){ \ PC.error=pa_strcat(PC.cclass->type(), " - class is already defined"); \ YYERROR; \ } #define YYERROR3(header, value, footer) { \ PC.error=pa_strcat(header, value, footer); \ YYERROR; \ } #define YYERROR1(value) { \ PC.error=value; \ YYERROR; \ } #line 151 "compile.tab.C" /* yacc.c:337 */ # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { EON = 258, STRING = 259, BOGUS = 260, BAD_STRING_COMPARISON_OPERATOR = 261, BAD_HEX_LITERAL = 262, BAD_METHOD_DECL_START = 263, BAD_METHOD_PARAMETER_NAME_CHARACTER = 264, LAND = 265, LOR = 266, LXOR = 267, NXOR = 268, NLE = 269, NGE = 270, NEQ = 271, NNE = 272, NSL = 273, NSR = 274, SLT = 275, SGT = 276, SLE = 277, SGE = 278, SEQ = 279, SNE = 280, DEF = 281, IN = 282, FEXISTS = 283, DEXISTS = 284, IS = 285, LITERAL_TRUE = 286, LITERAL_FALSE = 287, NUNARY = 288 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif int yyparse (Parse_control* pc); #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 53 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 560 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 61 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 91 /* YYNRULES -- Number of rules. */ #define YYNRULES 176 /* YYNSTATES -- Number of states. */ #define YYNSTATES 270 #define YYUNDEFTOK 2 #define YYMAXUTOK 288 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 47, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 45, 59, 2, 51, 42, 36, 60, 55, 56, 39, 37, 2, 38, 54, 40, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 58, 50, 33, 2, 34, 2, 46, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 48, 41, 49, 57, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52, 35, 53, 44, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 43 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 148, 148, 152, 154, 154, 155, 157, 157, 159, 230, 230, 231, 231, 232, 233, 233, 235, 235, 282, 282, 283, 284, 284, 285, 285, 287, 287, 291, 291, 293, 293, 294, 294, 295, 295, 295, 299, 330, 331, 331, 332, 334, 335, 336, 385, 386, 386, 390, 403, 404, 405, 406, 428, 433, 436, 437, 438, 440, 444, 440, 459, 460, 462, 469, 476, 477, 478, 480, 486, 487, 487, 491, 502, 505, 502, 554, 570, 570, 572, 573, 574, 576, 579, 576, 582, 583, 585, 586, 589, 590, 593, 594, 596, 599, 612, 617, 618, 619, 624, 624, 626, 626, 627, 628, 640, 649, 652, 653, 654, 655, 656, 658, 662, 671, 674, 671, 687, 691, 696, 696, 697, 703, 704, 706, 725, 735, 737, 738, 739, 740, 741, 742, 743, 744, 746, 747, 748, 749, 750, 751, 752, 753, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 784, 789, 810, 815, 816, 817, 819 }; #endif #if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "EON", "STRING", "BOGUS", "BAD_STRING_COMPARISON_OPERATOR", "BAD_HEX_LITERAL", "BAD_METHOD_DECL_START", "BAD_METHOD_PARAMETER_NAME_CHARACTER", "\"&&\"", "\"||\"", "\"!||\"", "\"!|\"", "\"<=\"", "\">=\"", "\"==\"", "\"!=\"", "\"<<\"", "\">>\"", "\"lt\"", "\"gt\"", "\"le\"", "\"ge\"", "\"eq\"", "\"ne\"", "\"def\"", "\"in\"", "\"-f\"", "\"-d\"", "\"is\"", "\"true\"", "\"false\"", "'<'", "'>'", "'|'", "'&'", "'+'", "'-'", "'*'", "'/'", "'\\\\'", "'%'", "NUNARY", "'~'", "'!'", "'@'", "'\\n'", "'['", "']'", "';'", "'$'", "'{'", "'}'", "'.'", "'('", "')'", "'^'", "':'", "'\"'", "'\\''", "$accept", "all", "methods", "one_big_piece", "method", "control_method", "maybe_control_strings", "control_strings", "control_string", "maybe_string", "code_method", "@1", "maybe_bracketed_strings", "bracketed_maybe_strings", "maybe_strings", "strings", "maybe_comment", "maybe_codes", "codes", "code", "action", "get", "get_value", "get_name_value", "name_in_curly_rdive", "name_without_curly_rdive", "name_without_curly_rdive_read", "name_without_curly_rdive_class", "name_without_curly_rdive_code", "put", "name_expr_wdive", "name_expr_wdive_root", "name_expr_wdive_write", "name_expr_wdive_class", "construct", "construct_square", "@2", "$@3", "any_constructor_code_values", "construct_round", "construct_curly", "any_constructor_code_value", "constructor_code_value", "constructor_code", "codes__excluding_sole_str_literal", "call", "call_value", "$@4", "$@5", "call_name", "store_params", "store_param", "store_square_param", "@6", "$@7", "store_round_param", "store_curly_param", "store_code_param_parts", "store_expr_param_parts", "store_curly_param_parts", "store_code_param_part", "store_expr_param_part", "store_curly_param_part", "code_param_value", "name_expr_dive_code", "name_path", "name_step", "name_advance1", "name_advance2", "name_expr_value", "name_expr_subvar_value", "name_expr_with_subvar_value", "name_square_code_value", "@8", "$@9", "name_round_expr_value", "subvar_ref_name_rdive", "subvar_get_writes", "subvar__get_write", "class_prefix", "class_static_prefix", "class_constructor_prefix", "expr_value", "expr", "double_or_STRING", "string_inside_quotes_value", "write_string", "empty_value", "true_value", "false_value", "empty", YY_NULLPTR }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 60, 62, 124, 38, 43, 45, 42, 47, 92, 37, 288, 126, 33, 64, 10, 91, 93, 59, 36, 123, 125, 46, 40, 41, 94, 58, 34, 39 }; # endif #define YYPACT_NINF -220 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-220))) #define YYTABLE_NINF -177 #define yytable_value_is_error(Yytable_value) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { 9, -220, 29, 50, -220, 37, 16, -220, -220, -220, -220, -220, 10, -220, -220, -220, -220, -220, -220, -220, -220, -220, -6, 14, -220, 45, 91, 92, 248, -220, -220, 47, -220, -220, -220, -24, -220, -220, -220, -220, 93, -220, -3, -220, 5, -220, -220, -220, -220, 93, -1, -220, 91, -220, -220, -220, 80, 82, 43, -220, 45, -220, 66, -220, 10, -220, -220, 58, 93, 68, 93, 66, -220, 92, 68, -220, 248, 248, 248, 248, -220, -220, 248, 248, 248, 248, 77, 248, 10, 10, -220, -220, 70, 346, -220, -220, -220, -220, -220, 10, 248, -220, -220, -220, -220, 12, -220, -220, 5, -220, -220, -220, -220, -220, -220, -220, -220, 11, -220, 84, 90, -220, 75, 83, -220, 123, -220, -220, -220, -220, 10, -220, 68, 480, 480, 480, 480, -220, -220, -220, -220, 299, -220, 101, 85, -220, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 22, 108, 106, -16, -220, -220, -220, -220, 159, -220, 117, -220, 116, -220, -220, -220, 442, 412, 379, 505, 472, 472, 312, 312, 112, 112, 472, 472, 472, 472, 312, 312, 480, 472, 472, 512, 518, 67, 67, -220, -220, -220, -220, 86, 10, 107, 118, -220, -220, -220, -220, -220, -220, -220, -220, 10, 248, 35, -220, -220, -220, -220, -220, -220, -220, 10, 22, 120, 23, -220, 32, -220, 60, -220, -220, -220, -220, 10, -220, -220, 109, -220, 121, -220, -220, -220, 10, -220, 248, -220, -220, 23, 125, -220, -220, -220, -220 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 176, 172, 0, 0, 73, 0, 3, 2, 4, 7, 8, 6, 29, 30, 33, 34, 37, 35, 36, 72, 32, 28, 0, 107, 114, 0, 0, 0, 0, 38, 40, 0, 42, 43, 44, 0, 49, 50, 51, 52, 0, 101, 0, 46, 99, 108, 109, 110, 111, 0, 122, 123, 0, 1, 5, 31, 176, 176, 176, 106, 0, 124, 113, 119, 0, 118, 112, 0, 0, 105, 0, 107, 53, 0, 99, 170, 0, 0, 0, 0, 174, 175, 0, 0, 0, 0, 0, 0, 176, 176, 130, 131, 0, 126, 127, 128, 129, 39, 58, 176, 0, 48, 55, 56, 57, 107, 102, 47, 100, 103, 45, 54, 125, 76, 74, 16, 9, 11, 12, 0, 10, 24, 0, 23, 22, 176, 20, 19, 121, 120, 115, 41, 100, 139, 140, 141, 142, 136, 135, 137, 138, 0, 171, 0, 0, 117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 0, 0, 0, 13, 15, 14, 21, 0, 27, 0, 26, 0, 134, 132, 133, 154, 155, 156, 153, 159, 160, 161, 162, 149, 150, 163, 164, 165, 166, 167, 168, 169, 157, 158, 152, 151, 144, 143, 145, 146, 148, 147, 172, 0, 33, 59, 61, 67, 68, 69, 65, 64, 63, 82, 176, 0, 0, 77, 79, 80, 81, 25, 17, 116, 71, 173, 0, 173, 95, 0, 91, 0, 89, 94, 75, 78, 176, 62, 60, 172, 98, 83, 87, 93, 96, 176, 86, 0, 85, 18, 173, 0, 92, 90, 88, 84 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -220, -220, -220, -220, 160, -220, -220, -220, 53, -220, -220, -220, -220, 114, -220, -220, -220, 1, -62, 8, -170, -220, 0, -220, -220, -5, -220, -220, -26, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -220, -72, -219, -220, -220, -220, 4, -220, -220, -220, -220, -55, -220, -220, -220, -220, -220, -220, -220, -220, -88, -83, -80, -220, 7, 26, -33, -220, -22, 3, -220, -220, -220, -220, -220, -220, 149, -220, 148, 177, -220, -220, -23, 36, -220, 122, -220, -216, -220, -220, -47 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 5, 6, 7, 8, 9, 116, 117, 118, 119, 10, 250, 125, 58, 122, 123, 183, 142, 12, 13, 14, 15, 90, 29, 30, 31, 32, 33, 34, 17, 35, 36, 37, 38, 101, 102, 173, 240, 219, 103, 104, 220, 221, 222, 223, 18, 91, 52, 176, 114, 230, 231, 232, 241, 265, 233, 234, 255, 245, 243, 256, 246, 244, 257, 39, 68, 41, 42, 43, 69, 45, 46, 47, 64, 185, 48, 66, 62, 63, 70, 50, 51, 247, 93, 94, 143, 20, 224, 95, 96, 21 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 16, 11, 130, 218, 19, 92, 44, 106, -105, 120, 124, 127, 16, 1, 1, 115, 19, 59, 107, 59, 55, 67, 254, 110, 98, 258, 216, 253, 99, 40, 74, 100, 227, 22, 72, 106, 228, 53, 248, 229, 106, 56, 57, 108, 110, 254, 107, 113, 258, 65, 97, 109, 44, 73, 23, 2, 111, 112, -176, -104, 3, 3, 2, 60, 16, 60, 4, 4, 19, 218, 178, 218, 61, 3, 3, 40, 132, 175, 184, 4, 4, 23, 259, 227, 115, 260, 121, 228, 16, 16, 229, 57, 19, 19, 218, 23, 71, 105, 24, 16, 174, 25, 26, 19, 27, 28, 169, 170, 171, 172, 261, 131, 133, 134, 135, 136, 262, 60, 137, 138, 139, 140, -104, 141, 180, 24, 145, 182, 25, 26, 16, 179, 28, 181, 19, -66, -66, -15, 55, 24, 24, 24, 25, 25, 25, 188, 28, 28, 28, 167, 168, 169, 170, 171, 172, 238, -70, -70, -97, -97, 187, 225, 226, 235, 236, 237, 54, 251, 239, 252, 177, 264, 126, 16, 269, 249, 268, 19, 267, 266, 49, 217, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 128, 129, 144, 0, 0, 0, 0, 0, 16, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 16, 242, 0, 0, 19, 0, 0, 0, 0, 0, 16, 16, 0, 16, 19, 19, 0, 19, 55, 217, 0, 217, 16, 263, 75, 0, 19, 0, 0, 0, 0, 16, 242, 0, 0, 19, 16, 0, 0, 0, 19, 0, 0, 0, 217, 0, 76, 77, 78, 79, 0, 80, 81, 0, 0, 0, 0, 82, 83, 0, 0, 0, 0, 0, 84, 85, 0, 0, 0, 0, 0, 86, 0, 0, 0, 87, 0, 4, 0, 88, 89, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 149, 0, 0, 0, 162, 154, 155, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 162, 0, 0, 0, 0, 165, 166, 167, 168, 169, 170, 171, 172, 186, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 0, 0, 0, 0, 162, 0, 0, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 146, 147, 0, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 0, 0, 0, 0, 162, 0, 0, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 146, 0, 0, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 0, 0, 0, 0, 162, 0, 0, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 0, 0, 0, 0, 162, 0, 0, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 149, 0, 0, 152, 153, 154, 155, 0, 149, 0, 0, 160, 161, 154, 155, 0, 0, 162, 0, 0, 0, 0, 165, 166, 167, 168, 169, 170, 171, 172, 165, 166, 167, 168, 169, 170, 171, 172, 154, 155, 0, 0, 0, 0, 0, 154, 155, 0, 0, 0, 0, 154, 155, 0, 0, 165, 166, 167, 168, 169, 170, 171, 172, 166, 167, 168, 169, 170, 171, 172, 167, 168, 169, 170, 171, 172 }; static const yytype_int16 yycheck[] = { 0, 0, 64, 173, 0, 28, 3, 40, 3, 56, 57, 58, 12, 4, 4, 4, 12, 5, 40, 5, 12, 26, 241, 49, 48, 241, 4, 4, 52, 3, 27, 55, 48, 4, 27, 68, 52, 0, 3, 55, 73, 47, 48, 40, 70, 264, 68, 52, 264, 4, 3, 54, 49, 27, 4, 46, 49, 58, 47, 54, 51, 51, 46, 51, 64, 51, 57, 57, 64, 239, 117, 241, 58, 51, 51, 49, 73, 100, 125, 57, 57, 4, 50, 48, 4, 53, 4, 52, 88, 89, 55, 48, 88, 89, 264, 4, 4, 4, 48, 99, 99, 51, 52, 99, 54, 55, 39, 40, 41, 42, 50, 53, 76, 77, 78, 79, 56, 51, 82, 83, 84, 85, 54, 87, 49, 48, 56, 4, 51, 52, 130, 47, 55, 50, 130, 49, 50, 47, 130, 48, 48, 48, 51, 51, 51, 60, 55, 55, 55, 37, 38, 39, 40, 41, 42, 217, 49, 50, 49, 50, 59, 53, 56, 4, 47, 49, 6, 239, 50, 49, 117, 50, 58, 173, 49, 230, 264, 173, 261, 259, 3, 173, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 60, 62, 89, -1, -1, -1, -1, -1, 217, -1, -1, -1, 217, -1, -1, -1, -1, -1, -1, 228, 228, -1, -1, 228, -1, -1, -1, -1, -1, 238, 239, -1, 241, 238, 239, -1, 241, 238, 239, -1, 241, 250, 250, 4, -1, 250, -1, -1, -1, -1, 259, 259, -1, -1, 259, 264, -1, -1, -1, 264, -1, -1, -1, 264, -1, 26, 27, 28, 29, -1, 31, 32, -1, -1, -1, -1, 37, 38, -1, -1, -1, -1, -1, 44, 45, -1, -1, -1, -1, -1, 51, -1, -1, -1, 55, -1, 57, -1, 59, 60, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 13, -1, -1, -1, 30, 18, 19, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 30, -1, -1, -1, -1, 35, 36, 37, 38, 39, 40, 41, 42, 56, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 10, 11, -1, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 10, -1, -1, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 30, -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 13, -1, -1, 16, 17, 18, 19, -1, 13, -1, -1, 24, 25, 18, 19, -1, -1, 30, -1, -1, -1, -1, 35, 36, 37, 38, 39, 40, 41, 42, 35, 36, 37, 38, 39, 40, 41, 42, 18, 19, -1, -1, -1, -1, -1, 18, 19, -1, -1, -1, -1, 18, 19, -1, -1, 35, 36, 37, 38, 39, 40, 41, 42, 36, 37, 38, 39, 40, 41, 42, 37, 38, 39, 40, 41, 42 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 4, 46, 51, 57, 62, 63, 64, 65, 66, 71, 78, 79, 80, 81, 82, 83, 90, 106, 107, 147, 151, 4, 4, 48, 51, 52, 54, 55, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 125, 126, 127, 128, 129, 130, 131, 132, 133, 136, 140, 141, 142, 108, 0, 65, 80, 47, 48, 74, 5, 51, 58, 138, 139, 134, 4, 137, 86, 126, 130, 140, 4, 125, 126, 130, 4, 26, 27, 28, 29, 31, 32, 37, 38, 44, 45, 51, 55, 59, 60, 83, 107, 143, 144, 145, 149, 150, 3, 48, 52, 55, 95, 96, 100, 101, 4, 127, 129, 130, 54, 89, 125, 58, 86, 110, 4, 67, 68, 69, 70, 151, 4, 75, 76, 151, 73, 74, 151, 137, 139, 79, 53, 130, 144, 144, 144, 144, 144, 144, 144, 144, 144, 78, 146, 146, 56, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 30, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 97, 78, 143, 109, 69, 151, 47, 49, 50, 4, 77, 151, 135, 56, 59, 60, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 4, 80, 81, 99, 102, 103, 104, 105, 148, 53, 56, 48, 52, 55, 111, 112, 113, 116, 117, 4, 47, 49, 79, 50, 98, 114, 78, 120, 123, 119, 122, 143, 3, 112, 72, 102, 49, 4, 103, 118, 121, 124, 148, 50, 53, 50, 56, 78, 50, 115, 123, 122, 121, 49 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 61, 62, 62, 63, 63, 64, 65, 65, 66, 67, 67, 68, 68, 69, 70, 70, 72, 71, 73, 73, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 81, 82, 83, 84, 84, 85, 86, 86, 87, 88, 89, 89, 90, 91, 91, 91, 92, 93, 94, 95, 95, 95, 97, 98, 96, 99, 99, 100, 101, 102, 102, 102, 103, 104, 105, 105, 106, 108, 109, 107, 110, 111, 111, 112, 112, 112, 114, 115, 113, 116, 117, 118, 118, 119, 119, 120, 120, 121, 122, 123, 124, 124, 124, 125, 125, 126, 126, 127, 128, 129, 129, 130, 130, 130, 130, 130, 131, 132, 134, 135, 133, 136, 137, 138, 138, 139, 140, 140, 141, 142, 143, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 145, 146, 147, 148, 149, 150, 151 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 2, 2, 1, 1, 0, 8, 1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 3, 1, 1, 1, 2, 1, 2, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 0, 0, 5, 1, 3, 3, 3, 1, 1, 1, 1, 1, 1, 2, 1, 0, 0, 6, 1, 1, 2, 1, 1, 1, 0, 0, 5, 3, 3, 1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 2, 0, 0, 5, 3, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 0, 1, 1, 0 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (pc, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value, pc); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, Parse_control* pc) { FILE *yyoutput = yyo; YYUSE (yyoutput); YYUSE (pc); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyo, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, Parse_control* pc) { YYFPRINTF (yyo, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyo, yytype, yyvaluep, pc); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, Parse_control* pc) { unsigned long yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &yyvsp[(yyi + 1) - (yynrhs)] , pc); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule, pc); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; else goto append; append: default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) yysize = yysize1; else return 2; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) yysize = yysize1; else return 2; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, Parse_control* pc) { YYUSE (yyvaluep); YYUSE (pc); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*----------. | yyparse. | `----------*/ int yyparse (Parse_control* pc) { /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ YY_INITIAL_VALUE (static YYSTYPE yyval_default;) YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Number of syntax errors so far. */ int yynerrs; int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; /*--------------------------------------------------------------------. | yynewstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: *yyssp = (yytype_int16) yystate; if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE goto yyexhaustedlab; #else { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); # if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (&yylval, pc); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 148 "compile.y" /* yacc.c:1652 */ { Method* method=new Method(Method::CT_ANY, 0, 0 /*min, max numbered_params_count*/, 0 /*param_names*/, 0 /*local_names*/, yyvsp[0] /*parser_code*/, 0 /*native_code*/, PC.cclass->is_vars_local()); PC.cclass->set_method(PC.alias_method(main_method_name), method); } #line 1608 "compile.tab.C" /* yacc.c:1652 */ break; case 9: #line 160 "compile.y" /* yacc.c:1652 */ { const String& command=LA2S(*yyvsp[-2])->trim(String::TRIM_END); YYSTYPE strings_code=yyvsp[0]; if(strings_code->count()<1*OPERATIONS_PER_OPVALUE) YYERROR3("@", command.cstr(), " is empty"); if(command==CLASS_NAME) { if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { CLASS_ADD; // new class' name const String& name=LA2S(*strings_code)->trim(String::TRIM_END); // creating the class VStateless_class* cclass=new VClass(name.cstr(), PC.request.get_used_filespec(PC.file_no)); PC.cclass_new=cclass; PC.append=false; } else { YYERROR1("@" CLASS_NAME " must contain only one line with class name (contains more than one)"); } } else if(command==USE_CONTROL_METHOD_NAME) { CLASS_ADD; for(size_t i=0; icount(); i+=OPERATIONS_PER_OPVALUE){ PC.request.use_file(LA2S(*strings_code, i)->trim(String::TRIM_END), PC.request.get_used_filespec(PC.file_no), strings_code->get(i+1).origin); } } else if(command==BASE_NAME) { if(PC.append) YYERROR3("can't set base while appending methods to class '", PC.cclass->type(), "'"); CLASS_ADD; if(PC.cclass->base_class()) // already changed from default? YYERROR3("class already have a base '", PC.cclass->base_class()->type(), "'"); if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { const String& base_name=LA2S(*strings_code)->trim(String::TRIM_END); if(VStateless_class *base_class=PC.request.get_class(base_name)) { // @CLASS == @BASE sanity check if(PC.cclass==base_class) YYERROR1("@" CLASS_NAME " equals @" BASE_NAME); PC.cclass->get_class()->set_base(base_class); } else { YYERROR3("'", base_name.cstr(), "': undefined class in @" BASE_NAME); } } else { YYERROR1("@" BASE_NAME " must contain sole name"); } } else if(command==OPTIONS_CONTROL_METHOD_NAME) { for(size_t i=0; icount(); i+=OPERATIONS_PER_OPVALUE) { const String& option=LA2S(*strings_code, i)->trim(String::TRIM_END); if(option==Symbols::LOCALS_SYMBOL){ PC.set_all_vars_local(); } else if(option==Symbols::PARTIAL_SYMBOL){ if(PC.cclass_new){ if(VStateless_class* existed=PC.get_existed_class(PC.cclass_new)){ if(!PC.reuse_existed_class(existed)) YYERROR3("can't append methods to '", PC.cclass_new->type(), "' - the class wasn't marked as partial"); } else { // marks the new class as partial. we will be able to add methods here later. PC.cclass_new->set_partial(); } } else { YYERROR1("'partial' option should be used straight after @" CLASS_NAME); } } else if(option==Symbols::STATIC_SYMBOL){ PC.set_methods_call_type(Method::CT_STATIC); } else if(option==Symbols::DYNAMIC_SYMBOL){ PC.set_methods_call_type(Method::CT_DYNAMIC); } else { YYERROR3("'", option.cstr(), "' invalid option. valid options are 'partial', 'locals', 'static' and 'dynamic'"); } } } else { YYERROR3("'", command.cstr(), "' invalid special name. valid names are '" CLASS_NAME "', '" USE_CONTROL_METHOD_NAME "', '" BASE_NAME "' and '" OPTIONS_CONTROL_METHOD_NAME "'."); } } #line 1683 "compile.tab.C" /* yacc.c:1652 */ break; case 13: #line 231 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } #line 1689 "compile.tab.C" /* yacc.c:1652 */ break; case 17: #line 235 "compile.y" /* yacc.c:1652 */ { CLASS_ADD; PC.explicit_result=false; YYSTYPE params_names_code=yyvsp[-3]; ArrayString* params_names=0; if(int size=params_names_code->count()) { params_names=new ArrayString; for(int i=0; iis_vars_local(); if(int size=locals_names_code->count()) { locals_names=new ArrayString; for(int i=0; i(&yyval)=method; } #line 1732 "compile.tab.C" /* yacc.c:1652 */ break; case 18: #line 272 "compile.y" /* yacc.c:1652 */ { Method* method=reinterpret_cast(yyvsp[-1]); // fill in the code method->parser_code=yyvsp[0]; // register in class const String& name=*LA2S(*yyvsp[-6]); PC.cclass->set_method(PC.alias_method(name), method); } #line 1746 "compile.tab.C" /* yacc.c:1652 */ break; case 21: #line 283 "compile.y" /* yacc.c:1652 */ {yyval=yyvsp[-1];} #line 1752 "compile.tab.C" /* yacc.c:1652 */ break; case 25: #line 285 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); } #line 1758 "compile.tab.C" /* yacc.c:1652 */ break; case 31: #line 293 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } #line 1764 "compile.tab.C" /* yacc.c:1652 */ break; case 37: #line 299 "compile.y" /* yacc.c:1652 */ { yyval=N(); YYSTYPE code=yyvsp[0]; size_t count=code->count(); #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if(count!=3 || !change_first(*code, OP::OP_VALUE__GET_ELEMENT, /*=>*/OP::OP_VALUE__GET_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT if(count!=3 || !change_first(*code, OP::OP_WITH_SELF__VALUE__GET_ELEMENT, /*=>*/OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT if(count!=5 || !change_first(*code, OP::OP_GET_OBJECT_ELEMENT, /*=>*/OP::OP_GET_OBJECT_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT if(count!=5 || !change_first(*code, OP::OP_GET_OBJECT_VAR_ELEMENT, /*=>*/OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE) ) #endif #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL if(!change(*code, count-1/* last */, OP::OP_GET_ELEMENT__SPECIAL, /*=>*/OP::OP_GET_ELEMENT__SPECIAL__WRITE) ) #endif { change_or_append(*code, count-1 /* last */, OP::OP_GET_ELEMENT, /*=>*/OP::OP_GET_ELEMENT__WRITE, /*or */OP::OP_WRITE_VALUE ); /* value=pop; wcontext.write(value) */ } P(*yyval, *code); } #line 1800 "compile.tab.C" /* yacc.c:1652 */ break; case 38: #line 330 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; } #line 1806 "compile.tab.C" /* yacc.c:1652 */ break; case 41: #line 332 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; } #line 1812 "compile.tab.C" /* yacc.c:1652 */ break; case 44: #line 336 "compile.y" /* yacc.c:1652 */ { yyval=N(); YYSTYPE diving_code=yyvsp[0]; size_t count=diving_code->count(); if(maybe_make_self(*yyval, *diving_code, count)) { // $self. } else #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT if(maybe_make_get_object_element(*yyval, *diving_code, count)){ // optimization for $object.field + ^object.method[ } else #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT if(maybe_make_get_object_var_element(*yyval, *diving_code, count)){ // optimization for $object.$var } else #endif #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if(count>=4 && (*diving_code)[0].code==OP::OP_VALUE && (*diving_code)[3].code==OP::OP_GET_ELEMENT ){ // optimization O(*yyval, (PC.in_call_value && count==4) ? OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR // ^object[ : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT_OR_OPERATOR+origin+string : OP::OP_VALUE__GET_ELEMENT // $object : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT+origin+string ); P(*yyval, *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value if(count>4) P(*yyval, *diving_code, 4); // copy tail } else { O(*yyval, OP::OP_WITH_READ); /* stack: starting context */ P(*yyval, *diving_code); } #else { O(*yyval, OP::OP_WITH_READ); /* stack: starting context */ // ^if OP_ELEMENT => ^if OP_ELEMENT_OR_OPERATOR // optimized OP_VALUE+origin+string+OP_GET_ELEMENT. => OP_VALUE+origin+string+OP_GET_ELEMENT_OR_OPERATOR. if(PC.in_call_value && count==4) diving_code->put(count-1, OP::OP_GET_ELEMENT_OR_OPERATOR); P(*yyval, *diving_code); } #endif /* diving code; stack: current context */ } #line 1866 "compile.tab.C" /* yacc.c:1652 */ break; case 45: #line 385 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } #line 1872 "compile.tab.C" /* yacc.c:1652 */ break; case 47: #line 386 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } #line 1878 "compile.tab.C" /* yacc.c:1652 */ break; case 48: #line 390 "compile.y" /* yacc.c:1652 */ { yyval=N(); #ifdef OPTIMIZE_BYTECODE_CONSTRUCT if(maybe_optimize_construct(*yyval, *yyvsp[-1], *yyvsp[0])){ // $a(expr), $.a(expr), $a[value], $.a[value], $self.a[value], $self.a(expr) } else #endif { P(*yyval, *yyvsp[-1]); /* stack: context,name */ P(*yyval, *yyvsp[0]); /* stack: context,name,constructor_value */ } } #line 1895 "compile.tab.C" /* yacc.c:1652 */ break; case 52: #line 406 "compile.y" /* yacc.c:1652 */ { yyval=N(); YYSTYPE diving_code=yyvsp[0]; size_t count=diving_code->count(); if(maybe_make_self(*yyval, *diving_code, count)) { // $self. } else #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT if(count>=4 && (*diving_code)[0].code==OP::OP_VALUE && (*diving_code)[3].code==OP::OP_GET_ELEMENT ){ O(*yyval, OP::OP_WITH_ROOT__VALUE__GET_ELEMENT); P(*yyval, *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value if(count>4) P(*yyval, *diving_code, 4); // tail } else #endif { O(*yyval, OP::OP_WITH_ROOT); /* stack: starting context */ P(*yyval, *diving_code); } /* diving code; stack: current context */ } #line 1922 "compile.tab.C" /* yacc.c:1652 */ break; case 53: #line 428 "compile.y" /* yacc.c:1652 */ { yyval=N(); O(*yyval, OP::OP_WITH_WRITE); /* stack: starting context */ P(*yyval, *yyvsp[0]); /* diving code; stack: context,name */ } #line 1932 "compile.tab.C" /* yacc.c:1652 */ break; case 54: #line 433 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } #line 1938 "compile.tab.C" /* yacc.c:1652 */ break; case 58: #line 440 "compile.y" /* yacc.c:1652 */ { // allow $result_or_other_variable[ letters here any time ] *reinterpret_cast(&yyval)=PC.explicit_result; PC.explicit_result=false; PC.array=false; // no need to save current value as if() is right after PC.array=true; } #line 1948 "compile.tab.C" /* yacc.c:1652 */ break; case 59: #line 444 "compile.y" /* yacc.c:1652 */ { PC.explicit_result=*reinterpret_cast(&yyvsp[-1]); } #line 1956 "compile.tab.C" /* yacc.c:1652 */ break; case 60: #line 446 "compile.y" /* yacc.c:1652 */ { // stack: context, name if(!PC.array){ yyval=yyvsp[-2]; // stack: context, name, value O(*yyval, OP::OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */ } else { yyval = N(); OA(*yyval, OP::OP_CONSTRUCT_ARRAY, yyvsp[-2]); PC.array=false; } } #line 1972 "compile.tab.C" /* yacc.c:1652 */ break; case 61: #line 459 "compile.y" /* yacc.c:1652 */ { yyval = yyvsp[0]; } #line 1978 "compile.tab.C" /* yacc.c:1652 */ break; case 62: #line 460 "compile.y" /* yacc.c:1652 */ { yyval = yyvsp[-2]; P(*yyval, *yyvsp[0]); PC.array=true; } #line 1984 "compile.tab.C" /* yacc.c:1652 */ break; case 63: #line 462 "compile.y" /* yacc.c:1652 */ { yyval=N(); // stack: context, name P(*yyval, *yyvsp[-1]); // stack: context, name, value O(*yyval, OP::OP_CONSTRUCT_EXPR); /* value=pop->as_expr_result; name=pop; context=pop; construct(context,name,value) */ } #line 1995 "compile.tab.C" /* yacc.c:1652 */ break; case 64: #line 469 "compile.y" /* yacc.c:1652 */ { // stack: context, name yyval=N(); OA(*yyval, OP::OP_CURLY_CODE__CONSTRUCT, yyvsp[-1]); /* code=pop; name=pop; context=pop; construct(context,name,junction(code)) */ } #line 2005 "compile.tab.C" /* yacc.c:1652 */ break; case 68: #line 480 "compile.y" /* yacc.c:1652 */ { yyval=N(); OA(*yyval, OP::OP_OBJECT_POOL, yyvsp[0]); /* stack: empty write context */ /* some code that writes to that context */ /* context=pop; stack: context.value() */ } #line 2016 "compile.tab.C" /* yacc.c:1652 */ break; case 71: #line 487 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } #line 2022 "compile.tab.C" /* yacc.c:1652 */ break; case 72: #line 491 "compile.y" /* yacc.c:1652 */ { size_t count=yyvsp[0]->count(); #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR if(count) #endif { yyval=yyvsp[0]; /* stack: value */ if(!change_first(*yyval, OP::OP_CONSTRUCT_OBJECT, /*=>*/ OP::OP_CONSTRUCT_OBJECT__WRITE)) change_or_append(*yyval, count-2 /* second last */, OP::OP_CALL, /*=>*/ OP::OP_CALL__WRITE, /*or */ OP::OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ } } #line 2038 "compile.tab.C" /* yacc.c:1652 */ break; case 73: #line 502 "compile.y" /* yacc.c:1652 */ { PC.in_call_value=true; } #line 2046 "compile.tab.C" /* yacc.c:1652 */ break; case 74: #line 505 "compile.y" /* yacc.c:1652 */ { PC.in_call_value=false; } #line 2054 "compile.tab.C" /* yacc.c:1652 */ break; case 75: #line 508 "compile.y" /* yacc.c:1652 */ { /* ^field.$method{vasya} */ #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT const String* operator_name=LA2S(*yyvsp[-3], 0, OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR); #else const String* operator_name=LA2S(*yyvsp[-3], 1); #endif if(operator_name && SYMBOLS_EQ(*operator_name,REM_SYMBOL)){ yyval=N(); } else #endif { YYSTYPE params_code=yyvsp[-1]; if(params_code->count()==3) { // probably [] case. [OP::OP_VALUE+origin+Void] if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value? if(const String * string=value->get_string()) if(string->is_empty()) // value is empty string? params_code=0; // ^zzz[] case. don't append lone empty param. } /* stack: context, method_junction */ YYSTYPE var_code=yyvsp[-3]; if( var_code->count()==8 && ( (*var_code)[0].code==OP::OP_VALUE__GET_CLASS || (*var_code)[0].code==OP::OP_VALUE__GET_BASE_CLASS ) && (*var_code)[3].code==OP::OP_PREPARE_TO_CONSTRUCT_OBJECT && (*var_code)[4].code==OP::OP_VALUE #ifdef FEATURE_GET_ELEMENT4CALL && (*var_code)[7].code==OP::OP_GET_ELEMENT4CALL #else && (*var_code)[7].code==OP::OP_GET_ELEMENT #endif ){ yyval=N(); O(*yyval, OP::OP_CONSTRUCT_OBJECT); P(*yyval, *var_code, 1/*offset*/, 2/*limit*/); // class name P(*yyval, *var_code, 5/*offset*/, 2/*limit*/); // constructor name OA(*yyval, params_code); } else { yyval=var_code; /* with_xxx,diving code; stack: context,method_junction */ OA(*yyval, OP::OP_CALL, params_code); // method_frame=make frame(pop junction); ncontext=pop; call(ncontext,method_frame) stack: value } } } #line 2104 "compile.tab.C" /* yacc.c:1652 */ break; case 76: #line 554 "compile.y" /* yacc.c:1652 */ { #ifdef FEATURE_GET_ELEMENT4CALL size_t count=yyvsp[0]->count(); if(count){ yyval=yyvsp[0]; #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT !(count==5 && change_first(*yyval, OP::OP_GET_OBJECT_ELEMENT, OP::OP_GET_OBJECT_ELEMENT4CALL)) && #endif #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT !(count==5 && change_first(*yyval, OP::OP_GET_OBJECT_VAR_ELEMENT, OP::OP_GET_OBJECT_VAR_ELEMENT4CALL)) && #endif !change(*yyval, count-1, OP::OP_GET_ELEMENT, OP::OP_GET_ELEMENT4CALL); } #endif } #line 2124 "compile.tab.C" /* yacc.c:1652 */ break; case 78: #line 570 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } #line 2130 "compile.tab.C" /* yacc.c:1652 */ break; case 82: #line 576 "compile.y" /* yacc.c:1652 */ { // allow ^call[ letters here any time ] *reinterpret_cast(&yyval)=PC.explicit_result; PC.explicit_result=false; } #line 2139 "compile.tab.C" /* yacc.c:1652 */ break; case 83: #line 579 "compile.y" /* yacc.c:1652 */ { PC.explicit_result=*reinterpret_cast(&yyvsp[-1]); } #line 2147 "compile.tab.C" /* yacc.c:1652 */ break; case 84: #line 581 "compile.y" /* yacc.c:1652 */ {yyval=yyvsp[-2];} #line 2153 "compile.tab.C" /* yacc.c:1652 */ break; case 85: #line 582 "compile.y" /* yacc.c:1652 */ {yyval=yyvsp[-1];} #line 2159 "compile.tab.C" /* yacc.c:1652 */ break; case 86: #line 583 "compile.y" /* yacc.c:1652 */ {yyval=yyvsp[-1];} #line 2165 "compile.tab.C" /* yacc.c:1652 */ break; case 88: #line 586 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); } #line 2171 "compile.tab.C" /* yacc.c:1652 */ break; case 90: #line 590 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); } #line 2177 "compile.tab.C" /* yacc.c:1652 */ break; case 92: #line 594 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); } #line 2183 "compile.tab.C" /* yacc.c:1652 */ break; case 93: #line 596 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; } #line 2191 "compile.tab.C" /* yacc.c:1652 */ break; case 94: #line 599 "compile.y" /* yacc.c:1652 */ { YYSTYPE expr_code=yyvsp[0]; if(expr_code->count()==3 && (*expr_code)[0].code==OP::OP_VALUE) { // optimizing (double/bool/incidently 'string' too) case. [OP::OP_VALUE+origin+Double]. no evaluating yyval=expr_code; } else { YYSTYPE code=N(); P(*code, *expr_code); O(*code, OP::OP_WRITE_EXPR_RESULT); yyval=N(); OA(*yyval, OP::OP_EXPR_CODE__STORE_PARAM, code); } } #line 2209 "compile.tab.C" /* yacc.c:1652 */ break; case 95: #line 612 "compile.y" /* yacc.c:1652 */ { yyval=N(); OA(*yyval, OP::OP_CURLY_CODE__STORE_PARAM, yyvsp[0]); } #line 2218 "compile.tab.C" /* yacc.c:1652 */ break; case 100: #line 624 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } #line 2224 "compile.tab.C" /* yacc.c:1652 */ break; case 102: #line 626 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } #line 2230 "compile.tab.C" /* yacc.c:1652 */ break; case 104: #line 628 "compile.y" /* yacc.c:1652 */ { // we know that name_advance1 not called from ^xxx context // so we'll not check for operator call possibility as we do in name_advance2 /* stack: context */ yyval=yyvsp[0]; /* stack: context,name */ #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL O(*yyval, is_special_element(*yyval) ? OP::OP_GET_ELEMENT__SPECIAL : OP::OP_GET_ELEMENT); #else O(*yyval, OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ #endif } #line 2247 "compile.tab.C" /* yacc.c:1652 */ break; case 105: #line 640 "compile.y" /* yacc.c:1652 */ { /* stack: context */ yyval=yyvsp[0]; /* stack: context,name */ #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL O(*yyval, is_special_element(*yyval) ? OP::OP_GET_ELEMENT__SPECIAL : OP::OP_GET_ELEMENT); #else O(*yyval, OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */ #endif } #line 2261 "compile.tab.C" /* yacc.c:1652 */ break; case 112: #line 658 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; O(*yyval, OP::OP_GET_ELEMENT); } #line 2270 "compile.tab.C" /* yacc.c:1652 */ break; case 113: #line 662 "compile.y" /* yacc.c:1652 */ { YYSTYPE code; { change_string_literal_to_write_string_literal(*(code=yyvsp[-1])); P(*code, *yyvsp[0]); } yyval=N(); OA(*yyval, OP::OP_STRING_POOL, code); } #line 2284 "compile.tab.C" /* yacc.c:1652 */ break; case 114: #line 671 "compile.y" /* yacc.c:1652 */ { // allow $result_or_other_variable[ letters here any time ] *reinterpret_cast(&yyval)=PC.explicit_result; PC.explicit_result=false; } #line 2293 "compile.tab.C" /* yacc.c:1652 */ break; case 115: #line 674 "compile.y" /* yacc.c:1652 */ { PC.explicit_result=*reinterpret_cast(&yyvsp[-1]); } #line 2301 "compile.tab.C" /* yacc.c:1652 */ break; case 116: #line 676 "compile.y" /* yacc.c:1652 */ { yyval=N(); #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL if(!maybe_append_simple_diving_code(*yyval, *yyvsp[-2])) #endif { OA(*yyval, OP::OP_OBJECT_POOL, yyvsp[-2]); /* stack: empty write context */ /* some code that writes to that context */ /* context=pop; stack: context.value() */ } } #line 2317 "compile.tab.C" /* yacc.c:1652 */ break; case 117: #line 687 "compile.y" /* yacc.c:1652 */ { yyval = N(); P(*yyval, *yyvsp[-1]); } #line 2326 "compile.tab.C" /* yacc.c:1652 */ break; case 118: #line 691 "compile.y" /* yacc.c:1652 */ { yyval=N(); O(*yyval, OP::OP_WITH_READ); P(*yyval, *yyvsp[0]); } #line 2336 "compile.tab.C" /* yacc.c:1652 */ break; case 120: #line 696 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]); } #line 2342 "compile.tab.C" /* yacc.c:1652 */ break; case 121: #line 697 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; O(*yyval, OP::OP_GET_ELEMENT__WRITE); } #line 2351 "compile.tab.C" /* yacc.c:1652 */ break; case 124: #line 706 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; // stack: class name string OP::OPCODE code = OP::OP_VALUE__GET_CLASS; if(*LA2S(*yyval) == BASE_NAME) { // pseudo BASE class if(VStateless_class* base=PC.cclass->base_class()) { change_string_literal_value(*yyval, *new String(base->type())); } else { YYERROR1("no base class declared"); } code = OP::OP_VALUE__GET_BASE_CLASS; } else { // can't use get_class because it will call @autouse[] if the class wasn't loaded VStateless_class* base=PC.request.classes().get(*LA2S(*yyval)); if(base && PC.cclass->derived_from(*base)) code = OP::OP_VALUE__GET_BASE_CLASS; } // optimized OP_VALUE+origin+string+OP_GET_CLASS => OP_VALUE__GET_CLASS+origin+string change_first(*yyval, OP::OP_VALUE, code); } #line 2375 "compile.tab.C" /* yacc.c:1652 */ break; case 125: #line 725 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-1]; if(!PC.in_call_value) YYERROR1(":: not allowed here"); O(*yyval, OP::OP_PREPARE_TO_CONSTRUCT_OBJECT); } #line 2386 "compile.tab.C" /* yacc.c:1652 */ break; case 132: #line 742 "compile.y" /* yacc.c:1652 */ { yyval = yyvsp[-1]; } #line 2392 "compile.tab.C" /* yacc.c:1652 */ break; case 133: #line 743 "compile.y" /* yacc.c:1652 */ { yyval = yyvsp[-1]; } #line 2398 "compile.tab.C" /* yacc.c:1652 */ break; case 134: #line 744 "compile.y" /* yacc.c:1652 */ { yyval = yyvsp[-1]; } #line 2404 "compile.tab.C" /* yacc.c:1652 */ break; case 135: #line 746 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; O(*yyval, OP::OP_NEG); } #line 2410 "compile.tab.C" /* yacc.c:1652 */ break; case 136: #line 747 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; } #line 2416 "compile.tab.C" /* yacc.c:1652 */ break; case 137: #line 748 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; O(*yyval, OP::OP_INV); } #line 2422 "compile.tab.C" /* yacc.c:1652 */ break; case 138: #line 749 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; O(*yyval, OP::OP_NOT); } #line 2428 "compile.tab.C" /* yacc.c:1652 */ break; case 139: #line 750 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; O(*yyval, OP::OP_DEF); } #line 2434 "compile.tab.C" /* yacc.c:1652 */ break; case 140: #line 751 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; O(*yyval, OP::OP_IN); } #line 2440 "compile.tab.C" /* yacc.c:1652 */ break; case 141: #line 752 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; O(*yyval, OP::OP_FEXISTS); } #line 2446 "compile.tab.C" /* yacc.c:1652 */ break; case 142: #line 753 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[0]; O(*yyval, OP::OP_DEXISTS); } #line 2452 "compile.tab.C" /* yacc.c:1652 */ break; case 143: #line 755 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_SUB); } #line 2458 "compile.tab.C" /* yacc.c:1652 */ break; case 144: #line 756 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_ADD); } #line 2464 "compile.tab.C" /* yacc.c:1652 */ break; case 145: #line 757 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_MUL); } #line 2470 "compile.tab.C" /* yacc.c:1652 */ break; case 146: #line 758 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_DIV); } #line 2476 "compile.tab.C" /* yacc.c:1652 */ break; case 147: #line 759 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_MOD); } #line 2482 "compile.tab.C" /* yacc.c:1652 */ break; case 148: #line 760 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_INTDIV); } #line 2488 "compile.tab.C" /* yacc.c:1652 */ break; case 149: #line 761 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_BIN_SL); } #line 2494 "compile.tab.C" /* yacc.c:1652 */ break; case 150: #line 762 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_BIN_SR); } #line 2500 "compile.tab.C" /* yacc.c:1652 */ break; case 151: #line 763 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_BIN_AND); } #line 2506 "compile.tab.C" /* yacc.c:1652 */ break; case 152: #line 764 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_BIN_OR); } #line 2512 "compile.tab.C" /* yacc.c:1652 */ break; case 153: #line 765 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_BIN_XOR); } #line 2518 "compile.tab.C" /* yacc.c:1652 */ break; case 154: #line 766 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; OA(*yyval, OP::OP_NESTED_CODE, yyvsp[0]); O(*yyval, OP::OP_LOG_AND); } #line 2524 "compile.tab.C" /* yacc.c:1652 */ break; case 155: #line 767 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; OA(*yyval, OP::OP_NESTED_CODE, yyvsp[0]); O(*yyval, OP::OP_LOG_OR); } #line 2530 "compile.tab.C" /* yacc.c:1652 */ break; case 156: #line 768 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_LOG_XOR); } #line 2536 "compile.tab.C" /* yacc.c:1652 */ break; case 157: #line 769 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_LT); } #line 2542 "compile.tab.C" /* yacc.c:1652 */ break; case 158: #line 770 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_GT); } #line 2548 "compile.tab.C" /* yacc.c:1652 */ break; case 159: #line 771 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_LE); } #line 2554 "compile.tab.C" /* yacc.c:1652 */ break; case 160: #line 772 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_GE); } #line 2560 "compile.tab.C" /* yacc.c:1652 */ break; case 161: #line 773 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_EQ); } #line 2566 "compile.tab.C" /* yacc.c:1652 */ break; case 162: #line 774 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_NUM_NE); } #line 2572 "compile.tab.C" /* yacc.c:1652 */ break; case 163: #line 775 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_LT); } #line 2578 "compile.tab.C" /* yacc.c:1652 */ break; case 164: #line 776 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_GT); } #line 2584 "compile.tab.C" /* yacc.c:1652 */ break; case 165: #line 777 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_LE); } #line 2590 "compile.tab.C" /* yacc.c:1652 */ break; case 166: #line 778 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_GE); } #line 2596 "compile.tab.C" /* yacc.c:1652 */ break; case 167: #line 779 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_EQ); } #line 2602 "compile.tab.C" /* yacc.c:1652 */ break; case 168: #line 780 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_STR_NE); } #line 2608 "compile.tab.C" /* yacc.c:1652 */ break; case 169: #line 781 "compile.y" /* yacc.c:1652 */ { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]); O(*yyval, OP::OP_IS); } #line 2614 "compile.tab.C" /* yacc.c:1652 */ break; case 170: #line 784 "compile.y" /* yacc.c:1652 */ { // optimized OP_STRING => OP_VALUE for doubles maybe_change_string_literal_to_double_literal(*(yyval=yyvsp[0])); } #line 2623 "compile.tab.C" /* yacc.c:1652 */ break; case 171: #line 789 "compile.y" /* yacc.c:1652 */ { #ifdef OPTIMIZE_BYTECODE_STRING_POOL // it brakes ^if(" 09 "){...} YYSTYPE code=yyvsp[0]; yyval=N(); if(code->count()==3 && change_first(*code, OP::OP_STRING__WRITE, OP::OP_VALUE)){ // optimized OP_STRING__WRITE+origin+value => OP_VALUE+origin+value without starting OP_STRING_POOL P(*yyval, *code); } else { OA(*yyval, OP::OP_STRING_POOL, code); /* stack: empty write context */ } #else yyval=N(); OA(*yyval, OP::OP_STRING_POOL, yyvsp[0]); /* stack: empty write context */ #endif /* some code that writes to that context */ /* context=pop; stack: context.get_string() */ } #line 2646 "compile.tab.C" /* yacc.c:1652 */ break; case 172: #line 810 "compile.y" /* yacc.c:1652 */ { // optimized OP_STRING+OP_WRITE_VALUE => OP_STRING__WRITE change_string_literal_to_write_string_literal(*(yyval=yyvsp[0])); } #line 2655 "compile.tab.C" /* yacc.c:1652 */ break; case 173: #line 815 "compile.y" /* yacc.c:1652 */ { yyval=VL(/*we know that we will not change it*/const_cast(&vempty), 0, 0, 0); } #line 2661 "compile.tab.C" /* yacc.c:1652 */ break; case 174: #line 816 "compile.y" /* yacc.c:1652 */ { yyval = VL(/*we know that we will not change it*/const_cast(&vtrue), 0, 0, 0); } #line 2667 "compile.tab.C" /* yacc.c:1652 */ break; case 175: #line 817 "compile.y" /* yacc.c:1652 */ { yyval = VL(/*we know that we will not change it*/const_cast(&vfalse), 0, 0, 0); } #line 2673 "compile.tab.C" /* yacc.c:1652 */ break; case 176: #line 819 "compile.y" /* yacc.c:1652 */ { yyval=N(); } #line 2679 "compile.tab.C" /* yacc.c:1652 */ break; #line 2683 "compile.tab.C" /* yacc.c:1652 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (pc, YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (pc, yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval, pc); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp, pc); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (pc, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif /*-----------------------------------------------------. | yyreturn -- parsing is finished, return the result. | `-----------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, pc); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp, pc); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } #line 821 "compile.y" /* yacc.c:1918 */ #endif /* 000$111(2222)00 000$111{3333}00 $,^: push,=0 1:( { break=pop 2:( ) pop 3:{ } pop 000^111(2222)4444{33333}4000 $,^: push,=0 1:( { break=pop 2:( )=4 3:{ }=4 4:[^({]=pop */ inline void ungetc(Parse_control& pc, uint last_line_end_col) { pc.source--; if(pc.pos.col==0) { --pc.pos.line; pc.pos.col=last_line_end_col; } else --pc.pos.col; } static int yylex(YYSTYPE *lvalp, void *apc) { Parse_control& pc=*static_cast(apc); #define lexical_brackets_nestage pc.brackets_nestages[pc.ls_sp] #define RC {result=c; goto break2; } int c; int result; if(pc.pending_state) { result=pc.pending_state; pc.pending_state=0; return result; } const char *begin=pc.source; Pos begin_pos=pc.pos; const char *end; int skip_analized=0; while(true) { c=*(end=(pc.source++)); // fprintf(stderr, "\nchar: %c %02X; nestage: %d, sp=%d", c, c, lexical_brackets_nestage, pc.sp); if(c=='\n') pc.pos_next_line(); else pc.pos_next_c(c); // fprintf(stderr, "\nchar: %c file(%d:%d)", c, pc.pos.line, pc.pos.col); if(pc.pos.col==0+1 && c=='@') { if(pc.ls==LS_DEF_SPECIAL_BODY) { // @SPECIAL // ... // @punctuation begin_pos=pc.pos; // skip over _ after ^ pc.source++; pc.pos.col++; // skip analysis = forced literal continue; // converting ^#HH into char(hex(HH)) case '#': if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till ^ pc.string.append_strdup_know_length(begin, end-begin); } // #HH ? if(pc.source[1] && isxdigit(pc.source[1]) && pc.source[2] && isxdigit(pc.source[2])) { char c=(char)( hex_value[(unsigned char)pc.source[1]]*0x10+ hex_value[(unsigned char)pc.source[2]]); if(c==0) { result=BAD_HEX_LITERAL; goto break2; // wrong hex value[no ^#00 chars allowed]: bail out } // append char(hex(HH)) pc.string.append(c); // skip over ^#HH pc.source+=3; pc.pos.col+=3; // reset piece 'begin' position & line begin=pc.source; // ->after ^#HH begin_pos=pc.pos; // skip analysis = forced literal continue; } // just escaped char // reset piece 'begin' position & line begin=pc.source; begin_pos=pc.pos; // skip over _ after ^ pc.source++; pc.pos.col++; // skip analysis = forced literal continue; } break; } } // #comment start skipping if(c=='#' && pc.pos.col==1) { if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till # pc.string.append_strdup_know_length(begin, end-begin); } // fall into COMMENT lexical state [wait for \n] push_LS(pc, LS_USER_COMMENT); continue; } switch(pc.ls) { // USER'S = NOT OURS case LS_USER: case LS_NAME_SQUARE_PART: // name.[here].xxx if(pc.trim_bof) switch(c) { case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; // skip it default: pc.trim_bof=false; } switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ']': if(pc.ls==LS_NAME_SQUARE_PART) if(--lexical_brackets_nestage==0) {// $name.[co<]?>de<]?> pop_LS(pc); // $name.[co<]>de<]!> RC; } break; case '[': // $name.[co<[>de] if(pc.ls==LS_NAME_SQUARE_PART) lexical_brackets_nestage++; break; } if(pc.explicit_result && c) switch(c) { default: pc.string.append(c); case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; } break; // #COMMENT case LS_USER_COMMENT: if(c=='\n') { // skip comment begin=pc.source; begin_pos=pc.pos; pop_LS(pc); continue; } break; // STRING IN EXPRESSION case LS_EXPRESSION_STRING_QUOTED: case LS_EXPRESSION_STRING_APOSTROFED: switch(c) { case '"': case '\'': if( (pc.ls == LS_EXPRESSION_STRING_QUOTED && c=='"') || (pc.ls == LS_EXPRESSION_STRING_APOSTROFED && c=='\'') ) { pop_LS(pc); //"abc". | 'abc'. RC; } break; case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; } break; // METHOD DEFINITION case LS_DEF_NAME: switch(c) { case '[': pc.ls=LS_DEF_PARAMS; RC; case '\n': pc.ls=LS_DEF_SPECIAL_BODY; RC; } break; case LS_DEF_PARAMS: switch(c) { case '$': // common error result=BAD_METHOD_PARAMETER_NAME_CHARACTER; goto break2; case ';': RC; case ']': pc.ls=*pc.source=='['?LS_DEF_LOCALS:LS_DEF_COMMENT; RC; case '\n': // wrong. bailing out pop_LS(pc); RC; } break; case LS_DEF_LOCALS: switch(c) { case '[': case ';': RC; case ']': pc.ls=LS_DEF_COMMENT; RC; case '\n': // wrong. bailing out pop_LS(pc); RC; } break; case LS_DEF_COMMENT: if(c=='\n') { pop_LS(pc); RC; } break; case LS_DEF_SPECIAL_BODY: if(c=='\n') RC; break; // (EXPRESSION) case LS_VAR_ROUND: case LS_METHOD_ROUND: switch(c) { case ')': if(--lexical_brackets_nestage==0) { if(pc.ls==LS_METHOD_ROUND) // method round param ended pc.ls=LS_METHOD_AFTER; // look for method end else // pc.ls==LS_VAR_ROUND // variable constructor ended pop_LS(pc); // return to normal life } RC; case '#': // comment start skipping if(end!=begin) { if(!pc.string_start) pc.string_start=begin_pos; // append piece till # pc.string.append_strdup_know_length(begin, end-begin); } // fall into COMMENT lexical state [wait for \n] push_LS(pc, LS_EXPRESSION_COMMENT); lexical_brackets_nestage=1; continue; case '$': push_LS(pc, LS_EXPRESSION_VAR_NAME_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case '(': lexical_brackets_nestage++; RC; case '-': switch(*pc.source) { case 'f': // -f skip_analized=1; result=FEXISTS; goto break2; case 'd': // -d skip_analized=1; result=DEXISTS; goto break2; default: // minus result=c; goto break2; } goto break2; case '+': case '*': case '/': case '%': case '\\': case '~': case ';': RC; case '&': case '|': if(*pc.source==c) { // && || result=c=='&'?LAND:LOR; skip_analized=1; } else result=c; goto break2; case '!': switch(pc.source[0]) { case '|': // !| !|| skip_analized=1; if(pc.source[1]=='|') { skip_analized++; result=LXOR; } else result=NXOR; goto break2; case '=': // != skip_analized=1; result=NNE; goto break2; } RC; case '<': // <<, <=, < switch(*pc.source) { case '<': // <[<] skip_analized=1; result=NSL; break; case '=': // <[=] skip_analized=1; result=NLE; break; default: // <[] result=c; break; } goto break2; case '>': // >>, >=, > switch(*pc.source) { case '>': // >[>] skip_analized=1; result=NSR; break; case '=': // >[=] skip_analized=1; result=NGE; break; default: // >[] result=c; break; } goto break2; case '=': // == switch(*pc.source) { case '=': // =[=] skip_analized=1; result=NEQ; break; default: // =[] result=c; break; // not used now } goto break2; case '"': push_LS(pc, LS_EXPRESSION_STRING_QUOTED); RC; case '\'': push_LS(pc, LS_EXPRESSION_STRING_APOSTROFED); RC; case 'l': case 'g': case 'e': case 'n': if(end==begin) // right after whitespace if(isspace(pc.source[1])) { switch(*pc.source) { // case '?': // ok [and bad cases, yacc would bark at them] case 't': // lt gt [et nt] result=c=='l'?SLT:c=='g'?SGT:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; case 'e': // le ge ne [ee] result=c=='l'?SLE:c=='g'?SGE:c=='n'?SNE:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; case 'q': // eq [lq gq nq] result=c=='e'?SEQ:BAD_STRING_COMPARISON_OPERATOR; skip_analized=1; goto break2; } } break; case 'i': if(end==begin) // right after whitespace if(isspace(pc.source[1])) { switch(pc.source[0]) { case 'n': // in skip_analized=1; result=IN; goto break2; case 's': // is skip_analized=1; result=IS; goto break2; } } break; case 'd': if(end==begin) // right after whitespace if(pc.source[0]=='e' && pc.source[1]=='f') { // def switch(pc.source[2]){ case ' ': case '\t': case '\n': case '"': case '\'': case '^': case '$': // non-quoted string without whitespace after 'def' is not allowed skip_analized=2; result=DEF; goto break2; } // error: incorrect char after 'def' } break; case 't': if(end==begin) // right after whitespace if(pc.source[0]=='r' && pc.source[1]=='u' && pc.source[2]=='e') { // true skip_analized=3; result=LITERAL_TRUE; goto break2; } break; case 'f': if(end==begin) // right after whitespace if(pc.source[0]=='a' && pc.source[1]=='l' && pc.source[2]=='s' && pc.source[3]=='e') { // false skip_analized=4; result=LITERAL_FALSE; goto break2; } break; case ' ': case '\t': case '\n': if(end!=begin) { // there were a string after previous operator? result=0; // return that string goto break2; } // that's a leading|traling space or after-operator-space // ignoring it // reset piece 'begin' position & line begin=pc.source; // after whitespace char begin_pos=pc.pos; continue; } break; case LS_EXPRESSION_COMMENT: if(c=='(') lexical_brackets_nestage++; switch(*pc.source) { case '\n': case ')': if(*pc.source==')') if(--lexical_brackets_nestage!=0) continue; // skip comment begin=pc.source; begin_pos=pc.pos; pop_LS(pc); continue; } break; // VARIABLE GET/PUT/WITH case LS_VAR_NAME_SIMPLE_WITH_COLON: case LS_VAR_NAME_SIMPLE_WITHOUT_COLON: case LS_EXPRESSION_VAR_NAME_WITH_COLON: case LS_EXPRESSION_VAR_NAME_WITHOUT_COLON: if( pc.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON || pc.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) { // name in expr ends also before switch(c) { // expression minus case '-': // expression integer division case '\\': pop_LS(pc); pc.ungetc(); result=EON; goto break2; } } if( pc.ls==LS_VAR_NAME_SIMPLE_WITHOUT_COLON || pc.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) { // name already has ':', stop before next switch(c) { case ':': pop_LS(pc); pc.ungetc(); result=EON; goto break2; } } switch(c) { case 0: case ' ': case '\t': case '\n': case ';': case ']': case '}': case ')': case '"': case '\'': case '<': case '>': // these stand for HTML brackets AND expression binary ops case '+': case '*': case '/': case '\\': case '%': case '&': case '|': case '=': case '!': // common delimiters case ',': case '?': case '#': // mysql column separators case '`': // before call case '^': pop_LS(pc); pc.ungetc(); result=EON; goto break2; case '[': // $name.<[>code] if( end[-1]=='$' /* was start of get */ || end[-1]==':' /* was class name delim */ || end[-1]=='.' /* was name delim */ ) { push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; } pc.ls=LS_VAR_SQUARE; lexical_brackets_nestage=1; RC; case '{': if(end[-1]=='$') { // ${name}, no need of EON, switching LS, not begin==end as $[a]{$b} will fit pc.ls=LS_VAR_NAME_CURLY; } else { pc.ls=LS_VAR_CURLY; lexical_brackets_nestage=1; } RC; case '(': // $name.<(>expr) if( // end[-1]=='$' /* $() excluded */ || end[-1]==':' /* was class name delim */ || end[-1]=='.' /* was name delim */ ) { push_LS(pc, LS_VAR_ROUND); lexical_brackets_nestage=1; RC; } pc.ls=LS_VAR_ROUND; lexical_brackets_nestage=1; RC; case '.': // name part delim case '$': // name part subvar case ':': // class<:>name // go to _WITHOUT_COLON state variant... if(pc.ls==LS_VAR_NAME_SIMPLE_WITH_COLON) pc.ls=LS_VAR_NAME_SIMPLE_WITHOUT_COLON; else if(pc.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON) pc.ls=LS_EXPRESSION_VAR_NAME_WITHOUT_COLON; // ...stop before next ':' RC; } break; case LS_VAR_NAME_CURLY: switch(c) { case '[': // ${name.<[>code]} push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; case '(': // ${name.<(>expr)} push_LS(pc, LS_VAR_ROUND); lexical_brackets_nestage=1; RC; case '}': // ${name} finished, restoring LS pop_LS(pc); RC; case '.': // name part delim case '$': // name part subvar case ':': // ':name' or 'class:name' RC; } break; case LS_VAR_SQUARE: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ']': if(--lexical_brackets_nestage==0) { pop_LS(pc); RC; } break; case ';': // operator_or_fmt;value delim RC; case '[': lexical_brackets_nestage++; break; } break; case LS_VAR_CURLY: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case '}': if(--lexical_brackets_nestage==0) { pop_LS(pc); RC; } break; case '{': lexical_brackets_nestage++; break; } break; // METHOD CALL case LS_METHOD_NAME: switch(c) { case '[': // ^name.<[>code] if( // end[-1]=='^' /* never, ^[ is literal */ || end[-1]==':' /* was class name delim */ || end[-1]=='.' /* was name delim */ ) { push_LS(pc, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; } pc.ls=LS_METHOD_SQUARE; lexical_brackets_nestage=1; RC; case '{': pc.ls=LS_METHOD_CURLY; lexical_brackets_nestage=1; RC; case '(': // ^name.<(>expr) if( // end[-1]=='^' /* never, ^( is literal */ || end[-1]==':' /* was class name delim */ || end[-1]=='.' /* was name delim */ ) { push_LS(pc, LS_VAR_ROUND); lexical_brackets_nestage=1; RC; } pc.ls=LS_METHOD_ROUND; lexical_brackets_nestage=1; RC; case '.': // name part delim case '$': // name part subvar case ':': // ':name' or 'class:name' case '^': // ^abc^xxx wrong. bailing out case ']': case '}': case ')': // ^abc]}) wrong. bailing out case ' ': // ^if ( wrong. bailing out RC; } break; case LS_METHOD_SQUARE: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ';': // param delim RC; case ']': if(--lexical_brackets_nestage==0) { pc.ls=LS_METHOD_AFTER; RC; } break; case '[': lexical_brackets_nestage++; break; } break; case LS_METHOD_CURLY: switch(c) { case '$': push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON); RC; case '^': push_LS(pc, LS_METHOD_NAME); RC; case ';': // param delim RC; case '}': if(--lexical_brackets_nestage==0) { pc.ls=LS_METHOD_AFTER; RC; } break; case '{': lexical_brackets_nestage++; break; } if(pc.explicit_result && c) switch(c) { default: pc.string.append(c); case '\n': case ' ': case '\t': begin=pc.source; begin_pos=pc.pos; continue; } break; case LS_METHOD_AFTER: if(c=='[') {/* ][ }[ )[ */ pc.ls=LS_METHOD_SQUARE; lexical_brackets_nestage=1; RC; } if(c=='{') {/* ]{ }{ ){ */ pc.ls=LS_METHOD_CURLY; lexical_brackets_nestage=1; RC; } if(c=='(') {/* ]( }( )( */ pc.ls=LS_METHOD_ROUND; lexical_brackets_nestage=1; RC; } pop_LS(pc); pc.ungetc(); result=EON; goto break2; } if(c==0) { result=-1; break; } } break2: if(end!=begin) { // there is last piece? if(c=='@' || c==0) // we are before LS_DEF_NAME or EOF? while(end!=begin && end[-1]=='\n') // trim all empty lines before LS_DEF_NAME and EOF end--; if(end!=begin && pc.ls!=LS_USER_COMMENT) { // last piece still alive and not comment? if(!pc.string_start) pc.string_start=begin_pos; // append it pc.string.append_strdup_know_length(begin, end-begin); } } if(!pc.string.is_empty()) { // something accumulated? // create STRING value: array of OP_VALUE+origin+vstring #ifdef SYMBOLS_CACHING Value *lookup=symbols->get(pc.string); #else Value *lookup=0; #endif *lvalp=VL(lookup ? lookup : new VString(*new String(pc.string, String::L_CLEAN)), pc.file_no, pc.string_start.line, pc.string_start.col); // new pieces storage pc.string.clear(); pc.string_start.clear(); // make current result be pending for next call, return STRING for now pc.pending_state=result; result=STRING; } if(skip_analized) { pc.source+=skip_analized; pc.pos.col+=skip_analized; } return result; } static int real_yyerror(Parse_control *pc, const char *s) { // Called by yyparse on error PC.error=pa_strdup(s); return 1; } static void yyprint(FILE *file, int type, YYSTYPE value) { if(type==STRING) fprintf(file, " \"%s\"", LA2S(*value)->cstr()); } parser-3.5.1/src/main/pa_sql_driver_manager.C0000644000076400007640000002236314712042465016123 00000000000000/** @file Parser: sql driver manager implementation. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_sql_driver_manager.h" #include "ltdl.h" #include "pa_threads.h" #include "pa_sql_connection.h" #include "pa_exception.h" #include "pa_common.h" #include "pa_vhash.h" #include "pa_vtable.h" #include "pa_charsets.h" volatile const char * IDENT_PA_SQL_DRIVER_MANAGER_C="$Id: pa_sql_driver_manager.C,v 1.105 2024/11/04 03:53:25 moko Exp $" IDENT_PA_SQL_DRIVER_MANAGER_H IDENT_PA_SQL_CONNECTION_H; // globals SQL_Driver_manager* SQL_driver_manager=0; // consts const time_t EXPIRE_UNUSED_CONNECTION_SECONDS=10; const time_t CHECK_EXPIRED_CONNECTIONS_SECONDS=EXPIRE_UNUSED_CONNECTION_SECONDS*2; // helpers const String& SQL_Driver_services_impl::url_without_login() const { String& result=*new String; result << furl->mid(0, furl->pos(':')) << "://****"; size_t at_pos=0; size_t new_at_pos; while( (new_at_pos=furl->pos('@', at_pos+1))!=STRING_NOT_FOUND) at_pos=new_at_pos; if(at_pos) result << furl->mid(at_pos, furl->length()); return result; } void SQL_Driver_services_impl::transcode(const char* src, size_t src_length, const char*& dst, size_t& dst_length, const char* charset_from_name, const char* charset_to_name ) { try { // to speed up sql transcode [lots of charsets::get-s -- twice for each cell] // without complicating sql driver API // we need to cache couple of name->charset pairs // assuming pointers to names are are NOT to local vars struct cache_record { const char* name; Charset* object; } cache[2]={{0,0}, {0,0}}; Charset* charset_from_object; Charset* charset_to_object; if(charset_from_name==cache[0].name) { charset_from_object=cache[0].object; } else { cache[0].name=charset_from_name; cache[0].object=charset_from_object=&pa_charsets.get_direct(charset_from_name); } if(charset_to_name==cache[1].name) { charset_to_object=cache[1].object; } else { cache[1].name=charset_to_name; cache[1].object=charset_to_object=&pa_charsets.get_direct(charset_to_name); } String::C result=Charset::transcode(String::C(src, src_length), *charset_from_object, *charset_to_object); dst=result.str; dst_length=result.length; } catch(const Exception& e) { _throw(SQL_Error(e.type(), e.comment())); } catch(...) { _throw(SQL_Error("unknown error while transcoding in sql driver")); } } // helpers static void expire_connection(SQL_Connection& connection, time_t older_dies) { if(connection.connected() && connection.expired(older_dies)) connection.disconnect(); } static void expire_connections(SQL_Driver_manager::connection_cache_type::key_type /*key*/, SQL_Driver_manager::connection_cache_type::value_type stack, time_t older_dies) { for(size_t i=0; itop_index(); i++) expire_connection(*stack->get(i), older_dies); } // SQL_Driver_manager SQL_Driver_manager::SQL_Driver_manager(): prev_expiration_pass_time(0) {} SQL_Driver_manager::~SQL_Driver_manager() { connection_cache.for_each(expire_connections, time(0)+(time_t)10/*=in future=expire all*/); } /// @param aurl protocol://[driver-dependent] SQL_Connection* SQL_Driver_manager::get_connection(const String& aurl, Table *protocol2driver_and_client, const char* arequest_charset, const char* adocument_root) { // we have table for locating protocol's library if(!protocol2driver_and_client) throw Exception(PARSER_RUNTIME, &aurl, "$" MAIN_SQL_NAME ":" MAIN_SQL_DRIVERS_NAME " table must be defined"); // first trying to get cached connection SQL_Connection* connection=get_connection_from_cache(aurl); if(connection) { connection->set_url(); if(!connection->ping()) { // we have some cached connection, is it pingable? connection->disconnect(); // kill unpingabe=dead connection connection=0; } } char *url_cstr; if(connection) url_cstr=0; // calm, compiler else { // no cached connection or it were unpingabe: connect/reconnect url_cstr=aurl.cstrm(); if(!strstr(url_cstr, "://")) throw Exception(PARSER_RUNTIME, aurl.length()?&aurl:0, "connection string must start with protocol://"); char *protocol_cstr=lsplit(&url_cstr, ':'); // skip "//" after ':' while(*url_cstr=='/') url_cstr++; const String& protocol=*new String(protocol_cstr); SQL_Driver *driver; // first trying to get cached driver if(!(driver=get_driver_from_cache(protocol))) { // no cached const String* library=0; const String* dlopen_file_spec=0; Table::Action_options options; if(protocol2driver_and_client->locate(0, protocol, options)) { if(!(library=protocol2driver_and_client->item(1)) || library->length()==0) throw Exception(PARSER_RUNTIME, 0, "driver library column for protocol '%s' is empty", protocol_cstr); dlopen_file_spec=protocol2driver_and_client->item(2); } else throw Exception(PARSER_RUNTIME, &aurl, "undefined protocol '%s'", protocol_cstr); pa_dlinit(); const char* filename=library->taint_cstr(String::L_FILE_SPEC); lt_dlhandle handle=lt_dlopen(filename); if (!handle) { const char* error=lt_dlerror(); throw Exception(0, library, error ? error : "cannot open the module"); } SQL_Driver_create_func create=(SQL_Driver_create_func)(lt_dlsym(handle, SQL_DRIVER_CREATE_NAME)); if(!create) throw Exception(0, library, "function '" SQL_DRIVER_CREATE_NAME "' was not found"); // create library-driver! driver=(*create)(); // validate driver api version int driver_api_version=driver->api_version(); if(driver_api_version!=SQL_DRIVER_API_VERSION) throw Exception(0, library, "driver implements API version 0x%04X not equal to 0x%04X", driver_api_version, SQL_DRIVER_API_VERSION); // initialise by connecting to sql client dynamic link library char* dlopen_file_spec_cstr= dlopen_file_spec && dlopen_file_spec->length()? dlopen_file_spec->taint_cstrm(String::L_AS_IS):0; if(const char* error=driver->initialize(dlopen_file_spec_cstr)) throw Exception(0, library, "driver failed to initialize client library '%s', %s", dlopen_file_spec_cstr ? dlopen_file_spec_cstr : "unspecifed", error); // cache it put_driver_to_cache(protocol, driver); } connection=new SQL_Connection(aurl, *driver, arequest_charset, adocument_root); // associate with pool[request] (deassociates at close) connection->set_url(); } // if not connected yet, do that now, when connection has services if(!connection->connected()) connection->connect(url_cstr); // return autoclosing object for it return connection; } void SQL_Driver_manager::close_connection(connection_cache_type::key_type url, SQL_Connection* connection) { put_connection_to_cache(url, connection); } // driver cache SQL_Driver *SQL_Driver_manager::get_driver_from_cache(driver_cache_type::key_type protocol) { SYNCHRONIZED; return driver_cache.get(protocol); } void SQL_Driver_manager::put_driver_to_cache(driver_cache_type::key_type protocol, driver_cache_type::value_type driver) { SYNCHRONIZED; driver_cache.put(protocol, driver); } // connection cache /// @todo get rid of memory spending Stack [zeros deep inside got accumulated] SQL_Connection* SQL_Driver_manager::get_connection_from_cache(connection_cache_type::key_type url) { SYNCHRONIZED; if(connection_cache_type::value_type connections=connection_cache.get(url)) while(!connections->is_empty()) { // there are cached connections to that 'url' SQL_Connection* result=connections->pop(); if(result->connected()) // not expired? return result; } return 0; } void SQL_Driver_manager::put_connection_to_cache(connection_cache_type::key_type url, SQL_Connection* connection) { SYNCHRONIZED; connection_cache_type::value_type connections=connection_cache.get(url); if(!connections) { // there are no cached connections to that 'url' yet? connections=new connection_cache_element_base_type; connection_cache.put(url, connections); } connections->push(connection); } void SQL_Driver_manager::maybe_expire_cache() { time_t now=time(0); if(prev_expiration_pass_time(expire_connections, time_t(now-EXPIRE_UNUSED_CONNECTION_SECONDS)); prev_expiration_pass_time=now; } } static void add_connection_to_status_cache_table(SQL_Connection& connection, Table* table) { if(connection.connected()) { ArrayString& row=*new ArrayString; // url row+=&connection.services().url_without_login(); // time time_t time_used=connection.get_time_used(); row+=new String(pa_strdup(ctime(&time_used))); *table+=&row; } } static void add_connections_to_status_cache_table(SQL_Driver_manager::connection_cache_type::key_type /*key*/, SQL_Driver_manager::connection_cache_type::value_type stack, Table* table) { for(Array_iterator i(*stack); i; ) add_connection_to_status_cache_table(*i.next(), table); } Value* SQL_Driver_manager::get_status() { Value* result=new VHash; // cache { ArrayString& columns=*new ArrayString; columns+=new String("url"); columns+=new String("time"); Table& table=*new Table(&columns, connection_cache.count()); connection_cache.for_each(add_connections_to_status_cache_table, &table); result->get_hash()->put(*new String("cache"), new VTable(&table)); } return result; } parser-3.5.1/src/sql/0000755000076400007640000000000014740300546011416 500000000000000parser-3.5.1/src/sql/Makefile.in0000644000076400007640000004203414740273416013413 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/sql ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(includedir)" HEADERS = $(include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ include_HEADERS = pa_sql_driver.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/sql/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/sql/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-includeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/sql/Makefile.am0000644000076400007640000000004211766060553013374 00000000000000include_HEADERS = pa_sql_driver.h parser-3.5.1/src/sql/pa_sql_driver.h0000644000076400007640000001121614712042465014344 00000000000000/** @file Parser: sql driver interface. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian driver dynamic library must look like this: @code class X_SQL_Driver: public SQL_Driver { public: X_SQL_Driver() : SQL_driver() {} int api_version() { return SQL_DRIVER_API_VERSION; } //... }; extern "C" SQL_Driver *create() { return new X_SQL_Driver(); } @endcode */ #ifndef PA_SQL_DRIVER_H #define PA_SQL_DRIVER_H #define IDENT_PA_SQL_DRIVER_H "$Id: pa_sql_driver.h,v 1.54 2024/11/04 03:53:25 moko Exp $" #include #include #include #include /* 1..8 not logged 9 introducing placeholders 10 limit fixed (default: SQL_NO_LIMIT [ULONG_MAX]), path to document_root added */ #define SQL_DRIVER_API_VERSION 10 //#define SQL_DRIVER_API_VERSION 9 #define SQL_DRIVER_CREATE create /* used in driver implementation */ #define SQL_DRIVER_CREATE_NAME "create" /* could not figure out how to # it :( */ #define SQL_NO_LIMIT ULONG_MAX //#define SQL_NO_LIMIT 0 /// fields are freed elsewhere class SQL_Error { bool fdefined; const char* ftype; const char* fcomment; public: SQL_Error(): fdefined(false) {} SQL_Error( const char* atype, const char* acomment): fdefined(true), ftype(atype), fcomment(acomment) {} SQL_Error(const char* acomment): fdefined(true), ftype(0), fcomment(acomment) {} SQL_Error& operator =(const SQL_Error& src) { fdefined=src.fdefined; ftype=src.ftype; fcomment=src.fcomment; return *this; } bool defined() const { return fdefined; } const char* type() const { return ftype; } const char* comment() const { return fcomment; } }; /// service functions for SQL driver to use class SQL_Driver_services { public: /// allocates some bytes virtual void *malloc(size_t size) =0; /// allocates some bytes, user promises: no pointers inside virtual void *malloc_atomic(size_t size) =0; /// reallocates bytes virtual void *realloc(void *ptr, size_t size) =0; /// $request:charset virtual const char* request_charset() =0; /// $request:document-root virtual const char* request_document_root() =0; /// transcoder. /// WARNING: can store pointers to charset names to speedup name-to-instance resolving /// so do NOT pass pointers to local vars and change those vars after that virtual void transcode(const char* src, size_t src_length, const char*& dst, size_t& dst_length, const char* charset_from_name, const char* charset_to_name ) =0; /// prepare throw exception virtual void _throw(const SQL_Error& e) =0; /// throw C++ exception from prepared virtual void propagate_exception() =0; /// helper func void _throw(const char* comment) { _throw(SQL_Error("sql.connect", comment)); } public: /// regretrully public, because can't make stack frames: "nowhere to return to" jmp_buf mark; }; /** events, occuring when SQL_Driver::query()-ing. when OK must return false. must NOT throw exceptions, must store them to error & return true. */ class SQL_Driver_query_event_handlers { public: virtual bool add_column(SQL_Error& error, const char* str, size_t length) =0; virtual bool before_rows(SQL_Error& error) =0; virtual bool add_row(SQL_Error& error) =0; virtual bool add_row_cell(SQL_Error& error, const char* str, size_t length) =0; }; /// SQL driver API class SQL_Driver { public: /// @todo can be optimized to contain type information, /// to pass IN and OUT int/double NOT in string format struct Placeholder { const char* name; const char* value; bool is_null; bool were_updated; }; /// get api version virtual int api_version() =0; /// initialize driver by loading sql dynamic link library virtual const char* initialize(char *dlopen_file_spec) =0; /** connect to sql database using @param url_cstr format is driver specific @returns true+'connection' on success. 'error' on failure */ virtual void connect(char *url_cstr, SQL_Driver_services& services, void **connection) =0; virtual void disconnect(void *connection) =0; virtual void commit(void *connection) =0; virtual void rollback(void *connection) =0; /// @returns true to indicate that connection still alive virtual bool ping(void *connection) =0; /// encodes the string in 'from' to an escaped SQL string virtual const char* quote(void *connection, const char* str, unsigned int length) =0; virtual void query(void *connection, const char* statement, size_t placeholders_count, Placeholder* placeholders, unsigned long offset, unsigned long limit, SQL_Driver_query_event_handlers& handlers) =0; }; typedef SQL_Driver *(*SQL_Driver_create_func)(); #endif parser-3.5.1/src/lib/0000755000076400007640000000000014740300546011365 500000000000000parser-3.5.1/src/lib/gc/0000755000076400007640000000000014740300546011756 500000000000000parser-3.5.1/src/lib/gc/include/0000755000076400007640000000000014740300546013401 500000000000000parser-3.5.1/src/lib/gc/include/Makefile.in0000644000076400007640000003557514740273415015411 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/gc/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = gc.h gc_allocator.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/gc/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/gc/include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/gc/include/Makefile.am0000644000076400007640000000004511300360673015350 00000000000000noinst_HEADERS = gc.h gc_allocator.h parser-3.5.1/src/lib/gc/include/gc_allocator.h0000644000076400007640000001206313765772311016136 00000000000000/* * Copyright (c) 1996-1997 * Silicon Graphics Computer Systems, Inc. * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Silicon Graphics makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. * * Copyright (c) 2002 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear * in supporting documentation. Hewlett-Packard Company makes no * representations about the suitability of this software for any * purpose. It is provided "as is" without express or implied warranty. */ /* * This implements standard-conforming allocators that interact with * the garbage collector. Gc_alloctor allocates garbage-collectable * objects of type T. Traceable_allocator allocates objects that * are not temselves garbage collected, but are scanned by the * collector for pointers to collectable objects. Traceable_alloc * should be used for explicitly managed STL containers that may * point to collectable objects. * * This code was derived from an earlier version of the GNU C++ standard * library, which itself was derived from the SGI STL implementation. */ #ifndef GC_ALLOCATOR_H #define GC_ALLOCATOR_H #include // for placement new #if defined(__GNUC__) # define GC_ATTR_UNUSED __attribute__((unused)) #else # define GC_ATTR_UNUSED #endif /* First some helpers to allow us to dispatch on whether or not a type * is known to be pointerfree. * These are private, except that the client may invoke the * GC_DECLARE_PTRFREE macro. */ struct GC_true_type {}; struct GC_false_type {}; template struct GC_type_traits { GC_false_type GC_is_ptr_free; }; # define GC_DECLARE_PTRFREE(T) \ template<> struct GC_type_traits { GC_true_type GC_is_ptr_free; } GC_DECLARE_PTRFREE(char); GC_DECLARE_PTRFREE(signed char); GC_DECLARE_PTRFREE(unsigned char); GC_DECLARE_PTRFREE(signed short); GC_DECLARE_PTRFREE(unsigned short); GC_DECLARE_PTRFREE(signed int); GC_DECLARE_PTRFREE(unsigned int); GC_DECLARE_PTRFREE(signed long); GC_DECLARE_PTRFREE(unsigned long); GC_DECLARE_PTRFREE(float); GC_DECLARE_PTRFREE(double); GC_DECLARE_PTRFREE(long double); /* The client may want to add others. */ // In the following GC_Tp is GC_true_type iff we are allocating a // pointerfree object. template inline void * GC_selective_alloc(size_t n, GC_Tp) { return GC_MALLOC(n); } template <> inline void * GC_selective_alloc(size_t n, GC_true_type) { return GC_MALLOC_ATOMIC(n); } /* Now the public gc_allocator class: */ template class gc_allocator { public: typedef size_t size_type; typedef ptrdiff_t difference_type; typedef GC_Tp* pointer; typedef const GC_Tp* const_pointer; typedef GC_Tp& reference; typedef const GC_Tp& const_reference; typedef GC_Tp value_type; template struct rebind { typedef gc_allocator other; }; gc_allocator() {} gc_allocator(const gc_allocator&) throw() {} # if !(GC_NO_MEMBER_TEMPLATES || 0 < _MSC_VER && _MSC_VER <= 1200) // MSVC++ 6.0 do not support member templates template gc_allocator(const gc_allocator&) throw() {} # endif ~gc_allocator() throw() {} pointer address(reference GC_x) const { return &GC_x; } const_pointer address(const_reference GC_x) const { return &GC_x; } // GC_n is permitted to be 0. The C++ standard says nothing about what // the return value is when GC_n == 0. GC_Tp* allocate(size_type GC_n, const void* = 0) { GC_type_traits traits; return static_cast (GC_selective_alloc(GC_n * sizeof(GC_Tp), traits.GC_is_ptr_free)); } // __p is not permitted to be a null pointer. void deallocate(pointer __p, size_type GC_ATTR_UNUSED) { GC_FREE(__p); } size_type max_size() const throw() { return size_t(-1) / sizeof(GC_Tp); } void construct(pointer __p, const GC_Tp& __val) { new(__p) GC_Tp(__val); } void destroy(pointer __p) { __p->~GC_Tp(); } }; template<> class gc_allocator { typedef size_t size_type; typedef ptrdiff_t difference_type; typedef void* pointer; typedef const void* const_pointer; typedef void value_type; template struct rebind { typedef gc_allocator other; }; }; template inline bool operator==(const gc_allocator&, const gc_allocator&) { return true; } template inline bool operator!=(const gc_allocator&, const gc_allocator&) { return false; } #endif /* GC_ALLOCATOR_H */ parser-3.5.1/src/lib/gc/include/gc.h0000644000076400007640000002161214000605171014054 00000000000000/* * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers * Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. * Copyright 1996-1999 by Silicon Graphics. All rights reserved. * Copyright 1999 by Hewlett-Packard Company. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. */ /* * Note that this defines a large number of tuning hooks, which can * safely be ignored in nearly all cases. For normal use it suffices * to call only GC_MALLOC and perhaps GC_REALLOC. * For better performance, also look at GC_MALLOC_ATOMIC, and * GC_enable_incremental. If you need an action to be performed * immediately before an object is collected, look at GC_register_finalizer. * If you are using Solaris threads, look at the end of this file. * Everything else is best ignored unless you encounter performance * problems. */ #ifndef _GC_H # define _GC_H # define __GC # include # ifdef _WIN32_WCE /* Yet more kluges for WinCE */ # include /* size_t is defined here */ typedef long ptrdiff_t; /* ptrdiff_t is not defined */ # endif #if defined(__MINGW32__) && defined(_DLL) && !defined(GC_NOT_DLL) # ifdef GC_BUILD # define GC_API __declspec(dllexport) # else # define GC_API __declspec(dllimport) # endif #endif #if (defined(__DMC__) || defined(_MSC_VER)) && (defined(_DLL) && !defined(GC_NOT_DLL) || defined(GC_DLL)) # ifdef GC_BUILD # define GC_API extern __declspec(dllexport) # else # define GC_API __declspec(dllimport) # endif #endif #ifndef GC_API #define GC_API extern #endif # if defined(__STDC__) || defined(__cplusplus) # define GC_PROTO(args) args typedef void * GC_PTR; # define GC_CONST const # else # define GC_PROTO(args) () typedef char * GC_PTR; # define GC_CONST # endif # ifdef __cplusplus extern "C" { # endif typedef unsigned long GC_word; typedef long GC_signed_word; /* Public procedures */ /* Initialize the collector. This is only required when using thread-local * allocation, since unlike the regular allocation routines, GC_local_malloc * is not self-initializing. If you use GC_local_malloc you should arrange * to call this somehow (e.g. from a constructor) before doing any allocation. */ GC_API void GC_init GC_PROTO((void)); /* Disable garbage collection. Even GC_gcollect calls will be */ /* ineffective. */ GC_API void GC_disable(void); /* Try to re-enable garbage collection. GC_disable() and GC_enable() */ /* calls nest. Garbage collection is enabled if the number of calls to */ /* both functions is equal. */ GC_API void GC_enable(void); /* * general purpose allocation routines, with roughly malloc calling conv. * The atomic versions promise that no relevant pointers are contained * in the object. The nonatomic versions guarantee that the new object * is cleared. GC_malloc_stubborn promises that no changes to the object * will occur after GC_end_stubborn_change has been called on the * result of GC_malloc_stubborn. GC_malloc_uncollectable allocates an object * that is scanned for pointers to collectable objects, but is not itself * collectable. The object is scanned even if it does not appear to * be reachable. GC_malloc_uncollectable and GC_free called on the resulting * object implicitly update GC_non_gc_bytes appropriately. */ GC_API GC_PTR GC_malloc GC_PROTO((size_t size_in_bytes)); GC_API GC_PTR GC_malloc_atomic GC_PROTO((size_t size_in_bytes)); /* Explicitly deallocate an object. Dangerous if used incorrectly. */ /* Requires a pointer to the base of an object. */ /* If the argument is stubborn, it should not be changeable when freed. */ /* An object should not be enable for finalization when it is */ /* explicitly deallocated. */ /* GC_free(0) is a no-op, as required by ANSI C for free. */ GC_API void GC_free GC_PROTO((GC_PTR object_addr)); /* For compatibility with C library. This is occasionally faster than */ /* a malloc followed by a bcopy. But if you rely on that, either here */ /* or with the standard C library, your code is broken. In my */ /* opinion, it shouldn't have been invented, but now we're stuck. -HB */ /* The resulting object has the same kind as the original. */ /* If the argument is stubborn, the result will have changes enabled. */ /* It is an error to have changes enabled for the original object. */ /* Follows ANSI comventions for NULL old_object. */ GC_API GC_PTR GC_realloc GC_PROTO((GC_PTR old_object, size_t new_size_in_bytes)); /* Explicitly trigger a full, world-stop collection. */ GC_API void GC_gcollect GC_PROTO((void)); /* We try to make sure that we allocate at least N/GC_free_space_divisor bytes between collections */ GC_API void GC_set_free_space_divisor(GC_word); GC_API GC_word GC_get_free_space_divisor(void); /* Return the number of bytes in the heap. Excludes collector private */ /* data structures. Includes empty blocks and fragmentation loss. */ /* Includes some pages that were allocated but never written. */ GC_API size_t GC_get_heap_size GC_PROTO((void)); /* Return a lower bound on the number of free bytes in the heap. */ GC_API size_t GC_get_free_bytes GC_PROTO((void)); /* Return the number of bytes allocated since the last collection. */ GC_API size_t GC_get_bytes_since_gc GC_PROTO((void)); /* Return the total number of bytes allocated in this process. */ /* Never decreases. */ GC_API size_t GC_get_total_bytes GC_PROTO((void)); #if defined(__sgi) && !defined(__GNUC__) && _COMPILER_VERSION >= 720 # define GC_ADD_CALLER # define GC_RETURN_ADDR (GC_word)__return_address #endif #ifdef GC_ADD_CALLER # define GC_EXTRAS GC_RETURN_ADDR, __FILE__, __LINE__ # define GC_EXTRA_PARAMS GC_word ra, GC_CONST char * s, int i #else # define GC_EXTRAS __FILE__, __LINE__ # define GC_EXTRA_PARAMS GC_CONST char * s, int i #endif /* Debugging (annotated) allocation. GC_gcollect will check */ /* objects allocated in this way for overwrites, etc. */ GC_API GC_PTR GC_debug_malloc GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); GC_API GC_PTR GC_debug_malloc_atomic GC_PROTO((size_t size_in_bytes, GC_EXTRA_PARAMS)); GC_API void GC_debug_free GC_PROTO((GC_PTR object_addr)); GC_API GC_PTR GC_debug_realloc GC_PROTO((GC_PTR old_object, size_t new_size_in_bytes, GC_EXTRA_PARAMS)); /* Routines that allocate objects with debug information (like the */ /* above), but just fill in dummy file and line number information. */ /* Thus they can serve as drop-in malloc/realloc replacements. This */ /* can be useful for two reasons: */ /* 1) It allows the collector to be built with DBG_HDRS_ALL defined */ /* even if some allocation calls come from 3rd party libraries */ /* that can't be recompiled. */ /* 2) On some platforms, the file and line information is redundant, */ /* since it can be reconstructed from a stack trace. On such */ /* platforms it may be more convenient not to recompile, e.g. for */ /* leak detection. This can be accomplished by instructing the */ /* linker to replace malloc/realloc with these. */ GC_API GC_PTR GC_debug_malloc_replacement GC_PROTO((size_t size_in_bytes)); GC_API GC_PTR GC_debug_realloc_replacement GC_PROTO((GC_PTR object_addr, size_t size_in_bytes)); # ifdef GC_DEBUG # define GC_MALLOC(sz) GC_debug_malloc(sz, GC_EXTRAS) # define GC_MALLOC_ATOMIC(sz) GC_debug_malloc_atomic(sz, GC_EXTRAS) # define GC_REALLOC(old, sz) GC_debug_realloc(old, sz, GC_EXTRAS) # define GC_FREE(p) GC_debug_free(p) # else # define GC_MALLOC(sz) GC_malloc(sz) # define GC_MALLOC_ATOMIC(sz) GC_malloc_atomic(sz) # define GC_REALLOC(old, sz) GC_realloc(old, sz) # define GC_FREE(p) GC_free(p) # endif /* The following are included because they are often convenient, and */ /* reduce the chance for a misspecifed size argument. But calls may */ /* expand to something syntactically incorrect if t is a complicated */ /* type expression. */ # define GC_NEW(t) (t *)GC_MALLOC(sizeof (t)) # define GC_NEW_ATOMIC(t) (t *)GC_MALLOC_ATOMIC(sizeof (t)) /* GC_set_warn_proc can be used to redirect or filter warning messages. */ /* p may not be a NULL pointer. */ typedef void (*GC_warn_proc) GC_PROTO((char *msg, GC_word arg)); GC_API void GC_set_warn_proc GC_PROTO((GC_warn_proc p)); /* GC_ignore_warn_proc may be used as an argument for GC_set_warn_proc */ /* to suppress all warnings (unless statistics printing is turned on). */ GC_API void GC_ignore_warn_proc(char *, GC_word); #ifdef __cplusplus } /* end of extern "C" */ #endif #endif /* _GC_H */ parser-3.5.1/src/lib/gc/Makefile.in0000644000076400007640000004601014740273415013750 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/gc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = include all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/gc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/gc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/gc/Makefile.am0000644000076400007640000000002207707741612013734 00000000000000SUBDIRS = include parser-3.5.1/src/lib/pcre/0000755000076400007640000000000014740300546012316 500000000000000parser-3.5.1/src/lib/pcre/pa_pcre_chartables.c0000644000076400007640000001717712377661026016227 00000000000000/************************************************* * Perl-Compatible Regular Expressions * *************************************************/ /* This file contains character tables that are used when no external tables are passed to PCRE by the application that calls it. The tables are used only for characters whose code values are less than 256. This is a default version of the tables that assumes ASCII encoding. A program called dftables (which is distributed with PCRE) can be used to build alternative versions of this file. This is necessary if you are running in an EBCDIC environment, or if you want to default to a different encoding, for example ISO-8859-1. When dftables is run, it creates these tables in the current locale. If PCRE is configured with --enable-rebuild-chartables, this happens automatically. The following #includes are present because without them gcc 4.x may remove the array definition from the final binary if PCRE is built into a static library and dead code stripping is activated. This leads to link errors. Pulling in the header ensures that the array gets flagged as "someone outside this compilation unit might reference this" and so it will always be supplied to the linker. */ #include "pa_pcre_internal.h" const unsigned char pa_pcre_default_tables[] = { /* This table is a lower casing table. */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99,100,101,102,103, 104,105,106,107,108,109,110,111, 112,113,114,115,116,117,118,119, 120,121,122, 91, 92, 93, 94, 95, 96, 97, 98, 99,100,101,102,103, 104,105,106,107,108,109,110,111, 112,113,114,115,116,117,118,119, 120,121,122,123,124,125,126,127, 128,129,130,131,132,133,134,135, 136,137,138,139,140,141,142,143, 144,145,146,147,148,149,150,151, 152,153,154,155,156,157,158,159, 160,161,162,163,164,165,166,167, 168,169,170,171,172,173,174,175, 176,177,178,179,180,181,182,183, 184,185,186,187,188,189,190,191, 192,193,194,195,196,197,198,199, 200,201,202,203,204,205,206,207, 208,209,210,211,212,213,214,215, 216,217,218,219,220,221,222,223, 224,225,226,227,228,229,230,231, 232,233,234,235,236,237,238,239, 240,241,242,243,244,245,246,247, 248,249,250,251,252,253,254,255, /* This table is a case flipping table. */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99,100,101,102,103, 104,105,106,107,108,109,110,111, 112,113,114,115,116,117,118,119, 120,121,122, 91, 92, 93, 94, 95, 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, 128,129,130,131,132,133,134,135, 136,137,138,139,140,141,142,143, 144,145,146,147,148,149,150,151, 152,153,154,155,156,157,158,159, 160,161,162,163,164,165,166,167, 168,169,170,171,172,173,174,175, 176,177,178,179,180,181,182,183, 184,185,186,187,188,189,190,191, 192,193,194,195,196,197,198,199, 200,201,202,203,204,205,206,207, 208,209,210,211,212,213,214,215, 216,217,218,219,220,221,222,223, 224,225,226,227,228,229,230,231, 232,233,234,235,236,237,238,239, 240,241,242,243,244,245,246,247, 248,249,250,251,252,253,254,255, /* This table contains bit maps for various character classes. Each map is 32 bytes long and the bits run from the least significant end of each byte. The classes that have their own maps are: space, xdigit, digit, upper, lower, word, graph, print, punct, and cntrl. Other classes are built from combinations. */ 0x00,0x3e,0x00,0x00,0x01,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, 0x7e,0x00,0x00,0x00,0x7e,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xfe,0xff,0xff,0x07,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0x07, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03, 0xfe,0xff,0xff,0x87,0xfe,0xff,0xff,0x07, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xfe,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff, 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0xfe,0xff,0x00,0xfc, 0x01,0x00,0x00,0xf8,0x01,0x00,0x00,0x78, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* This table identifies various classes of character by individual bits: 0x01 white space character 0x02 letter 0x04 decimal digit 0x08 hexadecimal digit 0x10 alphanumeric or '_' 0x80 regular expression metacharacter or binary zero */ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0- 7 */ 0x00,0x01,0x01,0x00,0x01,0x01,0x00,0x00, /* 8- 15 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 16- 23 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 24- 31 */ 0x01,0x00,0x00,0x00,0x80,0x00,0x00,0x00, /* - ' */ 0x80,0x80,0x80,0x80,0x00,0x00,0x80,0x00, /* ( - / */ 0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c,0x1c, /* 0 - 7 */ 0x1c,0x1c,0x00,0x00,0x00,0x00,0x00,0x80, /* 8 - ? */ 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* @ - G */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* H - O */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* P - W */ 0x12,0x12,0x12,0x80,0x80,0x00,0x80,0x10, /* X - _ */ 0x00,0x1a,0x1a,0x1a,0x1a,0x1a,0x1a,0x12, /* ` - g */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* h - o */ 0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12, /* p - w */ 0x12,0x12,0x12,0x80,0x80,0x00,0x00,0x00, /* x -127 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 128-135 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 136-143 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 144-151 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 152-159 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 160-167 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 168-175 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 176-183 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 184-191 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 192-199 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 200-207 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 208-215 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 216-223 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 224-231 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 232-239 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 240-247 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};/* 248-255 */ /* End of pcre_chartables.c */ parser-3.5.1/src/lib/pcre/Makefile.in0000644000076400007640000004571614740273415014324 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/pcre ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libpcre_internal_la_LIBADD = am_libpcre_internal_la_OBJECTS = pa_pcre_chartables.lo \ pa_pcre_valid_utf8.lo libpcre_internal_la_OBJECTS = $(am_libpcre_internal_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/pa_pcre_chartables.Plo \ ./$(DEPDIR)/pa_pcre_valid_utf8.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libpcre_internal_la_SOURCES) DIST_SOURCES = $(libpcre_internal_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = @PCRE_INCLUDES@ noinst_HEADERS = pa_pcre_internal.h noinst_LTLIBRARIES = libpcre_internal.la libpcre_internal_la_SOURCES = pa_pcre_chartables.c pa_pcre_valid_utf8.c EXTRA_DIST = pcre_internal.vcproj all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/pcre/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/pcre/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libpcre_internal.la: $(libpcre_internal_la_OBJECTS) $(libpcre_internal_la_DEPENDENCIES) $(EXTRA_libpcre_internal_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libpcre_internal_la_OBJECTS) $(libpcre_internal_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_pcre_chartables.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_pcre_valid_utf8.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/pa_pcre_chartables.Plo -rm -f ./$(DEPDIR)/pa_pcre_valid_utf8.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/pa_pcre_chartables.Plo -rm -f ./$(DEPDIR)/pa_pcre_valid_utf8.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/pcre/pcre_internal.vcproj0000644000076400007640000001061314600704370016307 00000000000000 parser-3.5.1/src/lib/pcre/pa_pcre_internal.h0000644000076400007640000000636614536123210015721 00000000000000/* Some internal stuff from PCRE library */ /* Author: Sergey B Kirpichev */ #include "pa_config_includes.h" /* Bit definitions for entries in the pcre_ctypes table. */ #define ctype_space 0x01 #define ctype_letter 0x02 #define ctype_digit 0x04 #define ctype_xdigit 0x08 #define ctype_word 0x10 /* alphanumeric or '_' */ #define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */ /* Offsets for the bitmap tables in pcre_cbits. Each table contains a set of bits for a class map. Some classes are built by combining these tables. */ #define cbit_space 0 /* [:space:] or \s */ #define cbit_xdigit 32 /* [:xdigit:] */ #define cbit_digit 64 /* [:digit:] or \d */ #define cbit_upper 96 /* [:upper:] */ #define cbit_lower 128 /* [:lower:] */ #define cbit_word 160 /* [:word:] or \w */ #define cbit_graph 192 /* [:graph:] */ #define cbit_print 224 /* [:print:] */ #define cbit_punct 256 /* [:punct:] */ #define cbit_cntrl 288 /* [:cntrl:] */ #define cbit_length 320 /* Length of the cbits table */ /* Offsets of the various tables from the base tables pointer, and total length. */ #define lcc_offset 0 #define fcc_offset 256 #define cbits_offset 512 #define ctypes_offset (cbits_offset + cbit_length) #define tables_length (ctypes_offset + 256) /* Internal shared data tables. The data for these tables is in the pa_pcre_chartables.c module. */ #ifdef __cplusplus extern "C" const unsigned char pa_pcre_default_tables[]; #else extern const unsigned char pa_pcre_default_tables[]; #endif /* Internal function for validating UTF-8 character strings. The code for this function is in the pcre_valid_utf8.c module. */ #ifdef __cplusplus extern "C" int pa_pcre_valid_utf(unsigned char *string, int length, int *erroroffset); #else extern int pa_pcre_valid_utf(unsigned char *string, int length, int *erroroffset); #endif #ifdef HAVE_PCRE2 #define PCRE_UTF8_ERR0 0 #define PCRE_UTF8_ERR6 PCRE2_ERROR_UTF8_ERR6 #define PCRE_UTF8_ERR7 PCRE2_ERROR_UTF8_ERR7 #define PCRE_UTF8_ERR8 PCRE2_ERROR_UTF8_ERR8 #define PCRE_UTF8_ERR9 PCRE2_ERROR_UTF8_ERR9 #define PCRE_UTF8_ERR10 PCRE2_ERROR_UTF8_ERR10 #define PCRE_UTF8_ERR11 PCRE2_ERROR_UTF8_ERR11 #define PCRE_UTF8_ERR12 PCRE2_ERROR_UTF8_ERR12 #define PCRE_UTF8_ERR13 PCRE2_ERROR_UTF8_ERR13 #define PCRE_UTF8_ERR14 PCRE2_ERROR_UTF8_ERR14 #define PCRE_UTF8_ERR15 PCRE2_ERROR_UTF8_ERR15 #define PCRE_UTF8_ERR16 PCRE2_ERROR_UTF8_ERR16 #define PCRE_UTF8_ERR17 PCRE2_ERROR_UTF8_ERR17 #define PCRE_UTF8_ERR18 PCRE2_ERROR_UTF8_ERR18 #define PCRE_UTF8_ERR19 PCRE2_ERROR_UTF8_ERR19 #define PCRE_UTF8_ERR20 PCRE2_ERROR_UTF8_ERR20 #define PCRE_UTF8_ERR21 PCRE2_ERROR_UTF8_ERR21 #define PCRE_ERROR_BADUTF8_OFFSET PCRE2_ERROR_BADUTFOFFSET #define PCRE_UTF8 PCRE2_UTF #define PCRE_UCP PCRE2_UCP #define PCRE_EXTENDED PCRE2_EXTENDED #define PCRE_ERROR_NOMATCH PCRE2_ERROR_NOMATCH #define PCRE_INFO_SIZE PCRE2_INFO_SIZE #define PCRE_CASELESS PCRE2_CASELESS #define PCRE_DOTALL PCRE2_DOTALL #define PCRE_MULTILINE PCRE2_MULTILINE #define PCRE_UNGREEDY PCRE2_UNGREEDY #define PCRE_DOLLAR_ENDONLY PCRE2_DOLLAR_ENDONLY #define PCRE_EXTRA 0 #define pcre_fullinfo(fcode, fextra, type, result) pcre2_pattern_info(fcode, type, result) #endif parser-3.5.1/src/lib/pcre/Makefile.am0000644000076400007640000000032712572102226014270 00000000000000AM_CPPFLAGS = @PCRE_INCLUDES@ noinst_HEADERS = pa_pcre_internal.h noinst_LTLIBRARIES = libpcre_internal.la libpcre_internal_la_SOURCES = pa_pcre_chartables.c pa_pcre_valid_utf8.c EXTRA_DIST = pcre_internal.vcproj parser-3.5.1/src/lib/pcre/pa_pcre_valid_utf8.c0000644000076400007640000002423214536123210016135 00000000000000/************************************************* * Perl-Compatible Regular Expressions * *************************************************/ /* PCRE is a library of functions to support regular expressions whose syntax and semantics are as close as possible to those of the Perl 5 language. Written by Philip Hazel Copyright (c) 1997-2012 University of Cambridge ----------------------------------------------------------------------------- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 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. * Neither the name of the University of Cambridge nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ----------------------------------------------------------------------------- */ /* This module contains an internal function for validating UTF-8 character strings. */ #include "pa_pcre_internal.h" #ifdef HAVE_PCRE2 #include #else #include #endif /************************************************* * Validate a UTF-8 string * *************************************************/ /* This function is called (optionally) at the start of compile or match, to check that a supposed UTF-8 string is actually valid. The early check means that subsequent code can assume it is dealing with a valid string. The check can be turned off for maximum performance, but the consequences of supplying an invalid string are then undefined. Originally, this function checked according to RFC 2279, allowing for values in the range 0 to 0x7fffffff, up to 6 bytes long, but ensuring that they were in the canonical format. Once somebody had pointed out RFC 3629 to me (it obsoletes 2279), additional restrictions were applied. The values are now limited to be between 0 and 0x0010ffff, no more than 4 bytes long, and the subrange 0xd000 to 0xdfff is excluded. However, the format of 5-byte and 6-byte characters is still checked. From release 8.13 more information about the details of the error are passed back in the returned value: PCRE_UTF8_ERR0 No error PCRE_UTF8_ERR1 Missing 1 byte at the end of the string PCRE_UTF8_ERR2 Missing 2 bytes at the end of the string PCRE_UTF8_ERR3 Missing 3 bytes at the end of the string PCRE_UTF8_ERR4 Missing 4 bytes at the end of the string PCRE_UTF8_ERR5 Missing 5 bytes at the end of the string PCRE_UTF8_ERR6 2nd-byte's two top bits are not 0x80 PCRE_UTF8_ERR7 3rd-byte's two top bits are not 0x80 PCRE_UTF8_ERR8 4th-byte's two top bits are not 0x80 PCRE_UTF8_ERR9 5th-byte's two top bits are not 0x80 PCRE_UTF8_ERR10 6th-byte's two top bits are not 0x80 PCRE_UTF8_ERR11 5-byte character is not permitted by RFC 3629 PCRE_UTF8_ERR12 6-byte character is not permitted by RFC 3629 PCRE_UTF8_ERR13 4-byte character with value > 0x10ffff is not permitted PCRE_UTF8_ERR14 3-byte character with value 0xd000-0xdfff is not permitted PCRE_UTF8_ERR15 Overlong 2-byte sequence PCRE_UTF8_ERR16 Overlong 3-byte sequence PCRE_UTF8_ERR17 Overlong 4-byte sequence PCRE_UTF8_ERR18 Overlong 5-byte sequence (won't ever occur) PCRE_UTF8_ERR19 Overlong 6-byte sequence (won't ever occur) PCRE_UTF8_ERR20 Isolated 0x80 byte (not within UTF-8 character) PCRE_UTF8_ERR21 Byte with the illegal value 0xfe or 0xff Arguments: string points to the string length length of string, or -1 if the string is zero-terminated errp pointer to an error position offset variable Returns: = 0 if the string is a valid UTF-8 string > 0 otherwise, setting the offset of the bad character */ typedef unsigned char *PCRE_PUCHAR; #define SUPPORT_UTF static const unsigned char utf8_table4[] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; int pa_pcre_valid_utf(PCRE_PUCHAR string, int length, int *erroroffset) { #ifdef SUPPORT_UTF register PCRE_PUCHAR p; if (length < 0) { for (p = string; *p != 0; p++); length = (int)(p - string); } for (p = string; length-- > 0; p++) { register int ab, c, d; c = *p; if (c < 128) continue; /* ASCII character */ if (c < 0xc0) /* Isolated 10xx xxxx byte */ { *erroroffset = (int)(p - string); return PCRE_UTF8_ERR20; } if (c >= 0xfe) /* Invalid 0xfe or 0xff bytes */ { *erroroffset = (int)(p - string); return PCRE_UTF8_ERR21; } ab = utf8_table4[c & 0x3f]; /* Number of additional bytes */ if (length < ab) { *erroroffset = (int)(p - string); /* Missing bytes */ return ab - length; /* Codes ERR1 to ERR5 */ } length -= ab; /* Length remaining */ /* Check top bits in the second byte */ if (((d = *(++p)) & 0xc0) != 0x80) { *erroroffset = (int)(p - string) - 1; return PCRE_UTF8_ERR6; } /* For each length, check that the remaining bytes start with the 0x80 bit set and not the 0x40 bit. Then check for an overlong sequence, and for the excluded range 0xd800 to 0xdfff. */ switch (ab) { /* 2-byte character. No further bytes to check for 0x80. Check first byte for for xx00 000x (overlong sequence). */ case 1: if ((c & 0x3e) == 0) { *erroroffset = (int)(p - string) - 1; return PCRE_UTF8_ERR15; } break; /* 3-byte character. Check third byte for 0x80. Then check first 2 bytes for 1110 0000, xx0x xxxx (overlong sequence) or 1110 1101, 1010 xxxx (0xd800 - 0xdfff) */ case 2: if ((*(++p) & 0xc0) != 0x80) /* Third byte */ { *erroroffset = (int)(p - string) - 2; return PCRE_UTF8_ERR7; } if (c == 0xe0 && (d & 0x20) == 0) { *erroroffset = (int)(p - string) - 2; return PCRE_UTF8_ERR16; } if (c == 0xed && d >= 0xa0) { *erroroffset = (int)(p - string) - 2; return PCRE_UTF8_ERR14; } break; /* 4-byte character. Check 3rd and 4th bytes for 0x80. Then check first 2 bytes for for 1111 0000, xx00 xxxx (overlong sequence), then check for a character greater than 0x0010ffff (f4 8f bf bf) */ case 3: if ((*(++p) & 0xc0) != 0x80) /* Third byte */ { *erroroffset = (int)(p - string) - 2; return PCRE_UTF8_ERR7; } if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */ { *erroroffset = (int)(p - string) - 3; return PCRE_UTF8_ERR8; } if (c == 0xf0 && (d & 0x30) == 0) { *erroroffset = (int)(p - string) - 3; return PCRE_UTF8_ERR17; } if (c > 0xf4 || (c == 0xf4 && d > 0x8f)) { *erroroffset = (int)(p - string) - 3; return PCRE_UTF8_ERR13; } break; /* 5-byte and 6-byte characters are not allowed by RFC 3629, and will be rejected by the length test below. However, we do the appropriate tests here so that overlong sequences get diagnosed, and also in case there is ever an option for handling these larger code points. */ /* 5-byte character. Check 3rd, 4th, and 5th bytes for 0x80. Then check for 1111 1000, xx00 0xxx */ case 4: if ((*(++p) & 0xc0) != 0x80) /* Third byte */ { *erroroffset = (int)(p - string) - 2; return PCRE_UTF8_ERR7; } if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */ { *erroroffset = (int)(p - string) - 3; return PCRE_UTF8_ERR8; } if ((*(++p) & 0xc0) != 0x80) /* Fifth byte */ { *erroroffset = (int)(p - string) - 4; return PCRE_UTF8_ERR9; } if (c == 0xf8 && (d & 0x38) == 0) { *erroroffset = (int)(p - string) - 4; return PCRE_UTF8_ERR18; } break; /* 6-byte character. Check 3rd-6th bytes for 0x80. Then check for 1111 1100, xx00 00xx. */ case 5: if ((*(++p) & 0xc0) != 0x80) /* Third byte */ { *erroroffset = (int)(p - string) - 2; return PCRE_UTF8_ERR7; } if ((*(++p) & 0xc0) != 0x80) /* Fourth byte */ { *erroroffset = (int)(p - string) - 3; return PCRE_UTF8_ERR8; } if ((*(++p) & 0xc0) != 0x80) /* Fifth byte */ { *erroroffset = (int)(p - string) - 4; return PCRE_UTF8_ERR9; } if ((*(++p) & 0xc0) != 0x80) /* Sixth byte */ { *erroroffset = (int)(p - string) - 5; return PCRE_UTF8_ERR10; } if (c == 0xfc && (d & 0x3c) == 0) { *erroroffset = (int)(p - string) - 5; return PCRE_UTF8_ERR19; } break; } /* Character is valid under RFC 2279, but 4-byte and 5-byte characters are excluded by RFC 3629. The pointer p is currently at the last byte of the character. */ if (ab > 3) { *erroroffset = (int)(p - string) - ab; return (ab == 4)? PCRE_UTF8_ERR11 : PCRE_UTF8_ERR12; } } #else /* SUPPORT_UTF */ (void)(string); /* Keep picky compilers happy */ (void)(length); #endif return PCRE_UTF8_ERR0; /* This indicates success */ } /* End of pcre_valid_utf8.c */ parser-3.5.1/src/lib/curl/0000755000076400007640000000000014740300546012332 500000000000000parser-3.5.1/src/lib/curl/Makefile.in0000644000076400007640000003553614740273415014337 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/curl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = curl.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/curl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/curl/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/curl/Makefile.am0000644000076400007640000000003111744235623014304 00000000000000noinst_HEADERS = curl.h parser-3.5.1/src/lib/curl/curl.h0000644000076400007640000011144713206630367013403 00000000000000#ifndef __CURL_CURL_H #define __CURL_CURL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * * $Id: curl.h,v 1.5 2017/11/26 21:24:07 moko Exp $ ***************************************************************************/ /* * If you have libcurl problems, all docs and details are found here: * http://curl.haxx.se/libcurl/ * * curl-library mailing list subscription and unsubscription web interface: * http://cool.haxx.se/mailman/listinfo/curl-library/ */ typedef struct CURL CURL; typedef enum { CURLE_OK = 0, CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ CURLE_FAILED_INIT, /* 2 */ CURLE_URL_MALFORMAT, /* 3 */ CURLE_OBSOLETE4, /* 4 - NOT USED */ CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ CURLE_COULDNT_RESOLVE_HOST, /* 6 */ CURLE_COULDNT_CONNECT, /* 7 */ CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */ CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server due to lack of access - when login fails this is not returned. */ CURLE_OBSOLETE10, /* 10 - NOT USED */ CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ CURLE_OBSOLETE12, /* 12 - NOT USED */ CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ CURLE_FTP_CANT_GET_HOST, /* 15 */ CURLE_OBSOLETE16, /* 16 - NOT USED */ CURLE_FTP_COULDNT_SET_TYPE, /* 17 */ CURLE_PARTIAL_FILE, /* 18 */ CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ CURLE_OBSOLETE20, /* 20 - NOT USED */ CURLE_QUOTE_ERROR, /* 21 - quote command failure */ CURLE_HTTP_RETURNED_ERROR, /* 22 */ CURLE_WRITE_ERROR, /* 23 */ CURLE_OBSOLETE24, /* 24 - NOT USED */ CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ CURLE_READ_ERROR, /* 26 - couldn't open/read from file */ CURLE_OUT_OF_MEMORY, /* 27 */ /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error instead of a memory allocation error if CURL_DOES_CONVERSIONS is defined */ CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ CURLE_OBSOLETE29, /* 29 - NOT USED */ CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ CURLE_OBSOLETE32, /* 32 - NOT USED */ CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ CURLE_HTTP_POST_ERROR, /* 34 */ CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ CURLE_FILE_COULDNT_READ_FILE, /* 37 */ CURLE_LDAP_CANNOT_BIND, /* 38 */ CURLE_LDAP_SEARCH_FAILED, /* 39 */ CURLE_OBSOLETE40, /* 40 - NOT USED */ CURLE_FUNCTION_NOT_FOUND, /* 41 */ CURLE_ABORTED_BY_CALLBACK, /* 42 */ CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ CURLE_OBSOLETE44, /* 44 - NOT USED */ CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ CURLE_OBSOLETE46, /* 46 - NOT USED */ CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */ CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ CURLE_OBSOLETE50, /* 50 - NOT USED */ CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint wasn't verified fine */ CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as default */ CURLE_SEND_ERROR, /* 55 - failed sending network data */ CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ CURLE_OBSOLETE57, /* 57 - NOT IN USE */ CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */ CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind that failed */ CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not accepted and we failed to login */ CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ CURLE_TFTP_PERM, /* 69 - permission problem on server */ CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */ CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */ CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ CURLE_CONV_FAILED, /* 75 - conversion failed */ CURLE_CONV_REQD, /* 76 - caller must register conversion callbacks using curl_easy_setopt options CURLOPT_CONV_FROM_NETWORK_FUNCTION, CURLOPT_CONV_TO_NETWORK_FUNCTION, and CURLOPT_CONV_FROM_UTF8_FUNCTION */ CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing or wrong format */ CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */ CURLE_SSH, /* 79 - error from the SSH layer, somewhat generic so the error message will be of interest when this has happened */ CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL connection */ CURLE_AGAIN, /* 81 - socket is not ready for send/recv, wait till it's ready and try again (Added in 7.18.2) */ CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or wrong format (Added in 7.19.0) */ CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in 7.19.0) */ CURL_LAST /* never use! */ } CURLcode; /* long may be 32 or 64 bits, but we should never depend on anything else but 32 */ #define CURLOPTTYPE_LONG 0 #define CURLOPTTYPE_OBJECTPOINT 10000 #define CURLOPTTYPE_FUNCTIONPOINT 20000 #define CURLOPTTYPE_OFF_T 30000 /* name is uppercase CURLOPT_, type is one of the defined CURLOPTTYPE_ number is unique identifier */ #define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number /* * This macro-mania below setups the CURLOPT_[what] enum, to be used with * curl_easy_setopt(). The first argument in the CINIT() macro is the [what] * word. */ typedef enum { /* This is the FILE * or void * the regular output should be written to. */ CINIT(FILE, OBJECTPOINT, 1), /* The full URL to get/put */ CINIT(URL, OBJECTPOINT, 2), /* Port number to connect to, if other than default. */ CINIT(PORT, LONG, 3), /* Name of proxy to use. */ CINIT(PROXY, OBJECTPOINT, 4), /* "name:password" to use when fetching. */ CINIT(USERPWD, OBJECTPOINT, 5), /* "name:password" to use with proxy. */ CINIT(PROXYUSERPWD, OBJECTPOINT, 6), /* Range to get, specified as an ASCII string. */ CINIT(RANGE, OBJECTPOINT, 7), /* not used */ /* Specified file stream to upload from (use as input): */ CINIT(INFILE, OBJECTPOINT, 9), /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE * bytes big. If this is not used, error messages go to stderr instead: */ CINIT(ERRORBUFFER, OBJECTPOINT, 10), /* Function that will be called to store the output (instead of fwrite). The * parameters will use fwrite() syntax, make sure to follow them. */ CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11), /* Function that will be called to read the input (instead of fread). The * parameters will use fread() syntax, make sure to follow them. */ CINIT(READFUNCTION, FUNCTIONPOINT, 12), /* Time-out the read operation after this amount of seconds */ CINIT(TIMEOUT, LONG, 13), /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about * how large the file being sent really is. That allows better error * checking and better verifies that the upload was successful. -1 means * unknown size. * * For large file support, there is also a _LARGE version of the key * which takes an off_t type, allowing platforms with larger off_t * sizes to handle larger files. See below for INFILESIZE_LARGE. */ CINIT(INFILESIZE, LONG, 14), /* POST static input fields. */ CINIT(POSTFIELDS, OBJECTPOINT, 15), /* Set the referrer page (needed by some CGIs) */ CINIT(REFERER, OBJECTPOINT, 16), /* Set the FTP PORT string (interface name, named or numerical IP address) Use i.e '-' to use default address. */ CINIT(FTPPORT, OBJECTPOINT, 17), /* Set the User-Agent string (examined by some CGIs) */ CINIT(USERAGENT, OBJECTPOINT, 18), /* If the download receives less than "low speed limit" bytes/second * during "low speed time" seconds, the operations is aborted. * You could i.e if you have a pretty high speed connection, abort if * it is less than 2000 bytes/sec during 20 seconds. */ /* Set the "low speed limit" */ CINIT(LOW_SPEED_LIMIT, LONG, 19), /* Set the "low speed time" */ CINIT(LOW_SPEED_TIME, LONG, 20), /* Set the continuation offset. * * Note there is also a _LARGE version of this key which uses * off_t types, allowing for large file offsets on platforms which * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. */ CINIT(RESUME_FROM, LONG, 21), /* Set cookie in request: */ CINIT(COOKIE, OBJECTPOINT, 22), /* This points to a linked list of headers, struct curl_slist kind */ CINIT(HTTPHEADER, OBJECTPOINT, 23), /* This points to a linked list of post entries, struct curl_httppost */ CINIT(HTTPPOST, OBJECTPOINT, 24), /* name of the file keeping your private SSL-certificate */ CINIT(SSLCERT, OBJECTPOINT, 25), /* password for the SSL or SSH private key */ CINIT(KEYPASSWD, OBJECTPOINT, 26), /* send TYPE parameter? */ CINIT(CRLF, LONG, 27), /* send linked-list of QUOTE commands */ CINIT(QUOTE, OBJECTPOINT, 28), /* send FILE * or void * to store headers to, if you use a callback it is simply passed to the callback unmodified */ CINIT(WRITEHEADER, OBJECTPOINT, 29), /* point to a file to read the initial cookies from, also enables "cookie awareness" */ CINIT(COOKIEFILE, OBJECTPOINT, 31), /* What version to specifically try to use. See CURL_SSLVERSION defines below. */ CINIT(SSLVERSION, LONG, 32), /* What kind of HTTP time condition to use, see defines */ CINIT(TIMECONDITION, LONG, 33), /* Time to use with the above condition. Specified in number of seconds since 1 Jan 1970 */ CINIT(TIMEVALUE, LONG, 34), /* 35 = OBSOLETE */ /* Custom request, for customizing the get command like HTTP: DELETE, TRACE and others FTP: to use a different list command */ CINIT(CUSTOMREQUEST, OBJECTPOINT, 36), /* HTTP request, for odd commands like DELETE, TRACE and others */ CINIT(STDERR, OBJECTPOINT, 37), /* 38 is not used */ /* send linked-list of post-transfer QUOTE commands */ CINIT(POSTQUOTE, OBJECTPOINT, 39), /* Pass a pointer to string of the output using full variable-replacement as described elsewhere. */ CINIT(WRITEINFO, OBJECTPOINT, 40), CINIT(VERBOSE, LONG, 41), /* talk a lot */ CINIT(HEADER, LONG, 42), /* throw the header out too */ CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */ CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */ CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */ CINIT(UPLOAD, LONG, 46), /* this is an upload */ CINIT(POST, LONG, 47), /* HTTP POST method */ CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */ CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */ /* Specify whether to read the user+password from the .netrc or the URL. * This must be one of the CURL_NETRC_* enums below. */ CINIT(NETRC, LONG, 51), CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */ CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */ CINIT(PUT, LONG, 54), /* HTTP PUT */ /* 55 = OBSOLETE */ /* Function that will be called instead of the internal progress display * function. This function should be defined as the curl_progress_callback * prototype defines. */ CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), /* Data passed to the progress callback */ CINIT(PROGRESSDATA, OBJECTPOINT, 57), /* We want the referrer field set automatically when following locations */ CINIT(AUTOREFERER, LONG, 58), /* Port of the proxy, can be set in the proxy string as well with: "[host]:[port]" */ CINIT(PROXYPORT, LONG, 59), /* size of the POST input data, if strlen() is not good to use */ CINIT(POSTFIELDSIZE, LONG, 60), /* tunnel non-http operations through a HTTP proxy */ CINIT(HTTPPROXYTUNNEL, LONG, 61), /* Set the interface string to use as outgoing network interface */ CINIT(INTERFACE, OBJECTPOINT, 62), /* Set the krb4/5 security level, this also enables krb4/5 awareness. This * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string * is set but doesn't match one of these, 'private' will be used. */ CINIT(KRBLEVEL, OBJECTPOINT, 63), /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ CINIT(SSL_VERIFYPEER, LONG, 64), /* The CApath or CAfile used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true */ CINIT(CAINFO, OBJECTPOINT, 65), /* 66 = OBSOLETE */ /* 67 = OBSOLETE */ /* Maximum number of http redirects to follow */ CINIT(MAXREDIRS, LONG, 68), /* Pass a long set to 1 to get the date of the requested document (if possible)! Pass a zero to shut it off. */ CINIT(FILETIME, LONG, 69), /* This points to a linked list of telnet options */ CINIT(TELNETOPTIONS, OBJECTPOINT, 70), /* Max amount of cached alive connections */ CINIT(MAXCONNECTS, LONG, 71), /* What policy to use when closing connections when the cache is filled up */ CINIT(CLOSEPOLICY, LONG, 72), /* 73 = OBSOLETE */ /* Set to explicitly use a new connection for the upcoming transfer. Do not use this unless you're absolutely sure of this, as it makes the operation slower and is less friendly for the network. */ CINIT(FRESH_CONNECT, LONG, 74), /* Set to explicitly forbid the upcoming transfer's connection to be re-used when done. Do not use this unless you're absolutely sure of this, as it makes the operation slower and is less friendly for the network. */ CINIT(FORBID_REUSE, LONG, 75), /* Set to a file name that contains random data for libcurl to use to seed the random engine when doing SSL connects. */ CINIT(RANDOM_FILE, OBJECTPOINT, 76), /* Set to the Entropy Gathering Daemon socket pathname */ CINIT(EGDSOCKET, OBJECTPOINT, 77), /* Time-out connect operations after this amount of seconds, if connects are OK within this time, then fine... This only aborts the connect phase. [Only works on unix-style/SIGALRM operating systems] */ CINIT(CONNECTTIMEOUT, LONG, 78), /* Function that will be called to store headers (instead of fwrite). The * parameters will use fwrite() syntax, make sure to follow them. */ CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79), /* Set this to force the HTTP request to get back to GET. Only really usable if POST, PUT or a custom request have been used first. */ CINIT(HTTPGET, LONG, 80), /* Set if we should verify the Common name from the peer certificate in ssl * handshake, set 1 to check existence, 2 to ensure that it matches the * provided hostname. */ CINIT(SSL_VERIFYHOST, LONG, 81), /* Specify which file name to write all known cookies in after completed operation. Set file name to "-" (dash) to make it go to stdout. */ CINIT(COOKIEJAR, OBJECTPOINT, 82), /* Specify which SSL ciphers to use */ CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83), /* Specify which HTTP version to use! This must be set to one of the CURL_HTTP_VERSION* enums set below. */ CINIT(HTTP_VERSION, LONG, 84), /* Specifically switch on or off the FTP engine's use of the EPSV command. By default, that one will always be attempted before the more traditional PASV command. */ CINIT(FTP_USE_EPSV, LONG, 85), /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ CINIT(SSLCERTTYPE, OBJECTPOINT, 86), /* name of the file keeping your private SSL-key */ CINIT(SSLKEY, OBJECTPOINT, 87), /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ CINIT(SSLKEYTYPE, OBJECTPOINT, 88), /* crypto engine for the SSL-sub system */ CINIT(SSLENGINE, OBJECTPOINT, 89), /* set the crypto engine for the SSL-sub system as default the param has no meaning... */ CINIT(SSLENGINE_DEFAULT, LONG, 90), /* Non-zero value means to use the global dns cache */ CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */ /* DNS cache timeout */ CINIT(DNS_CACHE_TIMEOUT, LONG, 92), /* send linked-list of pre-transfer QUOTE commands */ CINIT(PREQUOTE, OBJECTPOINT, 93), /* set the debug function */ CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), /* set the data for the debug function */ CINIT(DEBUGDATA, OBJECTPOINT, 95), /* mark this as start of a cookie session */ CINIT(COOKIESESSION, LONG, 96), /* The CApath directory used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true */ CINIT(CAPATH, OBJECTPOINT, 97), /* Instruct libcurl to use a smaller receive buffer */ CINIT(BUFFERSIZE, LONG, 98), /* Instruct libcurl to not use any signal/alarm handlers, even when using timeouts. This option is useful for multi-threaded applications. See libcurl-the-guide for more background information. */ CINIT(NOSIGNAL, LONG, 99), /* Provide a CURLShare for mutexing non-ts data */ CINIT(SHARE, OBJECTPOINT, 100), /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */ CINIT(PROXYTYPE, LONG, 101), /* Set the Accept-Encoding string. Use this to tell a server you would like the response to be compressed. */ CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102), /* Set pointer to private data */ CINIT(PRIVATE, OBJECTPOINT, 103), /* Set aliases for HTTP 200 in the HTTP Response header */ CINIT(HTTP200ALIASES, OBJECTPOINT, 104), /* Continue to send authentication (user+password) when following locations, even when hostname changed. This can potentially send off the name and password to whatever host the server decides. */ CINIT(UNRESTRICTED_AUTH, LONG, 105), /* Specifically switch on or off the FTP engine's use of the EPRT command ( it also disables the LPRT attempt). By default, those ones will always be attempted before the good old traditional PORT command. */ CINIT(FTP_USE_EPRT, LONG, 106), /* Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_USERPWD. Note that setting multiple bits may cause extra network round-trips. */ CINIT(HTTPAUTH, LONG, 107), /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx in second argument. The function must be matching the curl_ssl_ctx_callback proto. */ CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108), /* Set the userdata for the ssl context callback function's third argument */ CINIT(SSL_CTX_DATA, OBJECTPOINT, 109), /* FTP Option that causes missing dirs to be created on the remote server. In 7.19.4 we introduced the convenience enums for this option using the CURLFTP_CREATE_DIR prefix. */ CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110), /* Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. Note that setting multiple bits may cause extra network round-trips. */ CINIT(PROXYAUTH, LONG, 111), /* FTP option that changes the timeout, in seconds, associated with getting a response. This is different from transfer timeout time and essentially places a demand on the FTP server to acknowledge commands in a timely manner. */ CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112), /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to tell libcurl to resolve names to those IP versions only. This only has affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */ CINIT(IPRESOLVE, LONG, 113), /* Set this option to limit the size of a file that will be downloaded from an HTTP or FTP server. Note there is also _LARGE version which adds large file support for platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ CINIT(MAXFILESIZE, LONG, 114), /* See the comment for INFILESIZE above, but in short, specifies * the size of the file being uploaded. -1 means unknown. */ CINIT(INFILESIZE_LARGE, OFF_T, 115), /* Sets the continuation offset. There is also a LONG version of this; * look above for RESUME_FROM. */ CINIT(RESUME_FROM_LARGE, OFF_T, 116), /* Sets the maximum size of data that will be downloaded from * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. */ CINIT(MAXFILESIZE_LARGE, OFF_T, 117), /* Set this option to the file name of your .netrc file you want libcurl to parse (using the CURLOPT_NETRC option). If not set, libcurl will do a poor attempt to find the user's home directory and check for a .netrc file in there. */ CINIT(NETRC_FILE, OBJECTPOINT, 118), /* Enable SSL/TLS for FTP, pick one of: CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise CURLFTPSSL_CONTROL - SSL for the control connection or fail CURLFTPSSL_ALL - SSL for all communication or fail */ CINIT(USE_SSL, LONG, 119), /* The _LARGE version of the standard POSTFIELDSIZE option */ CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120), /* Enable/disable the TCP Nagle algorithm */ CINIT(TCP_NODELAY, LONG, 121), /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 123 OBSOLETE. Gone in 7.16.0 */ /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 127 OBSOLETE. Gone in 7.16.0 */ /* 128 OBSOLETE. Gone in 7.16.0 */ /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option can be used to change libcurl's default action which is to first try "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK response has been received. Available parameters are: CURLFTPAUTH_DEFAULT - let libcurl decide CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL */ CINIT(FTPSSLAUTH, LONG, 129), CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130), CINIT(IOCTLDATA, OBJECTPOINT, 131), /* 132 OBSOLETE. Gone in 7.16.0 */ /* 133 OBSOLETE. Gone in 7.16.0 */ /* zero terminated string for pass on to the FTP server when asked for "account" info */ CINIT(FTP_ACCOUNT, OBJECTPOINT, 134), /* feed cookies into cookie engine */ CINIT(COOKIELIST, OBJECTPOINT, 135), /* ignore Content-Length */ CINIT(IGNORE_CONTENT_LENGTH, LONG, 136), /* Set to non-zero to skip the IP address received in a 227 PASV FTP server response. Typically used for FTP-SSL purposes but is not restricted to that. libcurl will then instead use the same IP address it used for the control connection. */ CINIT(FTP_SKIP_PASV_IP, LONG, 137), /* Select "file method" to use when doing FTP, see the curl_ftpmethod above. */ CINIT(FTP_FILEMETHOD, LONG, 138), /* Local port number to bind the socket to */ CINIT(LOCALPORT, LONG, 139), /* Number of ports to try, including the first one set with LOCALPORT. Thus, setting it to 1 will make no additional attempts but the first. */ CINIT(LOCALPORTRANGE, LONG, 140), /* no transfer, set up connection and let application use the socket by extracting it with CURLINFO_LASTSOCKET */ CINIT(CONNECT_ONLY, LONG, 141), /* Function that will be called to convert from the network encoding (instead of using the iconv calls in libcurl) */ CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142), /* Function that will be called to convert to the network encoding (instead of using the iconv calls in libcurl) */ CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143), /* Function that will be called to convert from UTF8 (instead of using the iconv calls in libcurl) Note that this is used only for SSL certificate processing */ CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144), /* if the connection proceeds too quickly then need to slow it down */ /* limit-rate: maximum number of bytes per second to send or receive */ CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145), CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146), /* Pointer to command string to send if USER/PASS fails. */ CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147), /* callback function for setting socket options */ CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148), CINIT(SOCKOPTDATA, OBJECTPOINT, 149), /* set to 0 to disable session ID re-use for this transfer, default is enabled (== 1) */ CINIT(SSL_SESSIONID_CACHE, LONG, 150), /* allowed SSH authentication methods */ CINIT(SSH_AUTH_TYPES, LONG, 151), /* Used by scp/sftp to do public/private key authentication */ CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152), CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153), /* Send CCC (Clear Command Channel) after authentication */ CINIT(FTP_SSL_CCC, LONG, 154), /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */ CINIT(TIMEOUT_MS, LONG, 155), CINIT(CONNECTTIMEOUT_MS, LONG, 156), /* set to zero to disable the libcurl's decoding and thus pass the raw body data to the application even when it is encoded/compressed */ CINIT(HTTP_TRANSFER_DECODING, LONG, 157), CINIT(HTTP_CONTENT_DECODING, LONG, 158), /* Permission used when creating new files and directories on the remote server for protocols that support it, SFTP/SCP/FILE */ CINIT(NEW_FILE_PERMS, LONG, 159), CINIT(NEW_DIRECTORY_PERMS, LONG, 160), /* Set the behaviour of POST when redirecting. Values must be set to one of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */ CINIT(POSTREDIR, LONG, 161), /* used by scp/sftp to verify the host's public key */ CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162), /* Callback function for opening socket (instead of socket(2)). Optionally, callback is able change the address or refuse to connect returning CURL_SOCKET_BAD. The callback should have type curl_opensocket_callback */ CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163), CINIT(OPENSOCKETDATA, OBJECTPOINT, 164), /* POST volatile input fields. */ CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165), /* set transfer mode (;type=) when doing FTP via an HTTP proxy */ CINIT(PROXY_TRANSFER_MODE, LONG, 166), /* Callback function for seeking in the input stream */ CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167), CINIT(SEEKDATA, OBJECTPOINT, 168), /* CRL file */ CINIT(CRLFILE, OBJECTPOINT, 169), /* Issuer certificate */ CINIT(ISSUERCERT, OBJECTPOINT, 170), /* (IPv6) Address scope */ CINIT(ADDRESS_SCOPE, LONG, 171), /* Collect certificate chain info and allow it to get retrievable with CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only working with OpenSSL-powered builds. */ CINIT(CERTINFO, LONG, 172), /* "name" and "pwd" to use when fetching. */ CINIT(USERNAME, OBJECTPOINT, 173), CINIT(PASSWORD, OBJECTPOINT, 174), /* "name" and "pwd" to use with Proxy when fetching. */ CINIT(PROXYUSERNAME, OBJECTPOINT, 175), CINIT(PROXYPASSWORD, OBJECTPOINT, 176), /* Comma separated list of hostnames defining no-proxy zones. These should match both hostnames directly, and hostnames within a domain. For example, local.com will match local.com and www.local.com, but NOT notlocal.com or www.notlocal.com. For compatibility with other implementations of this, .local.com will be considered to be the same as local.com. A single * is the only valid wildcard, and effectively disables the use of proxy. */ CINIT(NOPROXY, OBJECTPOINT, 177), /* block size for TFTP transfers */ CINIT(TFTP_BLKSIZE, LONG, 178), /* Socks Service */ CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179), /* Socks Service */ CINIT(SOCKS5_GSSAPI_NEC, LONG, 180), /* set the bitmask for the protocols that are allowed to be used for the transfer, which thus helps the app which takes URLs from users or other external inputs and want to restrict what protocol(s) to deal with. Defaults to CURLPROTO_ALL. */ CINIT(PROTOCOLS, LONG, 181), /* set the bitmask for the protocols that libcurl is allowed to follow to, as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs to be set in both bitmasks to be allowed to get redirected to. Defaults to all protocols except FILE and SCP. */ CINIT(REDIR_PROTOCOLS, LONG, 182), /* set the SSH knownhost file name to use */ CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183), /* set the SSH host key callback, must point to a curl_sshkeycallback function */ CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184), /* set the SSH host key callback custom pointer */ CINIT(SSH_KEYDATA, OBJECTPOINT, 185), CURLOPT_LASTENTRY /* the last unused */ } CURLoption; /* compatibility with older names */ #define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING /* three convenient "aliases" that follow the name scheme better */ #define CURLOPT_WRITEDATA CURLOPT_FILE #define CURLOPT_READDATA CURLOPT_INFILE #define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER #define CFINIT(name) CURLFORM_ ## name typedef enum { CFINIT(NOTHING), /********* the first one is unused ************/ /* */ CFINIT(COPYNAME), CFINIT(PTRNAME), CFINIT(NAMELENGTH), CFINIT(COPYCONTENTS), CFINIT(PTRCONTENTS), CFINIT(CONTENTSLENGTH), CFINIT(FILECONTENT), CFINIT(ARRAY), CFINIT(OBSOLETE), CFINIT(FILE), CFINIT(BUFFER), CFINIT(BUFFERPTR), CFINIT(BUFFERLENGTH), CFINIT(CONTENTTYPE), CFINIT(CONTENTHEADER), CFINIT(FILENAME), CFINIT(END), CFINIT(OBSOLETE2), CFINIT(STREAM), CURLFORM_LASTENTRY /* the last unused */ } CURLformoption; #define CURLINFO_STRING 0x100000 #define CURLINFO_LONG 0x200000 #define CURLINFO_DOUBLE 0x300000 #define CURLINFO_SLIST 0x400000 #define CURLINFO_PTR 0x400000 /* same as SLIST */ #define CURLINFO_SOCKET 0x500000 #define CURLINFO_OFF_T 0x600000 #define CURLINFO_MASK 0x0fffff #define CURLINFO_TYPEMASK 0xf00000 typedef enum { CURLINFO_NONE, /* first, never use this */ CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7, CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8, CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9, CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10, CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, CURLINFO_FILETIME = CURLINFO_LONG + 14, CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15, CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16, CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, CURLINFO_PRIVATE = CURLINFO_STRING + 21, CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22, CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27, CURLINFO_COOKIELIST = CURLINFO_SLIST + 28, CURLINFO_LASTSOCKET = CURLINFO_LONG + 29, CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30, CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31, CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32, CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33, CURLINFO_CERTINFO = CURLINFO_SLIST + 34, CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35, CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36, CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37, CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38, CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39, CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40, CURLINFO_LOCAL_IP = CURLINFO_STRING + 41, CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42, CURLINFO_TLS_SESSION = CURLINFO_PTR + 43, CURLINFO_ACTIVESOCKET = CURLINFO_SOCKET + 44, CURLINFO_TLS_SSL_PTR = CURLINFO_PTR + 45, CURLINFO_HTTP_VERSION = CURLINFO_LONG + 46, CURLINFO_PROXY_SSL_VERIFYRESULT = CURLINFO_LONG + 47, CURLINFO_PROTOCOL = CURLINFO_LONG + 48, CURLINFO_SCHEME = CURLINFO_STRING + 49, /* Fill in new entries below here! */ CURLINFO_LASTONE = 49 } CURLINFO; #define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP versions that your system allows */ #define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */ #define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */ typedef enum { CURL_FORMADD_OK, /* first, no error */ CURL_FORMADD_MEMORY, CURL_FORMADD_OPTION_TWICE, CURL_FORMADD_NULL, CURL_FORMADD_UNKNOWN_OPTION, CURL_FORMADD_INCOMPLETE, CURL_FORMADD_ILLEGAL_ARRAY, CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */ CURL_FORMADD_LAST /* last */ } CURLFORMcode; enum { CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd like the library to choose the best possible for us! */ CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ CURL_HTTP_VERSION_2_0, /* please use HTTP 2 in the request */ CURL_HTTP_VERSION_2TLS, /* use version 2 for HTTPS, version 1.1 for HTTP */ CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE, /* please use HTTP 2 without HTTP/1.1 Upgrade */ CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ }; /* Convenience definition simple because the name of the version is HTTP/2 and not 2.0. The 2_0 version of the enum name was set while the version was still planned to be 2.0 and we stick to it for compatibility. */ #define CURL_HTTP_VERSION_2 CURL_HTTP_VERSION_2_0 #endif /* __CURL_CURL_H */ parser-3.5.1/src/lib/memcached/0000755000076400007640000000000014740300546013273 500000000000000parser-3.5.1/src/lib/memcached/memcached.vcproj0000644000076400007640000000704113622760246016355 00000000000000 parser-3.5.1/src/lib/memcached/types.h0000644000076400007640000000671311731730455014542 00000000000000/* LibMemcached * Copyright (C) 2006-2009 Brian Aker * All rights reserved. * * Use and distribution licensed under the BSD license. See * the COPYING file in the parent directory for full text. * * Summary: Types for libmemcached * */ #ifndef __LIBMEMCACHED_TYPES_H__ #define __LIBMEMCACHED_TYPES_H__ typedef struct memcached_st memcached_st; typedef struct memcached_stat_st memcached_stat_st; typedef struct memcached_analysis_st memcached_analysis_st; typedef struct memcached_result_st memcached_result_st; // All of the flavors of memcache_server_st typedef struct memcached_server_st memcached_server_st; typedef const struct memcached_server_st *memcached_server_instance_st; typedef struct memcached_server_st *memcached_server_list_st; typedef struct memcached_callback_st memcached_callback_st; // The following two structures are internal, and never exposed to users. typedef struct memcached_string_st memcached_string_st; typedef struct memcached_continuum_item_st memcached_continuum_item_st; #ifdef __cplusplus extern "C" { #endif typedef memcached_return_t (*memcached_clone_fn)(memcached_st *destination, const memcached_st *source); typedef memcached_return_t (*memcached_cleanup_fn)(const memcached_st *ptr); /** Memory allocation functions. */ typedef void (*memcached_free_fn)(const memcached_st *ptr, void *mem, void *context); typedef void *(*memcached_malloc_fn)(const memcached_st *ptr, const size_t size, void *context); typedef void *(*memcached_realloc_fn)(const memcached_st *ptr, void *mem, const size_t size, void *context); typedef void *(*memcached_calloc_fn)(const memcached_st *ptr, size_t nelem, const size_t elsize, void *context); typedef memcached_return_t (*memcached_execute_fn)(const memcached_st *ptr, memcached_result_st *result, void *context); typedef memcached_return_t (*memcached_server_fn)(const memcached_st *ptr, memcached_server_instance_st server, void *context); /** Trigger functions. */ typedef memcached_return_t (*memcached_trigger_key_fn)(const memcached_st *ptr, const char *key, size_t key_length, memcached_result_st *result); typedef memcached_return_t (*memcached_trigger_delete_key_fn)(const memcached_st *ptr, const char *key, size_t key_length); typedef memcached_return_t (*memcached_dump_fn)(const memcached_st *ptr, const char *key, size_t key_length, void *context); #ifdef __cplusplus } #endif /** @note The following definitions are just here for backwards compatibility. */ typedef memcached_return_t memcached_return; typedef memcached_server_distribution_t memcached_server_distribution; typedef memcached_behavior_t memcached_behavior; typedef memcached_callback_t memcached_callback; typedef memcached_hash_t memcached_hash; typedef memcached_connection_t memcached_connection; typedef memcached_clone_fn memcached_clone_func; typedef memcached_cleanup_fn memcached_cleanup_func; typedef memcached_execute_fn memcached_execute_function; typedef memcached_server_fn memcached_server_function; typedef memcached_trigger_key_fn memcached_trigger_key; typedef memcached_trigger_delete_key_fn memcached_trigger_delete_key; typedef memcached_dump_fn memcached_dump_func; #endif /* __LIBMEMCACHED_TYPES_H__ */ parser-3.5.1/src/lib/memcached/Makefile.in0000644000076400007640000004531714740273415015276 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/memcached ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmemcached_la_LIBADD = am_libmemcached_la_OBJECTS = pa_memcached.lo libmemcached_la_OBJECTS = $(am_libmemcached_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/pa_memcached.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libmemcached_la_SOURCES) DIST_SOURCES = $(libmemcached_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = $(INCLTDL) noinst_HEADERS = constants.h types.h pa_memcached.h noinst_LTLIBRARIES = libmemcached.la libmemcached_la_SOURCES = pa_memcached.C EXTRA_DIST = memcached.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/memcached/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/memcached/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libmemcached.la: $(libmemcached_la_OBJECTS) $(libmemcached_la_DEPENDENCIES) $(EXTRA_libmemcached_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libmemcached_la_OBJECTS) $(libmemcached_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_memcached.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .C.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/pa_memcached.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/pa_memcached.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/memcached/Makefile.am0000644000076400007640000000027312572102226015245 00000000000000AM_CPPFLAGS = $(INCLTDL) noinst_HEADERS = constants.h types.h pa_memcached.h noinst_LTLIBRARIES = libmemcached.la libmemcached_la_SOURCES = pa_memcached.C EXTRA_DIST = memcached.vcproj parser-3.5.1/src/lib/memcached/pa_memcached.C0000644000076400007640000000501214712042465015705 00000000000000/** @file Parser: memcached support impl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) */ #include "pa_config_includes.h" #include "pa_memcached.h" #include "ltdl.h" volatile const char * IDENT_PA_MEMCACHED_C="$Id: pa_memcached.C,v 1.14 2024/11/04 03:53:25 moko Exp $"; t_memcached f_memcached=0; t_memcached_create f_memcached_create; t_memcached_free f_memcached_free; t_memcached_strerror f_memcached_strerror; t_memcached_server_push f_memcached_server_push; t_memcached_servers_parse f_memcached_servers_parse; t_memcached_version f_memcached_version; t_memcached_flush f_memcached_flush; t_memcached_quit f_memcached_quit; t_memcached_get f_memcached_get; t_memcached_delete f_memcached_delete; t_memcached_mget f_memcached_mget; t_memcached_set f_memcached_set; t_memcached_add f_memcached_add; t_memcached_fetch_result f_memcached_fetch_result; t_memcached_result_create f_memcached_result_create; t_memcached_result_free f_memcached_result_free; t_memcached_result_key_value f_memcached_result_key_value; t_memcached_result_value f_memcached_result_value; t_memcached_result_key_length f_memcached_result_key_length; t_memcached_result_length f_memcached_result_length; t_memcached_result_flags f_memcached_result_flags; #define GLINK(name) f_##name=(t_##name)lt_dlsym(handle, #name); #define DLINK(name) GLINK(name) if(!f_##name) return "function " #name " was not found"; void pa_dlinit(); static const char *dlink(const char *dlopen_file_spec) { pa_dlinit(); lt_dlhandle handle=lt_dlopen(dlopen_file_spec); if(!handle){ if(const char* result=lt_dlerror()) return result; return "cannot open the dynamic link module"; } GLINK(memcached); DLINK(memcached_create); DLINK(memcached_free); DLINK(memcached_strerror); DLINK(memcached_server_push); DLINK(memcached_servers_parse); DLINK(memcached_version); DLINK(memcached_flush); DLINK(memcached_quit); DLINK(memcached_get); DLINK(memcached_delete); DLINK(memcached_mget); DLINK(memcached_set); DLINK(memcached_add); DLINK(memcached_fetch_result); DLINK(memcached_result_create); DLINK(memcached_result_free); DLINK(memcached_result_key_value); DLINK(memcached_result_value); DLINK(memcached_result_key_length); DLINK(memcached_result_length); DLINK(memcached_result_flags); return 0; } bool memcached_linked = false; const char *memcached_status = 0; const char *memcached_load(const char *library_name){ if(!memcached_linked){ memcached_linked=true; memcached_status=dlink(library_name); } return memcached_status; } parser-3.5.1/src/lib/memcached/pa_memcached.h0000644000076400007640000000714214712042465015760 00000000000000/** @file Parser: memcached support decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) */ #ifndef PA_MEMCACHED_H #define PA_MEMCACHED_H #include "constants.h" #include "types.h" // memcached library load function const char *memcached_load(const char *alt_library_name); // memcached library inferface typedef memcached_st *(*t_memcached)(const char *string, size_t string_length); typedef memcached_st *(*t_memcached_create)(memcached_st *ptr); typedef void (*t_memcached_free)(memcached_st *ptr); typedef const char *(*t_memcached_strerror)(memcached_st *ptr, memcached_return_t rc); typedef memcached_return_t (*t_memcached_server_push)(memcached_st *ptr, const memcached_server_list_st list); typedef memcached_server_list_st (*t_memcached_servers_parse)(const char *server_strings); typedef memcached_return_t (*t_memcached_version)(memcached_st *ptr); typedef memcached_return_t (*t_memcached_flush)(memcached_st *ptr, time_t expiration); typedef void (*t_memcached_quit)(memcached_st *ptr); typedef char *(*t_memcached_get)(memcached_st *ptr, const char *key, size_t key_length, size_t *value_length, uint32_t *flags, memcached_return_t *error); typedef memcached_return_t (*t_memcached_delete)(memcached_st *ptr, const char *key, size_t key_length, time_t expiration); typedef memcached_return_t (*t_memcached_mget)(memcached_st *ptr, const char * const *keys, const size_t *key_length, size_t number_of_keys); typedef memcached_return_t (*t_memcached_set)(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags); typedef memcached_return_t (*t_memcached_add)(memcached_st *ptr, const char *key, size_t key_length, const char *value, size_t value_length, time_t expiration, uint32_t flags); typedef memcached_result_st *(*t_memcached_fetch_result)(memcached_st *ptr, memcached_result_st *result, memcached_return_t *error); typedef memcached_result_st *(*t_memcached_result_create)(const memcached_st *ptr, memcached_result_st *result); typedef void (*t_memcached_result_free)(memcached_result_st *result); typedef const char *(*t_memcached_result_key_value)(const memcached_result_st *self); typedef const char *(*t_memcached_result_value)(const memcached_result_st *self); typedef size_t (*t_memcached_result_key_length)(const memcached_result_st *self); typedef size_t (*t_memcached_result_length)(const memcached_result_st *self); typedef uint32_t (*t_memcached_result_flags)(const memcached_result_st *self); extern t_memcached f_memcached; extern t_memcached_create f_memcached_create; extern t_memcached_free f_memcached_free; extern t_memcached_strerror f_memcached_strerror; extern t_memcached_server_push f_memcached_server_push; extern t_memcached_servers_parse f_memcached_servers_parse; extern t_memcached_version f_memcached_version; extern t_memcached_flush f_memcached_flush; extern t_memcached_quit f_memcached_quit; extern t_memcached_get f_memcached_get; extern t_memcached_delete f_memcached_delete; extern t_memcached_mget f_memcached_mget; extern t_memcached_set f_memcached_set; extern t_memcached_add f_memcached_add; extern t_memcached_fetch_result f_memcached_fetch_result; extern t_memcached_result_create f_memcached_result_create; extern t_memcached_result_free f_memcached_result_free; extern t_memcached_result_key_value f_memcached_result_key_value; extern t_memcached_result_value f_memcached_result_value; extern t_memcached_result_key_length f_memcached_result_key_length; extern t_memcached_result_length f_memcached_result_length; extern t_memcached_result_flags f_memcached_result_flags; #endif /* PA_MEMCACHED_H */ parser-3.5.1/src/lib/memcached/constants.h0000644000076400007640000001162211731730455015405 00000000000000/* LibMemcached * Copyright (C) 2006-2009 Brian Aker * All rights reserved. * * Use and distribution licensed under the BSD license. See * the COPYING file in the parent directory for full text. * * Summary: Constants for libmemcached * */ #ifndef __LIBMEMCACHED_CONSTANTS_H__ #define __LIBMEMCACHED_CONSTANTS_H__ /* Public defines */ #define MEMCACHED_DEFAULT_PORT 11211 #define MEMCACHED_MAX_KEY 251 /* We add one to have it null terminated */ #define MEMCACHED_MAX_BUFFER 8196 #define MEMCACHED_MAX_HOST_SORT_LENGTH 86 /* Used for Ketama */ #define MEMCACHED_POINTS_PER_SERVER 100 #define MEMCACHED_POINTS_PER_SERVER_KETAMA 160 #define MEMCACHED_CONTINUUM_SIZE MEMCACHED_POINTS_PER_SERVER*100 /* This would then set max hosts to 100 */ #define MEMCACHED_STRIDE 4 #define MEMCACHED_DEFAULT_TIMEOUT 5000 #define MEMCACHED_DEFAULT_CONNECT_TIMEOUT 4000 #define MEMCACHED_CONTINUUM_ADDITION 10 /* How many extra slots we should build for in the continuum */ #define MEMCACHED_PREFIX_KEY_MAX_SIZE 128 #define MEMCACHED_EXPIRATION_NOT_ADD 0xffffffffU #define MEMCACHED_VERSION_STRING_LENGTH 24 typedef enum { MEMCACHED_SUCCESS, MEMCACHED_FAILURE, MEMCACHED_HOST_LOOKUP_FAILURE, MEMCACHED_CONNECTION_FAILURE, MEMCACHED_CONNECTION_BIND_FAILURE, MEMCACHED_WRITE_FAILURE, MEMCACHED_READ_FAILURE, MEMCACHED_UNKNOWN_READ_FAILURE, MEMCACHED_PROTOCOL_ERROR, MEMCACHED_CLIENT_ERROR, MEMCACHED_SERVER_ERROR, MEMCACHED_CONNECTION_SOCKET_CREATE_FAILURE, MEMCACHED_DATA_EXISTS, MEMCACHED_DATA_DOES_NOT_EXIST, MEMCACHED_NOTSTORED, MEMCACHED_STORED, MEMCACHED_NOTFOUND, MEMCACHED_MEMORY_ALLOCATION_FAILURE, MEMCACHED_PARTIAL_READ, MEMCACHED_SOME_ERRORS, MEMCACHED_NO_SERVERS, MEMCACHED_END, MEMCACHED_DELETED, MEMCACHED_VALUE, MEMCACHED_STAT, MEMCACHED_ITEM, MEMCACHED_ERRNO, MEMCACHED_FAIL_UNIX_SOCKET, MEMCACHED_NOT_SUPPORTED, MEMCACHED_NO_KEY_PROVIDED, /* Deprecated. Use MEMCACHED_BAD_KEY_PROVIDED! */ MEMCACHED_FETCH_NOTFINISHED, MEMCACHED_TIMEOUT, MEMCACHED_BUFFERED, MEMCACHED_BAD_KEY_PROVIDED, MEMCACHED_INVALID_HOST_PROTOCOL, MEMCACHED_SERVER_MARKED_DEAD, MEMCACHED_UNKNOWN_STAT_KEY, MEMCACHED_E2BIG, MEMCACHED_INVALID_ARGUMENTS, MEMCACHED_KEY_TOO_BIG, MEMCACHED_AUTH_PROBLEM, MEMCACHED_AUTH_FAILURE, MEMCACHED_AUTH_CONTINUE, MEMCACHED_MAXIMUM_RETURN /* Always add new error code before */ } memcached_return_t; typedef enum { MEMCACHED_DISTRIBUTION_MODULA, MEMCACHED_DISTRIBUTION_CONSISTENT, MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA, MEMCACHED_DISTRIBUTION_RANDOM, MEMCACHED_DISTRIBUTION_CONSISTENT_KETAMA_SPY, MEMCACHED_DISTRIBUTION_CONSISTENT_MAX } memcached_server_distribution_t; typedef enum { MEMCACHED_BEHAVIOR_NO_BLOCK, MEMCACHED_BEHAVIOR_TCP_NODELAY, MEMCACHED_BEHAVIOR_HASH, MEMCACHED_BEHAVIOR_KETAMA, MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE, MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE, MEMCACHED_BEHAVIOR_CACHE_LOOKUPS, MEMCACHED_BEHAVIOR_SUPPORT_CAS, MEMCACHED_BEHAVIOR_POLL_TIMEOUT, MEMCACHED_BEHAVIOR_DISTRIBUTION, MEMCACHED_BEHAVIOR_BUFFER_REQUESTS, MEMCACHED_BEHAVIOR_USER_DATA, MEMCACHED_BEHAVIOR_SORT_HOSTS, MEMCACHED_BEHAVIOR_VERIFY_KEY, MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT, MEMCACHED_BEHAVIOR_RETRY_TIMEOUT, MEMCACHED_BEHAVIOR_KETAMA_WEIGHTED, MEMCACHED_BEHAVIOR_KETAMA_HASH, MEMCACHED_BEHAVIOR_BINARY_PROTOCOL, MEMCACHED_BEHAVIOR_SND_TIMEOUT, MEMCACHED_BEHAVIOR_RCV_TIMEOUT, MEMCACHED_BEHAVIOR_SERVER_FAILURE_LIMIT, MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK, MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK, MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH, MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY, MEMCACHED_BEHAVIOR_NOREPLY, MEMCACHED_BEHAVIOR_USE_UDP, MEMCACHED_BEHAVIOR_AUTO_EJECT_HOSTS, MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS, MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ, MEMCACHED_BEHAVIOR_CORK, MEMCACHED_BEHAVIOR_TCP_KEEPALIVE, MEMCACHED_BEHAVIOR_TCP_KEEPIDLE, MEMCACHED_BEHAVIOR_MAX } memcached_behavior_t; typedef enum { MEMCACHED_CALLBACK_PREFIX_KEY = 0, MEMCACHED_CALLBACK_USER_DATA = 1, MEMCACHED_CALLBACK_CLEANUP_FUNCTION = 2, MEMCACHED_CALLBACK_CLONE_FUNCTION = 3, #ifdef MEMCACHED_ENABLE_DEPRECATED MEMCACHED_CALLBACK_MALLOC_FUNCTION = 4, MEMCACHED_CALLBACK_REALLOC_FUNCTION = 5, MEMCACHED_CALLBACK_FREE_FUNCTION = 6, #endif MEMCACHED_CALLBACK_GET_FAILURE = 7, MEMCACHED_CALLBACK_DELETE_TRIGGER = 8, MEMCACHED_CALLBACK_MAX } memcached_callback_t; typedef enum { MEMCACHED_HASH_DEFAULT= 0, MEMCACHED_HASH_MD5, MEMCACHED_HASH_CRC, MEMCACHED_HASH_FNV1_64, MEMCACHED_HASH_FNV1A_64, MEMCACHED_HASH_FNV1_32, MEMCACHED_HASH_FNV1A_32, MEMCACHED_HASH_HSIEH, MEMCACHED_HASH_MURMUR, MEMCACHED_HASH_JENKINS, MEMCACHED_HASH_CUSTOM, MEMCACHED_HASH_MAX } memcached_hash_t; typedef enum { MEMCACHED_CONNECTION_UNKNOWN, MEMCACHED_CONNECTION_TCP, MEMCACHED_CONNECTION_UDP, MEMCACHED_CONNECTION_UNIX_SOCKET, MEMCACHED_CONNECTION_MAX } memcached_connection_t; #endif /* __LIBMEMCACHED_CONSTANTS_H__ */ parser-3.5.1/src/lib/gd/0000755000076400007640000000000014740300546011757 500000000000000parser-3.5.1/src/lib/gd/gif.h0000644000076400007640000001523714712042465012627 00000000000000/** @file Parser: image manipulations decls. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian based on: gd.h: declarations file for the gifdraw module. Written by Tom Boutell, 5/94. Copyright 1994, Cold Spring Harbor Labs. Permission granted to use this code in any fashion provided that this notice is retained and any alterations are labeled as such. It is requested, but not required, that you share extensions to this module with us so that we can incorporate them into new versions. */ #ifndef GIF_H #define GIF_H #define IDENT_GIF_H "$Id: gif.h,v 1.11 2024/11/04 03:53:25 moko Exp $" #include "pa_config_includes.h" #include "pa_memory.h" #define gdMaxColors 0x100 #define HSIZE 5003 /* 80% occupancy */ struct gdBuf { void *ptr; size_t size; gdBuf(void *aptr, size_t asize): ptr(aptr), size(asize) {} }; class gdGrowingBuf: PA_Object { unsigned char *fptr; size_t fallocated; size_t fused; void expand(size_t delta) { size_t new_allocated=fallocated+delta; fptr=(unsigned char*)pa_realloc(fptr, new_allocated); fallocated=new_allocated; } public: operator gdBuf() { return gdBuf(fptr, fused); } gdGrowingBuf(): fptr(0), fallocated(0), fused(0) {} void append(unsigned char *abuf, size_t asize) { ssize_t delta=asize-(fallocated-fused); if(delta>0) expand(delta+100); memcpy(&fptr[fused], abuf, asize); fused+=asize; } }; /** Image type. See functions below; you will not need to change the elements directly. Use the provided macros to access sx, sy, the color table, and colorsTotal for read-only purposes. */ class gdImage: public PA_Object { public: //@{ /// @name Functions to manipulate images void Create(int asx, int asy); bool CreateFromGif(FILE *fd); void SetPixel(int x, int y, int color); int GetPixel(int x, int y); void Line(int x1, int y1, int x2, int y2, int color); void StyledLine(int x1, int y1, int x2, int y2, int color, const char* lineStyle); void Rectangle(int x1, int y1, int x2, int y2, int color); void LineReplaceColor(int x1, int y1, int x2, int y2, int a, int b); void FilledRectangle(int x1, int y1, int x2, int y2, int color); //@} /// Point type for use in polygon drawing. struct Point { int x, y; }; void Polygon(Point *p, int n, int c, bool closed=true); void FilledPolygon(Point *p, int n, int c); void FilledPolygonReplaceColor(Point *p, int n, int a, int b); int ColorAllocate(int r, int g, int b); int ColorClosest(int r, int g, int b, int tolerance=0); int ColorExact(int r, int g, int b); int ColorRGB(int r, int g, int b); int Color(unsigned int rgb); unsigned int DecodeColor(int color); void ColorDeallocate(int color); void SetColorTransparent(int color); int BoundsSafe(int x, int y); void DoSetPixel(int x, int y, int color); gdBuf Gif(); void Arc(int cx, int cy, int w, int h, int s, int e, int color); void Sector(int cx, int cy, int w, int h, int s, int e, int color); void FillToBorder(int x, int y, int border, int color); void Fill(int x, int y, int color); void Copy(gdImage& dst, int dstX, int dstY, int srcX, int srcY, int w, int h); void CopyResampled(gdImage& dst, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH, int tolerance); void SetLineWidth(int width); void SetLineStyle(const char* aLineStyle); void SetInterlace(int interlaceArg); /* On or off(1 or 0) */ public: //@{ /// @name information about image. READ ONLY int SX() { return sx; } int SY() { return sy; } int ColorsTotal() { return colorsTotal; } int Red(int c) { return red[c]; } int Green(int c) { return green[c]; } int Blue(int c) { return blue[c]; } int GetTransparent() { return transparent; } int GetInterlaced() { return interlace; } //@} private: unsigned char ** pixels; int sx; int sy; int colorsTotal; int red[gdMaxColors]; int green[gdMaxColors]; int blue[gdMaxColors]; int open[gdMaxColors]; int transparent; int *polyInts; int polyAllocated; int lineWidth; const char* lineStyle; int interlace; private: // read gif int GetDataBlock(FILE *fd, unsigned char *buf); int LWZReadByte(FILE *fd, int flag, int input_code_size); void ReadImage(FILE *fd, int len, int height, unsigned char(*cmap)[256], int interlace, int ignore); int DoExtension(FILE *fd, int label, int *Transparent); int GetCode(FILE *fd, int code_size, int flag); private: // read gif int ZeroDataBlock; }; /// used by gdImage::Gif to produce buffer with bytes in GIF format class gdGifEncoder: public PA_Object { public: gdGifEncoder(gdImage& aim); gdBuf encode( int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue); private: /// a code_int must be able to hold 2**GIFBITS values of type int, and also -1 typedef int code_int; #ifdef SIGNED_COMPARE_SLOW typedef unsigned long int count_int; typedef unsigned short int count_short; #else typedef long int count_int; #endif private: void Putbyte(unsigned char c); void Putword(int w); void Write(void *buf, size_t size); void prepare_encoder(void); void BumpPixel(void); int GIFNextPixel(); void compress(int init_bits); void output(code_int code); void cl_block(void); void cl_hash(count_int hsize); void char_init(void); void char_out(int c); void flush_char(void); private: gdImage& im; gdGrowingBuf buf; int Width, Height; int curx, cury; long CountDown; int Pass; int Interlace; int g_init_bits; int ClearCode; int EOFCode; int n_bits; /* number of bits/code */ int maxbits; /* user settable max # bits/code */ code_int maxcode; /* maximum code, given n_bits */ code_int maxmaxcode; /* should NEVER generate this code */ count_int htab [HSIZE]; unsigned short codetab [HSIZE]; code_int hsize; /* for dynamic table sizing */ code_int free_ent; /* first unused entry */ /* * block compression parameters -- after all codes are used up, * and compression rate changes, start over. */ int clear_flg; int offset; long int in_count; /* length of input */ long int out_count; /* # of codes output(for debugging) */ unsigned long cur_accum; int cur_bits; /* * Number of characters so far in this 'packet' */ int a_count; /* * Define the storage for the packet accumulator */ char accum[ 256 ]; }; inline int gdImage::BoundsSafe(int x, int y){ return(!(((y < 0) ||(y >= sy)) ||((x < 0) ||(x >= sx)))); } inline /*paf int*/void gdImage::DoSetPixel(int x, int y, int color){ if(BoundsSafe(x, y)) pixels[x][y] = (unsigned char)color; } #endif parser-3.5.1/src/lib/gd/Makefile.in0000644000076400007640000004525514740273415013763 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/gd ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libgd_la_LIBADD = am_libgd_la_OBJECTS = gif.lo gifio.lo libgd_la_OBJECTS = $(am_libgd_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/gif.Plo ./$(DEPDIR)/gifio.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libgd_la_SOURCES) DIST_SOURCES = $(libgd_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = gif.h mtables.h noinst_LTLIBRARIES = libgd.la libgd_la_SOURCES = gif.C gifio.C EXTRA_DIST = gd.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/gd/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/gd/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libgd.la: $(libgd_la_OBJECTS) $(libgd_la_DEPENDENCIES) $(EXTRA_libgd_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libgd_la_OBJECTS) $(libgd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gifio.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .C.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/gif.Plo -rm -f ./$(DEPDIR)/gifio.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/gif.Plo -rm -f ./$(DEPDIR)/gifio.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/gd/Makefile.am0000644000076400007640000000017013211622356013727 00000000000000noinst_HEADERS = gif.h mtables.h noinst_LTLIBRARIES = libgd.la libgd_la_SOURCES = gif.C gifio.C EXTRA_DIST = gd.vcproj parser-3.5.1/src/lib/gd/gif.C0000644000076400007640000005270314712042465012561 00000000000000/** @file Parser: image manipulations impl1. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian based on: gd Written by Tom Boutell, 5/94. Copyright 1994, Cold Spring Harbor Labs. Permission granted to use this code in any fashion provided that this notice is retained and any alterations are labeled as such. It is requested, but not required, that you share extensions to this module with us so that we can incorporate them into new versions. */ #include "gif.h" #include "mtables.h" volatile const char * IDENT_GIF_C="$Id: gif.C,v 1.13 2024/11/04 03:53:25 moko Exp $" IDENT_GIF_H; //static void BrushApply(int x, int y); //static void TileApply(int x, int y); void gdImage::Create(int asx, int asy) { sx = asx; sy = asy; int i; pixels = (unsigned char **) pa_malloc(sizeof(unsigned char *) * sx); polyInts = 0; polyAllocated = 0; lineWidth = 1; for (i=0; (i>8, r=g>>8; return ColorRGB(r & 0xFF,g & 0xFF,b & 0xFF); } unsigned int gdImage::DecodeColor(int color) { if(color<0) return color; return (((red[color]<<8) + green[color])<<8)+blue[color]; } void gdImage::ColorDeallocate(int color) { /* Mark it open. */ open[color] = 1; } void gdImage::SetColorTransparent(int color) { transparent = color; } void gdImage::SetPixel(int x, int y, int color) { //paf int p; switch (lineWidth){ case 1: { DoSetPixel(x, y,color); return; } case 2: { DoSetPixel(x, y-1,color); DoSetPixel(x-1, y,color); DoSetPixel(x, y,color); DoSetPixel(x+1, y,color); DoSetPixel(x, y+1,color); return; } default:{ int i,j; for (i=-1;i<=1;i++) DoSetPixel(x+i, y-2,color); for (j=-1;j<=1;j++) for (i=-2;i<=2;i++) DoSetPixel(x+i, y+j,color); for (i=-1;i<=1;i++) DoSetPixel(x+i, y+2,color); return; } } } int gdImage::GetPixel(int x, int y) { return BoundsSafe(x, y) ? pixels[x][y]:-1; } /* Bresenham as presented in Foley & Van Dam */ /* As above, plus dashing */ #define styledSet \ { \ if (lineStyle) { \ if(!lineStyle[styleStep]) \ styleStep = 0; \ on=lineStyle[styleStep++]!=' '; \ } \ if (on) { \ SetPixel(x, y, color); \ } \ } void gdImage::Line(int x1, int y1, int x2, int y2, int color) { int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag; int styleStep = 0; int on = 1; dx = abs(x2-x1); dy = abs(y2-y1); if (dy <= dx) { d = 2*dy - dx; incr1 = 2*dy; incr2 = 2 * (dy - dx); if (x1 > x2) { x = x2; y = y2; ydirflag = (-1); xend = x1; } else { x = x1; y = y1; ydirflag = 1; xend = x2; } styledSet; if (((y2 - y1) * ydirflag) > 0) { while (x < xend) { x++; if (d <0) { d+=incr1; } else { y++; d+=incr2; } styledSet; } } else { while (x < xend) { x++; if (d <0) { d+=incr1; } else { y--; d+=incr2; } styledSet; } } } else { d = 2*dx - dy; incr1 = 2*dx; incr2 = 2 * (dx - dy); if (y1 > y2) { y = y2; x = x2; yend = y1; xdirflag = (-1); } else { y = y1; x = x1; yend = y2; xdirflag = 1; } styledSet; if (((x2 - x1) * xdirflag) > 0) { while (y < yend) { y++; if (d <0) { d+=incr1; } else { x++; d+=incr2; } styledSet; } } else { while (y < yend) { y++; if (d <0) { d+=incr1; } else { x--; d+=incr2; } styledSet; } } } } /* s and e are integers modulo 360 (degrees), with 0 degrees being the rightmost extreme and degrees changing clockwise. cx and cy are the center in pixels; w and h are the horizontal and vertical diameter in pixels. Nice interface, but slow, since I don't yet use Bresenham (I'm using an inefficient but simple solution with too much work going on in it; generalizing Bresenham to ellipses and partial arcs of ellipses is non-trivial, at least for me) and there are other inefficiencies (small circles do far too much work). */ void gdImage::Arc(int cx, int cy, int w, int h, int s, int e, int color) { #if 0 if(s==0 && e==360) { // full if(w==h) { // circle? /* Bresenham octant code, which I should use eventually */ int x, y, d; x = 0; y = w/2; d = 3-w; while (x <= y) { SetPixel(cx+x, cy+y, color); SetPixel(cx+x, cy-y, color); SetPixel(cx-x, cy+y, color); SetPixel(cx-x, cy-y, color); SetPixel(cx+y, cy+x, color); SetPixel(cx+y, cy-x, color); SetPixel(cx-y, cy+x, color); SetPixel(cx-y, cy-x, color); if (d < 0) { d += 4 * x + 6; } else { d += 4 * (x - y) + 10; y--; } x++; } } else { // full ellipse w/=2; h/=2; int elx, ely; long aa, aa2, bb, bb2, d, dx, dy; elx = 0; ely = h; aa = (long)w * w; aa2 = 2 * aa; bb = (long)h * h; bb2 = 2 * bb; d = bb - aa * h + aa/4; dx = 0; dy = aa2 * h; SetPixel(cx, cy - ely, color); SetPixel(cx, cy + ely, color); SetPixel(cx - w, cy, color); SetPixel(cx + w, cy, color); while (dx < dy) { if (d > 0) { ely--; dy-=aa2; d-=dy;} elx++; dx+=bb2; d+=bb+dx; SetPixel(cx + elx, cy + ely, color); SetPixel(cx - elx, cy + ely, color); SetPixel(cx + elx, cy - ely, color); SetPixel(cx - elx, cy - ely, color); }; d+=(3 * (aa - bb)/2 - (dx + dy))/2; while (ely > 0) { if (d < 0) {elx++; dx+=bb2; d+=bb + dx;} ely--; dy-=aa2; d+=aa - dy; SetPixel(cx + elx, cy + ely, color); SetPixel(cx - elx, cy + ely, color); SetPixel(cx + elx, cy - ely, color); SetPixel(cx - elx, cy - ely, color); }; } } else { #endif int i; int lx = 0, ly = 0; int w2, h2; w2 = w/2; h2 = h/2; while (e < s) e += 360; // paf while(s<0) s+=360; while(s>360) s-=360; while(e<0) e+=360; while(e>360) e-=360; for (i=s; (i <= e); i++) { int x, y; x = ((long)cost[i] * (long)w2 / costScale) + cx; y = ((long)sint[i] * (long)h2 / sintScale) + cy; if (i != s) { Line(lx, ly, x, y, color); } lx = x; ly = y; } #if 0 } #endif } /* // http://firststeps.narod.ru/cgi/18.html int CGIScreen::Ellipse(int exc, int eyc, int ea, int eb , unsigned char Color) { int elx, ely; long aa, aa2, bb, bb2, d, dx, dy; elx = 0; ely = eb; aa = (long)ea * ea; aa2 = 2 * aa; bb = (long)eb * eb; bb2 = 2 * bb; d = bb - aa * eb + aa/4; dx = 0; dy = aa2 * eb; PutPixel(exc, eyc - ely, Color); PutPixel(exc, eyc + ely, Color); PutPixel(exc - ea, eyc, Color); PutPixel(exc + ea, eyc, Color); while (dx < dy) { if (d > 0) { ely--; dy-=aa2; d-=dy;} elx++; dx+=bb2; d+=bb+dx; PutPixel(exc + elx, eyc + ely, Color); PutPixel(exc - elx, eyc + ely, Color); PutPixel(exc + elx, eyc - ely, Color); PutPixel(exc - elx, eyc - ely, Color); }; d+=(3 * (aa - bb)/2 - (dx + dy))/2; while (ely > 0) { if (d < 0) {elx++; dx+=bb2; d+=bb + dx;} ely--; dy-=aa2; d+=aa - dy; PutPixel(exc + elx, eyc + ely, Color); PutPixel(exc - elx, eyc + ely, Color); PutPixel(exc + elx, eyc - ely, Color); PutPixel(exc - elx, eyc - ely, Color); }; return 0; }; */ void gdImage::Sector(int cx, int cy, int w, int h, int s, int e, int color) { int i; int lx = 0, ly = 0; int w2, h2; w2 = w/2; h2 = h/2; while (e < s) e += 360; // paf while(s<0) s+=360; while(s>360) s-=360; while(e<0) e+=360; while(e>360) e-=360; for (i=s; (i <= e); i++) { int x, y; x = ((long)cost[i] * (long)w2 / costScale) + cx; y = ((long)sint[i] * (long)h2 / sintScale) + cy; if(i==s || i==e) Line(cx, cy, x, y, color); if (i != s) { Line(lx, ly, x, y, color); } lx = x; ly = y; } } void gdImage::FillToBorder(int x, int y, int border, int color) { if(!BoundsSafe(x, y)) //PAF return; int lastBorder; /* Seek left */ int leftLimit, rightLimit; int i; leftLimit = (-1); if (border < 0) { /* Refuse to fill to a non-solid border */ return; } for (i = x; (i >= 0); i--) { if (GetPixel(i, y) == border) { break; } SetPixel(i, y, color); leftLimit = i; } if (leftLimit == (-1)) { return; } /* Seek right */ rightLimit = x; for (i = (x+1); (i < sx); i++) { if (GetPixel(i, y) == border) { break; } SetPixel(i, y, color); rightLimit = i; } /* Look at lines above and below and start paints */ /* Above */ if (y > 0) { lastBorder = 1; for (i = leftLimit; (i <= rightLimit); i++) { int c; c = GetPixel(i, y-1); if (lastBorder) { if ((c != border) && (c != color)) { FillToBorder(i, y-1, border, color); lastBorder = 0; } } else if ((c == border) || (c == color)) { lastBorder = 1; } } } /* Below */ if (y < ((sy) - 1)) { lastBorder = 1; for (i = leftLimit; (i <= rightLimit); i++) { int c; c = GetPixel(i, y+1); if (lastBorder) { if ((c != border) && (c != color)) { FillToBorder(i, y+1, border, color); lastBorder = 0; } } else if ((c == border) || (c == color)) { lastBorder = 1; } } } } void gdImage::Fill(int x, int y, int color) { if(!BoundsSafe(x, y)) //PAF return; int lastBorder; int old; int leftLimit, rightLimit; int i; old = GetPixel(x, y); if (old == color) { /* Nothing to be done */ return; } /* Seek left */ leftLimit = (-1); for (i = x; (i >= 0); i--) { if (GetPixel(i, y) != old) { break; } DoSetPixel(i, y, color); // PAF, was SetPixel leftLimit = i; } if (leftLimit == (-1)) { return; } /* Seek right */ rightLimit = x; for (i = (x+1); (i < sx); i++) { if (GetPixel(i, y) != old) { break; } DoSetPixel(i, y, color); // PAF, was SetPixel rightLimit = i; } /* Look at lines above and below and start paints */ /* Above */ if (y > 0) { lastBorder = 1; for (i = leftLimit; (i <= rightLimit); i++) { int c; c = GetPixel(i, y-1); if (lastBorder) { if (c == old) { Fill(i, y-1, color); lastBorder = 0; } } else if (c != old) { lastBorder = 1; } } } /* Below */ if (y < ((sy) - 1)) { lastBorder = 1; for (i = leftLimit; (i <= rightLimit); i++) { int c; c = GetPixel(i, y+1); if (lastBorder) { if (c == old) { Fill(i, y+1, color); lastBorder = 0; } } else if (c != old) { lastBorder = 1; } } } } void gdImage::Rectangle(int x1, int y1, int x2, int y2, int color) { Line(x1, y1, x2, y1, color); Line(x1, y2, x2, y2, color); Line(x1, y1, x1, y2, color); Line(x2, y1, x2, y2, color); } void gdImage::FilledRectangle(int x1, int y1, int x2, int y2, int color) { if(x1>x2) { int t=x1; x1=x2; x2=t; } if(y1>y2) { int t=y1; y1=y2; y2=t; } int x, y; for (y=y1; (y<=y2); y++) for (x=x1; (x<=x2); x++) SetPixel(x, y, color); } void gdImage::Copy(gdImage& dst, int dstX, int dstY, int srcX, int srcY, int w, int h) { int c; int x, y; int tox, toy; int i; int colorMap[gdMaxColors]; for (i=0; (i sy2 - sy1) { yportion = sy2 - sy1; } sy = floor (sy); } else if (sy == floor (sy2)) { yportion = sy2 - floor (sy2); } else { yportion = 1.0; } sx1 = ((double) x - (double) dstX) * (double) srcW / dstW; sx2 = ((double) (x + 1) - (double) dstX) * (double) srcW / dstW; sx = sx1; do { double xportion; double pcontribution; int p; if (floor (sx) == floor (sx1)) { xportion = 1.0 - (sx - floor (sx)); if (xportion > sx2 - sx1) { xportion = sx2 - sx1; } sx = floor (sx); } else if (sx == floor (sx2)) { xportion = sx2 - floor (sx2); } else { xportion = 1.0; } pcontribution = xportion * yportion; p = src.GetPixel ( (int) sx, (int) sy); // fix added 20020116 by paf to support transparent src if (p!=srcTransparent) { transparent = false; red += Red (p) * pcontribution; green += Green (p) * pcontribution; blue += Blue (p) * pcontribution; } spixels += xportion * yportion; sx += 1.0; } while (sx < sx2); sy += 1.0; } while (sy < sy2); if(transparent) continue; if (spixels != 0.0) { red /= spixels; green /= spixels; blue /= spixels; } /* Clamping to allow for rounding errors above */ if (red > 255.0) red = 255.0; if (green > 255.0) green = 255.0; if (blue > 255.0) blue = 255.0; red=round(red); green=round(green); blue=round(blue); /* First look for an exact match */ int nc = dst.ColorExact((int)red, (int)green, (int)blue); if (nc == (-1)) { /* No, so go for the closest color with high tolerance */ nc = dst.ColorClosest((int)red, (int)green, (int)blue, tolerance); if (nc == (-1)) { /* Not found with even high tolerance, so try to allocate it */ nc = dst.ColorAllocate((int)red, (int)green, (int)blue); /* If we're out of colors, go for the closest color */ if (nc == (-1)) nc = dst.ColorClosest((int)red, (int)green, (int)blue); } } dst.SetPixel(x, y, nc); } } } void gdImage::Polygon(Point *p, int n, int c, bool closed) { int i; int lx, ly; if (!n) { return; } lx = p->x; ly = p->y; if(closed) Line(lx, ly, p[n-1].x, p[n-1].y, c); for (i=1; (i < n); i++) { p++; Line(lx, ly, p->x, p->y, c); lx = p->x; ly = p->y; } } static int gdCompareInt(const void *a, const void *b) { return (*(const int *)a) - (*(const int *)b); } void gdImage::FilledPolygon(Point *p, int n, int c) { int i; int y; int y1, y2; int ints; if (!n) { return; } if (!polyAllocated) { polyInts = (int *) pa_malloc(sizeof(int) * n); polyAllocated = n; } if (polyAllocated < n) { while (polyAllocated < n) { polyAllocated *= 2; } polyInts = (int *) pa_realloc(polyInts, sizeof(int) * polyAllocated); } y1 = p[0].y; y2 = p[0].y; for (i=1; (i < n); i++) { if (p[i].y < y1) { y1 = p[i].y; } if (p[i].y > y2) { y2 = p[i].y; } } for (y=y1; (y <= y2); y++) { int interLast = 0; int dirLast = 0; int interFirst = 1; ints = 0; for (i=0; (i <= n); i++) { int x1, x2; int y1, y2; int dir; int ind1, ind2; int lastInd1 = 0; if ((i == n) || (!i)) { ind1 = n-1; ind2 = 0; } else { ind1 = i-1; ind2 = i; } y1 = p[ind1].y; y2 = p[ind2].y; if (y1 < y2) { y1 = p[ind1].y; y2 = p[ind2].y; x1 = p[ind1].x; x2 = p[ind2].x; dir = -1; } else if (y1 > y2) { y2 = p[ind1].y; y1 = p[ind2].y; x2 = p[ind1].x; x1 = p[ind2].x; dir = 1; } else { /* Horizontal; just draw it */ Line( p[ind1].x, y1, p[ind2].x, y1, c); continue; } if ((y >= y1) && (y <= y2)) { int inter = (y-y1) * (x2-x1) / (y2-y1) + x1; /* Only count intersections once except at maxima and minima. Also, if two consecutive intersections are endpoints of the same horizontal line that is not at a maxima or minima, discard the leftmost of the two. */ if (!interFirst) { if ((p[ind1].y == p[lastInd1].y) && (p[ind1].x != p[lastInd1].x)) { if (dir == dirLast) { if (inter > interLast) { /* Replace the old one */ polyInts[ints] = inter; } else { /* Discard this one */ } continue; } } if (inter == interLast) { if (dir == dirLast) { continue; } } } if (i > 0) { polyInts[ints++] = inter; } lastInd1 = i; dirLast = dir; interLast = inter; interFirst = 0; } } qsort(polyInts, ints, sizeof(int), gdCompareInt); for (i=0; (i < (ints-1)); i+=2) Line(polyInts[i], y, polyInts[i+1], y, c); } } //001005paf this used in drawing straight lines in gdImage::FilledPolygonReplaceColor void gdImage::LineReplaceColor(int x1, int y1, int x2, int y2, int a, int b) { if(y1!=y2) return; for(int x=x1; x<=x2; x++) if(BoundsSafe(x, y1)) { unsigned char *pixel=&pixels[x][y1]; if(*pixel==a) *pixel=b; } } void gdImage::FilledPolygonReplaceColor(Point *p, int n, int a, int b) { int i; int y; int y1, y2; int ints; if (!n) { return; } if (!polyAllocated) { polyInts = (int *) pa_malloc(sizeof(int) * n); polyAllocated = n; } if (polyAllocated < n) { while (polyAllocated < n) { polyAllocated *= 2; } polyInts = (int *) pa_realloc(polyInts, sizeof(int) * polyAllocated); } y1 = p[0].y; y2 = p[0].y; for (i=1; (i < n); i++) { if (p[i].y < y1) { y1 = p[i].y; } if (p[i].y > y2) { y2 = p[i].y; } } for (y=y1; (y <= y2); y++) { int interLast = 0; int dirLast = 0; int interFirst = 1; ints = 0; for (i=0; (i <= n); i++) { int x1, x2; int y1, y2; int dir; int ind1, ind2; int lastInd1 = 0; if ((i == n) || (!i)) { ind1 = n-1; ind2 = 0; } else { ind1 = i-1; ind2 = i; } y1 = p[ind1].y; y2 = p[ind2].y; if (y1 < y2) { y1 = p[ind1].y; y2 = p[ind2].y; x1 = p[ind1].x; x2 = p[ind2].x; dir = -1; } else if (y1 > y2) { y2 = p[ind1].y; y1 = p[ind2].y; x2 = p[ind1].x; x1 = p[ind2].x; dir = 1; } else { /* Horizontal; just draw it */ LineReplaceColor( p[ind1].x, y1, p[ind2].x, y1, a,b); continue; } if ((y >= y1) && (y <= y2)) { int inter = (y-y1) * (x2-x1) / (y2-y1) + x1; /* Only count intersections once except at maxima and minima. Also, if two consecutive intersections are endpoints of the same horizontal line that is not at a maxima or minima, discard the leftmost of the two. */ if (!interFirst) { if ((p[ind1].y == p[lastInd1].y) && (p[ind1].x != p[lastInd1].x)) { if (dir == dirLast) { if (inter > interLast) { /* Replace the old one */ polyInts[ints] = inter; } else { /* Discard this one */ } continue; } } if (inter == interLast) { if (dir == dirLast) { continue; } } } if (i > 0) { polyInts[ints++] = inter; } lastInd1 = i; dirLast = dir; interLast = inter; interFirst = 0; } } qsort(polyInts, ints, sizeof(int), gdCompareInt); for (i=0; (i < (ints-1)); i+=2) { LineReplaceColor(polyInts[i], y, polyInts[i+1], y, a,b); } } } void gdImage::SetInterlace(int interlaceArg) { interlace = interlaceArg; } void gdImage::SetLineWidth(int width) { lineWidth=width; } void gdImage::SetLineStyle(const char* alineStyle) { lineStyle=alineStyle; } parser-3.5.1/src/lib/gd/gifio.C0000644000076400007640000006030514712042465013106 00000000000000/** @file Parser: image manipulations impl2. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian based on: gd Written by Tom Boutell, 5/94. Copyright 1994, Cold Spring Harbor Labs. Permission granted to use this code in any fashion provided that this notice is retained and any alterations are labeled as such. It is requested, but not required, that you share extensions to this module with us so that we can incorporate them into new versions. based on: ** ** Based on GIFENCOD by David Rowley . A ** Lempel-Zim compression based on "compress". ** ** Modified by Marcel Wijkstra ** ** Copyright(C) 1989 by Jef Poskanzer. ** ** Permission to use, copy, modify, and distribute this software and its ** documentation for any purpose and without fee is hereby granted, provided ** that the above copyright notice appear in all copies and that both that ** copyright notice and this permission notice appear in supporting ** documentation. This software is provided "as is" without express or ** implied warranty. ** ** The Graphics Interchange Format(c) is the Copyright property of ** CompuServe Incorporated. GIF(sm) is a Service Mark property of ** CompuServe Incorporated. */ #include "gif.h" volatile const char * IDENT_GIFIO_C="$Id: gifio.C,v 1.11 2024/11/04 03:53:25 moko Exp $"; static int colorstobpp(int colors); gdBuf gdImage::Gif() { int BitsPerPixel = colorstobpp(colorsTotal); /* Clear any old values in statics strewn through the GIF code */ gdGifEncoder encoder(*this); /* All set, let's do it. */ return encoder.encode( sx, sy, interlace, 0, transparent, BitsPerPixel, red, green, blue); } static int colorstobpp(int colors) { int bpp = 0; if( colors <= 2 ) bpp = 1; else if( colors <= 4 ) bpp = 2; else if( colors <= 8 ) bpp = 3; else if( colors <= 16 ) bpp = 4; else if( colors <= 32 ) bpp = 5; else if( colors <= 64 ) bpp = 6; else if( colors <= 128 ) bpp = 7; else if( colors <= 256 ) bpp = 8; return bpp; } /***************************************************************************** * * GIFENCODE.C - GIF Image compression interface * * GIFEncode( FName, GHeight, GWidth, GInterlace, Background, Transparent, * BitsPerPixel, Red, Green, Blue, gdGifEncoder::Ptr ) * *****************************************************************************/ #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif /* * Bump the 'curx' and 'cury' to point to the next pixel */ void gdGifEncoder::BumpPixel(void) { /* * Bump the current X position */ ++curx; /* * If we are at the end of a scan line, set curx back to the beginning * If we are interlaced, bump the cury to the appropriate spot, * otherwise, just increment it. */ if( curx == Width ) { curx = 0; if( !Interlace ) ++cury; else { switch( Pass ) { case 0: cury += 8; if( cury >= Height ) { ++Pass; cury = 4; } break; case 1: cury += 8; if( cury >= Height ) { ++Pass; cury = 2; } break; case 2: cury += 4; if( cury >= Height ) { ++Pass; cury = 1; } break; case 3: cury += 2; break; } } } } /* * Return the next pixel from the image */ int gdGifEncoder::GIFNextPixel() { int r; if( CountDown == 0 ) return EOF; --CountDown; r = im.GetPixel(curx, cury); BumpPixel(); return r; } /* public */ gdBuf gdGifEncoder::encode(int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue) { int B; int RWidth, RHeight; int LeftOfs, TopOfs; int Resolution; int ColorMapSize; int InitCodeSize; int i; Interlace = GInterlace; ColorMapSize = 1 << BitsPerPixel; RWidth = Width = GWidth; RHeight = Height = GHeight; LeftOfs = TopOfs = 0; Resolution = BitsPerPixel; /* * Calculate number of bits we are expecting */ CountDown =(long)Width *(long)Height; /* * Indicate which pass we are on(if interlace) */ Pass = 0; /* * The initial code size */ if( BitsPerPixel <= 1 ) InitCodeSize = 2; else InitCodeSize = BitsPerPixel; /* * Set up the current x and y position */ curx = cury = 0; /* * Write the Magic header */ Putbyte('G');Putbyte('I');Putbyte('F'); Putbyte('8');Putbyte(Transparent < 0?'7':'9');Putbyte('a'); /* * Write out the screen width and height */ Putword( RWidth); Putword( RHeight); /* * Indicate that there is a global colour map */ B = 0x80; /* Yes, there is a color map */ /* * OR in the resolution */ B |=(Resolution - 1) << 5; /* * OR in the Bits per Pixel */ B |=(BitsPerPixel - 1); /* * Write it out */ Putbyte(B); /* * Write out the Background colour */ Putbyte(Background); /* * Byte of 0's(future expansion) */ Putbyte(0); /* * Write out the Global Colour Map */ for( i=0; i= 0 ) { Putbyte( '!'); Putbyte( 0xf9); Putbyte( 4); Putbyte( 1); Putbyte( 0); Putbyte( 0); Putbyte((unsigned char) Transparent); Putbyte( 0); } /* * Write an Image separator */ Putbyte( ','); /* * Write the Image header */ Putword( LeftOfs); Putword( TopOfs); Putword( Width); Putword( Height); /* * Write out whether or not the image is interlaced */ if( Interlace ) Putbyte( 0x40); else Putbyte( 0x00); /* * Write out the initial code size */ Putbyte( InitCodeSize); /* * Go and actually compress the data */ compress( InitCodeSize+1 ); /* * Write out a Zero-length packet(to end the series) */ Putbyte( 0); /* * Write the GIF file terminator */ Putbyte( ';'); return buf; } /* * Write out a byte to the GIF file */ void gdGifEncoder::Putbyte(unsigned char c) { buf.append(&c, 1); } /* * Write out a word to the GIF file */ void gdGifEncoder::Putword(int w) { unsigned char b0=w & 0xff; unsigned char b1=w >> 8; buf.append(&b0, 1); buf.append(&b1, 1); } void gdGifEncoder::Write(void *abuf, size_t size) { buf.append((unsigned char*)abuf, size); } /*************************************************************************** * * GIFCOMPR.C - GIF Image compression routines * * Lempel-Ziv compression based on 'compress'. GIF modifications by * David Rowley(mgardi@watdcsu.waterloo.edu) * ***************************************************************************/ /* * General DEFINEs */ #define GIFBITS 12 #ifdef NO_UCHAR typedef char char_type; #else typedef unsigned char char_type; #endif /* * * GIF Image compression - modified 'compress' * * Based on: compress.c - File compression ala IEEE Computer, June 1984. * * By Authors: Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas) * Jim McKie (decvax!mcvax!jim) * Steve Davies (decvax!vax135!petsd!peora!srd) * Ken Turkowski (decvax!decwrl!turtlevax!ken) * James A. Woods (decvax!ihnp4!ames!jaw) * Joe Orost (decvax!vax135!petsd!joe) * */ #ifdef COMPATIBLE /* But wrong! */ # define MAXCODE(n_bits) ((code_int) 1 <<(n_bits) - 1) #else # define MAXCODE(n_bits) (((code_int) 1 <<(n_bits)) - 1) #endif #define HashTabOf(i) htab[i] #define CodeTabOf(i) codetab[i] /* * To save much memory, we overlay the table used by compress() with those * used by decompress(). The tab_prefix table is the same size and type * as the codetab. The tab_suffix table needs 2**GIFBITS characters. We * get this from the beginning of htab. The output stack uses the rest * of htab, and contains characters. There is plenty of room for any * possible stack(stack used to be 8000 characters). */ #define tab_prefixof(i) CodeTabOf(i) #define tab_suffixof(i) ((char_type*)(htab))[i] #define de_stack ((char_type*)&tab_suffixof((code_int)1< 0 ) goto probe; nomatch: output((code_int) ent ); ++out_count; ent = c; #ifdef SIGNED_COMPARE_SLOW if((unsigned) free_ent <(unsigned) maxmaxcode) { #else if( free_ent < maxmaxcode ) { /* } */ #endif CodeTabOf(i) = free_ent++; /* code -> hashtable */ HashTabOf(i) = fcode; } else cl_block(); } /* * Put out the final code. */ output((code_int)ent ); ++out_count; output((code_int) EOFCode ); } /***************************************************************** * TAG( output ) * * Output the given code. * Inputs: * code: A n_bits-bit integer. If == -1, then EOF. This assumes * that n_bits =<(long)wordsize - 1. * Outputs: * Outputs code to the file. * Assumptions: * Chars are 8 bits long. * Algorithm: * Maintain a GIFBITS character long buffer(so that 8 codes will * fit in it exactly). Use the VAX insv instruction to insert each * code in turn. When the buffer fills up empty it and start over. */ static unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }; void gdGifEncoder::output(code_int code) { cur_accum &= masks[ cur_bits ]; if( cur_bits > 0 ) cur_accum |=((long)code << cur_bits); else cur_accum = code; cur_bits += n_bits; while( cur_bits >= 8 ) { char_out((unsigned int)(cur_accum & 0xff) ); cur_accum >>= 8; cur_bits -= 8; } /* * If the next entry is going to be too big for the code size, * then increase it, if possible. */ if( free_ent > maxcode || clear_flg ) { if( clear_flg ) { maxcode = MAXCODE(n_bits = g_init_bits); clear_flg = 0; } else { ++n_bits; if( n_bits == maxbits ) maxcode = maxmaxcode; else maxcode = MAXCODE(n_bits); } } if( code == EOFCode ) { /* * At EOF, write the rest of the buffer. */ while( cur_bits > 0 ) { char_out((unsigned int)(cur_accum & 0xff) ); cur_accum >>= 8; cur_bits -= 8; } flush_char(); } } /* * Clear out the hash table */ void gdGifEncoder::cl_block(void) /* table clear for block compress */ { cl_hash((count_int) hsize ); free_ent = ClearCode + 2; clear_flg = 1; output((code_int)ClearCode ); } void gdGifEncoder::cl_hash(count_int hsize) /* reset code table */ { count_int *htab_p = htab+hsize; long i; long m1 = -1; i = hsize - 16; do { /* might use Sys V memset(3) here */ *(htab_p-16) = m1; *(htab_p-15) = m1; *(htab_p-14) = m1; *(htab_p-13) = m1; *(htab_p-12) = m1; *(htab_p-11) = m1; *(htab_p-10) = m1; *(htab_p-9) = m1; *(htab_p-8) = m1; *(htab_p-7) = m1; *(htab_p-6) = m1; *(htab_p-5) = m1; *(htab_p-4) = m1; *(htab_p-3) = m1; *(htab_p-2) = m1; *(htab_p-1) = m1; htab_p -= 16; } while((i -= 16) >= 0); for( i += 16; i > 0; --i ) *--htab_p = m1; } /****************************************************************************** * * GIF Specific routines * ******************************************************************************/ /* * Set up the 'byte output' routine */ void gdGifEncoder::char_init(void) { a_count = 0; } /* * Add a character to the end of the current packet, and if it is 254 * characters, flush the packet to disk. */ void gdGifEncoder::char_out(int c) { accum[ a_count++ ] = c; if( a_count >= 254 ) flush_char(); } /* * Flush the packet to disk, and reset the accumulator */ void gdGifEncoder::flush_char(void) { if( a_count > 0 ) { Putbyte( a_count ); Write( accum, a_count); a_count = 0; } } gdGifEncoder::gdGifEncoder(gdImage& aim): im(aim) { /* Some of these are properly initialized later. What I'm doing here is making sure code that depends on C's initialization of statics doesn't break when the code gets called more than once. */ Width = 0; Height = 0; curx = 0; cury = 0; CountDown = 0; Pass = 0; Interlace = 0; a_count = 0; cur_accum = 0; cur_bits = 0; g_init_bits = 0; ClearCode = 0; EOFCode = 0; free_ent = 0; clear_flg = 0; offset = 0; in_count = 1; out_count = 0; hsize = HSIZE; n_bits = 0; maxbits = GIFBITS; maxcode = 0; maxmaxcode =(code_int)1 << GIFBITS; } /* +-------------------------------------------------------------------+ */ /* | Copyright 1990, 1991, 1993, David Koblas.(koblas@netcom.com) | */ /* | Permission to use, copy, modify, and distribute this software | */ /* | and its documentation for any purpose and without fee is hereby | */ /* | granted, provided that the above copyright notice appear in all | */ /* | copies and that both that copyright notice and this permission | */ /* | notice appear in supporting documentation. This software is | */ /* | provided "as is" without express or implied warranty. | */ /* +-------------------------------------------------------------------+ */ #define MAXCOLORMAPSIZE 256 #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define CM_RED 0 #define CM_GREEN 1 #define CM_BLUE 2 #define MAX_LWZ_BITS 12 #define INTERLACE 0x40 #define LOCALCOLORMAP 0x80 #define BitSet(byte, bit) (((byte) &(bit)) ==(bit)) #define ReadOK(file,buffer,len)(fread(buffer, len, 1, file) != 0) #define LM_to_uint(a,b) (((b)<<8)|(a)) /* We may eventually want to use this information, but def it out for now */ #if 0 struct GifScreen { unsigned int Width; unsigned int Height; unsigned char ColorMap[3][MAXCOLORMAPSIZE]; unsigned int BitPixel; unsigned int ColorResolution; unsigned int Background; unsigned int AspectRatio; }; #endif /// Graphic Control Extension struct #ifndef DOXYGEN struct Gif89 { int transparent; int delayTime; int inputFlag; int disposal; }; #endif static int ReadColorMap(FILE *fd, int number, unsigned char(*buffer)[256]); bool gdImage::CreateFromGif(FILE *fd) { int imageNumber; int BitPixel; int Transparent =(-1); unsigned char buf[16]; unsigned char c; unsigned char ColorMap[3][MAXCOLORMAPSIZE]; unsigned char localColorMap[3][MAXCOLORMAPSIZE]; int imw, imh; int useGlobalColormap; int bitPixel; int imageCount = 0; char version[4]; ZeroDataBlock = FALSE; imageNumber = 1; if(! ReadOK(fd,buf,6)) { return false; } if(strncmp((char *)buf,"GIF",3) != 0) { return false; } strncpy(version,(char *)buf + 3, 3); version[3] = '\0'; if((strcmp(version, "87a") != 0) &&(strcmp(version, "89a") != 0)) { return false; } if(! ReadOK(fd,buf,7)) { return false; } BitPixel = 2<<(buf[4]&0x07); if(BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */ if(ReadColorMap(fd, BitPixel, ColorMap)) { return false; } } for(;;) { if(! ReadOK(fd,&c,1)) { return false; } if(c == ';') { /* GIF terminator */ int i; if(imageCount < imageNumber) { return false; } /* Check for open colors at the end, so we can reduce colorsTotal and ultimately BitsPerPixel */ for(i=((colorsTotal-1));(i>=0); i--) { if(open[i]) { colorsTotal--; } else { break; } } return true; } if(c == '!') { /* Extension */ if(! ReadOK(fd,&c,1)) { return false; } DoExtension(fd, c, &Transparent); continue; } if(c != ',') { /* Not a valid start character */ continue; } ++imageCount; if(! ReadOK(fd,buf,9)) { return false; } useGlobalColormap = ! BitSet(buf[8], LOCALCOLORMAP); bitPixel = 1<<((buf[8]&0x07)+1); imw = LM_to_uint(buf[4],buf[5]); imh = LM_to_uint(buf[6],buf[7]); Create(imw, imh); interlace = BitSet(buf[8], INTERLACE); if(! useGlobalColormap) { if(ReadColorMap(fd, bitPixel, localColorMap)) { return false; } ReadImage(fd, imw, imh, localColorMap, BitSet(buf[8], INTERLACE), imageCount != imageNumber); } else { ReadImage(fd, imw, imh, ColorMap, BitSet(buf[8], INTERLACE), imageCount != imageNumber); } if(Transparent !=(-1)) { SetColorTransparent(Transparent); } } } static int ReadColorMap(FILE *fd, int number, unsigned char(*buffer)[256]) { int i; unsigned char rgb[3]; for(i = 0; i < number; ++i) { if(! ReadOK(fd, rgb, sizeof(rgb))) { return TRUE; } buffer[CM_RED][i] = rgb[0] ; buffer[CM_GREEN][i] = rgb[1] ; buffer[CM_BLUE][i] = rgb[2] ; } return FALSE; } int gdImage::DoExtension(FILE *fd, int label, int *Transparent) { static unsigned char buf[256]; switch(label) { case 0xf9: { /* Graphic Control Extension */ (void) GetDataBlock(fd,(unsigned char*) buf); if((buf[0] & 0x1) != 0) *Transparent = buf[3]; while(GetDataBlock(fd,(unsigned char*) buf) != 0) ; return FALSE; } default: break; } while(GetDataBlock(fd,(unsigned char*) buf) != 0) ; return FALSE; } int gdImage::GetDataBlock(FILE *fd, unsigned char *buf) { unsigned char count; if(! ReadOK(fd,&count,1)) { return -1; } ZeroDataBlock = count == 0; if((count != 0) &&(! ReadOK(fd, buf, count))) { return -1; } return count; } int gdImage::GetCode(FILE *fd, int code_size, int flag) { static unsigned char buf[280]; static int curbit, lastbit, done, last_byte; int i, j, ret; unsigned char count; if(flag) { curbit = 0; lastbit = 0; done = FALSE; return 0; } if((curbit+code_size) >= lastbit) { if(done) { if(curbit >= lastbit) { /* Oh well */ } return -1; } buf[0] = buf[last_byte-2]; buf[1] = buf[last_byte-1]; if((count = GetDataBlock(fd, &buf[2])) == 0) done = TRUE; last_byte = 2 + count; curbit =(curbit - lastbit) + 16; lastbit =(2+count)*8 ; } ret = 0; for(i = curbit, j = 0; j < code_size; ++i, ++j) ret |=((buf[ i / 8 ] &(1 <<(i % 8))) != 0) << j; curbit += code_size; return ret; } int gdImage::LWZReadByte(FILE *fd, int flag, int input_code_size) { static int fresh = FALSE; int code, incode; static int code_size, set_code_size; static int max_code, max_code_size; static int firstcode, oldcode; static int clear_code, end_code; static int table[2][(1<< MAX_LWZ_BITS)]; static int stack[(1<<(MAX_LWZ_BITS))*2], *sp; int i; if(flag) { set_code_size = input_code_size; code_size = set_code_size+1; clear_code = 1 << set_code_size ; end_code = clear_code + 1; max_code_size = 2*clear_code; max_code = clear_code+2; GetCode(fd, 0, TRUE); fresh = TRUE; for(i = 0; i < clear_code; ++i) { table[0][i] = 0; table[1][i] = i; } for(; i <(1< stack) return *--sp; while((code = GetCode(fd, code_size, FALSE)) >= 0) { if(code == clear_code) { for(i = 0; i < clear_code; ++i) { table[0][i] = 0; table[1][i] = i; } for(; i <(1< 0) ; if(count != 0) return -2; } incode = code; if(code >= max_code) { *sp++ = firstcode; code = oldcode; } while(code >= clear_code) { *sp++ = table[1][code]; if(code == table[0][code]) { /* Oh well */ } code = table[0][code]; } *sp++ = firstcode = table[1][code]; if((code = max_code) <(1<= max_code_size) && (max_code_size <(1< stack) return *--sp; } return code; } void gdImage::ReadImage(FILE *fd, int len, int height, unsigned char(*cmap)[256], int interlace, int ignore) { unsigned char c; int v; int xpos = 0, ypos = 0, pass = 0; int i; /* Stash the color map into the image */ for(i=0;(i= 0) ; return; } while((v = LWZReadByte(fd,FALSE,c)) >= 0 ) { /* This how we recognize which colors are actually used. */ if(open[v]) { open[v] = 0; } SetPixel(xpos, ypos, v); ++xpos; if(xpos == len) { xpos = 0; if(interlace) { switch(pass) { case 0: case 1: ypos += 8; break; case 2: ypos += 4; break; case 3: ypos += 2; break; } if(ypos >= height) { ++pass; switch(pass) { case 1: ypos = 4; break; case 2: ypos = 2; break; case 3: ypos = 1; break; default: goto fini; } } } else { ++ypos; } } if(ypos >= height) break; } fini: if(LWZReadByte(fd,FALSE,c)>=0) { /* Ignore extra */ } } parser-3.5.1/src/lib/gd/mtables.h0000644000076400007640000001274307757403246013521 00000000000000#ifndef MTABLES_H #define MTABLES_H 1 #define costScale 1024 int cost[] = { 1024, 1023, 1023, 1022, 1021, 1020, 1018, 1016, 1014, 1011, 1008, 1005, 1001, 997, 993, 989, 984, 979, 973, 968, 962, 955, 949, 942, 935, 928, 920, 912, 904, 895, 886, 877, 868, 858, 848, 838, 828, 817, 806, 795, 784, 772, 760, 748, 736, 724, 711, 698, 685, 671, 658, 644, 630, 616, 601, 587, 572, 557, 542, 527, 512, 496, 480, 464, 448, 432, 416, 400, 383, 366, 350, 333, 316, 299, 282, 265, 247, 230, 212, 195, 177, 160, 142, 124, 107, 89, 71, 53, 35, 17, 0, -17, -35, -53, -71, -89, -107, -124, -142, -160, -177, -195, -212, -230, -247, -265, -282, -299, -316, -333, -350, -366, -383, -400, -416, -432, -448, -464, -480, -496, -512, -527, -542, -557, -572, -587, -601, -616, -630, -644, -658, -671, -685, -698, -711, -724, -736, -748, -760, -772, -784, -795, -806, -817, -828, -838, -848, -858, -868, -877, -886, -895, -904, -912, -920, -928, -935, -942, -949, -955, -962, -968, -973, -979, -984, -989, -993, -997, -1001, -1005, -1008, -1011, -1014, -1016, -1018, -1020, -1021, -1022, -1023, -1023, -1024, -1023, -1023, -1022, -1021, -1020, -1018, -1016, -1014, -1011, -1008, -1005, -1001, -997, -993, -989, -984, -979, -973, -968, -962, -955, -949, -942, -935, -928, -920, -912, -904, -895, -886, -877, -868, -858, -848, -838, -828, -817, -806, -795, -784, -772, -760, -748, -736, -724, -711, -698, -685, -671, -658, -644, -630, -616, -601, -587, -572, -557, -542, -527, -512, -496, -480, -464, -448, -432, -416, -400, -383, -366, -350, -333, -316, -299, -282, -265, -247, -230, -212, -195, -177, -160, -142, -124, -107, -89, -71, -53, -35, -17, 0, 17, 35, 53, 71, 89, 107, 124, 142, 160, 177, 195, 212, 230, 247, 265, 282, 299, 316, 333, 350, 366, 383, 400, 416, 432, 448, 464, 480, 496, 512, 527, 542, 557, 572, 587, 601, 616, 630, 644, 658, 671, 685, 698, 711, 724, 736, 748, 760, 772, 784, 795, 806, 817, 828, 838, 848, 858, 868, 877, 886, 895, 904, 912, 920, 928, 935, 942, 949, 955, 962, 968, 973, 979, 984, 989, 993, 997, 1001, 1005, 1008, 1011, 1014, 1016, 1018, 1020, 1021, 1022, 1023, 1023, 1024 //paf }; #define sintScale 1024 int sint[] = { 0, 17, 35, 53, 71, 89, 107, 124, 142, 160, 177, 195, 212, 230, 247, 265, 282, 299, 316, 333, 350, 366, 383, 400, 416, 432, 448, 464, 480, 496, 512, 527, 542, 557, 572, 587, 601, 616, 630, 644, 658, 671, 685, 698, 711, 724, 736, 748, 760, 772, 784, 795, 806, 817, 828, 838, 848, 858, 868, 877, 886, 895, 904, 912, 920, 928, 935, 942, 949, 955, 962, 968, 973, 979, 984, 989, 993, 997, 1001, 1005, 1008, 1011, 1014, 1016, 1018, 1020, 1021, 1022, 1023, 1023, 1024, 1023, 1023, 1022, 1021, 1020, 1018, 1016, 1014, 1011, 1008, 1005, 1001, 997, 993, 989, 984, 979, 973, 968, 962, 955, 949, 942, 935, 928, 920, 912, 904, 895, 886, 877, 868, 858, 848, 838, 828, 817, 806, 795, 784, 772, 760, 748, 736, 724, 711, 698, 685, 671, 658, 644, 630, 616, 601, 587, 572, 557, 542, 527, 512, 496, 480, 464, 448, 432, 416, 400, 383, 366, 350, 333, 316, 299, 282, 265, 247, 230, 212, 195, 177, 160, 142, 124, 107, 89, 71, 53, 35, 17, 0, -17, -35, -53, -71, -89, -107, -124, -142, -160, -177, -195, -212, -230, -247, -265, -282, -299, -316, -333, -350, -366, -383, -400, -416, -432, -448, -464, -480, -496, -512, -527, -542, -557, -572, -587, -601, -616, -630, -644, -658, -671, -685, -698, -711, -724, -736, -748, -760, -772, -784, -795, -806, -817, -828, -838, -848, -858, -868, -877, -886, -895, -904, -912, -920, -928, -935, -942, -949, -955, -962, -968, -973, -979, -984, -989, -993, -997, -1001, -1005, -1008, -1011, -1014, -1016, -1018, -1020, -1021, -1022, -1023, -1023, -1024, -1023, -1023, -1022, -1021, -1020, -1018, -1016, -1014, -1011, -1008, -1005, -1001, -997, -993, -989, -984, -979, -973, -968, -962, -955, -949, -942, -935, -928, -920, -912, -904, -895, -886, -877, -868, -858, -848, -838, -828, -817, -806, -795, -784, -772, -760, -748, -736, -724, -711, -698, -685, -671, -658, -644, -630, -616, -601, -587, -572, -557, -542, -527, -512, -496, -480, -464, -448, -432, -416, -400, -383, -366, -350, -333, -316, -299, -282, -265, -247, -230, -212, -195, -177, -160, -142, -124, -107, -89, -71, -53, -35, -17, 0 // paf }; #endif parser-3.5.1/src/lib/gd/gd.vcproj0000644000076400007640000000674113622760245013532 00000000000000 parser-3.5.1/src/lib/Makefile.in0000644000076400007640000004606714740273415013373 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = gd smtp cord ltdl pcre md5 gc sdbm json curl punycode memcached all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/smtp/0000755000076400007640000000000014740300546012350 500000000000000parser-3.5.1/src/lib/smtp/smtp.vcproj0000644000076400007640000000675713622760246014524 00000000000000 parser-3.5.1/src/lib/smtp/Makefile.in0000644000076400007640000004531614740273416014353 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/smtp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libsmtp_la_LIBADD = am_libsmtp_la_OBJECTS = comms.lo smtp.lo libsmtp_la_OBJECTS = $(am_libsmtp_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/comms.Plo ./$(DEPDIR)/smtp.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libsmtp_la_SOURCES) DIST_SOURCES = $(libsmtp_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = smtp.h noinst_LTLIBRARIES = libsmtp.la libsmtp_la_SOURCES = comms.C smtp.C EXTRA_DIST = smtp.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/smtp/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/smtp/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libsmtp.la: $(libsmtp_la_OBJECTS) $(libsmtp_la_DEPENDENCIES) $(EXTRA_libsmtp_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libsmtp_la_OBJECTS) $(libsmtp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comms.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smtp.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .C.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/comms.Plo -rm -f ./$(DEPDIR)/smtp.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/comms.Plo -rm -f ./$(DEPDIR)/smtp.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/smtp/comms.C0000644000076400007640000000765214712042465013526 00000000000000/** @file Parser: SMTP sender impl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "smtp.h" volatile const char * IDENT_COMMS_C="$Id: comms.C,v 1.15 2024/11/04 03:53:25 moko Exp $"; // --------------------------------------------------------------------------- int SMTP:: IsAddressARawIpaddress(const char* string) { while( *string ) { if( !isdigit((unsigned char)*string) ) { return 0; } string++; } return 1; } //--------------------------------------------------------------------------- ///@bug getservbyname is not reenterant int SMTP:: ResolveService(const char* service, u_short *our_port) { struct servent *serventry = NULL; if( IsAddressARawIpaddress(service) ) { char * tail; *our_port = (u_short)strtol(service, &tail, 10); if( tail == service ) { return WSAEPROTONOSUPPORT; } else { *our_port = htons(*our_port); } } else { serventry = getservbyname(service, "tcp"); if( serventry ) *our_port = serventry->s_port; else { #ifdef _MSC_VER int retval = WSAGetLastError(); if( (retval == WSANO_DATA) || (retval == WSANO_RECOVERY) ) { return WSAEPROTONOSUPPORT; } else { return (retval - 5000); } #else return WSAEPROTONOSUPPORT; #endif } } return 0; } //--------------------------------------------------------------------------- /// @bug gethostbyname is not reenterant int SMTP:: ResolveHostname(const char* hostname, struct sockaddr_in *sa_in) { struct hostent *hostentry = NULL; unsigned long ip_address; if( (ip_address = inet_addr(hostname)) != INADDR_NONE ) { sa_in->sin_addr.s_addr = ip_address; } else { if( (hostentry = gethostbyname(hostname)) == NULL ) { return WSAHOST_NOT_FOUND; } sa_in->sin_addr.s_addr = *(long *)hostentry->h_addr; } return 0; } //--------------------------------------------------------------------------- int SMTP:: GetAndSetTheSocket(SOCKET *the_socket) { if( INVALID_SOCKET == (*the_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP/* 0, */)) ) { return WSAESOCKTNOSUPPORT; } // To enable SO_DONTLINGER (that is, disable SO_LINGER) // l_onoff should be set to zero and setsockopt should be called linger dont_linger={0,0}; setsockopt(*the_socket, SOL_SOCKET, SO_LINGER, (const char *)&dont_linger, sizeof(dont_linger)); return 0; } //--------------------------------------------------------------------------- int SMTP:: GetConnection(SOCKET the_socket, struct sockaddr_in *sa_in) { if( connect(the_socket, (struct sockaddr *)sa_in, sizeof(struct sockaddr_in))<0 ) { int retval = 0; switch( (retval = WSAGetLastError()) ) { case WSAEWOULDBLOCK: break; case WSAECONNREFUSED: return WSAECONNREFUSED; default: //wsprintf(message, "unexpected error %d from winsock\n", retval); //ShowError(message); return WSAHOST_NOT_FOUND; } } return 0; } //--------------------------------------------------------------------------- void SMTP:: MiscSocketSetup(SOCKET soc, fd_set *fds, struct timeval *timeout) { #ifdef _MSC_VER unsigned long ioctl_blocking = 1; ioctlsocket(soc, FIONBIO, &ioctl_blocking); #endif FD_ZERO(fds); FD_SET(soc, fds); timeout->tv_sec = 30; timeout->tv_usec = 0; } //--------------------------------------------------------------------------- parser-3.5.1/src/lib/smtp/smtp.h0000644000076400007640000000747014712042465013436 00000000000000/** @file Parser: SMTP sender decl. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #define IDENT_SMTP_H "$Id: smtp.h,v 1.17 2024/11/04 03:53:25 moko Exp $" #include "pa_string.h" #ifdef _MSC_VER #include #else //_MSC_VER typedef char CHAR; typedef u_int SOCKET; #define closesocket close inline int WSAGetLastError() { return errno; } #ifdef EPROTONOSUPPORT # define WSAEPROTONOSUPPORT EPROTONOSUPPORT #else # define WSAEPROTONOSUPPORT (10000) #endif #ifdef ESOCKTNOSUPPORT # define WSAESOCKTNOSUPPORT ESOCKTNOSUPPORT #else # define WSAESOCKTNOSUPPORT (10001) #endif #ifdef ENOTCONN # define WSAENOTCONN ENOTCONN #else # define WSAENOTCONN (10002) #endif #ifdef ESHUTDOWN # define WSAENETDOWN ESHUTDOWN #else # define WSAENETDOWN (10003) #endif #ifdef EHOSTUNREACH # define WSAENETUNREACH EHOSTUNREACH #else # define WSAENETUNREACH (10004) #endif #ifdef ENETRESET # define WSAENETRESET ENETRESET #else # define WSAENETRESET (10005) #endif #ifdef ECONNABORTED # define WSAECONNABORTED ECONNABORTED #else # define WSAECONNABORTED (10006) #endif #ifdef ECONNRESET # define WSAECONNRESET ECONNRESET #else # define WSAECONNRESET (10007) #endif #ifdef EWOULDBLOCK # define WSAEWOULDBLOCK EWOULDBLOCK #else # define WSAEWOULDBLOCK (10008) #endif #ifdef ECONNREFUSED # define WSAECONNREFUSED ECONNREFUSED #else # define WSAECONNREFUSED (10009) #endif #define WSAHOST_NOT_FOUND (10010) #ifndef INADDR_NONE # define INADDR_NONE ((unsigned long) -1) #endif #ifndef INVALID_SOCKET # define INVALID_SOCKET (SOCKET)(~0) #endif #endif //_MSC_VER ////////////////////////////////////////////////////////////////////////////// #define SOCKET_BUFFER_SIZE 512 #define ERR_SENDING_DATA 4002 #define ERR_NOT_A_SOCKET 4010 #define ERR_CLOSING 4012 #define WAIT_A_BIT 4013 /// must be >=SOCKET_BUFFER_SIZE, thanks to Lev Walkin for pointing that out #define MAXOUTLINE (SOCKET_BUFFER_SIZE*2) ////////////////////////////////////////////////////////////////////////////// /// SIMPLE MAIL TRANSPORT PROTOCOL Win32 realization class SMTP: public PA_Object { char *in_buffer; char *out_buffer; unsigned int in_index; unsigned int out_index; unsigned int in_buffer_total; unsigned int out_buffer_total; unsigned int last_winsock_error; fd_set fds; struct timeval timeout; SOCKET the_socket; char my_hostname[1024]; CHAR ServerProtocol[100]; CHAR RemoteAddress[100]; CHAR RemoteHost[100]; CHAR RemoteUser[100]; CHAR HttpAccept[100]; CHAR HttpUserAgent[256]; CHAR FirstName[100]; CHAR LastName[100]; CHAR WebUse[100]; CHAR EMail[100]; CHAR HomePage[100]; CHAR text[500]; public: SMTP(); override ~SMTP(); // smtp.C void Send(const char* , const char* , const char* , char *, char *); bool MakeSmtpHeader(char *, char *, char *, char *); void prepare_message(char *, char *, const char* , const char* ); void open_socket(const char* , const char* ); int get_line(void); void SendSmtpError(const char* ); void transform_and_send_edit_data(const char* ); void send_data(const char* ); void ConnectToHost(const char* , const char* ); int GetBuffer(int); int GetChar(int, char *); void SendLine(const char* , unsigned long); void SendBuffer(const char* , unsigned long); void FlushBuffer(); bool CloseConnect(); // comms.C int IsAddressARawIpaddress(const char* ); int ResolveService(const char* , u_short *); int ResolveHostname(const char* , struct sockaddr_in *); int GetAndSetTheSocket(SOCKET *); int GetConnection(SOCKET, struct sockaddr_in *); void MiscSocketSetup(SOCKET, fd_set *, struct timeval *); }; parser-3.5.1/src/lib/smtp/Makefile.am0000644000076400007640000000016713211622356014326 00000000000000noinst_HEADERS = smtp.h noinst_LTLIBRARIES = libsmtp.la libsmtp_la_SOURCES = comms.C smtp.C EXTRA_DIST = smtp.vcproj parser-3.5.1/src/lib/smtp/smtp.C0000644000076400007640000002703214712042465013365 00000000000000/** @file Parser: SMTP sender. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian Parts of the code here is based upon an early gensock and blat */ #include "pa_exception.h" #include "smtp.h" volatile const char * IDENT_SMTP_C="$Id: smtp.C,v 1.17 2024/11/04 03:53:25 moko Exp $" IDENT_SMTP_H; // pa_common.C #undef snprintf extern int pa_snprintf(char *, size_t, const char* , ...); #define snprintf pa_snprintf //#define DEBUG_SHOW SMTP::SMTP() { the_socket = 0; in_index = 0; out_index = 0; in_buffer = 0; in_buffer_total = 0; out_buffer_total = 0; in_buffer = (char *)pa_malloc(SOCKET_BUFFER_SIZE); out_buffer = (char *)pa_malloc(SOCKET_BUFFER_SIZE); last_winsock_error = 0; } SMTP::~SMTP() { pa_free(in_buffer); pa_free(out_buffer); } // --------------------------------------------------------------------------- void SMTP:: ConnectToHost(const char* hostname, const char* service) { struct sockaddr_in sa_in; memset(&sa_in, 0, sizeof(sa_in)); u_short our_port; if( !ResolveService(service, &our_port) ) { if( !ResolveHostname(hostname, &sa_in) ) { sa_in.sin_family = AF_INET; sa_in.sin_port = (unsigned short)our_port; if( !GetAndSetTheSocket(&the_socket) ) { if( !GetConnection(the_socket, &sa_in) ) { MiscSocketSetup(the_socket, &fds, &timeout); return; } } } } CloseConnect(); throw Exception("smtp.connect", 0, "connect to %s:%s failed", hostname, service); } //--------------------------------------------------------------------------- // returns 0 if all is OK int SMTP:: GetBuffer(int wait) { int retval; int bytes_read = 0; // Use select to see if data is waiting... FD_ZERO(&fds); FD_SET(the_socket, &fds); // if wait is set, we are polling, return immediately if( wait ) { timeout.tv_sec = 0; } else { timeout.tv_sec = 30; } if( (retval = select(1+the_socket, &fds, NULL, NULL, &timeout))<0 ) { #ifdef _MSC_VER int error_code = WSAGetLastError(); if( error_code == WSAEINPROGRESS && wait ) { return WAIT_A_BIT; } #else if( errno == EAGAIN && wait ) return WAIT_A_BIT; #endif } // if we don't want to wait if( !retval && wait ) { return WAIT_A_BIT; } // we have data waiting... bytes_read = recv(the_socket, in_buffer, SOCKET_BUFFER_SIZE, 0); // just in case. if( 0 == bytes_read ) { // connection terminated (semi-) gracefully by the other side return WSAENOTCONN; } if( bytes_read <0 ) { //char what_error[256]; int ws_error = WSAGetLastError(); switch( ws_error ) { // all these indicate loss of connection (are there more?) case WSAENOTCONN: case WSAENETDOWN: case WSAENETUNREACH: case WSAENETRESET: case WSAECONNABORTED: case WSAECONNRESET: return WSAENOTCONN; case WSAEWOULDBLOCK: return WAIT_A_BIT; default: /*wsprintf(what_error, "GetBuffer() unexpected error: %d", ws_error); ShowError(what_error); */ break; } } // reset buffer indices. in_buffer_total = bytes_read; in_index = 0; return 0; } //--------------------------------------------------------------------------- // returns 0 if all is OK int SMTP:: GetChar(int wait, char *ch) { int retval = 0; if( in_index >= in_buffer_total ) { if( 0 != (retval = GetBuffer(wait)) ) return retval; } *ch = in_buffer[in_index++]; return 0; } //---------------------------------------------------------------------- int SMTP:: get_line( void ) { char ch = '.'; char in_data[MAXOUTLINE]; char *index; index = in_data; while( ch != '\n' ) { if( 0 != GetChar(0, &ch) ) { return -1; } else { *index = ch; index++; } } if( in_data[3] == '-' ) return get_line(); else { char *error_pos; return strtol(in_data, &error_pos, 0); } } //--------------------------------------------------------------------------- // returns 0 if all is OK void SMTP:: SendLine(const char* data, unsigned long length) { int num_sent; FD_ZERO(&fds); FD_SET(the_socket, &fds); timeout.tv_sec = 30; while( length > 0 ) { if( select(1+the_socket, NULL, &fds, NULL, &timeout)<0 ) throw Exception("smtp.execute", 0, "connection::put_data() unexpected error from select: %d", WSAGetLastError()); num_sent = send(the_socket, data, length > 1024 ? 1024 : (int)length, 0); if( num_sent<0 ) { int ws_error = WSAGetLastError(); switch( ws_error ) { // this is the only error we really expect to see. case WSAENOTCONN: return; // seems that we can still get a block case WSAEWOULDBLOCK: break; default: throw Exception("smtp.execute", 0, "connection::put_data() unexpected error from send(): %d", ws_error); } } else { length -= num_sent; data += num_sent; } } } //--------------------------------------------------------------------------- // returns 0 if all is OK void SMTP:: SendBuffer(const char* data, unsigned long length) { while( length ) { if( (out_index + length) < SOCKET_BUFFER_SIZE ) { // we won't overflow, simply copy into the buffer memcpy(out_buffer + out_index, data, length); out_index += length; length = 0; } else { unsigned int orphaned_chunk = SOCKET_BUFFER_SIZE - out_index; // we will overflow, handle it memcpy(out_buffer + out_index, data, orphaned_chunk); // send this buffer... SendLine(out_buffer, SOCKET_BUFFER_SIZE); length -= orphaned_chunk; out_index = 0; data += orphaned_chunk; } } } //--------------------------------------------------------------------------- // returns 0 if all is OK void SMTP:: FlushBuffer() { SendLine(out_buffer, out_index); out_index = 0; } //--------------------------------------------------------------------------- bool SMTP:: CloseConnect() { if( closesocket(the_socket) <0 ) return false; return true; } //---------------------------------------------------------------------- void SMTP:: SendSmtpError(const char* message) { SendLine("QUIT\r\n", 6); CloseConnect(); throw Exception("smtp.execute", 0, "failed: %s", message); } //---------------------------------------------------------------------- // returns 0 if all is OK // returns 20, 21, 22, 23, 24, 25 if SendBuffer() fails // returns 26 if FlushBuffer() fails void SMTP:: transform_and_send_edit_data(const char* editptr ) { const char *index; char previous_char = 'x'; unsigned int send_len; bool done = false; send_len = strlen(editptr); index = editptr; while( !done ) { // room for extra char for double dot on end case while( (unsigned int)(index - editptr) < send_len ) { switch( *index ) { case '.': if( previous_char == '\n' ) SendBuffer(index, 1); // send _two_ dots... SendBuffer(index, 1); break; case '\n': // x\n -> \r\n if( previous_char != '\r' ) { SendBuffer("\r", 1); SendBuffer(index, 1); } break; default: SendBuffer(index, 1); break; } previous_char = *index; index++; } if( (unsigned int)(index - editptr) == send_len ) done = true; } // this handles the case where the user doesn't end the last // line with a if( editptr[send_len-1] != '\n' ) SendBuffer("\r\n.\r\n", 5); else SendBuffer(".\r\n", 3); /* now make sure it's all sent... */ FlushBuffer(); } //---------------------------------------------------------------------- // returns 0 if all is OK // returns 16 if any get_line()'s fail // returns 20, 21, 22, 23, 24, 25, 26 if transform_and_send_edit_data() fails void SMTP:: send_data(const char* message) { transform_and_send_edit_data(message); if( 250 != get_line() ) SendSmtpError("Message not accepted by server"); } //---------------------------------------------------------------------- // returns 0 if all is OK // returns 50, 51, 52 if fails void SMTP:: open_socket( const char* server, const char* service ) { ConnectToHost(server, service); if( gethostname(my_hostname, sizeof(my_hostname)) ) throw Exception("smtp.connect", 0, "lookup of '%s' failed", my_hostname); } //---------------------------------------------------------------------- // returns 0 if all is OK // returns 50, 51, 52 if open_socket() fails // returns 10, 11, 12, 13, 14, 15 if any get_line()'s fail void SMTP:: prepare_message(char *from, char *to, const char* server, const char* service) { char out_data[MAXOUTLINE]; char *ptr; int len; int startLen; open_socket(server, service); if( 220 != get_line() ) SendSmtpError("SMTP server error"); snprintf(out_data, sizeof(out_data), "HELO %s\r\n", my_hostname ); SendLine(out_data, strlen(out_data) ); if( 250 != get_line() ) SendSmtpError("SMTP server error"); snprintf(out_data, sizeof(out_data), "MAIL From: <%s>\r\n", from); SendLine(out_data, strlen(out_data) ); if( 250 != get_line() ) SendSmtpError("The mail server doesn't like the sender name, have you set your mail address correctly?"); // do a series of RCPT lines for each name in address line for( ptr = to; *ptr; ptr += len + 1 ) { // if there's only one token left, then len will = startLen, // and we'll iterate once only startLen = strlen(ptr); if( (len = strcspn(ptr, " ,\n\t\r")) != startLen ) { ptr[len] = '\0'; // replace delim with NULL char while( strchr (" ,\n\t\r", ptr[len+1]) ) // eat white space ptr[len++] = '\0'; } snprintf(out_data, sizeof(out_data), "RCPT To: <%s>\r\n", ptr); SendLine(out_data, strlen(out_data) ); if( 250 != get_line() ) throw Exception("smtp.execute", 0, "The mail server doesn't like the name %s. Have you set the 'To: ' field correctly?", ptr); if( len == startLen ) // last token, we're done break; } snprintf(out_data, sizeof(out_data), "DATA\r\n"); SendLine(out_data, strlen(out_data)); if( 354 != get_line() ) SendSmtpError("Mail server error accepting message data"); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // returns 0 if all is OK // returns 1 if MakeSmtpHeader() fails // returns 10, 11, 12, 13, 14, 15, 50, 51, 52 if prepare_message() fails void SMTP:: Send(const char* server, const char* service, const char* msg, char *from, char *to) { #ifdef DEBUG_SHOW throw Exception("paf.debug",0,"from=%s|to=%s|msg=%s", from,to,msg); #endif prepare_message( from, to, server, service); send_data(msg); SendLine("QUIT\r\n", 6 ); CloseConnect(); } parser-3.5.1/src/lib/ltdl/0000755000076400007640000000000014740300546012324 500000000000000parser-3.5.1/src/lib/ltdl/config-h.in0000644000076400007640000001124011764646175014302 00000000000000/* config-h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `argz_add' function. */ #undef HAVE_ARGZ_ADD /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the `argz_create_sep' function. */ #undef HAVE_ARGZ_CREATE_SEP /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_insert' function. */ #undef HAVE_ARGZ_INSERT /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if you don't. */ #undef HAVE_DECL_CYGWIN_CONV_PATH /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the header file. */ #undef HAVE_DLD_H /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if libdlloader will be built on this platform */ #undef HAVE_LIBDLLOADER /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* 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 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 `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_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_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* This value is set to 1 to indicate that the system argz facility works */ #undef HAVE_WORKING_ARGZ /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the system default library search path. */ #undef LT_DLSEARCH_PATH /* The archive extension */ #undef LT_LIBEXT /* The archive prefix */ #undef LT_LIBPREFIX /* Define to the extension used for runtime loadable modules, say, ".so". */ #undef LT_MODULE_EXT /* Define to the name of the environment variable that determines the run-time module search path. */ #undef LT_MODULE_PATH_VAR /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to the shared library suffix, say, ".dylib". */ #undef LT_SHARED_EXT /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define so that glibc/gnulib argp.h does not typedef error_t. */ #undef __error_t_defined /* Define to a type to use for `error_t' if it is not otherwise available. */ #undef error_t parser-3.5.1/src/lib/ltdl/ltdl.h0000644000076400007640000001312511764645177013375 00000000000000/* ltdl.h -- generic dlopen functions Copyright (C) 1998-2000, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Only include this header file once. */ #if !defined(LTDL_H) #define LTDL_H 1 #include #include #include LT_BEGIN_C_DECLS /* LT_STRLEN can be used safely on NULL pointers. */ #define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) /* --- DYNAMIC MODULE LOADING API --- */ typedef struct lt__handle *lt_dlhandle; /* A loaded module. */ /* Initialisation and finalisation functions for libltdl. */ LT_SCOPE int lt_dlinit (void); LT_SCOPE int lt_dlexit (void); /* Module search path manipulation. */ LT_SCOPE int lt_dladdsearchdir (const char *search_dir); LT_SCOPE int lt_dlinsertsearchdir (const char *before, const char *search_dir); LT_SCOPE int lt_dlsetsearchpath (const char *search_path); LT_SCOPE const char *lt_dlgetsearchpath (void); LT_SCOPE int lt_dlforeachfile ( const char *search_path, int (*func) (const char *filename, void *data), void *data); /* User module loading advisors. */ LT_SCOPE int lt_dladvise_init (lt_dladvise *advise); LT_SCOPE int lt_dladvise_destroy (lt_dladvise *advise); LT_SCOPE int lt_dladvise_ext (lt_dladvise *advise); LT_SCOPE int lt_dladvise_resident (lt_dladvise *advise); LT_SCOPE int lt_dladvise_local (lt_dladvise *advise); LT_SCOPE int lt_dladvise_global (lt_dladvise *advise); LT_SCOPE int lt_dladvise_preload (lt_dladvise *advise); /* Portable libltdl versions of the system dlopen() API. */ LT_SCOPE lt_dlhandle lt_dlopen (const char *filename); LT_SCOPE lt_dlhandle lt_dlopenext (const char *filename); LT_SCOPE lt_dlhandle lt_dlopenadvise (const char *filename, lt_dladvise advise); LT_SCOPE void * lt_dlsym (lt_dlhandle handle, const char *name); LT_SCOPE const char *lt_dlerror (void); LT_SCOPE int lt_dlclose (lt_dlhandle handle); /* --- PRELOADED MODULE SUPPORT --- */ /* A preopened symbol. Arrays of this type comprise the exported symbols for a dlpreopened module. */ typedef struct { const char *name; void *address; } lt_dlsymlist; typedef int lt_dlpreload_callback_func (lt_dlhandle handle); LT_SCOPE int lt_dlpreload (const lt_dlsymlist *preloaded); LT_SCOPE int lt_dlpreload_default (const lt_dlsymlist *preloaded); LT_SCOPE int lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func); #define lt_preloaded_symbols lt__PROGRAM__LTX_preloaded_symbols /* Ensure C linkage. */ extern LT_DLSYM_CONST lt_dlsymlist lt__PROGRAM__LTX_preloaded_symbols[]; #define LTDL_SET_PRELOADED_SYMBOLS() \ lt_dlpreload_default(lt_preloaded_symbols) /* --- MODULE INFORMATION --- */ /* Associating user data with loaded modules. */ typedef void * lt_dlinterface_id; typedef int lt_dlhandle_interface (lt_dlhandle handle, const char *id_string); LT_SCOPE lt_dlinterface_id lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface); LT_SCOPE void lt_dlinterface_free (lt_dlinterface_id key); LT_SCOPE void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data); LT_SCOPE void * lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle); /* Read only information pertaining to a loaded module. */ typedef struct { char * filename; /* file name */ char * name; /* module name */ int ref_count; /* number of times lt_dlopened minus number of times lt_dlclosed. */ unsigned int is_resident:1; /* module can't be unloaded. */ unsigned int is_symglobal:1; /* module symbols can satisfy subsequently loaded modules. */ unsigned int is_symlocal:1; /* module symbols are only available locally. */ } lt_dlinfo; LT_SCOPE const lt_dlinfo *lt_dlgetinfo (lt_dlhandle handle); LT_SCOPE lt_dlhandle lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place); LT_SCOPE lt_dlhandle lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name); LT_SCOPE int lt_dlhandle_map (lt_dlinterface_id iface, int (*func) (lt_dlhandle handle, void *data), void *data); /* Deprecated module residency management API. */ LT_SCOPE int lt_dlmakeresident (lt_dlhandle handle); LT_SCOPE int lt_dlisresident (lt_dlhandle handle); #define lt_ptr void * LT_END_C_DECLS #endif /*!defined(LTDL_H)*/ parser-3.5.1/src/lib/ltdl/lt__strl.c0000644000076400007640000000702611764645176014255 00000000000000/* lt__strl.c -- size-bounded string copying and concatenation Copyright (C) 2004 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "lt__strl.h" /* lt_strlcat appends the NULL-terminated string src to the end of dst. It will append at most dstsize - strlen(dst) - 1 bytes, NULL-terminating the result. The total length of the string which would have been created given sufficient buffer size (may be longer than dstsize) is returned. This function substitutes for strlcat() which is available under NetBSD, FreeBSD and Solaris 9. Buffer overflow can be checked as follows: if (lt_strlcat(dst, src, dstsize) >= dstsize) return -1; */ #if !defined(HAVE_STRLCAT) size_t lt_strlcat(char *dst, const char *src, const size_t dstsize) { size_t length; char *p; const char *q; assert(dst != NULL); assert(src != (const char *) NULL); assert(dstsize >= 1); length=strlen(dst); /* Copy remaining characters from src while constraining length to size - 1. */ for ( p = dst + length, q = src; (*q != 0) && (length < dstsize - 1) ; length++, p++, q++ ) *p = *q; dst[length]='\0'; /* Add remaining length of src to length. */ while (*q++) length++; return length; } #endif /* !defined(HAVE_STRLCAT) */ /* lt_strlcpy copies up to dstsize - 1 characters from the NULL-terminated string src to dst, NULL-terminating the result. The total length of the string which would have been created given sufficient buffer size (may be longer than dstsize) is returned. This function substitutes for strlcpy() which is available under OpenBSD, FreeBSD and Solaris 9. Buffer overflow can be checked as follows: if (lt_strlcpy(dst, src, dstsize) >= dstsize) return -1; */ #if !defined(HAVE_STRLCPY) size_t lt_strlcpy(char *dst, const char *src, const size_t dstsize) { size_t length=0; char *p; const char *q; assert(dst != NULL); assert(src != (const char *) NULL); assert(dstsize >= 1); /* Copy src to dst within bounds of size-1. */ for ( p=dst, q=src, length=0 ; (*q != 0) && (length < dstsize-1) ; length++, p++, q++ ) *p = *q; dst[length]='\0'; /* Add remaining length of src to length. */ while (*q++) length++; return length; } #endif /* !defined(HAVE_STRLCPY) */ parser-3.5.1/src/lib/ltdl/Makefile.in0000644000076400007640000014320013027250523014305 00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ ##### VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_LTDL_TRUE@am__append_1 = ltdl.h @INSTALL_LTDL_TRUE@am__append_2 = libltdl.la @CONVENIENCE_LTDL_TRUE@am__append_3 = libltdlc.la subdir = . DIST_COMMON = README $(am__configure_deps) $(am__include_HEADERS_DIST) \ $(am__ltdlinclude_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config-h.in \ $(top_srcdir)/configure COPYING.LIB argz.c config/compile \ config/config.guess config/config.sub config/depcomp \ config/install-sh config/ltmain.sh \ config/missing lt__dirent.c lt__strl.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/argz.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltdl.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" \ "$(DESTDIR)$(ltdlincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) dld_link_la_DEPENDENCIES = am_dld_link_la_OBJECTS = dld_link.lo dld_link_la_OBJECTS = $(am_dld_link_la_OBJECTS) dld_link_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dld_link_la_LDFLAGS) $(LDFLAGS) -o $@ am__DEPENDENCIES_1 = dlopen_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_dlopen_la_OBJECTS = dlopen.lo dlopen_la_OBJECTS = $(am_dlopen_la_OBJECTS) dlopen_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dlopen_la_LDFLAGS) $(LDFLAGS) -o $@ dyld_la_LIBADD = am_dyld_la_OBJECTS = dyld.lo dyld_la_OBJECTS = $(am_dyld_la_OBJECTS) dyld_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(dyld_la_LDFLAGS) \ $(LDFLAGS) -o $@ am_libltdl_la_OBJECTS = libltdl_la-preopen.lo libltdl_la-lt__alloc.lo \ libltdl_la-lt_dlloader.lo libltdl_la-lt_error.lo \ libltdl_la-ltdl.lo libltdl_la-slist.lo libltdl_la_OBJECTS = $(am_libltdl_la_OBJECTS) libltdl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libltdl_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_LTDL_TRUE@am_libltdl_la_rpath = -rpath $(libdir) am__objects_1 = libltdlc_la-preopen.lo libltdlc_la-lt__alloc.lo \ libltdlc_la-lt_dlloader.lo libltdlc_la-lt_error.lo \ libltdlc_la-ltdl.lo libltdlc_la-slist.lo am_libltdlc_la_OBJECTS = $(am__objects_1) libltdlc_la_OBJECTS = $(am_libltdlc_la_OBJECTS) libltdlc_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libltdlc_la_LDFLAGS) $(LDFLAGS) -o $@ @CONVENIENCE_LTDL_TRUE@am_libltdlc_la_rpath = load_add_on_la_LIBADD = am_load_add_on_la_OBJECTS = load_add_on.lo load_add_on_la_OBJECTS = $(am_load_add_on_la_OBJECTS) load_add_on_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(load_add_on_la_LDFLAGS) $(LDFLAGS) -o $@ loadlibrary_la_LIBADD = am_loadlibrary_la_OBJECTS = loadlibrary.lo loadlibrary_la_OBJECTS = $(am_loadlibrary_la_OBJECTS) loadlibrary_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(loadlibrary_la_LDFLAGS) $(LDFLAGS) -o $@ shl_load_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_shl_load_la_OBJECTS = shl_load.lo shl_load_la_OBJECTS = $(am_shl_load_la_OBJECTS) shl_load_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(shl_load_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \ $(dyld_la_SOURCES) $(libltdl_la_SOURCES) \ $(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \ $(loadlibrary_la_SOURCES) $(shl_load_la_SOURCES) DIST_SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \ $(dyld_la_SOURCES) $(libltdl_la_SOURCES) \ $(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \ $(loadlibrary_la_SOURCES) $(shl_load_la_SOURCES) am__include_HEADERS_DIST = ltdl.h am__ltdlinclude_HEADERS_DIST = libltdl/lt_system.h libltdl/lt_error.h \ libltdl/lt_dlloader.h HEADERS = $(include_HEADERS) $(ltdlinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign # -I$(srcdir) is needed for user that built libltdl with a sub-Automake # (not as a sub-package!) using 'nostdinc': AM_CPPFLAGS = -DLT_CONFIG_H='<$(LT_CONFIG_H)>' -DLTDL -I. -I$(srcdir) \ -Ilibltdl -I$(srcdir)/libltdl -I$(srcdir)/libltdl AM_LDFLAGS = -no-undefined BUILT_SOURCES = $(ARGZ_H) include_HEADERS = $(am__append_1) noinst_LTLIBRARIES = $(LT_DLLOADERS) $(am__append_3) lib_LTLIBRARIES = $(am__append_2) EXTRA_LTLIBRARIES = dlopen.la dld_link.la dyld.la load_add_on.la \ loadlibrary.la shl_load.la EXTRA_DIST = config_fixed.h ltdl.vcproj lt__dirent.c lt__strl.c \ COPYING.LIB configure.ac Makefile.am aclocal.m4 Makefile.in \ configure config-h.in README argz_.h argz.c CLEANFILES = libltdl.la libltdlc.la libdlloader.la $(LIBOBJS) \ $(LTLIBOBJS) MOSTLYCLEANFILES = argz.h argz.h-t LTDL_VERSION_INFO = -version-info 10:0:3 @INSTALL_LTDL_TRUE@ltdlincludedir = $(includedir)/libltdl @INSTALL_LTDL_TRUE@ltdlinclude_HEADERS = libltdl/lt_system.h \ @INSTALL_LTDL_TRUE@ libltdl/lt_error.h \ @INSTALL_LTDL_TRUE@ libltdl/lt_dlloader.h libltdl_la_SOURCES = libltdl/lt__alloc.h \ libltdl/lt__dirent.h \ libltdl/lt__glibc.h \ libltdl/lt__private.h \ libltdl/lt__strl.h \ libltdl/lt_dlloader.h \ libltdl/lt_error.h \ libltdl/lt_system.h \ libltdl/slist.h \ loaders/preopen.c \ lt__alloc.c \ lt_dlloader.c \ lt_error.c \ ltdl.c \ ltdl.h \ slist.c libltdl_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS) libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN) libltdl_la_LIBADD = $(LTLIBOBJS) libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(LTLIBOBJS) libltdlc_la_SOURCES = $(libltdl_la_SOURCES) libltdlc_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS) libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN) libltdlc_la_LIBADD = $(libltdl_la_LIBADD) libltdlc_la_DEPENDENCIES = $(libltdl_la_DEPENDENCIES) dlopen_la_SOURCES = loaders/dlopen.c dlopen_la_LDFLAGS = -module -avoid-version dlopen_la_LIBADD = $(LIBADD_DLOPEN) dld_link_la_SOURCES = loaders/dld_link.c dld_link_la_LDFLAGS = -module -avoid-version dld_link_la_LIBADD = -ldld dyld_la_SOURCES = loaders/dyld.c dyld_la_LDFLAGS = -module -avoid-version load_add_on_la_SOURCES = loaders/load_add_on.c load_add_on_la_LDFLAGS = -module -avoid-version loadlibrary_la_SOURCES = loaders/loadlibrary.c loadlibrary_la_LDFLAGS = -module -avoid-version shl_load_la_SOURCES = loaders/shl_load.c shl_load_la_LDFLAGS = -module -avoid-version shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config-h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config-h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done dld_link.la: $(dld_link_la_OBJECTS) $(dld_link_la_DEPENDENCIES) $(dld_link_la_LINK) $(dld_link_la_OBJECTS) $(dld_link_la_LIBADD) $(LIBS) dlopen.la: $(dlopen_la_OBJECTS) $(dlopen_la_DEPENDENCIES) $(dlopen_la_LINK) $(dlopen_la_OBJECTS) $(dlopen_la_LIBADD) $(LIBS) dyld.la: $(dyld_la_OBJECTS) $(dyld_la_DEPENDENCIES) $(dyld_la_LINK) $(dyld_la_OBJECTS) $(dyld_la_LIBADD) $(LIBS) libltdl.la: $(libltdl_la_OBJECTS) $(libltdl_la_DEPENDENCIES) $(libltdl_la_LINK) $(am_libltdl_la_rpath) $(libltdl_la_OBJECTS) $(libltdl_la_LIBADD) $(LIBS) libltdlc.la: $(libltdlc_la_OBJECTS) $(libltdlc_la_DEPENDENCIES) $(libltdlc_la_LINK) $(am_libltdlc_la_rpath) $(libltdlc_la_OBJECTS) $(libltdlc_la_LIBADD) $(LIBS) load_add_on.la: $(load_add_on_la_OBJECTS) $(load_add_on_la_DEPENDENCIES) $(load_add_on_la_LINK) $(load_add_on_la_OBJECTS) $(load_add_on_la_LIBADD) $(LIBS) loadlibrary.la: $(loadlibrary_la_OBJECTS) $(loadlibrary_la_DEPENDENCIES) $(loadlibrary_la_LINK) $(loadlibrary_la_OBJECTS) $(loadlibrary_la_LIBADD) $(LIBS) shl_load.la: $(shl_load_la_OBJECTS) $(shl_load_la_DEPENDENCIES) $(shl_load_la_LINK) $(shl_load_la_OBJECTS) $(shl_load_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/argz.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lt__dirent.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lt__strl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dld_link.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dlopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dyld.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt__alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt_dlloader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt_error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-ltdl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-preopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-slist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt__alloc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt_dlloader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt_error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-ltdl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-preopen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-slist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_add_on.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadlibrary.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shl_load.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< dld_link.lo: loaders/dld_link.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dld_link.lo -MD -MP -MF $(DEPDIR)/dld_link.Tpo -c -o dld_link.lo `test -f 'loaders/dld_link.c' || echo '$(srcdir)/'`loaders/dld_link.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dld_link.Tpo $(DEPDIR)/dld_link.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/dld_link.c' object='dld_link.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dld_link.lo `test -f 'loaders/dld_link.c' || echo '$(srcdir)/'`loaders/dld_link.c dlopen.lo: loaders/dlopen.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dlopen.lo -MD -MP -MF $(DEPDIR)/dlopen.Tpo -c -o dlopen.lo `test -f 'loaders/dlopen.c' || echo '$(srcdir)/'`loaders/dlopen.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dlopen.Tpo $(DEPDIR)/dlopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/dlopen.c' object='dlopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dlopen.lo `test -f 'loaders/dlopen.c' || echo '$(srcdir)/'`loaders/dlopen.c dyld.lo: loaders/dyld.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dyld.lo -MD -MP -MF $(DEPDIR)/dyld.Tpo -c -o dyld.lo `test -f 'loaders/dyld.c' || echo '$(srcdir)/'`loaders/dyld.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/dyld.Tpo $(DEPDIR)/dyld.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/dyld.c' object='dyld.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dyld.lo `test -f 'loaders/dyld.c' || echo '$(srcdir)/'`loaders/dyld.c libltdl_la-preopen.lo: loaders/preopen.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-preopen.lo -MD -MP -MF $(DEPDIR)/libltdl_la-preopen.Tpo -c -o libltdl_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-preopen.Tpo $(DEPDIR)/libltdl_la-preopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/preopen.c' object='libltdl_la-preopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c libltdl_la-lt__alloc.lo: lt__alloc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt__alloc.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt__alloc.Tpo -c -o libltdl_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-lt__alloc.Tpo $(DEPDIR)/libltdl_la-lt__alloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt__alloc.c' object='libltdl_la-lt__alloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c libltdl_la-lt_dlloader.lo: lt_dlloader.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt_dlloader.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt_dlloader.Tpo -c -o libltdl_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-lt_dlloader.Tpo $(DEPDIR)/libltdl_la-lt_dlloader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_dlloader.c' object='libltdl_la-lt_dlloader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c libltdl_la-lt_error.lo: lt_error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt_error.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt_error.Tpo -c -o libltdl_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-lt_error.Tpo $(DEPDIR)/libltdl_la-lt_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_error.c' object='libltdl_la-lt_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c libltdl_la-ltdl.lo: ltdl.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-ltdl.lo -MD -MP -MF $(DEPDIR)/libltdl_la-ltdl.Tpo -c -o libltdl_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-ltdl.Tpo $(DEPDIR)/libltdl_la-ltdl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ltdl.c' object='libltdl_la-ltdl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c libltdl_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-slist.lo -MD -MP -MF $(DEPDIR)/libltdl_la-slist.Tpo -c -o libltdl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdl_la-slist.Tpo $(DEPDIR)/libltdl_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slist.c' object='libltdl_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c libltdlc_la-preopen.lo: loaders/preopen.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-preopen.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-preopen.Tpo -c -o libltdlc_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-preopen.Tpo $(DEPDIR)/libltdlc_la-preopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/preopen.c' object='libltdlc_la-preopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c libltdlc_la-lt__alloc.lo: lt__alloc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt__alloc.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt__alloc.Tpo -c -o libltdlc_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-lt__alloc.Tpo $(DEPDIR)/libltdlc_la-lt__alloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt__alloc.c' object='libltdlc_la-lt__alloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c libltdlc_la-lt_dlloader.lo: lt_dlloader.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt_dlloader.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt_dlloader.Tpo -c -o libltdlc_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-lt_dlloader.Tpo $(DEPDIR)/libltdlc_la-lt_dlloader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_dlloader.c' object='libltdlc_la-lt_dlloader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c libltdlc_la-lt_error.lo: lt_error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt_error.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt_error.Tpo -c -o libltdlc_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-lt_error.Tpo $(DEPDIR)/libltdlc_la-lt_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lt_error.c' object='libltdlc_la-lt_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c libltdlc_la-ltdl.lo: ltdl.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-ltdl.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-ltdl.Tpo -c -o libltdlc_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-ltdl.Tpo $(DEPDIR)/libltdlc_la-ltdl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ltdl.c' object='libltdlc_la-ltdl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c libltdlc_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-slist.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-slist.Tpo -c -o libltdlc_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libltdlc_la-slist.Tpo $(DEPDIR)/libltdlc_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slist.c' object='libltdlc_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c load_add_on.lo: loaders/load_add_on.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT load_add_on.lo -MD -MP -MF $(DEPDIR)/load_add_on.Tpo -c -o load_add_on.lo `test -f 'loaders/load_add_on.c' || echo '$(srcdir)/'`loaders/load_add_on.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/load_add_on.Tpo $(DEPDIR)/load_add_on.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/load_add_on.c' object='load_add_on.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o load_add_on.lo `test -f 'loaders/load_add_on.c' || echo '$(srcdir)/'`loaders/load_add_on.c loadlibrary.lo: loaders/loadlibrary.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT loadlibrary.lo -MD -MP -MF $(DEPDIR)/loadlibrary.Tpo -c -o loadlibrary.lo `test -f 'loaders/loadlibrary.c' || echo '$(srcdir)/'`loaders/loadlibrary.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/loadlibrary.Tpo $(DEPDIR)/loadlibrary.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/loadlibrary.c' object='loadlibrary.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o loadlibrary.lo `test -f 'loaders/loadlibrary.c' || echo '$(srcdir)/'`loaders/loadlibrary.c shl_load.lo: loaders/shl_load.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shl_load.lo -MD -MP -MF $(DEPDIR)/shl_load.Tpo -c -o shl_load.lo `test -f 'loaders/shl_load.c' || echo '$(srcdir)/'`loaders/shl_load.c @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/shl_load.Tpo $(DEPDIR)/shl_load.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='loaders/shl_load.c' object='shl_load.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shl_load.lo `test -f 'loaders/shl_load.c' || echo '$(srcdir)/'`loaders/shl_load.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(includedir)" && rm -f $$files install-ltdlincludeHEADERS: $(ltdlinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(ltdlincludedir)" || $(MKDIR_P) "$(DESTDIR)$(ltdlincludedir)" @list='$(ltdlinclude_HEADERS)'; test -n "$(ltdlincludedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(ltdlincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(ltdlincludedir)" || exit $$?; \ done uninstall-ltdlincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(ltdlinclude_HEADERS)'; test -n "$(ltdlincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(ltdlincludedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(ltdlincludedir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(ltdlincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-ltdlincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf $(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-ltdlincludeHEADERS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES ctags dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am html html-am info \ info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-includeHEADERS \ install-info install-info-am install-libLTLIBRARIES \ install-ltdlincludeHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-ltdlincludeHEADERS # We need the following in order to create an when the system # doesn't have one that works with the given compiler. all-local $(lib_OBJECTS): $(ARGZ_H) argz.h: argz_.h $(mkinstalldirs) . cp $(srcdir)/argz_.h $@-t mv $@-t $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/ltdl/ltdl.vcproj0000644000076400007640000001175213622760245014442 00000000000000 parser-3.5.1/src/lib/ltdl/libltdl/0000755000076400007640000000000014740300546013752 500000000000000parser-3.5.1/src/lib/ltdl/libltdl/lt__glibc.h0000644000076400007640000000533511770443336015774 00000000000000/* lt__glibc.h -- support for non glibc environments Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__GLIBC_H) #define LT__GLIBC_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #if !defined(HAVE_ARGZ_H) || !defined(HAVE_WORKING_ARGZ) /* Redefine any glibc symbols we reimplement to import the implementations into our lt__ namespace so we don't ever clash with the system library if our clients use argz_* from there in addition to libltdl. */ # undef argz_append # define argz_append lt__argz_append # undef argz_create_sep # define argz_create_sep lt__argz_create_sep # undef argz_insert # define argz_insert lt__argz_insert # undef argz_next # define argz_next lt__argz_next # undef argz_stringify # define argz_stringify lt__argz_stringify #endif #ifdef __cplusplus extern "C" { #endif #ifdef HAVE_WORKING_ARGZ #include #else #include #endif #ifdef __cplusplus } #endif # define slist_concat lt__slist_concat # define slist_cons lt__slist_cons # define slist_delete lt__slist_delete # define slist_remove lt__slist_remove # define slist_reverse lt__slist_reverse # define slist_sort lt__slist_sort # define slist_tail lt__slist_tail # define slist_nth lt__slist_nth # define slist_find lt__slist_find # define slist_length lt__slist_length # define slist_foreach lt__slist_foreach # define slist_box lt__slist_box # define slist_unbox lt__slist_unbox #include #endif /*!defined(LT__GLIBC_H)*/ parser-3.5.1/src/lib/ltdl/libltdl/lt_error.h0000644000076400007640000000707211764645200015703 00000000000000/* lt_error.h -- error propogation interface Copyright (C) 1999, 2000, 2001, 2004, 2007 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Only include this header file once. */ #if !defined(LT_ERROR_H) #define LT_ERROR_H 1 #include LT_BEGIN_C_DECLS /* Defining error strings alongside their symbolic names in a macro in this way allows us to expand the macro in different contexts with confidence that the enumeration of symbolic names will map correctly onto the table of error strings. \0 is appended to the strings to expilicitely initialize the string terminator. */ #define lt_dlerror_table \ LT_ERROR(UNKNOWN, "unknown error\0") \ LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available\0") \ LT_ERROR(INVALID_LOADER, "invalid loader\0") \ LT_ERROR(INIT_LOADER, "loader initialization failed\0") \ LT_ERROR(REMOVE_LOADER, "loader removal failed\0") \ LT_ERROR(FILE_NOT_FOUND, "file not found\0") \ LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found\0") \ LT_ERROR(NO_SYMBOLS, "no symbols defined\0") \ LT_ERROR(CANNOT_OPEN, "can't open the module\0") \ LT_ERROR(CANNOT_CLOSE, "can't close the module\0") \ LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found\0") \ LT_ERROR(NO_MEMORY, "not enough memory\0") \ LT_ERROR(INVALID_HANDLE, "invalid module handle\0") \ LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow\0") \ LT_ERROR(INVALID_ERRORCODE, "invalid errorcode\0") \ LT_ERROR(SHUTDOWN, "library already shutdown\0") \ LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module\0") \ LT_ERROR(INVALID_MUTEX_ARGS, "internal error (code withdrawn)\0")\ LT_ERROR(INVALID_POSITION, "invalid search path insert position\0")\ LT_ERROR(CONFLICTING_FLAGS, "symbol visibility can be global or local\0") /* Enumerate the symbolic error names. */ enum { #define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name), lt_dlerror_table #undef LT_ERROR LT_ERROR_MAX }; /* Should be max of the error string lengths above (plus one for C++) */ #define LT_ERROR_LEN_MAX (41) /* These functions are only useful from inside custom module loaders. */ LT_SCOPE int lt_dladderror (const char *diagnostic); LT_SCOPE int lt_dlseterror (int errorcode); LT_END_C_DECLS #endif /*!defined(LT_ERROR_H)*/ parser-3.5.1/src/lib/ltdl/libltdl/lt__alloc.h0000644000076400007640000000422311764645200015776 00000000000000/* lt__alloc.h -- internal memory management interface Copyright (C) 2004 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__ALLOC_H) #define LT__ALLOC_H 1 #include "lt_system.h" LT_BEGIN_C_DECLS #define MALLOC(tp, n) (tp*) lt__malloc((n) * sizeof(tp)) #define REALLOC(tp, mem, n) (tp*) lt__realloc((mem), (n) * sizeof(tp)) #define FREE(mem) LT_STMT_START { \ if (mem) { free ((void *)mem); mem = NULL; } } LT_STMT_END #define MEMREASSIGN(p, q) LT_STMT_START { \ if ((p) != (q)) { if (p) free (p); (p) = (q); (q) = 0; } \ } LT_STMT_END /* If set, this function is called when memory allocation has failed. */ LT_SCOPE void (*lt__alloc_die) (void); LT_SCOPE void *lt__malloc (size_t n); LT_SCOPE void *lt__zalloc (size_t n); LT_SCOPE void *lt__realloc (void *mem, size_t n); LT_SCOPE void *lt__memdup (void const *mem, size_t n); LT_SCOPE char *lt__strdup (const char *string); LT_END_C_DECLS #endif /*!defined(LT__ALLOC_H)*/ parser-3.5.1/src/lib/ltdl/libltdl/slist.h0000644000076400007640000000623111764645200015205 00000000000000/* slist.h -- generalised singly linked lists Copyright (C) 2000, 2004, 2009 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2000 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* A generalised list. This is deliberately transparent so that you can make the NEXT field of all your chained data structures first, and then cast them to `(SList *)' so that they can be manipulated by this API. Alternatively, you can generate raw SList elements using slist_new(), and put the element data in the USERDATA field. Either way you get to manage the memory involved by yourself. */ #if !defined(SLIST_H) #define SLIST_H 1 #if defined(LTDL) # include # include #else # define LT_SCOPE #endif #include #if defined(__cplusplus) extern "C" { #endif typedef struct slist { struct slist *next; /* chain forward pointer*/ const void *userdata; /* for boxed `SList' item */ } SList; typedef void * SListCallback (SList *item, void *userdata); typedef int SListCompare (const SList *item1, const SList *item2, void *userdata); LT_SCOPE SList *slist_concat (SList *head, SList *tail); LT_SCOPE SList *slist_cons (SList *item, SList *slist); LT_SCOPE SList *slist_delete (SList *slist, void (*delete_fct) (void *item)); LT_SCOPE SList *slist_remove (SList **phead, SListCallback *find, void *matchdata); LT_SCOPE SList *slist_reverse (SList *slist); LT_SCOPE SList *slist_sort (SList *slist, SListCompare *compare, void *userdata); LT_SCOPE SList *slist_tail (SList *slist); LT_SCOPE SList *slist_nth (SList *slist, size_t n); LT_SCOPE void * slist_find (SList *slist, SListCallback *find, void *matchdata); LT_SCOPE size_t slist_length (SList *slist); LT_SCOPE void * slist_foreach (SList *slist, SListCallback *foreach, void *userdata); LT_SCOPE SList *slist_box (const void *userdata); LT_SCOPE void * slist_unbox (SList *item); #if defined(__cplusplus) } #endif #if !defined(LTDL) # undef LT_SCOPE #endif #endif /*!defined(SLIST_H)*/ parser-3.5.1/src/lib/ltdl/libltdl/lt__strl.h0000644000076400007640000000370011764645200015667 00000000000000/* lt__strl.h -- size-bounded string copying and concatenation Copyright (C) 2004, 2006 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined(LT__STRL_H) #define LT__STRL_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #include #include "lt_system.h" #if !defined(HAVE_STRLCAT) # define strlcat(dst,src,dstsize) lt_strlcat(dst,src,dstsize) LT_SCOPE size_t lt_strlcat(char *dst, const char *src, const size_t dstsize); #endif /* !defined(HAVE_STRLCAT) */ #if !defined(HAVE_STRLCPY) # define strlcpy(dst,src,dstsize) lt_strlcpy(dst,src,dstsize) LT_SCOPE size_t lt_strlcpy(char *dst, const char *src, const size_t dstsize); #endif /* !defined(HAVE_STRLCPY) */ #endif /*!defined(LT__STRL_H)*/ parser-3.5.1/src/lib/ltdl/libltdl/lt_system.h0000644000076400007640000001237311764645200016076 00000000000000/* lt_system.h -- system portability abstraction layer Copyright (C) 2004, 2007, 2010 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined(LT_SYSTEM_H) #define LT_SYSTEM_H 1 #include #include #include /* Some systems do not define EXIT_*, even with STDC_HEADERS. */ #if !defined(EXIT_SUCCESS) # define EXIT_SUCCESS 0 #endif #if !defined(EXIT_FAILURE) # define EXIT_FAILURE 1 #endif /* Just pick a big number... */ #define LT_FILENAME_MAX 2048 /* Saves on those hard to debug '\0' typos.... */ #define LT_EOS_CHAR '\0' /* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations, so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at the end of C declarations. */ #if defined(__cplusplus) # define LT_BEGIN_C_DECLS extern "C" { # define LT_END_C_DECLS } #else # define LT_BEGIN_C_DECLS /* empty */ # define LT_END_C_DECLS /* empty */ #endif /* LT_STMT_START/END are used to create macros which expand to a a single compound statement in a portable way. */ #if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus) # define LT_STMT_START (void)( # define LT_STMT_END ) #else # if (defined (sun) || defined (__sun__)) # define LT_STMT_START if (1) # define LT_STMT_END else (void)0 # else # define LT_STMT_START do # define LT_STMT_END while (0) # endif #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* Canonicalise Windows and Cygwin recognition macros. To match the values set by recent Cygwin compilers, make sure that if __CYGWIN__ is defined (after canonicalisation), __WINDOWS__ is NOT! */ #if defined(__CYGWIN32__) && !defined(__CYGWIN__) # define __CYGWIN__ __CYGWIN32__ #endif #if defined(__CYGWIN__) # if defined(__WINDOWS__) # undef __WINDOWS__ # endif #elif defined(_WIN32) # define __WINDOWS__ _WIN32 #elif defined(WIN32) # define __WINDOWS__ WIN32 #endif #if defined(__CYGWIN__) && defined(__WINDOWS__) # undef __WINDOWS__ #endif /* DLL building support on win32 hosts; mostly to workaround their ridiculous implementation of data symbol exporting. */ #if !defined(LT_SCOPE) # if defined(__WINDOWS__) || defined(__CYGWIN__) # if defined(DLL_EXPORT) /* defined by libtool (if required) */ # define LT_SCOPE extern __declspec(dllexport) # endif # if defined(LIBLTDL_DLL_IMPORT) /* define if linking with this dll */ /* note: cygwin/mingw compilers can rely instead on auto-import */ # define LT_SCOPE extern __declspec(dllimport) # endif # endif # if !defined(LT_SCOPE) /* static linking or !__WINDOWS__ */ # define LT_SCOPE extern # endif #endif #if defined(__WINDOWS__) /* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory separator when it is set. */ # define LT_DIRSEP_CHAR '\\' # define LT_PATHSEP_CHAR ';' #else # define LT_PATHSEP_CHAR ':' #endif #if defined(_MSC_VER) /* Visual Studio */ # define R_OK 4 #endif /* fopen() mode flags for reading a text file */ #undef LT_READTEXT_MODE #if defined(__WINDOWS__) || defined(__CYGWIN__) # define LT_READTEXT_MODE "rt" #else # define LT_READTEXT_MODE "r" #endif /* The extra indirection to the LT__STR and LT__CONC macros is required so that if the arguments to LT_STR() (or LT_CONC()) are themselves macros, they will be expanded before being quoted. */ #ifndef LT_STR # define LT__STR(arg) #arg # define LT_STR(arg) LT__STR(arg) #endif #ifndef LT_CONC # define LT__CONC(a, b) a##b # define LT_CONC(a, b) LT__CONC(a, b) #endif #ifndef LT_CONC3 # define LT__CONC3(a, b, c) a##b##c # define LT_CONC3(a, b, c) LT__CONC3(a, b, c) #endif #endif /*!defined(LT_SYSTEM_H)*/ parser-3.5.1/src/lib/ltdl/libltdl/lt_dlloader.h0000644000076400007640000000620011764645200016330 00000000000000/* lt_dlloader.h -- dynamic library loader interface Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined(LT_DLLOADER_H) #define LT_DLLOADER_H 1 #include LT_BEGIN_C_DECLS typedef void * lt_dlloader; typedef void * lt_module; typedef void * lt_user_data; typedef struct lt__advise * lt_dladvise; /* Function pointer types for module loader vtable entries: */ typedef lt_module lt_module_open (lt_user_data data, const char *filename, lt_dladvise advise); typedef int lt_module_close (lt_user_data data, lt_module module); typedef void * lt_find_sym (lt_user_data data, lt_module module, const char *symbolname); typedef int lt_dlloader_init (lt_user_data data); typedef int lt_dlloader_exit (lt_user_data data); /* Default priority is LT_DLLOADER_PREPEND if none is explicitly given. */ typedef enum { LT_DLLOADER_PREPEND = 0, LT_DLLOADER_APPEND } lt_dlloader_priority; /* This structure defines a module loader, as populated by the get_vtable entry point of each loader. */ typedef struct { const char * name; const char * sym_prefix; lt_module_open * module_open; lt_module_close * module_close; lt_find_sym * find_sym; lt_dlloader_init * dlloader_init; lt_dlloader_exit * dlloader_exit; lt_user_data dlloader_data; lt_dlloader_priority priority; } lt_dlvtable; LT_SCOPE int lt_dlloader_add (const lt_dlvtable *vtable); LT_SCOPE lt_dlloader lt_dlloader_next (const lt_dlloader loader); LT_SCOPE lt_dlvtable * lt_dlloader_remove (const char *name); LT_SCOPE const lt_dlvtable *lt_dlloader_find (const char *name); LT_SCOPE const lt_dlvtable *lt_dlloader_get (lt_dlloader loader); /* Type of a function to get a loader's vtable: */ typedef const lt_dlvtable *lt_get_vtable (lt_user_data data); #ifdef LT_DEBUG_LOADERS LT_SCOPE void lt_dlloader_dump (void); #endif LT_END_C_DECLS #endif /*!defined(LT_DLLOADER_H)*/ parser-3.5.1/src/lib/ltdl/libltdl/lt__dirent.h0000644000076400007640000000472411764645200016177 00000000000000/* lt__dirent.h -- internal directory entry scanning interface Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2001 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__DIRENT_H) #define LT__DIRENT_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #include "lt_system.h" #ifdef HAVE_DIRENT_H /* We have a fully operational dirent subsystem. */ # include # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) #elif defined __WINDOWS__ /* Use some wrapper code to emulate dirent on windows.. */ # define WINDOWS_DIRENT_EMULATION 1 # include # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) # define dirent lt__dirent # define DIR lt__DIR # define opendir lt__opendir # define readdir lt__readdir # define closedir lt__closedir LT_BEGIN_C_DECLS struct dirent { char d_name[LT_FILENAME_MAX]; int d_namlen; }; typedef struct { HANDLE hSearch; WIN32_FIND_DATA Win32FindData; BOOL firsttime; struct dirent file_info; } DIR; LT_SCOPE DIR * opendir (const char *path); LT_SCOPE struct dirent *readdir (DIR *entry); LT_SCOPE void closedir (DIR *entry); LT_END_C_DECLS #else /* !defined(__WINDOWS__)*/ ERROR - cannot find dirent #endif /*!defined(__WINDOWS__)*/ #endif /*!defined(LT__DIRENT_H)*/ parser-3.5.1/src/lib/ltdl/libltdl/lt__private.h0000644000076400007640000001065011764645200016357 00000000000000/* lt__private.h -- internal apis for libltdl Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy con be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__PRIVATE_H) #define LT__PRIVATE_H 1 #if defined(LT_CONFIG_H) # include LT_CONFIG_H #else # include #endif #include #include #include #include #include #if defined(HAVE_UNISTD_H) # include #endif /* Import internal interfaces... */ #include "lt__alloc.h" #include "lt__dirent.h" #include "lt__strl.h" #include "lt__glibc.h" /* ...and all exported interfaces. */ #include "ltdl.h" #if defined(WITH_DMALLOC) # include #endif /* DLL building support on win32 hosts; mostly to workaround their ridiculous implementation of data symbol exporting. */ #ifndef LT_GLOBAL_DATA # if defined(__WINDOWS__) || defined(__CYGWIN__) # if defined(DLL_EXPORT) /* defined by libtool (if required) */ # define LT_GLOBAL_DATA __declspec(dllexport) # endif # endif # ifndef LT_GLOBAL_DATA # define LT_GLOBAL_DATA /* static linking or !__WINDOWS__ */ # endif #endif #ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ # define __attribute__(x) # endif #endif #ifndef LT__UNUSED # define LT__UNUSED __attribute__ ((__unused__)) #endif LT_BEGIN_C_DECLS #if !defined(errno) extern int errno; #endif LT_SCOPE void lt__alloc_die_callback (void); /* For readability: */ #define strneq(s1, s2) (strcmp((s1), (s2)) != 0) #define streq(s1, s2) (!strcmp((s1), (s2))) /* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ /* This type is used for the array of interface data sets in each handler. */ typedef struct { lt_dlinterface_id key; void * data; } lt_interface_data; struct lt__handle { lt_dlhandle next; const lt_dlvtable * vtable; /* dlopening interface */ lt_dlinfo info; /* user visible fields */ int depcount; /* number of dependencies */ lt_dlhandle * deplibs; /* dependencies */ lt_module module; /* system module handle */ void * system; /* system specific data */ lt_interface_data * interface_data; /* per caller associated data */ int flags; /* various boolean stats */ }; struct lt__advise { unsigned int try_ext:1; /* try system library extensions. */ unsigned int is_resident:1; /* module can't be unloaded. */ unsigned int is_symglobal:1; /* module symbols can satisfy subsequently loaded modules. */ unsigned int is_symlocal:1; /* module symbols are only available locally. */ unsigned int try_preload_only:1;/* only preloaded modules will be tried. */ }; /* --- ERROR HANDLING --- */ /* Extract the diagnostic strings from the error table macro in the same order as the enumerated indices in lt_error.h. */ #define LT__STRERROR(name) lt__error_string(LT_CONC(LT_ERROR_,name)) #define LT__GETERROR(lvalue) (lvalue) = lt__get_last_error() #define LT__SETERRORSTR(errormsg) lt__set_last_error(errormsg) #define LT__SETERROR(errorcode) LT__SETERRORSTR(LT__STRERROR(errorcode)) LT_SCOPE const char *lt__error_string (int errorcode); LT_SCOPE const char *lt__get_last_error (void); LT_SCOPE const char *lt__set_last_error (const char *errormsg); LT_END_C_DECLS #endif /*!defined(LT__PRIVATE_H)*/ parser-3.5.1/src/lib/ltdl/slist.c0000644000076400007640000002316411764645177013573 00000000000000/* slist.c -- generalised singly linked lists Copyright (C) 2000, 2004, 2007, 2008, 2009 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2000 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "slist.h" #include #include static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata); /* Call DELETE repeatedly on each element of HEAD. CAVEAT: If you call this when HEAD is the start of a list of boxed items, you must remember that each item passed back to your DELETE function will be a boxed item that must be slist_unbox()ed before operating on its contents. e.g. void boxed_delete (void *item) { item_free (slist_unbox (item)); } ... slist = slist_delete (slist, boxed_delete); ... */ SList * slist_delete (SList *head, void (*delete_fct) (void *item)) { assert (delete_fct); while (head) { SList *next = head->next; (*delete_fct) (head); head = next; } return 0; } /* Call FIND repeatedly with MATCHDATA and each item of *PHEAD, until FIND returns non-NULL, or the list is exhausted. If a match is found the matching item is destructively removed from *PHEAD, and the value returned by the matching call to FIND is returned. CAVEAT: To avoid memory leaks, unless you already have the address of the stale item, you should probably return that from FIND if it makes a successful match. Don't forget to slist_unbox() every item in a boxed list before operating on its contents. */ SList * slist_remove (SList **phead, SListCallback *find, void *matchdata) { SList *stale = 0; void *result = 0; assert (find); if (!phead || !*phead) return 0; /* Does the head of the passed list match? */ result = (*find) (*phead, matchdata); if (result) { stale = *phead; *phead = stale->next; } /* what about the rest of the elements? */ else { SList *head; for (head = *phead; head->next; head = head->next) { result = (*find) (head->next, matchdata); if (result) { stale = head->next; head->next = stale->next; break; } } } return (SList *) result; } /* Call FIND repeatedly with each element of SLIST and MATCHDATA, until FIND returns non-NULL, or the list is exhausted. If a match is found the value returned by the matching call to FIND is returned. */ void * slist_find (SList *slist, SListCallback *find, void *matchdata) { void *result = 0; assert (find); for (; slist; slist = slist->next) { result = (*find) (slist, matchdata); if (result) break; } return result; } /* Return a single list, composed by destructively concatenating the items in HEAD and TAIL. The values of HEAD and TAIL are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_concat (slist1, slist2); */ SList * slist_concat (SList *head, SList *tail) { SList *last; if (!head) { return tail; } last = head; while (last->next) last = last->next; last->next = tail; return head; } /* Return a single list, composed by destructively appending all of the items in SLIST to ITEM. The values of ITEM and SLIST are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_cons (slist_box (data), slist1); */ SList * slist_cons (SList *item, SList *slist) { if (!item) { return slist; } assert (!item->next); item->next = slist; return item; } /* Return a list starting at the second item of SLIST. */ SList * slist_tail (SList *slist) { return slist ? slist->next : NULL; } /* Return a list starting at the Nth item of SLIST. If SLIST is less than N items long, NULL is returned. Just to be confusing, list items are counted from 1, to get the 2nd element of slist: e.g. shared_list = slist_nth (slist, 2); */ SList * slist_nth (SList *slist, size_t n) { for (;n > 1 && slist; n--) slist = slist->next; return slist; } /* Return the number of items in SLIST. We start counting from 1, so the length of a list with no items is 0, and so on. */ size_t slist_length (SList *slist) { size_t n; for (n = 0; slist; ++n) slist = slist->next; return n; } /* Destructively reverse the order of items in SLIST. The value of SLIST is undefined after calling this function. CAVEAT: You must store the result of this function, or you might not be able to get all the items except the first one back again. e.g. slist = slist_reverse (slist); */ SList * slist_reverse (SList *slist) { SList *result = 0; SList *next; while (slist) { next = slist->next; slist->next = result; result = slist; slist = next; } return result; } /* Call FOREACH once for each item in SLIST, passing both the item and USERDATA on each call. */ void * slist_foreach (SList *slist, SListCallback *foreach, void *userdata) { void *result = 0; assert (foreach); while (slist) { SList *next = slist->next; result = (*foreach) (slist, userdata); if (result) break; slist = next; } return result; } /* Destructively merge the items of two ordered lists LEFT and RIGHT, returning a single sorted list containing the items of both -- Part of the quicksort algorithm. The values of LEFT and RIGHT are undefined after calling this function. At each iteration, add another item to the merged list by taking the lowest valued item from the head of either LEFT or RIGHT, determined by passing those items and USERDATA to COMPARE. COMPARE should return less than 0 if the head of LEFT has the lower value, greater than 0 if the head of RIGHT has the lower value, otherwise 0. */ static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata) { SList merged, *insert; insert = &merged; while (left && right) { if ((*compare) (left, right, userdata) <= 0) { insert = insert->next = left; left = left->next; } else { insert = insert->next = right; right = right->next; } } insert->next = left ? left : right; return merged.next; } /* Perform a destructive quicksort on the items in SLIST, by repeatedly calling COMPARE with a pair of items from SLIST along with USERDATA at every iteration. COMPARE is a function as defined above for slist_sort_merge(). The value of SLIST is undefined after calling this function. e.g. slist = slist_sort (slist, compare, 0); */ SList * slist_sort (SList *slist, SListCompare *compare, void *userdata) { SList *left, *right; if (!slist) return slist; /* Be sure that LEFT and RIGHT never contain the same item. */ left = slist; right = slist->next; if (!right) return left; /* Skip two items with RIGHT and one with SLIST, until RIGHT falls off the end. SLIST must be about half way along. */ while (right && (right = right->next)) { if (!right || !(right = right->next)) break; slist = slist->next; } right = slist->next; slist->next = 0; /* Sort LEFT and RIGHT, then merge the two. */ return slist_sort_merge (slist_sort (left, compare, userdata), slist_sort (right, compare, userdata), compare, userdata); } /* Aside from using the functions above to manage chained structures of any type that has a NEXT pointer as its first field, SLISTs can be comprised of boxed items. The boxes are chained together in that case, so there is no need for a NEXT field in the item proper. Some care must be taken to slist_box and slist_unbox each item in a boxed list at the appropriate points to avoid leaking the memory used for the boxes. It us usually a very bad idea to mix boxed and non-boxed items in a single list. */ /* Return a `boxed' freshly mallocated 1 element list containing USERDATA. */ SList * slist_box (const void *userdata) { SList *item = (SList *) malloc (sizeof *item); if (item) { item->next = 0; item->userdata = userdata; } return item; } /* Return the contents of a `boxed' ITEM, recycling the box itself. */ void * slist_unbox (SList *item) { void *userdata = 0; if (item) { /* Strip the const, because responsibility for this memory passes to the caller on return. */ userdata = (void *) item->userdata; free (item); } return userdata; } parser-3.5.1/src/lib/ltdl/Makefile.am0000644000076400007640000001213313027250366014301 00000000000000## Makefile.am -- Process this file with automake to produce Makefile.in ## ## Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. ## Written by Gary V. Vaughan, 2003 ## ## NOTE: The canonical source of this file is maintained with the ## GNU Libtool package. Report bugs to bug-libtool@gnu.org. ## ## GNU Libltdl is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (at your option) any later version. ## ## As a special exception to the GNU Lesser General Public License, ## if you distribute this file as part of a program or library that ## is built using GNU libtool, you may include this file under the ## same distribution terms that you use for the rest of that program. ## ## GNU Libltdl is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU Lesser General Public License for more details. ## ## You should have received a copy of the GNU LesserGeneral Public ## License along with GNU Libltdl; see the file COPYING.LIB. If not, a ## copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, ## or obtained by writing to the Free Software Foundation, Inc., ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ##### ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = foreign AM_CPPFLAGS = AM_LDFLAGS = BUILT_SOURCES = include_HEADERS = noinst_LTLIBRARIES = lib_LTLIBRARIES = EXTRA_LTLIBRARIES = EXTRA_DIST = config_fixed.h ltdl.vcproj CLEANFILES = MOSTLYCLEANFILES = # -I$(srcdir) is needed for user that built libltdl with a sub-Automake # (not as a sub-package!) using 'nostdinc': AM_CPPFLAGS += -DLT_CONFIG_H='<$(LT_CONFIG_H)>' \ -DLTDL -I. -I$(srcdir) -Ilibltdl \ -I$(srcdir)/libltdl -I$(srcdir)/libltdl AM_LDFLAGS += -no-undefined LTDL_VERSION_INFO = -version-info 10:0:3 noinst_LTLIBRARIES += $(LT_DLLOADERS) if INSTALL_LTDL ltdlincludedir = $(includedir)/libltdl ltdlinclude_HEADERS = libltdl/lt_system.h \ libltdl/lt_error.h \ libltdl/lt_dlloader.h include_HEADERS += ltdl.h lib_LTLIBRARIES += libltdl.la endif if CONVENIENCE_LTDL noinst_LTLIBRARIES += libltdlc.la endif libltdl_la_SOURCES = libltdl/lt__alloc.h \ libltdl/lt__dirent.h \ libltdl/lt__glibc.h \ libltdl/lt__private.h \ libltdl/lt__strl.h \ libltdl/lt_dlloader.h \ libltdl/lt_error.h \ libltdl/lt_system.h \ libltdl/slist.h \ loaders/preopen.c \ lt__alloc.c \ lt_dlloader.c \ lt_error.c \ ltdl.c \ ltdl.h \ slist.c EXTRA_DIST += lt__dirent.c \ lt__strl.c libltdl_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS) libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN) libltdl_la_LIBADD = $(LTLIBOBJS) libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(LTLIBOBJS) libltdlc_la_SOURCES = $(libltdl_la_SOURCES) libltdlc_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS) libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN) libltdlc_la_LIBADD = $(libltdl_la_LIBADD) libltdlc_la_DEPENDENCIES= $(libltdl_la_DEPENDENCIES) ## The loaders are preopened by libltdl, itself always built from ## pic-objects (either as a shared library, or a convenience library), ## so the loaders themselves must be made from pic-objects too. We ## use convenience libraries for that purpose: EXTRA_LTLIBRARIES += dlopen.la \ dld_link.la \ dyld.la \ load_add_on.la \ loadlibrary.la \ shl_load.la dlopen_la_SOURCES = loaders/dlopen.c dlopen_la_LDFLAGS = -module -avoid-version dlopen_la_LIBADD = $(LIBADD_DLOPEN) dld_link_la_SOURCES = loaders/dld_link.c dld_link_la_LDFLAGS = -module -avoid-version dld_link_la_LIBADD = -ldld dyld_la_SOURCES = loaders/dyld.c dyld_la_LDFLAGS = -module -avoid-version load_add_on_la_SOURCES = loaders/load_add_on.c load_add_on_la_LDFLAGS = -module -avoid-version loadlibrary_la_SOURCES = loaders/loadlibrary.c loadlibrary_la_LDFLAGS = -module -avoid-version shl_load_la_SOURCES = loaders/shl_load.c shl_load_la_LDFLAGS = -module -avoid-version shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) ## Make sure these will be cleaned even when they're not built by default: CLEANFILES += libltdl.la \ libltdlc.la \ libdlloader.la ## Automake-1.9.6 doesn't clean subdir AC_LIBOBJ compiled objects ## automatically: CLEANFILES += $(LIBOBJS) $(LTLIBOBJS) EXTRA_DIST += COPYING.LIB \ configure.ac \ Makefile.am \ aclocal.m4 \ Makefile.in \ configure \ config-h.in \ README ## --------------------------- ## ## Gnulib Makefile.am snippets ## ## --------------------------- ## BUILT_SOURCES += $(ARGZ_H) EXTRA_DIST += argz_.h \ argz.c # We need the following in order to create an when the system # doesn't have one that works with the given compiler. all-local $(lib_OBJECTS): $(ARGZ_H) argz.h: argz_.h $(mkinstalldirs) . cp $(srcdir)/argz_.h $@-t mv $@-t $@ MOSTLYCLEANFILES += argz.h \ argz.h-t parser-3.5.1/src/lib/ltdl/configure.ac0000644000076400007640000000501011764645176014544 00000000000000# Process this file with autoconf to create configure. -*- autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # NOTE: The canonical source of this file is maintained with the # GNU Libtool package. Report bugs to bug-libtool@gnu.org. # # GNU Libltdl is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # As a special exception to the GNU Lesser General Public License, # if you distribute this file as part of a program or library that # is built using GNU libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libltdl is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU LesserGeneral Public # License along with GNU Libltdl; see the file COPYING.LIB. If not, a # copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #### # This configure.ac is not used at all by the libtool bootstrap, but # is copied to the ltdl subdirectory if you libtoolize --ltdl your own # project. Adding LT_WITH_LTDL to your project configure.ac will then # configure this directory if your user doesn't want to use the installed # libltdl. AC_PREREQ(2.59)dnl We use AS_HELP_STRING ## ------------------------ ## ## Autoconf initialisation. ## ## ------------------------ ## AC_INIT([libltdl], [2.4.2], [bug-libtool@gnu.org]) AC_CONFIG_HEADERS([config.h:config-h.in]) AC_CONFIG_SRCDIR([ltdl.c]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([m4]) LT_CONFIG_LTDL_DIR([.]) # I am me! ## ------------------------ ## ## Automake Initialisation. ## ## ------------------------ ## AM_INIT_AUTOMAKE([gnu]) ## ------------------------------- ## ## Libtool specific configuration. ## ## ------------------------------- ## pkgdatadir='${datadir}'"/${PACKAGE}" ## ----------------------- ## ## Libtool initialisation. ## ## ----------------------- ## LT_INIT([dlopen win32-dll]) _LTDL_SETUP ## -------- ## ## Outputs. ## ## -------- ## AC_CONFIG_FILES([Makefile]) AC_OUTPUT parser-3.5.1/src/lib/ltdl/README0000644000076400007640000000126011764645175013140 00000000000000This is GNU libltdl, a system independent dlopen wrapper for GNU libtool. It supports the following dlopen interfaces: * dlopen (POSIX) * shl_load (HP-UX) * LoadLibrary (Win16 and Win32) * load_add_on (BeOS) * GNU DLD (emulates dynamic linking for static libraries) * dyld (darwin/Mac OS X) * libtool's dlpreopen -- Copyright (C) 1999, 2003, 2011 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 This file is part of GNU Libtool. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. parser-3.5.1/src/lib/ltdl/COPYING.LIB0000644000076400007640000006365611764645175013741 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. ^L Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. ^L GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. ^L 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. ^L 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. ^L 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. ^L 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. ^L 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 ^L How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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! parser-3.5.1/src/lib/ltdl/ltdl.c0000644000076400007640000015400411770443336013360 00000000000000/* ltdl.c -- system independent dlopen wrapper Copyright (C) 1998, 1999, 2000, 2004, 2005, 2006, 2007, 2008, 2011 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_system.h" #include "lt_dlloader.h" /* --- MANIFEST CONSTANTS --- */ #undef HAVE_LIBDLLOADER /* Standard libltdl search path environment variable name */ #undef LTDL_SEARCHPATH_VAR #define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH" /* Standard libtool archive file extension. */ #undef LT_ARCHIVE_EXT #define LT_ARCHIVE_EXT ".la" /* max. filename length */ #if !defined(LT_FILENAME_MAX) # define LT_FILENAME_MAX 1024 #endif #if !defined(LT_LIBEXT) # define LT_LIBEXT "a" #endif #if !defined(LT_LIBPREFIX) # define LT_LIBPREFIX "lib" #endif /* This is the maximum symbol size that won't require malloc/free */ #undef LT_SYMBOL_LENGTH #define LT_SYMBOL_LENGTH 128 /* This accounts for the _LTX_ separator */ #undef LT_SYMBOL_OVERHEAD #define LT_SYMBOL_OVERHEAD 5 /* Various boolean flags can be stored in the flags field of an lt_dlhandle... */ #define LT_DLIS_RESIDENT(handle) ((handle)->info.is_resident) #define LT_DLIS_SYMGLOBAL(handle) ((handle)->info.is_symglobal) #define LT_DLIS_SYMLOCAL(handle) ((handle)->info.is_symlocal) static const char objdir[] = LT_OBJDIR; static const char archive_ext[] = LT_ARCHIVE_EXT; static const char libext[] = LT_LIBEXT; static const char libprefix[] = LT_LIBPREFIX; #if defined(LT_MODULE_EXT) static const char shlib_ext[] = LT_MODULE_EXT; #endif /* If the loadable module suffix is not the same as the linkable * shared library suffix, this will be defined. */ #if defined(LT_SHARED_EXT) static const char shared_ext[] = LT_SHARED_EXT; #endif #if defined(LT_DLSEARCH_PATH) static const char sys_dlsearch_path[] = LT_DLSEARCH_PATH; #endif /* --- DYNAMIC MODULE LOADING --- */ /* The type of a function used at each iteration of foreach_dirinpath(). */ typedef int foreach_callback_func (char *filename, void *data1, void *data2); /* foreachfile_callback itself calls a function of this type: */ typedef int file_worker_func (const char *filename, void *data); static int foreach_dirinpath (const char *search_path, const char *base_name, foreach_callback_func *func, void *data1, void *data2); static int find_file_callback (char *filename, void *data1, void *data2); static int find_handle_callback (char *filename, void *data, void *ignored); static int foreachfile_callback (char *filename, void *data1, void *data2); static int canonicalize_path (const char *path, char **pcanonical); static int argzize_path (const char *path, char **pargz, size_t *pargz_len); static FILE *find_file (const char *search_path, const char *base_name, char **pdir); static lt_dlhandle *find_handle (const char *search_path, const char *base_name, lt_dlhandle *handle, lt_dladvise advise); static int find_module (lt_dlhandle *handle, const char *dir, const char *libdir, const char *dlname, const char *old_name, int installed, lt_dladvise advise); static int has_library_ext (const char *filename); static int load_deplibs (lt_dlhandle handle, char *deplibs); static int trim (char **dest, const char *str); static int try_dlopen (lt_dlhandle *handle, const char *filename, const char *ext, lt_dladvise advise); static int tryall_dlopen (lt_dlhandle *handle, const char *filename, lt_dladvise padvise, const lt_dlvtable *vtable); static int unload_deplibs (lt_dlhandle handle); static int lt_argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry); static int lt_argz_insertinorder (char **pargz, size_t *pargz_len, const char *entry); static int lt_argz_insertdir (char **pargz, size_t *pargz_len, const char *dirnam, struct dirent *dp); static int lt_dlpath_insertdir (char **ppath, char *before, const char *dir); static int list_files_by_dir (const char *dirnam, char **pargz, size_t *pargz_len); static int file_not_found (void); #ifdef HAVE_LIBDLLOADER static int loader_init_callback (lt_dlhandle handle); #endif /* HAVE_LIBDLLOADER */ static int loader_init (lt_get_vtable *vtable_func, lt_user_data data); static char *user_search_path= 0; static lt_dlhandle handles = 0; static int initialized = 0; /* Our memory failure callback sets the error message to be passed back up to the client, so we must be careful to return from mallocation callers if allocation fails (as this callback returns!!). */ void lt__alloc_die_callback (void) { LT__SETERROR (NO_MEMORY); } #ifdef HAVE_LIBDLLOADER /* This function is called to initialise each preloaded module loader, and hook it into the list of loaders to be used when attempting to dlopen an application module. */ static int loader_init_callback (lt_dlhandle handle) { lt_get_vtable *vtable_func = (lt_get_vtable *) lt_dlsym (handle, "get_vtable"); return loader_init (vtable_func, 0); } #endif /* HAVE_LIBDLLOADER */ static int loader_init (lt_get_vtable *vtable_func, lt_user_data data) { const lt_dlvtable *vtable = 0; int errors = 0; if (vtable_func) { vtable = (*vtable_func) (data); } /* lt_dlloader_add will LT__SETERROR if it fails. */ errors += lt_dlloader_add (vtable); assert (errors || vtable); if ((!errors) && vtable->dlloader_init) { if ((*vtable->dlloader_init) (vtable->dlloader_data)) { LT__SETERROR (INIT_LOADER); ++errors; } } return errors; } /* preopening loader is buggy under FreeBSD and not supported under MSVC, thus using preconfigured loader. */ #if defined(__CYGWIN__) || defined(__WINDOWS__) #define get_vtable loadlibrary_LTX_get_vtable #else #define get_vtable dlopen_LTX_get_vtable #endif LT_BEGIN_C_DECLS LT_SCOPE const lt_dlvtable * get_vtable (lt_user_data data); LT_END_C_DECLS #ifdef HAVE_LIBDLLOADER #define preloaded_symbols LT_CONC3(lt_, LTDLOPEN, _LTX_preloaded_symbols) extern LT_DLSYM_CONST lt_dlsymlist preloaded_symbols[]; #endif /* Initialize libltdl. */ int lt_dlinit (void) { int errors = 0; /* Initialize only at first call. */ if (++initialized == 1) { lt__alloc_die = lt__alloc_die_callback; handles = 0; user_search_path = 0; /* empty search path */ /* Loading the only supported loader */ errors += loader_init (get_vtable, 0); /* Now open all the preloaded module loaders, so the application can use _them_ to lt_dlopen its own modules. */ #ifdef HAVE_LIBDLLOADER if (!errors) { errors += lt_dlpreload (preloaded_symbols); } if (!errors) { errors += lt_dlpreload_open (LT_STR(LTDLOPEN), loader_init_callback); } #endif /* HAVE_LIBDLLOADER */ } #ifdef LT_DEBUG_LOADERS lt_dlloader_dump(); #endif return errors; } int lt_dlexit (void) { /* shut down libltdl */ lt_dlloader *loader = 0; lt_dlhandle handle = handles; int errors = 0; if (!initialized) { LT__SETERROR (SHUTDOWN); ++errors; goto done; } /* shut down only at last call. */ if (--initialized == 0) { int level; while (handles && LT_DLIS_RESIDENT (handles)) { handles = handles->next; } /* close all modules */ for (level = 1; handle; ++level) { lt_dlhandle cur = handles; int saw_nonresident = 0; while (cur) { lt_dlhandle tmp = cur; cur = cur->next; if (!LT_DLIS_RESIDENT (tmp)) { saw_nonresident = 1; if (tmp->info.ref_count <= level) { if (lt_dlclose (tmp)) { ++errors; } /* Make sure that the handle pointed to by 'cur' still exists. lt_dlclose recursively closes dependent libraries which removes them from the linked list. One of these might be the one pointed to by 'cur'. */ if (cur) { for (tmp = handles; tmp; tmp = tmp->next) if (tmp == cur) break; if (! tmp) cur = handles; } } } } /* done if only resident modules are left */ if (!saw_nonresident) break; } /* When removing loaders, we can only find out failure by testing the error string, so avoid a spurious one from an earlier failed command. */ if (!errors) LT__SETERRORSTR (0); /* close all loaders */ for (loader = (lt_dlloader *) lt_dlloader_next (NULL); loader;) { lt_dlloader *next = (lt_dlloader *) lt_dlloader_next (loader); lt_dlvtable *vtable = (lt_dlvtable *) lt_dlloader_get (loader); if ((vtable = lt_dlloader_remove ((char *) vtable->name))) { FREE (vtable); } else { /* ignore errors due to resident modules */ const char *err; LT__GETERROR (err); if (err) ++errors; } loader = next; } FREE(user_search_path); } done: return errors; } /* Try VTABLE or, if VTABLE is NULL, all available loaders for FILENAME. If the library is not successfully loaded, return non-zero. Otherwise, the dlhandle is stored at the address given in PHANDLE. */ static int tryall_dlopen (lt_dlhandle *phandle, const char *filename, lt_dladvise advise, const lt_dlvtable *vtable) { lt_dlhandle handle = handles; const char * saved_error = 0; int errors = 0; #ifdef LT_DEBUG_LOADERS fprintf (stderr, "tryall_dlopen (%s, %s)\n", filename ? filename : "(null)", vtable ? vtable->name : "(ALL)"); #endif LT__GETERROR (saved_error); /* check whether the module was already opened */ for (;handle; handle = handle->next) { if ((handle->info.filename == filename) /* dlopen self: 0 == 0 */ || (handle->info.filename && filename && streq (handle->info.filename, filename))) { break; } } if (handle) { ++handle->info.ref_count; *phandle = handle; goto done; } handle = *phandle; if (filename) { /* Comment out the check of file permissions using access. This call seems to always return -1 with error EACCES. */ /* We need to catch missing file errors early so that file_not_found() can detect what happened. if (access (filename, R_OK) != 0) { LT__SETERROR (FILE_NOT_FOUND); ++errors; goto done; } */ handle->info.filename = lt__strdup (filename); if (!handle->info.filename) { ++errors; goto done; } } else { handle->info.filename = 0; } { lt_dlloader loader = lt_dlloader_next (0); const lt_dlvtable *loader_vtable; do { if (vtable) loader_vtable = vtable; else loader_vtable = lt_dlloader_get (loader); #ifdef LT_DEBUG_LOADERS fprintf (stderr, "Calling %s->module_open (%s)\n", (loader_vtable && loader_vtable->name) ? loader_vtable->name : "(null)", filename ? filename : "(null)"); #endif handle->module = (*loader_vtable->module_open) (loader_vtable->dlloader_data, filename, advise); #ifdef LT_DEBUG_LOADERS fprintf (stderr, " Result: %s\n", handle->module ? "Success" : "Failed"); #endif if (handle->module != 0) { if (advise) { handle->info.is_resident = advise->is_resident; handle->info.is_symglobal = advise->is_symglobal; handle->info.is_symlocal = advise->is_symlocal; } break; } } while (!vtable && (loader = lt_dlloader_next (loader))); /* If VTABLE was given but couldn't open the module, or VTABLE wasn't given but we exhausted all loaders without opening the module, bail out! */ if ((vtable && !handle->module) || (!vtable && !loader)) { FREE (handle->info.filename); ++errors; goto done; } handle->vtable = loader_vtable; } LT__SETERRORSTR (saved_error); done: return errors; } static int tryall_dlopen_module (lt_dlhandle *handle, const char *prefix, const char *dirname, const char *dlname, lt_dladvise advise) { int error = 0; char *filename = 0; size_t filename_len = 0; size_t dirname_len = LT_STRLEN (dirname); assert (handle); assert (dirname); assert (dlname); #if defined(LT_DIRSEP_CHAR) /* Only canonicalized names (i.e. with DIRSEP chars already converted) should make it into this function: */ assert (strchr (dirname, LT_DIRSEP_CHAR) == 0); #endif if (dirname_len > 0) if (dirname[dirname_len -1] == '/') --dirname_len; filename_len = dirname_len + 1 + LT_STRLEN (dlname); /* Allocate memory, and combine DIRNAME and MODULENAME into it. The PREFIX (if any) is handled below. */ filename = MALLOC (char, filename_len + 1); if (!filename) return 1; sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); /* Now that we have combined DIRNAME and MODULENAME, if there is also a PREFIX to contend with, simply recurse with the arguments shuffled. Otherwise, attempt to open FILENAME as a module. */ if (prefix) { error += tryall_dlopen_module (handle, (const char *) 0, prefix, filename, advise); } else if (tryall_dlopen (handle, filename, advise, 0) != 0) { ++error; } FREE (filename); return error; } static int find_module (lt_dlhandle *handle, const char *dir, const char *libdir, const char *dlname, const char *old_name, int installed, lt_dladvise advise) { /* Try to open the old library first; if it was dlpreopened, we want the preopened version of it, even if a dlopenable module is available. */ if (old_name && tryall_dlopen (handle, old_name, advise, lt_dlloader_find ("lt_preopen") ) == 0) { return 0; } /* Try to open the dynamic library. */ if (dlname) { /* try to open the installed module */ if (installed && libdir) { if (tryall_dlopen_module (handle, (const char *) 0, libdir, dlname, advise) == 0) return 0; } /* try to open the not-installed module */ if (!installed) { if (tryall_dlopen_module (handle, dir, objdir, dlname, advise) == 0) return 0; } /* maybe it was moved to another directory */ { if (dir && (tryall_dlopen_module (handle, (const char *) 0, dir, dlname, advise) == 0)) return 0; } } return 1; } static int canonicalize_path (const char *path, char **pcanonical) { char *canonical = 0; assert (path && *path); assert (pcanonical); canonical = MALLOC (char, 1+ LT_STRLEN (path)); if (!canonical) return 1; { size_t dest = 0; size_t src; for (src = 0; path[src] != LT_EOS_CHAR; ++src) { /* Path separators are not copied to the beginning or end of the destination, or if another separator would follow immediately. */ if (path[src] == LT_PATHSEP_CHAR) { if ((dest == 0) || (path[1+ src] == LT_PATHSEP_CHAR) || (path[1+ src] == LT_EOS_CHAR)) continue; } /* Anything other than a directory separator is copied verbatim. */ if ((path[src] != '/') #if defined(LT_DIRSEP_CHAR) && (path[src] != LT_DIRSEP_CHAR) #endif ) { canonical[dest++] = path[src]; } /* Directory separators are converted and copied only if they are not at the end of a path -- i.e. before a path separator or NULL terminator. */ else if ((path[1+ src] != LT_PATHSEP_CHAR) && (path[1+ src] != LT_EOS_CHAR) #if defined(LT_DIRSEP_CHAR) && (path[1+ src] != LT_DIRSEP_CHAR) #endif && (path[1+ src] != '/')) { canonical[dest++] = '/'; } } /* Add an end-of-string marker at the end. */ canonical[dest] = LT_EOS_CHAR; } /* Assign new value. */ *pcanonical = canonical; return 0; } static int argzize_path (const char *path, char **pargz, size_t *pargz_len) { error_t error; assert (path); assert (pargz); assert (pargz_len); if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len))) { switch (error) { case ENOMEM: LT__SETERROR (NO_MEMORY); break; default: LT__SETERROR (UNKNOWN); break; } return 1; } return 0; } /* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns non-zero or all elements are exhausted. If BASE_NAME is non-NULL, it is appended to each SEARCH_PATH element before FUNC is called. */ static int foreach_dirinpath (const char *search_path, const char *base_name, foreach_callback_func *func, void *data1, void *data2) { int result = 0; size_t filenamesize = 0; size_t lenbase = LT_STRLEN (base_name); size_t argz_len = 0; char *argz = 0; char *filename = 0; char *canonical = 0; if (!search_path || !*search_path) { LT__SETERROR (FILE_NOT_FOUND); goto cleanup; } if (canonicalize_path (search_path, &canonical) != 0) goto cleanup; if (argzize_path (canonical, &argz, &argz_len) != 0) goto cleanup; { char *dir_name = 0; while ((dir_name = argz_next (argz, argz_len, dir_name))) { size_t lendir = LT_STRLEN (dir_name); if (1+ lendir + lenbase >= filenamesize) { FREE (filename); filenamesize = 1+ lendir + 1+ lenbase; /* "/d" + '/' + "f" + '\0' */ filename = MALLOC (char, filenamesize); if (!filename) goto cleanup; } assert (filenamesize > lendir); strcpy (filename, dir_name); if (base_name && *base_name) { if (filename[lendir -1] != '/') filename[lendir++] = '/'; strcpy (filename +lendir, base_name); } if ((result = (*func) (filename, data1, data2))) { break; } } } cleanup: FREE (argz); FREE (canonical); FREE (filename); return result; } /* If FILEPATH can be opened, store the name of the directory component in DATA1, and the opened FILE* structure address in DATA2. Otherwise DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */ static int find_file_callback (char *filename, void *data1, void *data2) { char **pdir = (char **) data1; FILE **pfile = (FILE **) data2; int is_done = 0; assert (filename && *filename); assert (pdir); assert (pfile); if ((*pfile = fopen (filename, LT_READTEXT_MODE))) { char *dirend = strrchr (filename, '/'); if (dirend > filename) *dirend = LT_EOS_CHAR; FREE (*pdir); *pdir = lt__strdup (filename); is_done = (*pdir == 0) ? -1 : 1; } return is_done; } static FILE * find_file (const char *search_path, const char *base_name, char **pdir) { FILE *file = 0; foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file); return file; } static int find_handle_callback (char *filename, void *data, void *data2) { lt_dlhandle *phandle = (lt_dlhandle *) data; int notfound = access (filename, R_OK); lt_dladvise advise = (lt_dladvise) data2; /* Bail out if file cannot be read... */ if (notfound) return 0; /* Try to dlopen the file, but do not continue searching in any case. */ if (tryall_dlopen (phandle, filename, advise, 0) != 0) *phandle = 0; return 1; } /* If HANDLE was found return it, otherwise return 0. If HANDLE was found but could not be opened, *HANDLE will be set to 0. */ static lt_dlhandle * find_handle (const char *search_path, const char *base_name, lt_dlhandle *phandle, lt_dladvise advise) { if (!search_path) return 0; if (!foreach_dirinpath (search_path, base_name, find_handle_callback, phandle, advise)) return 0; return phandle; } #if !defined(LTDL_DLOPEN_DEPLIBS) static int load_deplibs (lt_dlhandle handle, char * LT__UNUSED deplibs) { handle->depcount = 0; return 0; } #else /* defined(LTDL_DLOPEN_DEPLIBS) */ static int load_deplibs (lt_dlhandle handle, char *deplibs) { char *p, *save_search_path = 0; int depcount = 0; int i; char **names = 0; int errors = 0; handle->depcount = 0; if (!deplibs) { return errors; } ++errors; if (user_search_path) { save_search_path = lt__strdup (user_search_path); if (!save_search_path) goto cleanup; } /* extract search paths and count deplibs */ p = deplibs; while (*p) { if (!isspace ((unsigned char) *p)) { char *end = p+1; while (*end && !isspace((unsigned char) *end)) { ++end; } if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0) { char save = *end; *end = 0; /* set a temporary string terminator */ if (lt_dladdsearchdir(p+2)) { goto cleanup; } *end = save; } else { ++depcount; } p = end; } else { ++p; } } if (!depcount) { errors = 0; goto cleanup; } names = MALLOC (char *, depcount); if (!names) goto cleanup; /* now only extract the actual deplibs */ depcount = 0; p = deplibs; while (*p) { if (isspace ((unsigned char) *p)) { ++p; } else { char *end = p+1; while (*end && !isspace ((unsigned char) *end)) { ++end; } if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0) { char *name; char save = *end; *end = 0; /* set a temporary string terminator */ if (strncmp(p, "-l", 2) == 0) { size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2); name = MALLOC (char, 1+ name_len); if (name) sprintf (name, "lib%s", p+2); } else name = lt__strdup(p); if (!name) goto cleanup_names; names[depcount++] = name; *end = save; } p = end; } } /* load the deplibs (in reverse order) At this stage, don't worry if the deplibs do not load correctly, they may already be statically linked into the loading application for instance. There will be a more enlightening error message later on if the loaded module cannot resolve all of its symbols. */ if (depcount) { lt_dlhandle cur = handle; int j = 0; cur->deplibs = MALLOC (lt_dlhandle, depcount); if (!cur->deplibs) goto cleanup_names; for (i = 0; i < depcount; ++i) { cur->deplibs[j] = lt_dlopenext(names[depcount-1-i]); if (cur->deplibs[j]) { ++j; } } cur->depcount = j; /* Number of successfully loaded deplibs */ errors = 0; } cleanup_names: for (i = 0; i < depcount; ++i) { FREE (names[i]); } cleanup: FREE (names); /* restore the old search path */ if (save_search_path) { MEMREASSIGN (user_search_path, save_search_path); } return errors; } #endif /* defined(LTDL_DLOPEN_DEPLIBS) */ static int unload_deplibs (lt_dlhandle handle) { int i; int errors = 0; lt_dlhandle cur = handle; if (cur->depcount) { for (i = 0; i < cur->depcount; ++i) { if (!LT_DLIS_RESIDENT (cur->deplibs[i])) { errors += lt_dlclose (cur->deplibs[i]); } } FREE (cur->deplibs); } return errors; } static int trim (char **dest, const char *str) { /* remove the leading and trailing "'" from str and store the result in dest */ const char *end = strrchr (str, '\''); size_t len = LT_STRLEN (str); char *tmp; FREE (*dest); if (!end || end == str) return 1; if (len > 3 && str[0] == '\'') { tmp = MALLOC (char, end - str); if (!tmp) return 1; memcpy(tmp, &str[1], (end - str) - 1); tmp[(end - str) - 1] = LT_EOS_CHAR; *dest = tmp; } else { *dest = 0; } return 0; } /* Read the .la file FILE. */ static int parse_dotla_file(FILE *file, char **dlname, char **libdir, char **deplibs, char **old_name, int *installed) { int errors = 0; size_t line_len = LT_FILENAME_MAX; char * line = MALLOC (char, line_len); if (!line) { LT__SETERROR (FILE_NOT_FOUND); return 1; } while (!feof (file)) { line[line_len-2] = '\0'; if (!fgets (line, (int) line_len, file)) { break; } /* Handle the case where we occasionally need to read a line that is longer than the initial buffer size. Behave even if the file contains NUL bytes due to corruption. */ while (line[line_len-2] != '\0' && line[line_len-2] != '\n' && !feof (file)) { line = REALLOC (char, line, line_len *2); if (!line) { ++errors; goto cleanup; } line[line_len * 2 - 2] = '\0'; if (!fgets (&line[line_len -1], (int) line_len +1, file)) { break; } line_len *= 2; } if (line[0] == '\n' || line[0] == '#') { continue; } #undef STR_DLNAME #define STR_DLNAME "dlname=" if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0) { errors += trim (dlname, &line[sizeof (STR_DLNAME) - 1]); } #undef STR_OLD_LIBRARY #define STR_OLD_LIBRARY "old_library=" else if (strncmp (line, STR_OLD_LIBRARY, sizeof (STR_OLD_LIBRARY) - 1) == 0) { errors += trim (old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); } /* Windows native tools do not understand the POSIX paths we store in libdir. */ #undef STR_LIBDIR #define STR_LIBDIR "libdir=" else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0) { errors += trim (libdir, &line[sizeof(STR_LIBDIR) - 1]); #ifdef __WINDOWS__ /* Disallow following unix-style paths on MinGW. */ if (*libdir && (**libdir == '/' || **libdir == '\\')) **libdir = '\0'; #endif } #undef STR_DL_DEPLIBS #define STR_DL_DEPLIBS "dependency_libs=" else if (strncmp (line, STR_DL_DEPLIBS, sizeof (STR_DL_DEPLIBS) - 1) == 0) { errors += trim (deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); } else if (streq (line, "installed=yes\n")) { *installed = 1; } else if (streq (line, "installed=no\n")) { *installed = 0; } #undef STR_LIBRARY_NAMES #define STR_LIBRARY_NAMES "library_names=" else if (!*dlname && strncmp (line, STR_LIBRARY_NAMES, sizeof (STR_LIBRARY_NAMES) - 1) == 0) { char *last_libname; errors += trim (dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); if (!errors && *dlname && (last_libname = strrchr (*dlname, ' ')) != 0) { last_libname = lt__strdup (last_libname + 1); if (!last_libname) { ++errors; goto cleanup; } MEMREASSIGN (*dlname, last_libname); } } if (errors) break; } cleanup: FREE (line); return errors; } /* Try to open FILENAME as a module. */ static int try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext, lt_dladvise advise) { const char * saved_error = 0; char * archive_name = 0; char * canonical = 0; char * base_name = 0; char * dir = 0; char * name = 0; char * attempt = 0; int errors = 0; lt_dlhandle newhandle; assert (phandle); assert (*phandle == 0); #ifdef LT_DEBUG_LOADERS fprintf (stderr, "try_dlopen (%s, %s)\n", filename ? filename : "(null)", ext ? ext : "(null)"); #endif LT__GETERROR (saved_error); /* dlopen self? */ if (!filename) { *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) return 1; newhandle = *phandle; /* lt_dlclose()ing yourself is very bad! Disallow it. */ newhandle->info.is_resident = 1; if (tryall_dlopen (&newhandle, 0, advise, 0) != 0) { FREE (*phandle); return 1; } goto register_handle; } assert (filename && *filename); if (ext) { attempt = MALLOC (char, LT_STRLEN (filename) + LT_STRLEN (ext) + 1); if (!attempt) return 1; sprintf(attempt, "%s%s", filename, ext); } else { attempt = lt__strdup (filename); if (!attempt) return 1; } /* Doing this immediately allows internal functions to safely assume only canonicalized paths are passed. */ if (canonicalize_path (attempt, &canonical) != 0) { ++errors; goto cleanup; } /* If the canonical module name is a path (relative or absolute) then split it into a directory part and a name part. */ base_name = strrchr (canonical, '/'); if (base_name) { size_t dirlen = (1+ base_name) - canonical; dir = MALLOC (char, 1+ dirlen); if (!dir) { ++errors; goto cleanup; } strncpy (dir, canonical, dirlen); dir[dirlen] = LT_EOS_CHAR; ++base_name; } else MEMREASSIGN (base_name, canonical); assert (base_name && *base_name); ext = strrchr (base_name, '.'); if (!ext) { ext = base_name + LT_STRLEN (base_name); } /* extract the module name from the file name */ name = MALLOC (char, ext - base_name + 1); if (!name) { ++errors; goto cleanup; } /* canonicalize the module name */ { int i; for (i = 0; i < ext - base_name; ++i) { if (isalnum ((unsigned char)(base_name[i]))) { name[i] = base_name[i]; } else { name[i] = '_'; } } name[ext - base_name] = LT_EOS_CHAR; } /* Before trawling through the filesystem in search of a module, check whether we are opening a preloaded module. */ if (!dir) { const lt_dlvtable *vtable = lt_dlloader_find ("lt_preopen"); if (vtable) { /* libprefix + name + "." + libext + NULL */ archive_name = MALLOC (char, strlen (libprefix) + LT_STRLEN (name) + strlen (libext) + 2); *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if ((*phandle == NULL) || (archive_name == NULL)) { ++errors; goto cleanup; } newhandle = *phandle; /* Preloaded modules are always named according to their old archive name. */ if (strncmp(name, "lib", 3) == 0) { sprintf (archive_name, "%s%s.%s", libprefix, name + 3, libext); } else { sprintf (archive_name, "%s.%s", name, libext); } if (tryall_dlopen (&newhandle, archive_name, advise, vtable) == 0) { goto register_handle; } /* If we're still here, there was no matching preloaded module, so put things back as we found them, and continue searching. */ FREE (*phandle); newhandle = NULL; } } /* If we are allowing only preloaded modules, and we didn't find anything yet, give up on the search here. */ if (advise && advise->try_preload_only) { goto cleanup; } /* Check whether we are opening a libtool module (.la extension). */ if (ext && streq (ext, archive_ext)) { /* this seems to be a libtool module */ FILE * file = 0; char * dlname = 0; char * old_name = 0; char * libdir = 0; char * deplibs = 0; /* if we can't find the installed flag, it is probably an installed libtool archive, produced with an old version of libtool */ int installed = 1; /* Now try to open the .la file. If there is no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if (!dir) { const char *search_path = user_search_path; if (search_path) file = find_file (user_search_path, base_name, &dir); if (!file) { search_path = getenv (LTDL_SEARCHPATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #if defined(LT_MODULE_PATH_VAR) if (!file) { search_path = getenv (LT_MODULE_PATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #endif #if defined(LT_DLSEARCH_PATH) if (!file && *sys_dlsearch_path) { file = find_file (sys_dlsearch_path, base_name, &dir); } #endif } else { file = fopen (attempt, LT_READTEXT_MODE); } /* If we didn't find the file by now, it really isn't there. Set the status flag, and bail out. */ if (!file) { LT__SETERROR (FILE_NOT_FOUND); ++errors; goto cleanup; } /* read the .la file */ if (parse_dotla_file(file, &dlname, &libdir, &deplibs, &old_name, &installed) != 0) ++errors; fclose (file); /* allocate the handle */ *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) ++errors; if (errors) { FREE (dlname); FREE (old_name); FREE (libdir); FREE (deplibs); FREE (*phandle); goto cleanup; } assert (*phandle); if (load_deplibs (*phandle, deplibs) == 0) { newhandle = *phandle; /* find_module may replace newhandle */ if (find_module (&newhandle, dir, libdir, dlname, old_name, installed, advise)) { unload_deplibs (*phandle); ++errors; } } else { ++errors; } FREE (dlname); FREE (old_name); FREE (libdir); FREE (deplibs); if (errors) { FREE (*phandle); goto cleanup; } if (*phandle != newhandle) { unload_deplibs (*phandle); } } else { /* not a libtool module */ *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) { ++errors; goto cleanup; } newhandle = *phandle; /* If the module has no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if ((dir || (!find_handle (user_search_path, base_name, &newhandle, advise) && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, &newhandle, advise) #if defined(LT_MODULE_PATH_VAR) && !find_handle (getenv (LT_MODULE_PATH_VAR), base_name, &newhandle, advise) #endif #if defined(LT_DLSEARCH_PATH) && !find_handle (sys_dlsearch_path, base_name, &newhandle, advise) #endif ))) { if (tryall_dlopen (&newhandle, attempt, advise, 0) != 0) { newhandle = NULL; } } if (!newhandle) { FREE (*phandle); ++errors; goto cleanup; } } register_handle: MEMREASSIGN (*phandle, newhandle); if ((*phandle)->info.ref_count == 0) { (*phandle)->info.ref_count = 1; MEMREASSIGN ((*phandle)->info.name, name); (*phandle)->next = handles; handles = *phandle; } LT__SETERRORSTR (saved_error); cleanup: FREE (dir); FREE (attempt); FREE (name); if (!canonical) /* was MEMREASSIGNed */ FREE (base_name); FREE (canonical); FREE (archive_name); return errors; } /* If the last error message stored was `FILE_NOT_FOUND', then return non-zero. */ static int file_not_found (void) { const char *error = 0; LT__GETERROR (error); if (error == LT__STRERROR (FILE_NOT_FOUND)) return 1; return 0; } /* Unless FILENAME already bears a suitable library extension, then return 0. */ static int has_library_ext (const char *filename) { const char * ext = 0; assert (filename); ext = strrchr (filename, '.'); if (ext && ((streq (ext, archive_ext)) #if defined(LT_MODULE_EXT) || (streq (ext, shlib_ext)) #endif #if defined(LT_SHARED_EXT) || (streq (ext, shared_ext)) #endif )) { return 1; } return 0; } /* Initialise and configure a user lt_dladvise opaque object. */ int lt_dladvise_init (lt_dladvise *padvise) { lt_dladvise advise = (lt_dladvise) lt__zalloc (sizeof (struct lt__advise)); *padvise = advise; return (advise ? 0 : 1); } int lt_dladvise_destroy (lt_dladvise *padvise) { if (padvise) FREE(*padvise); return 0; } int lt_dladvise_ext (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->try_ext = 1; return 0; } int lt_dladvise_resident (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_resident = 1; return 0; } int lt_dladvise_local (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_symlocal = 1; return 0; } int lt_dladvise_global (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_symglobal = 1; return 0; } int lt_dladvise_preload (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->try_preload_only = 1; return 0; } /* Libtool-1.5.x interface for loading a new module named FILENAME. */ lt_dlhandle lt_dlopen (const char *filename) { return lt_dlopenadvise (filename, NULL); } /* If FILENAME has an ARCHIVE_EXT or MODULE_EXT extension, try to open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT, and if a file is still not found try again with MODULE_EXT appended instead. */ lt_dlhandle lt_dlopenext (const char *filename) { lt_dlhandle handle = 0; lt_dladvise advise; if (!lt_dladvise_init (&advise) && !lt_dladvise_ext (&advise)) handle = lt_dlopenadvise (filename, advise); lt_dladvise_destroy (&advise); return handle; } lt_dlhandle lt_dlopenadvise (const char *filename, lt_dladvise advise) { lt_dlhandle handle = 0; int errors = 0; const char * saved_error = 0; LT__GETERROR (saved_error); /* Can't have symbols hidden and visible at the same time! */ if (advise && advise->is_symlocal && advise->is_symglobal) { LT__SETERROR (CONFLICTING_FLAGS); return 0; } if (!filename || !advise || !advise->try_ext || has_library_ext (filename)) { /* Just incase we missed a code path in try_dlopen() that reports an error, but forgot to reset handle... */ if (try_dlopen (&handle, filename, NULL, advise) != 0) return 0; return handle; } else if (filename && *filename) { /* First try appending ARCHIVE_EXT. */ errors += try_dlopen (&handle, filename, archive_ext, advise); /* If we found FILENAME, stop searching -- whether we were able to load the file as a module or not. If the file exists but loading failed, it is better to return an error message here than to report FILE_NOT_FOUND when the alternatives (foo.so etc) are not in the module search path. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #if defined(LT_MODULE_EXT) /* Try appending SHLIB_EXT. */ LT__SETERRORSTR (saved_error); errors = try_dlopen (&handle, filename, shlib_ext, advise); /* As before, if the file was found but loading failed, return now with the current error message. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #endif #if defined(LT_SHARED_EXT) /* Try appending SHARED_EXT. */ LT__SETERRORSTR (saved_error); errors = try_dlopen (&handle, filename, shared_ext, advise); /* As before, if the file was found but loading failed, return now with the current error message. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #endif } /* Still here? Then we really did fail to locate any of the file names we tried. */ LT__SETERROR (FILE_NOT_FOUND); return 0; } static int lt_argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry) { error_t error; /* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz, pargz_len, NULL, entry) failed with EINVAL. */ if (before) error = argz_insert (pargz, pargz_len, before, entry); else error = argz_append (pargz, pargz_len, entry, 1 + strlen (entry)); if (error) { switch (error) { case ENOMEM: LT__SETERROR (NO_MEMORY); break; default: LT__SETERROR (UNKNOWN); break; } return 1; } return 0; } static int lt_argz_insertinorder (char **pargz, size_t *pargz_len, const char *entry) { char *before = 0; assert (pargz); assert (pargz_len); assert (entry && *entry); if (*pargz) while ((before = argz_next (*pargz, *pargz_len, before))) { int cmp = strcmp (entry, before); if (cmp < 0) break; if (cmp == 0) return 0; /* No duplicates! */ } return lt_argz_insert (pargz, pargz_len, before, entry); } static int lt_argz_insertdir (char **pargz, size_t *pargz_len, const char *dirnam, struct dirent *dp) { char *buf = 0; size_t buf_len = 0; char *end = 0; size_t end_offset = 0; size_t dir_len = 0; int errors = 0; assert (pargz); assert (pargz_len); assert (dp); dir_len = LT_STRLEN (dirnam); end = dp->d_name + D_NAMLEN(dp); /* Ignore version numbers. */ { char *p; for (p = end; p -1 > dp->d_name; --p) if (strchr (".0123456789", p[-1]) == 0) break; if (*p == '.') end = p; } /* Ignore filename extension. */ { char *p; for (p = end -1; p > dp->d_name; --p) if (*p == '.') { end = p; break; } } /* Prepend the directory name. */ end_offset = end - dp->d_name; buf_len = dir_len + 1+ end_offset; buf = MALLOC (char, 1+ buf_len); if (!buf) return ++errors; assert (buf); strcpy (buf, dirnam); strcat (buf, "/"); strncat (buf, dp->d_name, end_offset); buf[buf_len] = LT_EOS_CHAR; /* Try to insert (in order) into ARGZ/ARGZ_LEN. */ if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) ++errors; FREE (buf); return errors; } static int list_files_by_dir (const char *dirnam, char **pargz, size_t *pargz_len) { DIR *dirp = 0; int errors = 0; assert (dirnam && *dirnam); assert (pargz); assert (pargz_len); assert (dirnam[LT_STRLEN(dirnam) -1] != '/'); dirp = opendir (dirnam); if (dirp) { struct dirent *dp = 0; while ((dp = readdir (dirp))) if (dp->d_name[0] != '.') if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp)) { ++errors; break; } closedir (dirp); } else ++errors; return errors; } /* If there are any files in DIRNAME, call the function passed in DATA1 (with the name of each file and DATA2 as arguments). */ static int foreachfile_callback (char *dirname, void *data1, void *data2) { file_worker_func *func = *(file_worker_func **) data1; int is_done = 0; char *argz = 0; size_t argz_len = 0; if (list_files_by_dir (dirname, &argz, &argz_len) != 0) goto cleanup; if (!argz) goto cleanup; { char *filename = 0; while ((filename = argz_next (argz, argz_len, filename))) if ((is_done = (*func) (filename, data2))) break; } cleanup: FREE (argz); return is_done; } /* Call FUNC for each unique extensionless file in SEARCH_PATH, along with DATA. The filenames passed to FUNC would be suitable for passing to lt_dlopenext. The extensions are stripped so that individual modules do not generate several entries (e.g. libfoo.la, libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL, then the same directories that lt_dlopen would search are examined. */ int lt_dlforeachfile (const char *search_path, int (*func) (const char *filename, void *data), void *data) { int is_done = 0; file_worker_func **fpptr = &func; if (search_path) { /* If a specific path was passed, search only the directories listed in it. */ is_done = foreach_dirinpath (search_path, 0, foreachfile_callback, fpptr, data); } else { /* Otherwise search the default paths. */ is_done = foreach_dirinpath (user_search_path, 0, foreachfile_callback, fpptr, data); if (!is_done) { is_done = foreach_dirinpath (getenv(LTDL_SEARCHPATH_VAR), 0, foreachfile_callback, fpptr, data); } #if defined(LT_MODULE_PATH_VAR) if (!is_done) { is_done = foreach_dirinpath (getenv(LT_MODULE_PATH_VAR), 0, foreachfile_callback, fpptr, data); } #endif #if defined(LT_DLSEARCH_PATH) if (!is_done && *sys_dlsearch_path) { is_done = foreach_dirinpath (sys_dlsearch_path, 0, foreachfile_callback, fpptr, data); } #endif } return is_done; } int lt_dlclose (lt_dlhandle handle) { lt_dlhandle cur, last; int errors = 0; /* check whether the handle is valid */ last = cur = handles; while (cur && handle != cur) { last = cur; cur = cur->next; } if (!cur) { LT__SETERROR (INVALID_HANDLE); ++errors; goto done; } cur = handle; cur->info.ref_count--; /* Note that even with resident modules, we must track the ref_count correctly incase the user decides to reset the residency flag later (even though the API makes no provision for that at the moment). */ if (cur->info.ref_count <= 0 && !LT_DLIS_RESIDENT (cur)) { lt_user_data data = cur->vtable->dlloader_data; if (cur != handles) { last->next = cur->next; } else { handles = cur->next; } errors += cur->vtable->module_close (data, cur->module); errors += unload_deplibs (handle); /* It is up to the callers to free the data itself. */ FREE (cur->interface_data); FREE (cur->info.filename); FREE (cur->info.name); FREE (cur); goto done; } if (LT_DLIS_RESIDENT (handle)) { LT__SETERROR (CLOSE_RESIDENT_MODULE); ++errors; } done: return errors; } void * lt_dlsym (lt_dlhandle place, const char *symbol) { size_t lensym; char lsym[LT_SYMBOL_LENGTH]; char *sym; void *address; lt_user_data data; lt_dlhandle handle; if (!place) { LT__SETERROR (INVALID_HANDLE); return 0; } handle = place; if (!symbol) { LT__SETERROR (SYMBOL_NOT_FOUND); return 0; } lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->vtable->sym_prefix) + LT_STRLEN (handle->info.name); if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) { sym = lsym; } else { sym = MALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); if (!sym) { LT__SETERROR (BUFFER_OVERFLOW); return 0; } } data = handle->vtable->dlloader_data; if (handle->info.name) { const char *saved_error; LT__GETERROR (saved_error); /* this is a libtool module */ if (handle->vtable->sym_prefix) { strcpy(sym, handle->vtable->sym_prefix); strcat(sym, handle->info.name); } else { strcpy(sym, handle->info.name); } strcat(sym, "_LTX_"); strcat(sym, symbol); /* try "modulename_LTX_symbol" */ address = handle->vtable->find_sym (data, handle->module, sym); if (address) { if (sym != lsym) { FREE (sym); } return address; } LT__SETERRORSTR (saved_error); } /* otherwise try "symbol" */ if (handle->vtable->sym_prefix) { strcpy(sym, handle->vtable->sym_prefix); strcat(sym, symbol); } else { strcpy(sym, symbol); } address = handle->vtable->find_sym (data, handle->module, sym); if (sym != lsym) { FREE (sym); } return address; } const char * lt_dlerror (void) { const char *error; LT__GETERROR (error); LT__SETERRORSTR (0); return error; } static int lt_dlpath_insertdir (char **ppath, char *before, const char *dir) { int errors = 0; char *canonical = 0; char *argz = 0; size_t argz_len = 0; assert (ppath); assert (dir && *dir); if (canonicalize_path (dir, &canonical) != 0) { ++errors; goto cleanup; } assert (canonical && *canonical); /* If *PPATH is empty, set it to DIR. */ if (*ppath == 0) { assert (!before); /* BEFORE cannot be set without PPATH. */ assert (dir); /* Without DIR, don't call this function! */ *ppath = lt__strdup (dir); if (*ppath == 0) ++errors; goto cleanup; } assert (ppath && *ppath); if (argzize_path (*ppath, &argz, &argz_len) != 0) { ++errors; goto cleanup; } /* Convert BEFORE into an equivalent offset into ARGZ. This only works if *PPATH is already canonicalized, and hence does not change length with respect to ARGZ. We canonicalize each entry as it is added to the search path, and don't call this function with (uncanonicalized) user paths, so this is a fair assumption. */ if (before) { assert (*ppath <= before); assert ((int) (before - *ppath) <= (int) strlen (*ppath)); before = before - *ppath + argz; } if (lt_argz_insert (&argz, &argz_len, before, dir) != 0) { ++errors; goto cleanup; } argz_stringify (argz, argz_len, LT_PATHSEP_CHAR); MEMREASSIGN(*ppath, argz); cleanup: FREE (argz); FREE (canonical); return errors; } int lt_dladdsearchdir (const char *search_dir) { int errors = 0; if (search_dir && *search_dir) { if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) ++errors; } return errors; } int lt_dlinsertsearchdir (const char *before, const char *search_dir) { int errors = 0; if (before) { if ((before < user_search_path) || (before >= user_search_path + LT_STRLEN (user_search_path))) { LT__SETERROR (INVALID_POSITION); return 1; } } if (search_dir && *search_dir) { if (lt_dlpath_insertdir (&user_search_path, (char *) before, search_dir) != 0) { ++errors; } } return errors; } int lt_dlsetsearchpath (const char *search_path) { int errors = 0; FREE (user_search_path); if (!search_path || !LT_STRLEN (search_path)) { return errors; } if (canonicalize_path (search_path, &user_search_path) != 0) ++errors; return errors; } const char * lt_dlgetsearchpath (void) { const char *saved_path; saved_path = user_search_path; return saved_path; } int lt_dlmakeresident (lt_dlhandle handle) { int errors = 0; if (!handle) { LT__SETERROR (INVALID_HANDLE); ++errors; } else { handle->info.is_resident = 1; } return errors; } int lt_dlisresident (lt_dlhandle handle) { if (!handle) { LT__SETERROR (INVALID_HANDLE); return -1; } return LT_DLIS_RESIDENT (handle); } /* --- MODULE INFORMATION --- */ typedef struct { const char *id_string; lt_dlhandle_interface *iface; } lt__interface_id; lt_dlinterface_id lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface) { lt__interface_id *interface_id = (lt__interface_id *) lt__malloc (sizeof *interface_id); /* If lt__malloc fails, it will LT__SETERROR (NO_MEMORY), which can then be detected with lt_dlerror() if we return 0. */ if (interface_id) { interface_id->id_string = lt__strdup (id_string); if (!interface_id->id_string) FREE (interface_id); else interface_id->iface = iface; } return (lt_dlinterface_id) interface_id; } void lt_dlinterface_free (lt_dlinterface_id key) { lt__interface_id *interface_id = (lt__interface_id *)key; FREE (interface_id->id_string); FREE (interface_id); } void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data) { int n_elements = 0; void *stale = (void *) 0; lt_dlhandle cur = handle; int i; if (cur->interface_data) while (cur->interface_data[n_elements].key) ++n_elements; for (i = 0; i < n_elements; ++i) { if (cur->interface_data[i].key == key) { stale = cur->interface_data[i].data; break; } } /* Ensure that there is enough room in this handle's interface_data array to accept a new element (and an empty end marker). */ if (i == n_elements) { lt_interface_data *temp = REALLOC (lt_interface_data, cur->interface_data, 2+ n_elements); if (!temp) { stale = 0; goto done; } cur->interface_data = temp; /* We only need this if we needed to allocate a new interface_data. */ cur->interface_data[i].key = key; cur->interface_data[1+ i].key = 0; } cur->interface_data[i].data = data; done: return stale; } void * lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle) { void *result = (void *) 0; lt_dlhandle cur = handle; /* Locate the index of the element with a matching KEY. */ if (cur->interface_data) { int i; for (i = 0; cur->interface_data[i].key; ++i) { if (cur->interface_data[i].key == key) { result = cur->interface_data[i].data; break; } } } return result; } const lt_dlinfo * lt_dlgetinfo (lt_dlhandle handle) { if (!handle) { LT__SETERROR (INVALID_HANDLE); return 0; } return &(handle->info); } lt_dlhandle lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place) { lt_dlhandle handle = place; lt__interface_id *iterator = (lt__interface_id *) iface; assert (iface); /* iface is a required argument */ if (!handle) handle = handles; else handle = handle->next; /* advance while the interface check fails */ while (handle && iterator->iface && ((*iterator->iface) (handle, iterator->id_string) != 0)) { handle = handle->next; } return handle; } lt_dlhandle lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name) { lt_dlhandle handle = 0; assert (iface); /* iface is a required argument */ while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle; if (cur && cur->info.name && streq (cur->info.name, module_name)) break; } return handle; } int lt_dlhandle_map (lt_dlinterface_id iface, int (*func) (lt_dlhandle handle, void *data), void *data) { lt__interface_id *iterator = (lt__interface_id *) iface; lt_dlhandle cur = handles; assert (iface); /* iface is a required argument */ while (cur) { int errorcode = 0; /* advance while the interface check fails */ while (cur && iterator->iface && ((*iterator->iface) (cur, iterator->id_string) != 0)) { cur = cur->next; } if ((errorcode = (*func) (cur, data)) != 0) return errorcode; } return 0; } parser-3.5.1/src/lib/ltdl/argz.c0000644000076400007640000001351011770443336013360 00000000000000/* argz.c -- argz implementation for non-glibc systems Copyright (C) 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if defined(LTDL) && defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #ifdef HAVE_WORKING_ARGZ #include #else #include #endif #include #include #include #include #include #include #define EOS_CHAR '\0' error_t argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len) { size_t argz_len; char *argz; assert (pargz); assert (pargz_len); assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len)); /* If nothing needs to be appended, no more work is required. */ if (buf_len == 0) return 0; /* Ensure there is enough room to append BUF_LEN. */ argz_len = *pargz_len + buf_len; argz = (char *) realloc (*pargz, argz_len); if (!argz) return ENOMEM; /* Copy characters from BUF after terminating '\0' in ARGZ. */ memcpy (argz + *pargz_len, buf, buf_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } error_t argz_create_sep (const char *str, int delim, char **pargz, size_t *pargz_len) { size_t argz_len; char *argz = 0; assert (str); assert (pargz); assert (pargz_len); /* Make a copy of STR, but replacing each occurrence of DELIM with '\0'. */ argz_len = 1+ strlen (str); if (argz_len) { const char *p; char *q; argz = (char *) malloc (argz_len); if (!argz) return ENOMEM; for (p = str, q = argz; *p != EOS_CHAR; ++p) { if (*p == delim) { /* Ignore leading delimiters, and fold consecutive delimiters in STR into a single '\0' in ARGZ. */ if ((q > argz) && (q[-1] != EOS_CHAR)) *q++ = EOS_CHAR; else --argz_len; } else *q++ = *p; } /* Copy terminating EOS_CHAR. */ *q = *p; } /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ if (!argz_len) argz = (free (argz), (char *) 0); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } error_t argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry) { assert (pargz); assert (pargz_len); assert (entry && *entry); /* No BEFORE address indicates ENTRY should be inserted after the current last element. */ if (!before) return argz_append (pargz, pargz_len, entry, 1+ strlen (entry)); /* This probably indicates a programmer error, but to preserve semantics, scan back to the start of an entry if BEFORE points into the middle of it. */ while ((before > *pargz) && (before[-1] != EOS_CHAR)) --before; { size_t entry_len = 1+ strlen (entry); size_t argz_len = *pargz_len + entry_len; size_t offset = before - *pargz; char *argz = (char *) realloc (*pargz, argz_len); if (!argz) return ENOMEM; /* Make BEFORE point to the equivalent offset in ARGZ that it used to have in *PARGZ incase realloc() moved the block. */ before = argz + offset; /* Move the ARGZ entries starting at BEFORE up into the new space at the end -- making room to copy ENTRY into the resulting gap. */ memmove (before + entry_len, before, *pargz_len - offset); memcpy (before, entry, entry_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; } return 0; } char * argz_next (char *argz, size_t argz_len, const char *entry) { assert ((argz && argz_len) || (!argz && !argz_len)); if (entry) { /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address within the ARGZ vector. */ assert ((!argz && !argz_len) || ((argz <= entry) && (entry < (argz + argz_len)))); /* Move to the char immediately after the terminating '\0' of ENTRY. */ entry = 1+ strchr (entry, EOS_CHAR); /* Return either the new ENTRY, or else NULL if ARGZ is exhausted. */ return (entry >= argz + argz_len) ? 0 : (char *) entry; } else { /* This should probably be flagged as a programmer error, since starting an argz_next loop with the iterator set to ARGZ is safer. To preserve semantics, handle the NULL case by returning the start of ARGZ (if any). */ if (argz_len > 0) return argz; else return 0; } } void argz_stringify (char *argz, size_t argz_len, int sep) { assert ((argz && argz_len) || (!argz && !argz_len)); if (sep) { --argz_len; /* don't stringify the terminating EOS */ while (--argz_len > 0) { if (argz[argz_len] == EOS_CHAR) argz[argz_len] = sep; } } } parser-3.5.1/src/lib/ltdl/lt_dlloader.c0000644000076400007640000001367411764645177014727 00000000000000/* lt_dlloader.c -- dynamic library loader interface Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" #define RETURN_SUCCESS 0 #define RETURN_FAILURE 1 static void * loader_callback (SList *item, void *userdata); /* A list of all the dlloaders we know about, each stored as a boxed SList item: */ static SList *loaders = 0; /* Return NULL, unless the loader in this ITEM has a matching name, in which case we return the matching item so that its address is passed back out (for possible freeing) by slist_remove. */ static void * loader_callback (SList *item, void *userdata) { const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata; const char * name = (const char *) userdata; assert (vtable); return streq (vtable->name, name) ? (void *) item : NULL; } /* Hook VTABLE into our global LOADERS list according to its own PRIORITY field value. */ int lt_dlloader_add (const lt_dlvtable *vtable) { SList *item; if ((vtable == 0) /* diagnose invalid vtable fields */ || (vtable->module_open == 0) || (vtable->module_close == 0) || (vtable->find_sym == 0) || ((vtable->priority != LT_DLLOADER_PREPEND) && (vtable->priority != LT_DLLOADER_APPEND))) { LT__SETERROR (INVALID_LOADER); return RETURN_FAILURE; } item = slist_box (vtable); if (!item) { (*lt__alloc_die) (); /* Let the caller know something went wrong if lt__alloc_die doesn't abort. */ return RETURN_FAILURE; } if (vtable->priority == LT_DLLOADER_PREPEND) { loaders = slist_cons (item, loaders); } else { assert (vtable->priority == LT_DLLOADER_APPEND); loaders = slist_concat (loaders, item); } return RETURN_SUCCESS; } #ifdef LT_DEBUG_LOADERS static void * loader_dump_callback (SList *item, void *userdata) { const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata; fprintf (stderr, ", %s", (vtable && vtable->name) ? vtable->name : "(null)"); return 0; } void lt_dlloader_dump (void) { fprintf (stderr, "loaders: "); if (!loaders) { fprintf (stderr, "(empty)"); } else { const lt_dlvtable *head = (const lt_dlvtable *) loaders->userdata; fprintf (stderr, "%s", (head && head->name) ? head->name : "(null)"); if (slist_tail (loaders)) slist_foreach (slist_tail (loaders), loader_dump_callback, NULL); } fprintf (stderr, "\n"); } #endif /* An iterator for the global loader list: if LOADER is NULL, then return the first element, otherwise the following element. */ lt_dlloader lt_dlloader_next (lt_dlloader loader) { SList *item = (SList *) loader; return (lt_dlloader) (item ? item->next : loaders); } /* Non-destructive unboxing of a loader. */ const lt_dlvtable * lt_dlloader_get (lt_dlloader loader) { return (const lt_dlvtable *) (loader ? ((SList *) loader)->userdata : NULL); } /* Return the contents of the first item in the global loader list with a matching NAME after removing it from that list. If there was no match, return NULL; if there is an error, return NULL and set an error for lt_dlerror; do not set an error if only resident modules need this loader; in either case, the loader list is not changed if NULL is returned. */ lt_dlvtable * lt_dlloader_remove (const char *name) { const lt_dlvtable * vtable = lt_dlloader_find (name); static const char id_string[] = "lt_dlloader_remove"; lt_dlinterface_id iface; lt_dlhandle handle = 0; int in_use = 0; int in_use_by_resident = 0; if (!vtable) { LT__SETERROR (INVALID_LOADER); return 0; } /* Fail if there are any open modules which use this loader. */ iface = lt_dlinterface_register (id_string, NULL); while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle; if (cur->vtable == vtable) { in_use = 1; if (lt_dlisresident (handle)) in_use_by_resident = 1; } } lt_dlinterface_free (iface); if (in_use) { if (!in_use_by_resident) LT__SETERROR (REMOVE_LOADER); return 0; } /* Call the loader finalisation function. */ if (vtable && vtable->dlloader_exit) { if ((*vtable->dlloader_exit) (vtable->dlloader_data) != 0) { /* If there is an exit function, and it returns non-zero then it must set an error, and we will not remove it from the list. */ return 0; } } /* If we got this far, remove the loader from our global list. */ return (lt_dlvtable *) slist_unbox ((SList *) slist_remove (&loaders, loader_callback, (void *) name)); } const lt_dlvtable * lt_dlloader_find (const char *name) { return lt_dlloader_get (slist_find (loaders, loader_callback, (void *) name)); } parser-3.5.1/src/lib/ltdl/lt_error.c0000644000076400007640000000562111764645177014263 00000000000000/* lt_error.c -- error propogation interface Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_error.h" static const char *last_error = 0; static const char error_strings[LT_ERROR_MAX][LT_ERROR_LEN_MAX + 1] = { #define LT_ERROR(name, diagnostic) diagnostic, lt_dlerror_table #undef LT_ERROR }; static const char **user_error_strings = 0; static int errorcount = LT_ERROR_MAX; int lt_dladderror (const char *diagnostic) { int errindex = 0; int result = -1; const char **temp = (const char **) 0; assert (diagnostic); errindex = errorcount - LT_ERROR_MAX; temp = REALLOC (const char *, user_error_strings, 1 + errindex); if (temp) { user_error_strings = temp; user_error_strings[errindex] = diagnostic; result = errorcount++; } return result; } int lt_dlseterror (int errindex) { int errors = 0; if (errindex >= errorcount || errindex < 0) { /* Ack! Error setting the error message! */ LT__SETERROR (INVALID_ERRORCODE); ++errors; } else if (errindex < LT_ERROR_MAX) { /* No error setting the error message! */ LT__SETERRORSTR (error_strings[errindex]); } else { /* No error setting the error message! */ LT__SETERRORSTR (user_error_strings[errindex - LT_ERROR_MAX]); } return errors; } const char * lt__error_string (int errorcode) { assert (errorcode >= 0); assert (errorcode < LT_ERROR_MAX); return error_strings[errorcode]; } const char * lt__get_last_error (void) { return last_error; } const char * lt__set_last_error (const char *errormsg) { return last_error = errormsg; } parser-3.5.1/src/lib/ltdl/config_fixed.h0000644000076400007640000000075011770053110015033 00000000000000/* pa_config_fixed.h. */ /* Configure file for autoconf-disabled platforms */ #define HAVE_CTYPE_H 1 #define HAVE_ERRNO_H 1 #define HAVE_MEMCPY 1 #define HAVE_MEMMOVE 1 #define HAVE_MEMORY_H 1 #define HAVE_STDIO_H 1 #define HAVE_STDLIB_H 1 #define HAVE_STRCHR 1 #define HAVE_STRCMP 1 #define HAVE_STRINGS_H 1 #define HAVE_STRING_H 1 #define HAVE_STRRCHR 1 #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_TYPES_H 1 #define error_t int #define LT_OBJDIR ".libs/" #define LT_MODULE_EXT ".dll" parser-3.5.1/src/lib/ltdl/configure0000755000076400007640000153001014504641704014155 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for libltdl 2.4.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: bug-libtool@gnu.org about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} 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='libltdl' PACKAGE_TARNAME='libltdl' PACKAGE_VERSION='2.4.2' PACKAGE_STRING='libltdl 2.4.2' PACKAGE_BUGREPORT='bug-libtool@gnu.org' PACKAGE_URL='' ac_unique_file="ltdl.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LTDLOPEN LT_CONFIG_H CONVENIENCE_LTDL_FALSE CONVENIENCE_LTDL_TRUE INSTALL_LTDL_FALSE INSTALL_LTDL_TRUE ARGZ_H LIBOBJS sys_symbol_underscore LIBADD_DL LT_DLPREOPEN LIBADD_DLD_LINK LIBADD_SHL_LOAD LIBADD_DLOPEN LT_DLLOADERS CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL OBJDUMP DLLTOOL AS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_shared enable_static with_pic enable_fast_install enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock enable_ltdl_install ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures libltdl 2.4.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/libltdl] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names 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 case $ac_init_help in short | recursive ) echo "Configuration of libltdl 2.4.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). 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 . _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 libltdl configure 2.4.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_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_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_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _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_decl # 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 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 libltdl $as_me 2.4.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h:config-h.in" ac_aux_dir= for ac_dir in config "$srcdir"/config; 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 config \"$srcdir\"/config" "$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. # I am me! ## ------------------------ ## ## Automake Initialisation. ## ## ------------------------ ## am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='libltdl' VERSION='2.4.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ## ------------------------------- ## ## Libtool specific configuration. ## ## ------------------------------- ## pkgdatadir='${datadir}'"/${PACKAGE}" ## ----------------------- ## ## Libtool initialisation. ## ## ----------------------- ## case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # 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 # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_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 '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "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_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_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_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_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 fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "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_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$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 DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$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_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" 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 DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $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 OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" 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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $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 DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" 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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$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 AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$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_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" 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 AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $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 MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" 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 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $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 DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $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_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" 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 DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $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 NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $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_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" 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 NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $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 LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $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_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" 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 LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $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 OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $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_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" 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 OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $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 OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $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_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" 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 OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac 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 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 # 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 dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done # Set options enable_dlopen=yes enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; 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_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $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 AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; 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_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $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_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" 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 AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $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 DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" 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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $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 OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" 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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $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 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5 $as_echo_n "checking which extension is used for runtime loadable modules... " >&6; } if ${libltdl_cv_shlibext+:} false; then : $as_echo_n "(cached) " >&6 else module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 $as_echo "$libltdl_cv_shlibext" >&6; } if test -n "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_EXT "$libltdl_cv_shlibext" _ACEOF fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_SHARED_EXT "$libltdl_cv_shrext" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variable specifies run-time module search path" >&5 $as_echo_n "checking which variable specifies run-time module search path... " >&6; } if ${lt_cv_module_path_var+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_module_path_var="$shlibpath_var" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 $as_echo "$lt_cv_module_path_var" >&6; } if test -n "$lt_cv_module_path_var"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_PATH_VAR "$lt_cv_module_path_var" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 $as_echo_n "checking for the default library search path... " >&6; } if ${lt_cv_sys_dlsearch_path+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 $as_echo "$lt_cv_sys_dlsearch_path" >&6; } if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done cat >>confdefs.h <<_ACEOF #define LT_DLSEARCH_PATH "$sys_dlsearch_path" _ACEOF fi LT_DLLOADERS= 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 LIBADD_DLOPEN= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} 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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; 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_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBDL 1" >>confdefs.h if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main () { dlopen(0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" for ac_func in dlerror do : ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" if test "x$ac_cv_func_dlerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLERROR 1 _ACEOF fi done LIBS="$lt_save_LIBS" fi LIBADD_SHL_LOAD= ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld" fi fi case $host_os in darwin[1567].*) # We only want this for pre-Mac OS X 10.4. ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" if test "x$ac_cv_func__dyld_func_lookup" = xyes; then : $as_echo "#define HAVE_DYLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" fi ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include " if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl _ACEOF LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : $as_echo "#define HAVE_DLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" fi LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done $as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h fi LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" 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 _ prefix in compiled symbols" >&5 $as_echo_n "checking for _ prefix in compiled symbols... " >&6; } if ${lt_cv_sys_symbol_underscore+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&5 fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 $as_echo "$lt_cv_sys_symbol_underscore" >&6; } sys_symbol_underscore=$lt_cv_sys_symbol_underscore if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 $as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; } if ${libltdl_cv_need_uscore+:} false; then : $as_echo_n "(cached) " >&6 else libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" if test "$cross_compiling" = yes; then : libltdl_cv_need_uscore=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; x$lt_dlunknown|x*) ;; esac else : # compilation failed fi fi rm -fr conftest* LIBS="$save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 $as_echo "$libltdl_cv_need_uscore" >&6; } fi fi if test x"$libltdl_cv_need_uscore" = xyes; then $as_echo "#define NEED_USCORE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 $as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; } if ${lt_cv_sys_dlopen_deplibs+:} false; then : $as_echo_n "(cached) " >&6 else # PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[4-9]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[12345]*|irix6.[01]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[1234]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; } if test "$lt_cv_sys_dlopen_deplibs" != yes; then $as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h fi : for ac_header in argz.h do : ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default " if test "x$ac_cv_header_argz_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARGZ_H 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) # include #endif " if test "x$ac_cv_type_error_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERROR_T 1 _ACEOF else $as_echo "#define error_t int" >>confdefs.h $as_echo "#define __error_t_defined 1" >>confdefs.h fi ARGZ_H= for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify 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 else ARGZ_H=argz.h; case " $LIBOBJS " in *" argz.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS argz.$ac_objext" ;; esac fi done if test -z "$ARGZ_H"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 $as_echo_n "checking if argz actually works... " >&6; } if ${lt_cv_sys_argz_works+:} false; then : $as_echo_n "(cached) " >&6 else case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 $as_echo "$lt_cv_sys_argz_works" >&6; } if test "$lt_cv_sys_argz_works" = yes; then : $as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h else ARGZ_H=argz.h case " $LIBOBJS " in *" argz.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS argz.$ac_objext" ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 $as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } if ${libltdl_cv_preloaded_symbols+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 $as_echo "$libltdl_cv_preloaded_symbols" >&6; } if test x"$libltdl_cv_preloaded_symbols" = xyes; then $as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h fi # Check whether --enable-ltdl-install was given. if test "${enable_ltdl_install+set}" = set; then : enableval=$enable_ltdl_install; fi case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac if test x"${enable_ltdl_install-no}" != xno; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else INSTALL_LTDL_TRUE='#' INSTALL_LTDL_FALSE= fi if test x"${enable_ltdl_convenience-no}" != xno; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else CONVENIENCE_LTDL_TRUE='#' CONVENIENCE_LTDL_FALSE= fi # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.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_func in closedir opendir readdir 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 else case " $LIBOBJS " in *" lt__dirent.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lt__dirent.$ac_objext" ;; esac fi done for ac_func in strlcat strlcpy 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 else case " $LIBOBJS " in *" lt__strl.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lt__strl.$ac_objext" ;; esac fi done cat >>confdefs.h <<_ACEOF #define LT_LIBEXT "$libext" _ACEOF name= eval "lt_libprefix=\"$libname_spec\"" cat >>confdefs.h <<_ACEOF #define LT_LIBPREFIX "$lt_libprefix" _ACEOF name=ltdl eval "LTDLOPEN=\"$libname_spec\"" ## -------- ## ## Outputs. ## ## -------- ## ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= 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 if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then as_fn_error $? "conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi LT_CONFIG_H=config.h : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by libltdl $as_me 2.4.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ libltdl config.status 2.4.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _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:config-h.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="" # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; 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 parser-3.5.1/src/lib/ltdl/lt__dirent.c0000644000076400007640000000573211764645176014560 00000000000000/* lt__dirent.c -- internal directory entry scanning interface Copyright (C) 2001, 2004 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2001 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include #include #include "lt__dirent.h" #if defined(__WINDOWS__) void closedir (DIR *entry) { assert (entry != (DIR *) NULL); FindClose (entry->hSearch); free ((void *) entry); } DIR * opendir (const char *path) { char file_spec[LT_FILENAME_MAX]; DIR *entry; assert (path != (char *) 0); if (lt_strlcpy (file_spec, path, sizeof file_spec) >= sizeof file_spec || lt_strlcat (file_spec, "\\", sizeof file_spec) >= sizeof file_spec) return (DIR *) 0; entry = (DIR *) malloc (sizeof(DIR)); if (entry != (DIR *) 0) { entry->firsttime = TRUE; entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData); if (entry->hSearch == INVALID_HANDLE_VALUE) { if (lt_strlcat (file_spec, "\\*.*", sizeof file_spec) < sizeof file_spec) { entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData); } if (entry->hSearch == INVALID_HANDLE_VALUE) { entry = (free (entry), (DIR *) 0); } } } return entry; } struct dirent * readdir (DIR *entry) { int status; if (entry == (DIR *) 0) return (struct dirent *) 0; if (!entry->firsttime) { status = FindNextFile (entry->hSearch, &entry->Win32FindData); if (status == 0) return (struct dirent *) 0; } entry->firsttime = FALSE; if (lt_strlcpy (entry->file_info.d_name, entry->Win32FindData.cFileName, sizeof entry->file_info.d_name) >= sizeof entry->file_info.d_name) return (struct dirent *) 0; entry->file_info.d_namlen = strlen (entry->file_info.d_name); return &entry->file_info; } #endif /*defined(__WINDOWS__)*/ parser-3.5.1/src/lib/ltdl/lt__alloc.c0000644000076400007640000000435511764645176014365 00000000000000/* lt__alloc.c -- internal memory management interface Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include #include "lt__alloc.h" static void alloc_die_default (void); void (*lt__alloc_die) (void) = alloc_die_default; /* Unless overridden, exit on memory failure. */ static void alloc_die_default (void) { fprintf (stderr, "Out of memory.\n"); exit (EXIT_FAILURE); } void * lt__malloc (size_t n) { void *mem; if (! (mem = malloc (n))) (*lt__alloc_die) (); return mem; } void * lt__zalloc (size_t n) { void *mem; if ((mem = lt__malloc (n))) memset (mem, 0, n); return mem; } void * lt__realloc (void *mem, size_t n) { if (! (mem = realloc (mem, n))) (*lt__alloc_die) (); return mem; } void * lt__memdup (void const *mem, size_t n) { void *newmem; if ((newmem = lt__malloc (n))) return memcpy (newmem, mem, n); return 0; } char * lt__strdup (const char *string) { return (char *) lt__memdup (string, strlen (string) +1); } parser-3.5.1/src/lib/ltdl/aclocal.m40000644000076400007640000010377111764646175014133 00000000000000# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 10 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/argz.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltdl.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) parser-3.5.1/src/lib/ltdl/m4/0000755000076400007640000000000014740300546012644 500000000000000parser-3.5.1/src/lib/ltdl/m4/ltversion.m40000644000076400007640000000126211764645202015060 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) parser-3.5.1/src/lib/ltdl/m4/lt~obsolete.m40000644000076400007640000001375611764645202015420 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) parser-3.5.1/src/lib/ltdl/m4/ltoptions.m40000644000076400007640000003007311764645202015070 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) parser-3.5.1/src/lib/ltdl/m4/libtool.m40000644000076400007640000105721611764645201014511 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS parser-3.5.1/src/lib/ltdl/m4/ltsugar.m40000644000076400007640000001042411764645202014514 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) parser-3.5.1/src/lib/ltdl/m4/ltdl.m40000644000076400007640000006466311764645202014010 00000000000000# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- # # Copyright (C) 1999-2006, 2007, 2008, 2011 Free Software Foundation, Inc. # Written by Thomas Tanner, 1999 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 18 LTDL_INIT # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) # ------------------------------------------ # DIRECTORY contains the libltdl sources. It is okay to call this # function multiple times, as long as the same DIRECTORY is always given. AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) _$0($*) ])# LT_CONFIG_LTDL_DIR # We break this out into a separate macro, so that we can call it safely # internally without being caught accidentally by the sed scan in libtoolize. m4_defun([_LT_CONFIG_LTDL_DIR], [dnl remove trailing slashes m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$])) m4_case(_LTDL_DIR, [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.' m4_if(_ARG_DIR, [.], [], [m4_define([_LTDL_DIR], _ARG_DIR) _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])], [m4_if(_ARG_DIR, _LTDL_DIR, [], [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])]) m4_popdef([_ARG_DIR]) ])# _LT_CONFIG_LTDL_DIR # Initialise: m4_define([_LTDL_DIR], []) # _LT_BUILD_PREFIX # ---------------- # If Autoconf is new enough, expand to `${top_build_prefix}', otherwise # to `${top_builddir}/'. m4_define([_LT_BUILD_PREFIX], [m4_ifdef([AC_AUTOCONF_VERSION], [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]), [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX], [${top_build_prefix}], [${top_builddir}/])], [${top_build_prefix}])], [${top_builddir}/])[]dnl ]) # LTDL_CONVENIENCE # ---------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with # '${top_build_prefix}' if available, otherwise with '${top_builddir}/', # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_build_prefix, top_builddir, and top_srcdir appropriately # in your Makefiles. AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_CONVENIENCE # AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], []) # _LTDL_CONVENIENCE # ----------------- # Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]). m4_defun([_LTDL_CONVENIENCE], [case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" AC_SUBST([INCLTDL]) ])# _LTDL_CONVENIENCE # LTDL_INSTALLABLE # ---------------- # sets LIBLTDL to the link flags for the libltdl installable library # and LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl # is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if # available, otherwise with '${top_builddir}/', and LTDLINCL will be # prefixed with '${top_srcdir}/' (note the single quotes!). If your # package is not flat and you're not using automake, define top_build_prefix, # top_builddir, and top_srcdir appropriately in your Makefiles. # In the future, this macro may have to be called after LT_INIT. AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_INSTALLABLE # AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) # _LTDL_INSTALLABLE # ----------------- # Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]). m4_defun([_LTDL_INSTALLABLE], [if test -f $prefix/lib/libltdl.la; then lt_save_LDFLAGS="$LDFLAGS" LDFLAGS="-L$prefix/lib $LDFLAGS" AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes]) LDFLAGS="$lt_save_LDFLAGS" if test x"${lt_lib_ltdl-no}" = xyes; then if test x"$enable_ltdl_install" != xyes; then # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install']) enable_ltdl_install=no fi elif test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) fi fi # If configure.ac declared an installable ltdl, and the user didn't override # with --disable-ltdl-install, we will install the shipped libltdl. case $enable_ltdl_install in no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLDEPS= LTDLINCL= ;; *) enable_ltdl_install=yes ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" ;; esac AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" AC_SUBST([INCLTDL]) ])# LTDL_INSTALLABLE # _LTDL_MODE_DISPATCH # ------------------- m4_define([_LTDL_MODE_DISPATCH], [dnl If _LTDL_DIR is `.', then we are configuring libltdl itself: m4_if(_LTDL_DIR, [], [], dnl if _LTDL_MODE was not set already, the default value is `subproject': [m4_case(m4_default(_LTDL_MODE, [subproject]), [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR) _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])], [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])], [recursive], [], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl dnl Be careful not to expand twice: m4_define([$0], []) ])# _LTDL_MODE_DISPATCH # _LT_LIBOBJ(MODULE_NAME) # ----------------------- # Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead # of into LIBOBJS. AC_DEFUN([_LT_LIBOBJ], [ m4_pattern_allow([^_LT_LIBOBJS$]) _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" ])# _LT_LIBOBJS # LTDL_INIT([OPTIONS]) # -------------------- # Clients of libltdl can use this macro to allow the installer to # choose between a shipped copy of the ltdl sources or a preinstalled # version of the library. If the shipped ltdl sources are not in a # subdirectory named libltdl, the directory name must be given by # LT_CONFIG_LTDL_DIR. AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) dnl We need to keep our own list of libobjs separate from our parent project, dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while dnl we look for our own LIBOBJs. m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) m4_pushdef([AC_LIBSOURCES]) dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: m4_if(_LTDL_MODE, [], [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) AC_ARG_WITH([included_ltdl], [AS_HELP_STRING([--with-included-ltdl], [use the GNU ltdl sources included here])]) if test "x$with_included_ltdl" != xyes; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_DECL([lt_dlinterface_register], [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], [with_included_ltdl=no], [with_included_ltdl=yes])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT #include ])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT] ) fi dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE dnl was called yet, then for old times' sake, we assume libltdl is in an dnl eponymous directory: AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) AC_ARG_WITH([ltdl_include], [AS_HELP_STRING([--with-ltdl-include=DIR], [use the ltdl headers installed in DIR])]) if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include']) fi else with_ltdl_include=no fi AC_ARG_WITH([ltdl_lib], [AS_HELP_STRING([--with-ltdl-lib=DIR], [use the libltdl.la installed in DIR])]) if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib']) fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) m4_case(m4_default(_LTDL_TYPE, [convenience]), [convenience], [_LTDL_CONVENIENCE], [installable], [_LTDL_INSTALLABLE], [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. AC_DEFINE([HAVE_LTDL], [1], [Define this if a modern libltdl is already installed]) LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together]) ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL="-I$with_ltdl_include" ;; esac INCLTDL="$LTDLINCL" # Report our decision... AC_MSG_CHECKING([where to find libltdl headers]) AC_MSG_RESULT([$LTDLINCL]) AC_MSG_CHECKING([where to find libltdl library]) AC_MSG_RESULT([$LIBLTDL]) _LTDL_SETUP dnl restore autoconf definition. m4_popdef([AC_LIBOBJ]) m4_popdef([AC_LIBSOURCES]) AC_CONFIG_COMMANDS_PRE([ _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) ]) # Only expand once: m4_define([LTDL_INIT]) ])# LTDL_INIT # Old names: AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIB_LTDL], []) dnl AC_DEFUN([AC_WITH_LTDL], []) dnl AC_DEFUN([LT_WITH_LTDL], []) # _LTDL_SETUP # ----------- # Perform all the checks necessary for compilation of the ltdl objects # -- including compiler checks and header checks. This is a public # interface mainly for the benefit of libltdl's own configure.ac, most # other users should call LTDL_INIT instead. AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_SYS_MODULE_EXT])dnl AC_REQUIRE([LT_SYS_MODULE_PATH])dnl AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl AC_REQUIRE([LT_LIB_DLLOAD])dnl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl AC_REQUIRE([gl_FUNC_ARGZ])dnl m4_require([_LT_CHECK_OBJDIR])dnl m4_require([_LT_HEADER_DLFCN])dnl m4_require([_LT_CHECK_DLPREOPEN])dnl m4_require([_LT_DECL_SED])dnl dnl Don't require this, or it will be expanded earlier than the code dnl that sets the variables it relies on: _LT_ENABLE_INSTALL dnl _LTDL_MODE specific code must be called at least once: _LTDL_MODE_DISPATCH # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). AC_CONFIG_COMMANDS_PRE([dnl m4_pattern_allow([^LT_CONFIG_H$])dnl m4_ifset([AH_HEADER], [LT_CONFIG_H=AH_HEADER], [m4_ifset([AC_LIST_HEADERS], [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[ ]]*,,;s,[[ :]].*$,,'`], [])])]) AC_SUBST([LT_CONFIG_H]) AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) m4_pattern_allow([LT_LIBEXT])dnl AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) name= eval "lt_libprefix=\"$libname_spec\"" m4_pattern_allow([LT_LIBPREFIX])dnl AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) name=ltdl eval "LTDLOPEN=\"$libname_spec\"" AC_SUBST([LTDLOPEN]) ])# _LTDL_SETUP # _LT_ENABLE_INSTALL # ------------------ m4_define([_LT_ENABLE_INSTALL], [AC_ARG_ENABLE([ltdl-install], [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])]) case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac m4_ifdef([AM_CONDITIONAL], [AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno) AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)]) ])# _LT_ENABLE_INSTALL # LT_SYS_DLOPEN_DEPLIBS # --------------------- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [lt_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[[4-9]]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[[12345]]*|irix6.[[01]]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test "$lt_cv_sys_dlopen_deplibs" != yes; then AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], [Define if the OS needs help to load dependent libraries for dlopen().]) fi ])# LT_SYS_DLOPEN_DEPLIBS # Old name: AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], []) # LT_SYS_MODULE_EXT # ----------------- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which extension is used for runtime loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_MODULE_EXT])dnl AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for runtime loadable modules, say, ".so".]) fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_SHARED_EXT])dnl AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"], [Define to the shared library suffix, say, ".dylib".]) fi ])# LT_SYS_MODULE_EXT # Old name: AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBEXT], []) # LT_SYS_MODULE_PATH # ------------------ AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([which variable specifies run-time module search path], [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"]) if test -n "$lt_cv_module_path_var"; then m4_pattern_allow([LT_MODULE_PATH_VAR])dnl AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], [Define to the name of the environment variable that determines the run-time module search path.]) fi ])# LT_SYS_MODULE_PATH # Old name: AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBPATH], []) # LT_SYS_DLSEARCH_PATH # -------------------- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([for the default library search path], [lt_cv_sys_dlsearch_path], [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"]) if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done m4_pattern_allow([LT_DLSEARCH_PATH])dnl AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], [Define to the system default library search path.]) fi ])# LT_SYS_DLSEARCH_PATH # Old name: AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], []) # _LT_CHECK_DLPREOPEN # ------------------- m4_defun([_LT_CHECK_DLPREOPEN], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], [libltdl_cv_preloaded_symbols], [if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi ]) if test x"$libltdl_cv_preloaded_symbols" = xyes; then AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], [Define if libtool can extract symbol lists from object files.]) fi ])# _LT_CHECK_DLPREOPEN # LT_LIB_DLLOAD # ------------- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) AC_LANG_PUSH([C]) LIBADD_DLOPEN= AC_SEARCH_LIBS([dlopen], [dl], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H # include #endif ]], [[dlopen(0, 0);]])], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" AC_CHECK_FUNCS([dlerror]) LIBS="$lt_save_LIBS" fi AC_SUBST([LIBADD_DLOPEN]) LIBADD_SHL_LOAD= AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld"])]) AC_SUBST([LIBADD_SHL_LOAD]) case $host_os in darwin[[1567]].*) # We only want this for pre-Mac OS X 10.4. AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) AC_SUBST([LIBADD_DLD_LINK]) m4_pattern_allow([^LT_DLPREOPEN$]) LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done AC_DEFINE([HAVE_LIBDLLOADER], [1], [Define if libdlloader will be built on this platform]) fi AC_SUBST([LT_DLPREOPEN]) dnl This isn't used anymore, but set it for backwards compatibility LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" AC_SUBST([LIBADD_DL]) AC_LANG_POP ])# LT_LIB_DLLOAD # Old name: AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLLIB], []) # LT_SYS_SYMBOL_USCORE # -------------------- # does the compiler prefix global symbols with an underscore? AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([for _ prefix in compiled symbols], [lt_cv_sys_symbol_underscore], [lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.c >&AS_MESSAGE_LOG_FD fi rm -rf conftest* ]) sys_symbol_underscore=$lt_cv_sys_symbol_underscore AC_SUBST([sys_symbol_underscore]) ])# LT_SYS_SYMBOL_USCORE # Old name: AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], []) # LT_FUNC_DLSYM_USCORE # -------------------- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], [libltdl_cv_need_uscore], [libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" _LT_TRY_DLOPEN_SELF( [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes], [], [libltdl_cv_need_uscore=cross]) LIBS="$save_LIBS" ]) fi fi if test x"$libltdl_cv_need_uscore" = xyes; then AC_DEFINE([NEED_USCORE], [1], [Define if dlsym() requires a leading underscore in symbol names.]) fi ])# LT_FUNC_DLSYM_USCORE # Old name: AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) parser-3.5.1/src/lib/ltdl/m4/argz.m40000644000076400007640000000507111764645201013777 00000000000000# Portability macros for glibc argz. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. # Written by Gary V. Vaughan # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 argz.m4 AC_DEFUN([gl_FUNC_ARGZ], [gl_PREREQ_ARGZ AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for `error_t' if it is not otherwise available.]) AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h does not typedef error_t.])], [#if defined(HAVE_ARGZ_H) # include #endif]) ARGZ_H= AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify], [], [ARGZ_H=argz.h; AC_LIBOBJ([argz])]) dnl if have system argz functions, allow forced use of dnl libltdl-supplied implementation (and default to do so dnl on "known bad" systems). Could use a runtime check, but dnl (a) detecting malloc issues is notoriously unreliable dnl (b) only known system that declares argz functions, dnl provides them, yet they are broken, is cygwin dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) dnl So, it's more straightforward simply to special case dnl this for known bad systems. AS_IF([test -z "$ARGZ_H"], [AC_CACHE_CHECK( [if argz actually works], [lt_cv_sys_argz_works], [[case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) AS_IF([test "$lt_cv_sys_argz_works" = yes], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [ARGZ_H=argz.h AC_LIBOBJ([argz])])]) AC_SUBST([ARGZ_H]) ]) # Prerequisites of lib/argz.c. AC_DEFUN([gl_PREREQ_ARGZ], [:]) parser-3.5.1/src/lib/ltdl/argz_.h0000644000076400007640000000425411764645175013541 00000000000000/* lt__argz.h -- internal argz interface for non-glibc systems Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined(LT__ARGZ_H) #define LT__ARGZ_H 1 #include #define __need_error_t #include #include #if defined(LTDL) # include "lt__glibc.h" # include "lt_system.h" #else # define LT_SCOPE #endif #if defined(__cplusplus) extern "C" { #endif LT_SCOPE error_t argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len); LT_SCOPE error_t argz_create_sep(const char *str, int delim, char **pargz, size_t *pargz_len); LT_SCOPE error_t argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry); LT_SCOPE char * argz_next (char *argz, size_t argz_len, const char *entry); LT_SCOPE void argz_stringify (char *argz, size_t argz_len, int sep); #if defined(__cplusplus) } #endif #if !defined(LTDL) # undef LT_SCOPE #endif #endif /*!defined(LT__ARGZ_H)*/ parser-3.5.1/src/lib/ltdl/loaders/0000755000076400007640000000000014740300546013755 500000000000000parser-3.5.1/src/lib/ltdl/loaders/shl_load.c0000644000076400007640000001507611764645201015642 00000000000000/* loader-shl_load.c -- dynamic linking with shl_load (HP-UX) Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable shl_load_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_shl_load"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_DL_H) # include #endif /* some flags are missing on some systems, so we provide * harmless defaults. * * Mandatory: * BIND_IMMEDIATE - Resolve symbol references when the library is loaded. * BIND_DEFERRED - Delay code symbol resolution until actual reference. * * Optionally: * BIND_FIRST - Place the library at the head of the symbol search * order. * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all * unsatisfied symbols as fatal. This flag allows * binding of unsatisfied code symbols to be deferred * until use. * [Perl: For certain libraries, like DCE, deferred * binding often causes run time problems. Adding * BIND_NONFATAL to BIND_IMMEDIATE still allows * unresolved references in situations like this.] * BIND_NOSTART - Do not call the initializer for the shared library * when the library is loaded, nor on a future call to * shl_unload(). * BIND_VERBOSE - Print verbose messages concerning possible * unsatisfied symbols. * * hp9000s700/hp9000s800: * BIND_RESTRICTED - Restrict symbols visible by the library to those * present at library load time. * DYNAMIC_PATH - Allow the loader to dynamically search for the * library specified by the path argument. */ #if !defined(DYNAMIC_PATH) # define DYNAMIC_PATH 0 #endif #if !defined(BIND_RESTRICTED) # define BIND_RESTRICTED 0 #endif #define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH) /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { static shl_t self = (shl_t) 0; lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); /* Since searching for a symbol against a NULL module handle will also look in everything else that was already loaded and exported with the -E compiler flag, we always cache a handle saved before any modules are loaded. */ if (!self) { void *address; shl_findsym (&self, "main", TYPE_UNDEFINED, &address); } if (!filename) { module = self; } else { module = shl_load (filename, LT_BIND_FLAGS, 0L); if (!module) { LT__SETERROR (CANNOT_OPEN); } } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (module && (shl_unload ((shl_t) (module)) != 0)) { LT__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = 0; /* sys_shl_open should never return a NULL module handle */ if (module == (lt_module) 0) { LT__SETERROR (INVALID_HANDLE); } else if (!shl_findsym((shl_t*) &module, name, TYPE_UNDEFINED, &address)) { if (!address) { LT__SETERROR (SYMBOL_NOT_FOUND); } } return address; } parser-3.5.1/src/lib/ltdl/loaders/dyld.c0000644000076400007640000003253611764645201015011 00000000000000/* loader-dyld.c -- dynamic linking on darwin and OS X Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Peter O'Gorman, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dyld_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_init (lt_user_data loader_data); static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dyld"; vtable->sym_prefix = "_"; vtable->dlloader_init = vl_init; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_MACH_O_DYLD_H) # if !defined(__APPLE_CC__) && !defined(__MWERKS__) && !defined(__private_extern__) /* Is this correct? Does it still function properly? */ # define __private_extern__ extern # endif # include #endif #include /* We have to put some stuff here that isn't in older dyld.h files */ #if !defined(ENUM_DYLD_BOOL) # define ENUM_DYLD_BOOL # undef FALSE # undef TRUE enum DYLD_BOOL { FALSE, TRUE }; #endif #if !defined(LC_REQ_DYLD) # define LC_REQ_DYLD 0x80000000 #endif #if !defined(LC_LOAD_WEAK_DYLIB) # define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) #endif #if !defined(NSADDIMAGE_OPTION_NONE) # define NSADDIMAGE_OPTION_NONE 0x0 #endif #if !defined(NSADDIMAGE_OPTION_RETURN_ON_ERROR) # define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 #endif #if !defined(NSADDIMAGE_OPTION_WITH_SEARCHING) # define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2 #endif #if !defined(NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED) # define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 #endif #if !defined(NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME) # define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND) # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW) # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY) # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 #endif #if !defined(NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) # define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 #endif #define LT__SYMLOOKUP_OPTS (NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW \ | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) #if defined(__BIG_ENDIAN__) # define LT__MAGIC MH_MAGIC #else # define LT__MAGIC MH_CIGAM #endif #define DYLD__SETMYERROR(errmsg) LT__SETERRORSTR (dylderror (errmsg)) #define DYLD__SETERROR(errcode) DYLD__SETMYERROR (LT__STRERROR (errcode)) typedef struct mach_header mach_header; typedef struct dylib_command dylib_command; static const char *dylderror (const char *errmsg); static const mach_header *lt__nsmodule_get_header (NSModule module); static const char *lt__header_get_instnam (const mach_header *mh); static const mach_header *lt__match_loadedlib (const char *name); static NSSymbol lt__linkedlib_symbol (const char *symname, const mach_header *mh); static const mach_header *(*lt__addimage) (const char *image_name, unsigned long options) = 0; static NSSymbol (*lt__image_symbol) (const mach_header *image, const char *symbolName, unsigned long options) = 0; static enum DYLD_BOOL (*lt__image_symbol_p) (const mach_header *image, const char *symbolName) = 0; static enum DYLD_BOOL (*lt__module_export) (NSModule module) = 0; static int dyld_cannot_close = 0; /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to initialise this loader. */ static int vl_init (lt_user_data loader_data) { int errors = 0; if (! dyld_cannot_close) { if (!_dyld_present ()) { ++errors; } else { (void) _dyld_func_lookup ("__dyld_NSAddImage", (unsigned long*) <__addimage); (void) _dyld_func_lookup ("__dyld_NSLookupSymbolInImage", (unsigned long*)<__image_symbol); (void) _dyld_func_lookup ("__dyld_NSIsSymbolNameDefinedInImage", (unsigned long*) <__image_symbol_p); (void) _dyld_func_lookup ("__dyld_NSMakePrivateModulePublic", (unsigned long*) <__module_export); dyld_cannot_close = lt_dladderror ("can't close a dylib"); } } return errors; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { lt_module module = 0; NSObjectFileImage ofi = 0; if (!filename) { return (lt_module) -1; } switch (NSCreateObjectFileImageFromFile (filename, &ofi)) { case NSObjectFileImageSuccess: module = NSLinkModule (ofi, filename, NSLINKMODULE_OPTION_RETURN_ON_ERROR | NSLINKMODULE_OPTION_PRIVATE | NSLINKMODULE_OPTION_BINDNOW); NSDestroyObjectFileImage (ofi); if (module) { lt__module_export (module); } break; case NSObjectFileImageInappropriateFile: if (lt__image_symbol_p && lt__image_symbol) { module = (lt_module) lt__addimage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR); } break; case NSObjectFileImageFailure: case NSObjectFileImageArch: case NSObjectFileImageFormat: case NSObjectFileImageAccess: /*NOWORK*/ break; } if (!module) { DYLD__SETERROR (CANNOT_OPEN); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data, lt_module module) { int errors = 0; if (module != (lt_module) -1) { const mach_header *mh = (const mach_header *) module; int flags = 0; if (mh->magic == LT__MAGIC) { lt_dlseterror (dyld_cannot_close); ++errors; } else { /* Currently, if a module contains c++ static destructors and it is unloaded, we get a segfault in atexit(), due to compiler and dynamic loader differences of opinion, this works around that. */ if ((const struct section *) NULL != getsectbynamefromheader (lt__nsmodule_get_header (module), "__DATA", "__mod_term_func")) { flags |= NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED; } #if defined(__ppc__) flags |= NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES; #endif if (!NSUnLinkModule (module, flags)) { DYLD__SETERROR (CANNOT_CLOSE); ++errors; } } } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data, lt_module module, const char *name) { NSSymbol *nssym = 0; const mach_header *mh = (const mach_header *) module; char saveError[256] = "Symbol not found"; if (module == (lt_module) -1) { void *address, *unused; _dyld_lookup_and_bind (name, (unsigned long*) &address, &unused); return address; } if (mh->magic == LT__MAGIC) { if (lt__image_symbol_p && lt__image_symbol) { if (lt__image_symbol_p (mh, name)) { nssym = lt__image_symbol (mh, name, LT__SYMLOOKUP_OPTS); } } } else { nssym = NSLookupSymbolInModule (module, name); } if (!nssym) { strncpy (saveError, dylderror (LT__STRERROR (SYMBOL_NOT_FOUND)), 255); saveError[255] = 0; if (!mh) { mh = (mach_header *)lt__nsmodule_get_header (module); } nssym = lt__linkedlib_symbol (name, mh); } if (!nssym) { LT__SETERRORSTR (saveError); } return nssym ? NSAddressOfSymbol (nssym) : 0; } /* --- HELPER FUNCTIONS --- */ /* Return the dyld error string, or the passed in error string if none. */ static const char * dylderror (const char *errmsg) { NSLinkEditErrors ler; int lerno; const char *file; const char *errstr; NSLinkEditError (&ler, &lerno, &file, &errstr); if (! (errstr && *errstr)) { errstr = errmsg; } return errstr; } /* There should probably be an apple dyld api for this. */ static const mach_header * lt__nsmodule_get_header (NSModule module) { int i = _dyld_image_count(); const char *modname = NSNameOfModule (module); const mach_header *mh = 0; if (!modname) return NULL; while (i > 0) { --i; if (strneq (_dyld_get_image_name (i), modname)) { mh = _dyld_get_image_header (i); break; } } return mh; } /* NSAddImage is also used to get the loaded image, but it only works if the lib is installed, for uninstalled libs we need to check the install_names against each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a different lib was loaded as a result. */ static const char * lt__header_get_instnam (const mach_header *mh) { unsigned long offset = sizeof(mach_header); const char* result = 0; int j; for (j = 0; j < mh->ncmds; j++) { struct load_command *lc; lc = (struct load_command*) (((unsigned long) mh) + offset); if (LC_ID_DYLIB == lc->cmd) { result=(char*)(((dylib_command*) lc)->dylib.name.offset + (unsigned long) lc); } offset += lc->cmdsize; } return result; } static const mach_header * lt__match_loadedlib (const char *name) { const mach_header *mh = 0; int i = _dyld_image_count(); while (i > 0) { const char *id; --i; id = lt__header_get_instnam (_dyld_get_image_header (i)); if (id && strneq (id, name)) { mh = _dyld_get_image_header (i); break; } } return mh; } /* Safe to assume our mh is good. */ static NSSymbol lt__linkedlib_symbol (const char *symname, const mach_header *mh) { NSSymbol symbol = 0; if (lt__image_symbol && NSIsSymbolNameDefined (symname)) { unsigned long offset = sizeof(mach_header); struct load_command *lc; int j; for (j = 0; j < mh->ncmds; j++) { lc = (struct load_command*) (((unsigned long) mh) + offset); if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) { unsigned long base = ((dylib_command *) lc)->dylib.name.offset; char *name = (char *) (base + (unsigned long) lc); const mach_header *mh1 = lt__match_loadedlib (name); if (!mh1) { /* Maybe NSAddImage can find it */ mh1 = lt__addimage (name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED | NSADDIMAGE_OPTION_WITH_SEARCHING | NSADDIMAGE_OPTION_RETURN_ON_ERROR); } if (mh1) { symbol = lt__image_symbol (mh1, symname, LT__SYMLOOKUP_OPTS); if (symbol) break; } } offset += lc->cmdsize; } } return symbol; } parser-3.5.1/src/lib/ltdl/loaders/loadlibrary.c0000644000076400007640000002517311764645201016360 00000000000000/* loader-loadlibrary.c -- dynamic linking for Win32 Copyright (C) 1998, 1999, 2000, 2004, 2005, 2006, 2007, 2008, 2010 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" #if defined(__CYGWIN__) # include #endif /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable loadlibrary_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlinterface_id iface_id = 0; static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); iface_id = lt_dlinterface_register ("ltdl loadlibrary", NULL); } if (vtable && !vtable->name) { vtable->name = "lt_loadlibrary"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #include #define LOCALFREE(mem) LT_STMT_START { \ if (mem) { LocalFree ((void *)mem); mem = NULL; } } LT_STMT_END #define LOADLIB__SETERROR(errmsg) LT__SETERRORSTR (loadlibraryerror (errmsg)) #define LOADLIB_SETERROR(errcode) LOADLIB__SETERROR (LT__STRERROR (errcode)) static const char *loadlibraryerror (const char *default_errmsg); static DWORD WINAPI wrap_getthreaderrormode (void); static DWORD WINAPI fallback_getthreaderrormode (void); static BOOL WINAPI wrap_setthreaderrormode (DWORD mode, DWORD *oldmode); static BOOL WINAPI fallback_setthreaderrormode (DWORD mode, DWORD *oldmode); typedef DWORD (WINAPI getthreaderrormode_type) (void); typedef BOOL (WINAPI setthreaderrormode_type) (DWORD, DWORD *); static getthreaderrormode_type *getthreaderrormode = wrap_getthreaderrormode; static setthreaderrormode_type *setthreaderrormode = wrap_setthreaderrormode; static char *error_message = 0; /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; LOCALFREE (error_message); return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { lt_module module = 0; char *ext; char wpath[MAX_PATH]; size_t len; if (!filename) { /* Get the name of main module */ *wpath = 0; GetModuleFileName (NULL, wpath, sizeof (wpath)); filename = wpath; } else { len = LT_STRLEN (filename); if (len >= MAX_PATH) { LT__SETERROR (CANNOT_OPEN); return 0; } #if HAVE_DECL_CYGWIN_CONV_PATH if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, filename, wpath, MAX_PATH)) { LT__SETERROR (CANNOT_OPEN); return 0; } len = 0; #elif defined(__CYGWIN__) cygwin_conv_to_full_win32_path (filename, wpath); len = 0; #else strcpy(wpath, filename); #endif ext = strrchr (wpath, '.'); if (!ext) { /* Append a `.' to stop Windows from adding an implicit `.dll' extension. */ if (!len) len = strlen (wpath); if (len + 1 >= MAX_PATH) { LT__SETERROR (CANNOT_OPEN); return 0; } wpath[len] = '.'; wpath[len+1] = '\0'; } } { /* Silence dialog from LoadLibrary on some failures. */ DWORD errormode = getthreaderrormode (); DWORD last_error; setthreaderrormode (errormode | SEM_FAILCRITICALERRORS, NULL); module = LoadLibrary (wpath); /* Restore the error mode. */ last_error = GetLastError (); setthreaderrormode (errormode, NULL); SetLastError (last_error); } /* libltdl expects this function to fail if it is unable to physically load the library. Sadly, LoadLibrary will search the loaded libraries for a match and return one of them if the path search load fails. We check whether LoadLibrary is returning a handle to an already loaded module, and simulate failure if we find one. */ { lt_dlhandle cur = 0; while ((cur = lt_dlhandle_iterate (iface_id, cur))) { if (!cur->module) { cur = 0; break; } if (cur->module == module) { break; } } if (!module) LOADLIB_SETERROR (CANNOT_OPEN); else if (cur) { LT__SETERROR (CANNOT_OPEN); module = 0; } } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (FreeLibrary ((HMODULE) module) == 0) { LOADLIB_SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = (void *) GetProcAddress ((HMODULE) module, name); if (!address) { LOADLIB_SETERROR (SYMBOL_NOT_FOUND); } return address; } /* --- HELPER FUNCTIONS --- */ /* Return the windows error message, or the passed in error message on failure. */ static const char * loadlibraryerror (const char *default_errmsg) { size_t len; LOCALFREE (error_message); FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError (), 0, (char *) &error_message, 0, NULL); /* Remove trailing CRNL */ len = LT_STRLEN (error_message); if (len && error_message[len - 1] == '\n') error_message[--len] = LT_EOS_CHAR; if (len && error_message[len - 1] == '\r') error_message[--len] = LT_EOS_CHAR; return len ? error_message : default_errmsg; } /* A function called through the getthreaderrormode variable which checks if the system supports GetThreadErrorMode (or GetErrorMode) and arranges for it or a fallback implementation to be called directly in the future. The selected version is then called. */ static DWORD WINAPI wrap_getthreaderrormode (void) { HMODULE kernel32 = GetModuleHandleA ("kernel32.dll"); getthreaderrormode = (getthreaderrormode_type *) GetProcAddress (kernel32, "GetThreadErrorMode"); if (!getthreaderrormode) getthreaderrormode = (getthreaderrormode_type *) GetProcAddress (kernel32, "GetErrorMode"); if (!getthreaderrormode) getthreaderrormode = fallback_getthreaderrormode; return getthreaderrormode (); } /* A function called through the getthreaderrormode variable for cases where the system does not support GetThreadErrorMode or GetErrorMode */ static DWORD WINAPI fallback_getthreaderrormode (void) { /* Prior to Windows Vista, the only way to get the current error mode was to set a new one. In our case, we are setting a new error mode right after "getting" it while ignoring the error mode in effect when setting the new error mode, so that's fairly ok. */ return (DWORD) SetErrorMode (SEM_FAILCRITICALERRORS); } /* A function called through the setthreaderrormode variable which checks if the system supports SetThreadErrorMode and arranges for it or a fallback implementation to be called directly in the future. The selected version is then called. */ static BOOL WINAPI wrap_setthreaderrormode (DWORD mode, DWORD *oldmode) { HMODULE kernel32 = GetModuleHandleA ("kernel32.dll"); setthreaderrormode = (setthreaderrormode_type *) GetProcAddress (kernel32, "SetThreadErrorMode"); if (!setthreaderrormode) setthreaderrormode = fallback_setthreaderrormode; return setthreaderrormode (mode, oldmode); } /* A function called through the setthreaderrormode variable for cases where the system does not support SetThreadErrorMode. */ static BOOL WINAPI fallback_setthreaderrormode (DWORD mode, DWORD *oldmode) { /* Prior to Windows 7, there was no way to set the thread local error mode, so set the process global error mode instead. */ DWORD old = (DWORD) SetErrorMode (mode); if (oldmode) *oldmode = old; return TRUE; } parser-3.5.1/src/lib/ltdl/loaders/dld_link.c0000644000076400007640000001074111764645201015627 00000000000000/* loader-dld_link.c -- dynamic linking with dld Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dld_link_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dld_link"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_DLD_H) # include #endif /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { lt_module module = lt__strdup (filename); if (dld_link (filename) != 0) { LT__SETERROR (CANNOT_OPEN); FREE (module); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (dld_unlink_by_file ((char*)(module), 1) != 0) { LT__SETERROR (CANNOT_CLOSE); ++errors; } else { FREE (module); } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module LT__UNUSED module, const char *name) { void *address = dld_get_func (name); if (!address) { LT__SETERROR (SYMBOL_NOT_FOUND); } return address; } parser-3.5.1/src/lib/ltdl/loaders/preopen.c0000644000076400007640000002245511764645201015524 00000000000000/* loader-preopen.c -- emulate dynamic linking using preloaded_symbols Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable preopen_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_init (lt_user_data loader_data); static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_preopen"; vtable->sym_prefix = 0; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_init = vl_init; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_PREPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ /* Wrapper type to chain together symbol lists of various origins. */ typedef struct symlist_chain { struct symlist_chain *next; const lt_dlsymlist *symlist; } symlist_chain; static int add_symlist (const lt_dlsymlist *symlist); static int free_symlists (void); /* The start of the symbol lists chain. */ static symlist_chain *preloaded_symlists = 0; /* A symbol list preloaded before lt_init() was called. */ static const lt_dlsymlist *default_preloaded_symbols = 0; /* A function called through the vtable to initialise this loader. */ static int vl_init (lt_user_data LT__UNUSED loader_data) { int errors = 0; preloaded_symlists = 0; if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } return errors; } /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; free_symlists (); return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { symlist_chain *lists; lt_module module = 0; if (!preloaded_symlists) { LT__SETERROR (NO_SYMBOLS); goto done; } /* Can't use NULL as the reflective symbol header, as NULL is used to mark the end of the entire symbol list. Self-dlpreopened symbols follow this magic number, chosen to be an unlikely clash with a real module name. */ if (!filename) { filename = "@PROGRAM@"; } for (lists = preloaded_symlists; lists; lists = lists->next) { const lt_dlsymlist *symbol; for (symbol= lists->symlist; symbol->name; ++symbol) { if (!symbol->address && streq (symbol->name, filename)) { /* If the next symbol's name and address is 0, it means the module just contains the originator and no symbols. In this case we pretend that we never saw the module and hope that some other loader will be able to load the module and have access to its symbols */ const lt_dlsymlist *next_symbol = symbol +1; if (next_symbol->address && next_symbol->name) { module = (lt_module) lists->symlist; goto done; } } } } LT__SETERROR (FILE_NOT_FOUND); done: return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module LT__UNUSED module) { /* Just to silence gcc -Wall */ module = 0; return 0; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { lt_dlsymlist *symbol = (lt_dlsymlist*) module; symbol +=2; /* Skip header (originator then libname). */ while (symbol->name) { if (streq (symbol->name, name)) { return symbol->address; } ++symbol; } LT__SETERROR (SYMBOL_NOT_FOUND); return 0; } /* --- HELPER FUNCTIONS --- */ /* The symbol lists themselves are not allocated from the heap, but we can unhook them and free up the chain of links between them. */ static int free_symlists (void) { symlist_chain *lists; lists = preloaded_symlists; while (lists) { symlist_chain *next = lists->next; FREE (lists); lists = next; } preloaded_symlists = 0; return 0; } /* Add a new symbol list to the global chain. */ static int add_symlist (const lt_dlsymlist *symlist) { symlist_chain *lists; int errors = 0; /* Search for duplicate entries: */ for (lists = preloaded_symlists; lists && lists->symlist != symlist; lists = lists->next) /*NOWORK*/; /* Don't add the same list twice: */ if (!lists) { symlist_chain *tmp = (symlist_chain *) lt__zalloc (sizeof *tmp); if (tmp) { tmp->symlist = symlist; tmp->next = preloaded_symlists; preloaded_symlists = tmp; } else { ++errors; } } return errors; } /* --- PRELOADING API CALL IMPLEMENTATIONS --- */ /* Save a default symbol list for later. */ int lt_dlpreload_default (const lt_dlsymlist *preloaded) { default_preloaded_symbols = preloaded; return 0; } /* Add a symbol list to the global chain, or with a NULL argument, revert to just the default list. */ int lt_dlpreload (const lt_dlsymlist *preloaded) { int errors = 0; if (preloaded) { errors = add_symlist (preloaded); } else { free_symlists(); if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } } return errors; } /* Open all the preloaded modules from the named originator, executing a callback for each one. If ORIGINATOR is NULL, then call FUNC for each preloaded module from the program itself. */ int lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func) { symlist_chain *list; int errors = 0; int found = 0; /* For each symlist in the chain... */ for (list = preloaded_symlists; list; list = list->next) { /* ...that was preloaded by the requesting ORIGINATOR... */ if ((originator && streq (list->symlist->name, originator)) || (!originator && streq (list->symlist->name, "@PROGRAM@"))) { const lt_dlsymlist *symbol; unsigned int idx = 0; ++found; /* ...load the symbols per source compilation unit: (we preincrement the index to skip over the originator entry) */ while ((symbol = &list->symlist[++idx])->name != 0) { if ((symbol->address == 0) && (strneq (symbol->name, "@PROGRAM@"))) { lt_dlhandle handle = lt_dlopen (symbol->name); if (handle == 0) { ++errors; } else { errors += (*func) (handle); } } } } } if (!found) { LT__SETERROR(CANNOT_OPEN); ++errors; } return errors; } parser-3.5.1/src/lib/ltdl/loaders/load_add_on.c0000644000076400007640000001130411764645201016266 00000000000000/* loader-load_add_on.c -- dynamic linking for BeOS Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable load_add_on_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_load_add_on"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #include /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise LT__UNUSED advise) { image_id image = 0; if (filename) { image = load_add_on (filename); } else { image_info info; int32 cookie = 0; if (get_next_image_info (0, &cookie, &info) == B_OK) image = load_add_on (info.name); } if (image <= 0) { LT__SETERROR (CANNOT_OPEN); image = 0; } return (lt_module) image; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (unload_add_on ((image_id) module) != B_OK) { LT__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = 0; image_id image = (image_id) module; if (get_image_symbol (image, name, B_SYMBOL_TYPE_ANY, address) != B_OK) { LT__SETERROR (SYMBOL_NOT_FOUND); address = 0; } return address; } parser-3.5.1/src/lib/ltdl/loaders/dlopen.c0000644000076400007640000001434111764645201015330 00000000000000/* loader-dlopen.c -- dynamic linking with dlopen/dlsym Copyright (C) 1998, 1999, 2000, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dlopen_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dlopen"; #if defined(DLSYM_USCORE) vtable->sym_prefix = "_"; #endif vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_PREPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined(HAVE_DLFCN_H) # include #endif #if defined(HAVE_SYS_DL_H) # include #endif /* We may have to define LT_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #if !defined(LT_LAZY_OR_NOW) # if defined(RTLD_LAZY) # define LT_LAZY_OR_NOW RTLD_LAZY # else # if defined(DL_LAZY) # define LT_LAZY_OR_NOW DL_LAZY # endif # endif /* !RTLD_LAZY */ #endif #if !defined(LT_LAZY_OR_NOW) # if defined(RTLD_NOW) # define LT_LAZY_OR_NOW RTLD_NOW # else # if defined(DL_NOW) # define LT_LAZY_OR_NOW DL_NOW # endif # endif /* !RTLD_NOW */ #endif #if !defined(LT_LAZY_OR_NOW) # define LT_LAZY_OR_NOW 0 #endif /* !LT_LAZY_OR_NOW */ /* We only support local and global symbols from modules for loaders that provide such a thing, otherwise the system default is used. */ #if !defined(RTLD_GLOBAL) # if defined(DL_GLOBAL) # define RTLD_GLOBAL DL_GLOBAL # endif #endif /* !RTLD_GLOBAL */ #if !defined(RTLD_LOCAL) # if defined(DL_LOCAL) # define RTLD_LOCAL DL_LOCAL # endif #endif /* !RTLD_LOCAL */ #if defined(HAVE_DLERROR) # define DLERROR(arg) dlerror () #else # define DLERROR(arg) LT__STRERROR (arg) #endif #define DL__SETERROR(errorcode) \ LT__SETERRORSTR (DLERROR (errorcode)) /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data LT__UNUSED loader_data) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, lt_dladvise advise) { int module_flags = LT_LAZY_OR_NOW; lt_module module; if (advise) { #ifdef RTLD_GLOBAL /* If there is some means of asking for global symbol resolution, do so. */ if (advise->is_symglobal) module_flags |= RTLD_GLOBAL; #else /* Otherwise, reset that bit so the caller can tell it wasn't acted on. */ advise->is_symglobal = 0; #endif /* And similarly for local only symbol resolution. */ #ifdef RTLD_LOCAL if (advise->is_symlocal) module_flags |= RTLD_LOCAL; #else advise->is_symlocal = 0; #endif } module = dlopen (filename, module_flags); if (!module) { DL__SETERROR (CANNOT_OPEN); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data LT__UNUSED loader_data, lt_module module) { int errors = 0; if (dlclose (module) != 0) { DL__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data LT__UNUSED loader_data, lt_module module, const char *name) { void *address = dlsym (module, name); if (!address) { DL__SETERROR (SYMBOL_NOT_FOUND); } return address; } parser-3.5.1/src/lib/ltdl/config/0000755000076400007640000000000014740300546013571 500000000000000parser-3.5.1/src/lib/ltdl/config/config.sub0000755000076400007640000010505211764645177015516 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-10-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 GNU 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. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # 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, 2006, 2007, 2008, 2009, 2010, 2011 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-android* | linux-dietlibc | linux-newlib* | \ linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-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 | -microblaze) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -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 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -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/'` ;; -sco5v6*) # 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 | avr32 \ | be32 | be64 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*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-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # 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 ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; 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 ;; cr16 | cr16-*) basic_machine=cr16-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 ;; dicos) basic_machine=i686-pc os=-dicos ;; 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 ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze) basic_machine=microblaze-xilinx ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; 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 ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; 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 ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; 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 ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) 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 ;; rdos) basic_machine=i386-pc os=-rdos ;; 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 ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; 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 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; 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 ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; 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 ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-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[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) 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. -auroraux) os=-auroraux ;; -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* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -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* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -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* | -rdos* | -toppers* | -drops* | -es*) # 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 ;; -dicos*) os=-dicos ;; -nacl*) ;; -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 score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) 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 ;; mep-*) os=-elf ;; 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 ;; -cnk*|-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: parser-3.5.1/src/lib/ltdl/config/depcomp0000755000076400007640000004426711764645177015122 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2009-04-28.21; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free # Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u="sed s,\\\\\\\\,/,g" depmode=msvisualcpp fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.5.1/src/lib/ltdl/config/config.guess0000755000076400007640000012675511764645177016070 00000000000000#! /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, 2006, 2007, 2008, 2009, 2010, # 2011 Free Software Foundation, Inc. timestamp='2011-10-01' # 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 (context # diff format) to and include a 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. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 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, 2006, 2007, 2008, 2009, 2010, 2011 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 "$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 ;; sh5el) machine=sh5le-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 -q __ELF__ 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 ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-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'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; 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 ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-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:*:[4567]) 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 -q __LP64__ 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:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *: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 ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-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 ;; 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 -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-gnueabi else echo ${UNAME_MACHINE}-unknown-linux-gnueabihf fi fi exit ;; avr32*: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 ;; hexagon:Linux:*:*) echo hexagon-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` echo "${UNAME_MACHINE}-pc-linux-${LIBC}" 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:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #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 ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu 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 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-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 ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu 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.[02]*:*) 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 i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-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; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' 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; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*) 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 ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku 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 ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-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 i386) eval $set_cc_for_build if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then UNAME_PROCESSOR="x86_64" fi fi ;; 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 ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} 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 ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros 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: parser-3.5.1/src/lib/ltdl/config/compile0000755000076400007640000001533011764645177015110 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2010-11-15.09; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010 Free Software # Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Win32 hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l*) lib=${1#-l} found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes set x "$@" "$dir/$lib.dll.lib" break fi if test -f "$dir/$lib.lib"; then found=yes set x "$@" "$dir/$lib.lib" break fi done IFS=$save_IFS test "$found" != yes && set x "$@" "$lib.lib" shift ;; -L*) func_file_conv "${1#-L}" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use `[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.5.1/src/lib/ltdl/config/install-sh0000755000076400007640000003325611764645200015530 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.5.1/src/lib/ltdl/config/missing0000755000076400007640000002623311764645200015120 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; tar*) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar*) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.5.1/src/lib/ltdl/config/ltmain.sh0000644000076400007640000105152211764645200015341 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 parser-3.5.1/src/lib/Makefile.am0000644000076400007640000000011213715440626013340 00000000000000SUBDIRS = gd smtp cord ltdl pcre md5 gc sdbm json curl punycode memcached parser-3.5.1/src/lib/sdbm/0000755000076400007640000000000014740300546012312 500000000000000parser-3.5.1/src/lib/sdbm/sdbm_private.h0000644000076400007640000000555714733136276015107 00000000000000/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * sdbm - ndbm work-alike hashed database library * based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978). * author: oz@nexus.yorku.ca */ #ifndef SDBM_PRIVATE_H #define SDBM_PRIVATE_H #include "pa_apr.h" #include "pa_file_io.h" #include "pa_errno.h" /* for pa_status_t */ #if 1 /* if the block/page size is increased, it breaks perl pa_sdbm_t compatibility */ #define DBLKSIZ 16384 #define PBLKSIZ 8192 // !see PAIRMAX definition in pa_vhashfile.C. values should be the same #define PAIRMAX 8008 /* arbitrary on PBLKSIZ-N */ #else #define DBLKSIZ 4096 #define PBLKSIZ 1024 #define PAIRMAX 1008 /* arbitrary on PBLKSIZ-N */ #endif #define SPLTMAX 10 /* maximum allowed splits */ /* for pa_sdbm_t.flags */ #define SDBM_RDONLY 0x1 /* data base open read-only */ #define SDBM_SHARED 0x2 /* data base open for sharing */ #define SDBM_SHARED_LOCK 0x4 /* data base locked for shared read */ #define SDBM_EXCLUSIVE_LOCK 0x8 /* data base locked for write */ struct pa_sdbm_t { pa_pool_t *pool; pa_file_t *dirf; /* directory file descriptor */ pa_file_t *pagf; /* page file descriptor */ pa_int32_t flags; /* status/error flags, see below */ long maxbno; /* size of dirfile in bits */ long curbit; /* current bit number */ long hmask; /* current hash mask */ long blkptr; /* current block for nextkey */ int keyptr; /* current key for nextkey */ long blkno; /* current page to read/write */ long pagbno; /* current page in pagbuf */ char pagbuf[PBLKSIZ]; /* page file block buffer */ long dirbno; /* current block in dirbuf */ char dirbuf[DBLKSIZ]; /* directory file block buffer */ int lckcnt; /* number of calls to sdbm_lock */ }; #define sdbm_hash pa_sdbm_hash #define sdbm_nullitem pa_sdbm_nullitem extern const pa_sdbm_datum_t sdbm_nullitem; long sdbm_hash(const char *str, int len); /* * zero the cache */ #define SDBM_INVALIDATE_CACHE(db, finfo) \ do { db->dirbno = (!finfo.size) ? 0 : -1; \ db->pagbno = -1; \ db->maxbno = (long)(finfo.size * BYTESIZ); \ } while (0); #endif /* SDBM_PRIVATE_H */ parser-3.5.1/src/lib/sdbm/sdbm_hash.c0000644000076400007640000000316114733136276014340 00000000000000/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * sdbm - ndbm work-alike hashed database library * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). * author: oz@nexus.yorku.ca * status: ex-public domain. keep it that way. * * hashing routine */ #include "pa_sdbm.h" #include "sdbm_private.h" /* * polynomial conversion ignoring overflows * [this seems to work remarkably well, in fact better * then the ndbm hash function. Replace at your own risk] * use: 65599 nice. * 65587 even better. */ long sdbm_hash(const char *str, int len) { register unsigned long n = 0; #define DUFF /* go ahead and use the loop-unrolled version */ #ifdef DUFF #define HASHC n = *str++ + 65599 * n if (len > 0) { register int loop = (len + 8 - 1) >> 3; switch(len & (8 - 1)) { case 0: do { HASHC; case 7: HASHC; case 6: HASHC; case 5: HASHC; case 4: HASHC; case 3: HASHC; case 2: HASHC; case 1: HASHC; } while (--loop); } } #else while (len--) n = *str++ + 65599 * n; #endif return n; } parser-3.5.1/src/lib/sdbm/Makefile.in0000644000076400007640000006362614740273415014320 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/sdbm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libsdbm_la_LIBADD = am_libsdbm_la_OBJECTS = sdbm.lo sdbm_hash.lo sdbm_lock.lo sdbm_pair.lo \ pa_file_io.lo pa_strings.lo libsdbm_la_OBJECTS = $(am_libsdbm_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/pa_file_io.Plo \ ./$(DEPDIR)/pa_strings.Plo ./$(DEPDIR)/sdbm.Plo \ ./$(DEPDIR)/sdbm_hash.Plo ./$(DEPDIR)/sdbm_lock.Plo \ ./$(DEPDIR)/sdbm_pair.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libsdbm_la_SOURCES) DIST_SOURCES = $(libsdbm_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = pa-include AM_CPPFLAGS = -Ipa-include noinst_HEADERS = sdbm_pair.h sdbm_private.h sdbm_tune.h noinst_LTLIBRARIES = libsdbm.la libsdbm_la_SOURCES = sdbm.c sdbm_hash.c sdbm_lock.c sdbm_pair.c pa_file_io.C pa_strings.C EXTRA_DIST = sdbm.vcproj all: all-recursive .SUFFIXES: .SUFFIXES: .C .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/sdbm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/sdbm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libsdbm.la: $(libsdbm_la_OBJECTS) $(libsdbm_la_DEPENDENCIES) $(EXTRA_libsdbm_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libsdbm_la_OBJECTS) $(libsdbm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_file_io.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_strings.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdbm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdbm_hash.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdbm_lock.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdbm_pair.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .C.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/pa_file_io.Plo -rm -f ./$(DEPDIR)/pa_strings.Plo -rm -f ./$(DEPDIR)/sdbm.Plo -rm -f ./$(DEPDIR)/sdbm_hash.Plo -rm -f ./$(DEPDIR)/sdbm_lock.Plo -rm -f ./$(DEPDIR)/sdbm_pair.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/pa_file_io.Plo -rm -f ./$(DEPDIR)/pa_strings.Plo -rm -f ./$(DEPDIR)/sdbm.Plo -rm -f ./$(DEPDIR)/sdbm_hash.Plo -rm -f ./$(DEPDIR)/sdbm_lock.Plo -rm -f ./$(DEPDIR)/sdbm_pair.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/sdbm/sdbm_pair.h0000644000076400007640000000243714733136276014362 00000000000000/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SDBM_PAIR_H #define SDBM_PAIR_H /* Mini EMBED (pair.c) */ #define chkpage pa_sdbm_chkpage #define delpair pa_sdbm_delpair #define duppair pa_sdbm_duppair #define fitpair pa_sdbm_fitpair #define getnkey pa_sdbm_getnkey #define getpair pa_sdbm_getpair #define putpair pa_sdbm_putpair #define splpage pa_sdbm_splpage int fitpair(char *, int); void putpair(char *, pa_sdbm_datum_t, pa_sdbm_datum_t); pa_sdbm_datum_t getpair(char *, pa_sdbm_datum_t); int delpair(char *, pa_sdbm_datum_t); int chkpage (char *); pa_sdbm_datum_t getnkey(char *, int); void splpage(char *, char *, long); int duppair(char *, pa_sdbm_datum_t); #endif /* SDBM_PAIR_H */ parser-3.5.1/src/lib/sdbm/pa-include/0000755000076400007640000000000014740300546014333 500000000000000parser-3.5.1/src/lib/sdbm/pa-include/pa_apr.h0000644000076400007640000000176614733136276015711 00000000000000/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PA_APR_H #define PA_APR_H #include "pa_config_includes.h" // apr.h typedef int pa_int32_t; typedef int pa_off_t; typedef size_t pa_size_t; // apr_pools.h typedef void pa_pool_t; #endif /* PA_APR_H */ parser-3.5.1/src/lib/sdbm/pa-include/pa_file_io.h0000644000076400007640000002117714733136276016533 00000000000000/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PA_FILE_IO_H #define PA_FILE_IO_H /** * @file pa_file_io.h * @brief APR File I/O Handling */ /** * @defgroup PA_File_IO_Handle I/O Handling Functions * @ingroup PA_File_Handle * @{ */ #include "pa_apr.h" #include "pa_errno.h" #include "pa_file_info.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @defgroup pa_file_open File Open Flags/Routines * @{ */ #define PA_READ 1 /**< Open the file for reading */ #define PA_WRITE 2 /**< Open the file for writing */ #define PA_CREATE 4 /**< Create the file if not there */ #define PA_APPEND 8 /**< Append to the end of the file */ #define PA_TRUNCATE 16 /**< Open the file and truncate to 0 length */ #define PA_BINARY 32 /**< Open the file in binary mode */ #define PA_EXCL 64 /**< Open should fail if PA_CREATE and file exists. */ #define PA_SHARELOCK 1024 /**< Platform dependent support for higher level locked read/write access to support writes across process/machines */ /** @} */ /** * @defgroup PA_file_seek_flags File Seek Flags * @{ */ /* flags for pa_file_seek */ #define PA_SET SEEK_SET #define PA_CUR SEEK_CUR #define PA_END SEEK_END /** @} */ /** should be same as whence type in lseek, POSIX defines this as int */ typedef int pa_seek_where_t; /** * Structure for referencing files. * @defvar pa_file_t */ typedef struct pa_file_t pa_file_t; /* File lock types/flags */ /** * @defgroup PA_file_lock_types File Lock Types * @{ */ #define PA_FLOCK_SHARED 1 /**< Shared lock. More than one process or thread can hold a shared lock at any given time. Essentially, this is a "read lock", preventing writers from establishing an exclusive lock. */ #define PA_FLOCK_EXCLUSIVE 2 /**< Exclusive lock. Only one process may hold an exclusive lock at any given time. This is analogous to a "write lock". */ #define PA_FLOCK_TYPEMASK 0x000F /**< mask to extract lock type */ /** @} */ /** * Open the specified file. * @param new_file The opened file descriptor. * @param fname The full path to the file (using / on all systems) * @param flag Or'ed value of: *
 *           PA_READ             open for reading
 *           PA_WRITE            open for writing
 *           PA_CREATE           create the file if not there
 *           PA_APPEND           file ptr is set to end prior to all writes
 *           PA_TRUNCATE         set length to zero if file exists
 *           PA_BINARY           not a text file (This flag is ignored on 
 *                                UNIX because it has no meaning)
 *           PA_EXCL             return error if PA_CREATE and file exists
 *           PA_SHARELOCK        Platform dependent support for higher
 *                                level locked read/write access to support
 *                                writes across process/machines
 * 
* @param perm Access permissions for file. * @param cont The pool to use. * @ingroup pa_file_open * @remark If perm is PA_OS_DEFAULT and the file is being created, appropriate * default permissions will be used. *arg1 must point to a valid file_t, * or NULL (in which case it will be allocated) */ pa_status_t pa_file_open(pa_file_t **new_file, const char *fname, pa_int32_t flag, pa_fileperms_t perm, pa_pool_t *cont); /** * Close the specified file. * @param file The file descriptor to close. */ pa_status_t pa_file_close(pa_file_t *file); /** file (un)locking functions. */ /** * Establish a lock on the specified, open file. The lock may be advisory * or mandatory, at the discretion of the platform. The lock applies to * the file as a whole, rather than a specific range. Locks are established * on a per-thread/process basis; a second lock by the same thread will not * block. * @param thefile The file to lock. * @param type The type of lock to establish on the file. */ pa_status_t pa_file_lock(pa_file_t *thefile, int type); /** * Remove any outstanding locks on the file. * @param thefile The file to unlock. */ pa_status_t pa_file_unlock(pa_file_t *thefile); /** * get the specified file's stats. * @param finfo Where to store the information about the file. * @param wanted The desired pa_finfo_t fields, as a bit flag of PA_FINFO_ values * @param thefile The file to get information about. */ pa_status_t pa_file_info_get(pa_finfo_t *finfo, pa_int32_t wanted, pa_file_t *thefile); /** * Move the read/write file offset to a specified byte within a file. * @param thefile The file descriptor * @param where How to move the pointer, one of: *
 *            PA_SET  --  set the offset to offset
 *            PA_CUR  --  add the offset to the current position 
 *            PA_END  --  add the offset to the current file size 
 * 
* @param offset The offset to move the pointer to. * @remark The third argument is modified to be the offset the pointer was actually moved to. */ pa_status_t pa_file_seek(pa_file_t *thefile, pa_seek_where_t where, pa_off_t *offset); /** * Read data from the specified file, ensuring that the buffer is filled * before returning. * @param thefile The file descriptor to read from. * @param buf The buffer to store the data to. * @param nbytes The number of bytes to read. * @param bytes_read If non-NULL, this will contain the number of bytes read. * @remark pa_file_read will read up to the specified number of bytes, but never * more. If there isn't enough data to fill that number of bytes, * then the process/thread will block until it is available or EOF * is reached. If a char was put back into the stream via ungetc, * it will be the first character returned. * * It is possible for both bytes to be read and an error to be * returned. And if *bytes_read is less than nbytes, an * accompanying error is _always_ returned. * * PA_EINTR is never returned. */ pa_status_t pa_file_read_full(pa_file_t *thefile, void *buf, pa_size_t nbytes, pa_size_t *bytes_read); /** * Write data to the specified file, ensuring that all of the data is * written before returning. * @param thefile The file descriptor to write to. * @param buf The buffer which contains the data. * @param nbytes The number of bytes to write. * @param bytes_written If non-NULL, this will contain the number of bytes written. * @remark pa_file_write will write up to the specified number of bytes, but never * more. If the OS cannot write that many bytes, the process/thread * will block until they can be written. Exceptional error such as * "out of space" or "pipe closed" will terminate with an error. * * It is possible for both bytes to be written and an error to be * returned. And if *bytes_written is less than nbytes, an * accompanying error is _always_ returned. * * PA_EINTR is never returned. */ pa_status_t pa_file_write_full(pa_file_t *thefile, const void *buf, pa_size_t nbytes, pa_size_t *bytes_written); #ifdef __cplusplus } #endif /** @} */ #endif /* ! PA_FILE_IO_H */ parser-3.5.1/src/lib/sdbm/pa-include/Makefile.in0000644000076400007640000003567714740273416016347 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/sdbm/pa-include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = pa_apr.h pa_errno.h pa_file_info.h pa_file_io.h pa_sdbm.h pa_strings.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/sdbm/pa-include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/sdbm/pa-include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/sdbm/pa-include/Makefile.am0000644000076400007640000000013011474460637016312 00000000000000noinst_HEADERS = pa_apr.h pa_errno.h pa_file_info.h pa_file_io.h pa_sdbm.h pa_strings.h parser-3.5.1/src/lib/sdbm/pa-include/pa_file_info.h0000644000076400007640000000275714733136276017062 00000000000000/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PA_FILE_INFO_H #define PA_FILE_INFO_H #include "pa_apr.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @file pa_file_info.h * @brief APR File handling */ /** * Structure for determining file permissions. * @defvar pa_fileperms_t */ typedef pa_int32_t pa_fileperms_t; /** * @defgroup PA_File_Info Stat Functions * @{ */ #define PA_FINFO_SIZE 0x00000100 /**< Size of the file */ /** * The file information structure. This is analogous to the POSIX * stat structure. */ typedef struct pa_finfo_t pa_finfo_t; struct pa_finfo_t { /** The size of the file */ pa_off_t size; }; /** @} */ #ifdef __cplusplus } #endif #endif /* ! PA_FILE_INFO_H */ parser-3.5.1/src/lib/sdbm/pa-include/pa_sdbm.h0000644000076400007640000001273114733136276016046 00000000000000/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * sdbm - ndbm work-alike hashed database library * based on Per-Ake Larson's Dynamic Hashing algorithms. BIT 18 (1978). * author: oz@nexus.yorku.ca * status: ex-public domain */ #ifndef PA_SDBM_H #define PA_SDBM_H #include "pa_apr.h" #include "pa_errno.h" #include "pa_file_io.h" /* for pa_fileperms_t */ #ifdef __cplusplus extern "C" { #endif /** * @file pa_sdbm.h * @brief apr-util SDBM library */ /** * @defgroup PA_Util_DBM_SDBM SDBM library * @ingroup PA_Util_DBM * @{ */ /** * Structure for referencing an sdbm */ typedef struct pa_sdbm_t pa_sdbm_t; /** * Structure for referencing the datum record within an sdbm */ typedef struct { /** pointer to the data stored/retrieved */ char *dptr; /** size of data */ int dsize; } pa_sdbm_datum_t; /* The extensions used for the database files */ #define PA_SDBM_DIRFEXT ".dir" #define PA_SDBM_PAGFEXT ".pag" /* flags to sdbm_store */ #define PA_SDBM_INSERT 0 #define PA_SDBM_REPLACE 1 #define PA_SDBM_INSERTDUP 2 /** * Open an sdbm database by file name * @param db The newly opened database * @param name The sdbm file to open * @param mode The flag values (PA_READ and PA_BINARY flags are implicit) *
 *           PA_WRITE          open for read-write access
 *           PA_CREATE         create the sdbm if it does not exist
 *           PA_TRUNCATE       empty the contents of the sdbm
 *           PA_EXCL           fail for PA_CREATE if the file exists
 *           PA_SHARELOCK      support locking across process/machines
 * 
* @param perm Permissions to apply to if created * @param pool The pool to use when creating the sdbm * @remark The sdbm name is not a true file name, as sdbm appends suffixes * for seperate data and index files. */ pa_status_t pa_sdbm_open(pa_sdbm_t **db, const char *name, pa_int32_t mode, pa_fileperms_t perms, pa_pool_t *p); /** * Close an sdbm file previously opened by pa_sdbm_open * @param db The database to close */ pa_status_t pa_sdbm_close(pa_sdbm_t *db); /** * Lock an sdbm database for concurency of multiple operations * @param db The database to lock * @param type The lock type *
 *           PA_FLOCK_SHARED
 *           PA_FLOCK_EXCLUSIVE
 * 
* @remark Calls to pa_sdbm_lock may be nested. All pa_sdbm functions * perform implicit locking. Since an PA_FLOCK_SHARED lock cannot be * portably promoted to an PA_FLOCK_EXCLUSIVE lock, pa_sdbm_store and * pa_sdbm_delete calls will fail if an PA_FLOCK_SHARED lock is held. * The pa_sdbm_lock call requires the database to be opened with the * PA_SHARELOCK mode value. */ pa_status_t pa_sdbm_lock(pa_sdbm_t *db, int type); /** * Release an sdbm lock previously aquired by pa_sdbm_lock * @param db The database to unlock */ pa_status_t pa_sdbm_unlock(pa_sdbm_t *db); /** * Fetch an sdbm record value by key * @param db The database * @param value The value datum retrieved for this record * @param key The key datum to find this record */ pa_status_t pa_sdbm_fetch(pa_sdbm_t *db, pa_sdbm_datum_t *value, pa_sdbm_datum_t key); /** * Store an sdbm record value by key * @param db The database * @param key The key datum to store this record by * @param value The value datum to store in this record * @param opt The method used to store the record *
 *           PA_SDBM_INSERT     return an error if the record exists
 *           PA_SDBM_REPLACE    overwrite any existing record for key
 * 
*/ pa_status_t pa_sdbm_store(pa_sdbm_t *db, pa_sdbm_datum_t key, pa_sdbm_datum_t value, int opt); /** * Delete an sdbm record value by key * @param db The database * @param key The key datum of the record to delete * @remark It is not an error to delete a non-existent record. */ pa_status_t pa_sdbm_delete(pa_sdbm_t *db, const pa_sdbm_datum_t key); /** * Retrieve the first record key from a dbm * @param dbm The database * @param key The key datum of the first record * @remark The keys returned are not ordered. To traverse the list of keys * for an sdbm opened with PA_SHARELOCK, the caller must use pa_sdbm_lock * prior to retrieving the first record, and hold the lock until after the * last call to pa_sdbm_nextkey. */ pa_status_t pa_sdbm_firstkey(pa_sdbm_t *db, pa_sdbm_datum_t *key); /** * Retrieve the next record key from an sdbm * @param db The database * @param key The key datum of the next record */ pa_status_t pa_sdbm_nextkey(pa_sdbm_t *db, pa_sdbm_datum_t *key); /** * Returns true if the sdbm database opened for read-only access * @param db The database to test */ int pa_sdbm_rdonly(pa_sdbm_t *db); /** @} */ #ifdef __cplusplus } #endif #endif /* PA_SDBM_H */ parser-3.5.1/src/lib/sdbm/pa-include/pa_strings.h0000644000076400007640000000221714733136276016610 00000000000000/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PA_STRINGS_H #define PA_STRINGS_H #include "pa_apr.h" #include "pa_errno.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ // Concatenate multiple strings, allocating memory out a pool char *pa_pstrcat(const char *a, const char *b); // use libgc void* pa_sdbm_malloc(unsigned int size); #ifdef __cplusplus } #endif #endif /* !PA_STRINGS_H */ parser-3.5.1/src/lib/sdbm/pa-include/pa_errno.h0000644000076400007640000000645214733136276016251 00000000000000/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PA_ERRNO_H #define PA_ERRNO_H #include "pa_apr.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * @file pa_errno.h * @brief APR Error Codes */ /** * @defgroup PA_Error_Codes Error Codes * @ingroup APR * @{ */ /** * Type for specifying an error or status code. */ typedef int pa_status_t; /** * PA_OS_START_ERROR is where the APR specific error values start. */ #define PA_OS_START_ERROR 20000 /** * PA_OS_ERRSPACE_SIZE is the maximum number of errors you can fit * into one of the error/status ranges below -- except for * PA_OS_START_USERERR, which see. */ #define PA_OS_ERRSPACE_SIZE 50000 /** * PA_OS_START_STATUS is where the APR specific status codes start. */ #define PA_OS_START_STATUS (PA_OS_START_ERROR + PA_OS_ERRSPACE_SIZE) /** * PA_OS_START_USERERR are reserved for applications that use APR that * layer their own error codes along with APR's. Note that the * error immediately following this one is set ten times farther * away than usual, so that users of apr have a lot of room in * which to declare custom error codes. */ #define PA_OS_START_USERERR (PA_OS_START_STATUS + PA_OS_ERRSPACE_SIZE) /** * PA_OS_START_CANONERR is where APR versions of errno values are defined * on systems which don't have the corresponding errno. */ #define PA_OS_START_CANONERR (PA_OS_START_USERERR \ + (PA_OS_ERRSPACE_SIZE * 10)) /** no error. @see PA_STATUS_IS_SUCCESS */ #define PA_SUCCESS 0 /* APR ERROR VALUES */ /** * @defgroup APRErrorValues Error Values *
 * APR ERROR VALUES
 * 
* *
 * APR STATUS VALUES
 * PA_EOF            APR has encountered the end of the file
 * 
* @{ */ #define PA_EGENERAL (PA_OS_START_ERROR + 14) #define PA_EOF (PA_OS_START_STATUS + 14) /** * @defgroup aprerrcanonical Canonical Errors * @{ */ /* APR CANONICAL ERROR VALUES */ /** @see PA_STATUS_IS_EACCES */ #ifdef EACCES #define PA_EACCES EACCES #else #define PA_EACCES (PA_OS_START_CANONERR + 1) #endif /** @see PA_STATUS_IS_EXIST */ #ifdef EEXIST #define PA_EEXIST EEXIST #else #define PA_EEXIST (PA_OS_START_CANONERR + 2) #endif /** @see PA_STATUS_IS_ENOSPC */ #ifdef ENOSPC #define PA_ENOSPC ENOSPC #else #define PA_ENOSPC (PA_OS_START_CANONERR + 6) #endif /** @see PA_STATUS_IS_EINVAL */ #ifdef EINVAL #define PA_EINVAL EINVAL #else #define PA_EINVAL (PA_OS_START_CANONERR + 11) #endif /** @} */ #ifdef __cplusplus } #endif #endif /* ! PA_ERRNO_H */ parser-3.5.1/src/lib/sdbm/sdbm.c0000644000076400007640000004034214733136276013337 00000000000000/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * sdbm - ndbm work-alike hashed database library * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). * author: oz@nexus.yorku.ca * ex-public domain, ported to APR for Apache 2 * core routines */ #include "pa_apr.h" #include "pa_file_io.h" #include "pa_strings.h" #include "pa_errno.h" #include "pa_sdbm.h" #include "sdbm_tune.h" #include "sdbm_pair.h" #include "sdbm_private.h" /* * forward */ static int getdbit (pa_sdbm_t *, long); static pa_status_t setdbit(pa_sdbm_t *, long); static pa_status_t getpage(pa_sdbm_t *db, long); static pa_status_t getnext(pa_sdbm_datum_t *key, pa_sdbm_t *db); static pa_status_t makroom(pa_sdbm_t *, long, int); /* * useful macros */ #define bad(x) ((x).dptr == NULL || (x).dsize <= 0) #define exhash(item) sdbm_hash((item).dptr, (item).dsize) /* ### Does anything need these externally? */ #define sdbm_dirfno(db) ((db)->dirf) #define sdbm_pagfno(db) ((db)->pagf) #define OFF_PAG(off) (pa_off_t) (off) * PBLKSIZ #define OFF_DIR(off) (pa_off_t) (off) * DBLKSIZ static long masks[] = { 000000000000, 000000000001, 000000000003, 000000000007, 000000000017, 000000000037, 000000000077, 000000000177, 000000000377, 000000000777, 000000001777, 000000003777, 000000007777, 000000017777, 000000037777, 000000077777, 000000177777, 000000377777, 000000777777, 000001777777, 000003777777, 000007777777, 000017777777, 000037777777, 000077777777, 000177777777, 000377777777, 000777777777, 001777777777, 003777777777, 007777777777, 017777777777 }; const pa_sdbm_datum_t sdbm_nullitem = { NULL, 0 }; static pa_status_t database_cleanup(void *data) { pa_sdbm_t *db = data; /* * Can't rely on pa_sdbm_unlock, since it will merely * decrement the refcnt if several locks are held. */ if (db->flags & (SDBM_SHARED_LOCK | SDBM_EXCLUSIVE_LOCK)) (void) pa_file_unlock(db->dirf); (void) pa_file_close(db->dirf); (void) pa_file_close(db->pagf); // free(db); // libcg will do it return PA_SUCCESS; } static pa_status_t prep(pa_sdbm_t **pdb, const char *dirname, const char *pagname, pa_int32_t flags, pa_fileperms_t perms, pa_pool_t *p) { pa_sdbm_t *db; pa_status_t status; *pdb = NULL; // db = malloc(sizeof(*db)); // memset(db, 0, sizeof(*db)); db = pa_sdbm_malloc(sizeof(*db)); db->pool = p; /* * adjust user flags so that WRONLY becomes RDWR, * as required by this package. Also set our internal * flag for RDONLY if needed. */ if (!(flags & PA_WRITE)) { db->flags |= SDBM_RDONLY; } /* * adjust the file open flags so that we handle locking * on our own (don't rely on any locking behavior within * an pa_file_t, in case it's ever introduced, and set * our own flag. */ if (flags & PA_SHARELOCK) { db->flags |= SDBM_SHARED; flags &= ~PA_SHARELOCK; } flags |= PA_BINARY | PA_READ; /* * open the files in sequence, and stat the dirfile. * If we fail anywhere, undo everything, return NULL. */ if ((status = pa_file_open(&db->dirf, dirname, flags, perms, p)) != PA_SUCCESS) goto error; if ((status = pa_file_open(&db->pagf, pagname, flags, perms, p)) != PA_SUCCESS) goto error; if ((status = pa_sdbm_lock(db, (db->flags & SDBM_RDONLY) ? PA_FLOCK_SHARED : PA_FLOCK_EXCLUSIVE)) != PA_SUCCESS) goto error; /* pa_pcalloc zeroed the buffers * pa_sdbm_lock stated the dirf->size and invalidated the cache */ /* * if we are opened in SHARED mode, unlock ourself */ if (db->flags & SDBM_SHARED) if ((status = pa_sdbm_unlock(db)) != PA_SUCCESS) goto error; /* make sure that we close the database at some point */ //pa_pool_cleanup_register(p, db, database_cleanup, pa_pool_cleanup_null); /* Done! */ *pdb = db; return PA_SUCCESS; error: if (db->dirf && db->pagf) (void) pa_sdbm_unlock(db); if (db->dirf != NULL) (void) pa_file_close(db->dirf); if (db->pagf != NULL) { (void) pa_file_close(db->pagf); } // free(db); // libcg will do it return status; } pa_status_t pa_sdbm_open(pa_sdbm_t **db, const char *file, pa_int32_t flags, pa_fileperms_t perms, pa_pool_t *p) { char *dirname = pa_pstrcat(file, PA_SDBM_DIRFEXT); char *pagname = pa_pstrcat(file, PA_SDBM_PAGFEXT); return prep(db, dirname, pagname, flags, perms, p); } pa_status_t pa_sdbm_close(pa_sdbm_t *db) { database_cleanup(db); return PA_SUCCESS; //return pa_pool_cleanup_run(db->pool, db, database_cleanup); } pa_status_t pa_sdbm_fetch(pa_sdbm_t *db, pa_sdbm_datum_t *val, pa_sdbm_datum_t key) { pa_status_t status; if (db == NULL || bad(key)) return PA_EINVAL; if ((status = pa_sdbm_lock(db, PA_FLOCK_SHARED)) != PA_SUCCESS) return status; if ((status = getpage(db, exhash(key))) == PA_SUCCESS) { *val = getpair(db->pagbuf, key); /* ### do we want a not-found result? */ } (void) pa_sdbm_unlock(db); return status; } static pa_status_t write_page(pa_sdbm_t *db, const char *buf, long pagno) { pa_status_t status; pa_off_t off = OFF_PAG(pagno); if ((status = pa_file_seek(db->pagf, PA_SET, &off)) == PA_SUCCESS) status = pa_file_write_full(db->pagf, buf, PBLKSIZ, NULL); return status; } pa_status_t pa_sdbm_delete(pa_sdbm_t *db, const pa_sdbm_datum_t key) { pa_status_t status; if (db == NULL || bad(key)) return PA_EINVAL; if (pa_sdbm_rdonly(db)) return PA_EINVAL; if ((status = pa_sdbm_lock(db, PA_FLOCK_EXCLUSIVE)) != PA_SUCCESS) return status; if ((status = getpage(db, exhash(key))) == PA_SUCCESS) { if (!delpair(db->pagbuf, key)) /* ### should we define some APRUTIL codes? */ status = PA_SUCCESS; /* PAF: were PA_EGENERAL, contradicting comment in .h file :( */ else status = write_page(db, db->pagbuf, db->pagbno); } (void) pa_sdbm_unlock(db); return status; } pa_status_t pa_sdbm_store(pa_sdbm_t *db, pa_sdbm_datum_t key, pa_sdbm_datum_t val, int flags) { int need; register long hash; pa_status_t status; if (db == NULL || bad(key)) return PA_EINVAL; if (pa_sdbm_rdonly(db)) return PA_EINVAL; need = key.dsize + val.dsize; /* * is the pair too big (or too small) for this database ?? */ if (need < 0 || need > PAIRMAX) return PA_EINVAL; if ((status = pa_sdbm_lock(db, PA_FLOCK_EXCLUSIVE)) != PA_SUCCESS) return status; if ((status = getpage(db, (hash = exhash(key)))) == PA_SUCCESS) { /* * if we need to replace, delete the key/data pair * first. If it is not there, ignore. */ if (flags == PA_SDBM_REPLACE) (void) delpair(db->pagbuf, key); else if (!(flags & PA_SDBM_INSERTDUP) && duppair(db->pagbuf, key)) { status = PA_EEXIST; goto error; } /* * if we do not have enough room, we have to split. */ if (!fitpair(db->pagbuf, need)) if ((status = makroom(db, hash, need)) != PA_SUCCESS) goto error; /* * we have enough room or split is successful. insert the key, * and update the page file. */ (void) putpair(db->pagbuf, key, val); status = write_page(db, db->pagbuf, db->pagbno); } error: (void) pa_sdbm_unlock(db); return status; } /* * makroom - make room by splitting the overfull page * this routine will attempt to make room for SPLTMAX times before * giving up. */ static pa_status_t makroom(pa_sdbm_t *db, long hash, int need) { long newp; char twin[PBLKSIZ]; char *pag = db->pagbuf; char *new = twin; register int smax = SPLTMAX; pa_status_t status; do { /* * split the current page */ (void) splpage(pag, new, db->hmask + 1); /* * address of the new page */ newp = (hash & db->hmask) | (db->hmask + 1); /* * write delay, read avoidence/cache shuffle: * select the page for incoming pair: if key is to go to the new page, * write out the previous one, and copy the new one over, thus making * it the current page. If not, simply write the new page, and we are * still looking at the page of interest. current page is not updated * here, as sdbm_store will do so, after it inserts the incoming pair. */ if (hash & (db->hmask + 1)) { if ((status = write_page(db, db->pagbuf, db->pagbno)) != PA_SUCCESS) return status; db->pagbno = newp; (void) memcpy(pag, new, PBLKSIZ); } else { if ((status = write_page(db, new, newp)) != PA_SUCCESS) return status; } if ((status = setdbit(db, db->curbit)) != PA_SUCCESS) return status; /* * see if we have enough room now */ if (fitpair(pag, need)) return PA_SUCCESS; /* * try again... update curbit and hmask as getpage would have * done. because of our update of the current page, we do not * need to read in anything. BUT we have to write the current * [deferred] page out, as the window of failure is too great. */ db->curbit = 2 * db->curbit + ((hash & (db->hmask + 1)) ? 2 : 1); db->hmask |= db->hmask + 1; if ((status = write_page(db, db->pagbuf, db->pagbno)) != PA_SUCCESS) return status; } while (--smax); /* * if we are here, this is real bad news. After SPLTMAX splits, * we still cannot fit the key. say goodnight. */ #if 0 (void) write(2, "sdbm: cannot insert after SPLTMAX attempts.\n", 44); #endif /* ### ENOSPC not really appropriate but better than nothing */ return PA_ENOSPC; } /* Reads 'len' bytes from file 'f' at offset 'off' into buf. * 'off' is given relative to the start of the file. * If EOF is returned while reading, this is taken as success. */ static pa_status_t read_from(pa_file_t *f, void *buf, pa_off_t off, pa_size_t len) { pa_status_t status; if ((status = pa_file_seek(f, PA_SET, &off)) != PA_SUCCESS || ((status = pa_file_read_full(f, buf, len, NULL)) != PA_SUCCESS)) { /* if EOF is reached, pretend we read all zero's */ if (status == PA_EOF) { memset(buf, 0, len); status = PA_SUCCESS; } } return status; } /* * the following two routines will break if * deletions aren't taken into account. (ndbm bug) */ pa_status_t pa_sdbm_firstkey(pa_sdbm_t *db, pa_sdbm_datum_t *key) { pa_status_t status; if ((status = pa_sdbm_lock(db, PA_FLOCK_SHARED)) != PA_SUCCESS) return status; /* * start at page 0 */ if ((status = read_from(db->pagf, db->pagbuf, OFF_PAG(0), PBLKSIZ)) == PA_SUCCESS) { db->pagbno = 0; db->blkptr = 0; db->keyptr = 0; status = getnext(key, db); } (void) pa_sdbm_unlock(db); return status; } pa_status_t pa_sdbm_nextkey(pa_sdbm_t *db, pa_sdbm_datum_t *key) { pa_status_t status; if ((status = pa_sdbm_lock(db, PA_FLOCK_SHARED)) != PA_SUCCESS) return status; status = getnext(key, db); (void) pa_sdbm_unlock(db); return status; } /* * all important binary tree traversal */ static pa_status_t getpage(pa_sdbm_t *db, long hash) { register int hbit; register long dbit; register long pagb; pa_status_t status; dbit = 0; hbit = 0; while (dbit < db->maxbno && getdbit(db, dbit)) dbit = 2 * dbit + ((hash & (1 << hbit++)) ? 2 : 1); debug(("dbit: %d...", dbit)); db->curbit = dbit; db->hmask = masks[hbit]; pagb = hash & db->hmask; /* * see if the block we need is already in memory. * note: this lookaside cache has about 10% hit rate. */ if (pagb != db->pagbno) { /* * note: here, we assume a "hole" is read as 0s. * if not, must zero pagbuf first. * ### joe: this assumption was surely never correct? but * ### we make it so in read_from anyway. */ if ((status = read_from(db->pagf, db->pagbuf, OFF_PAG(pagb), PBLKSIZ)) != PA_SUCCESS) return status; if (!chkpage(db->pagbuf)) return PA_ENOSPC; /* ### better error? */ db->pagbno = pagb; debug(("pag read: %d\n", pagb)); } return PA_SUCCESS; } static int getdbit(pa_sdbm_t *db, long dbit) { register long c; register long dirb; c = dbit / BYTESIZ; dirb = c / DBLKSIZ; if (dirb != db->dirbno) { if (read_from(db->dirf, db->dirbuf, OFF_DIR(dirb), DBLKSIZ) != PA_SUCCESS) return 0; db->dirbno = dirb; debug(("dir read: %d\n", dirb)); } return db->dirbuf[c % DBLKSIZ] & (1 << dbit % BYTESIZ); } static pa_status_t setdbit(pa_sdbm_t *db, long dbit) { register long c; register long dirb; pa_status_t status; pa_off_t off; c = dbit / BYTESIZ; dirb = c / DBLKSIZ; if (dirb != db->dirbno) { if ((status = read_from(db->dirf, db->dirbuf, OFF_DIR(dirb), DBLKSIZ)) != PA_SUCCESS) return status; db->dirbno = dirb; debug(("dir read: %d\n", dirb)); } db->dirbuf[c % DBLKSIZ] |= (1 << dbit % BYTESIZ); if (dbit >= db->maxbno) db->maxbno += DBLKSIZ * BYTESIZ; off = OFF_DIR(dirb); if ((status = pa_file_seek(db->dirf, PA_SET, &off)) == PA_SUCCESS) status = pa_file_write_full(db->dirf, db->dirbuf, DBLKSIZ, NULL); return status; } /* * getnext - get the next key in the page, and if done with * the page, try the next page in sequence */ static pa_status_t getnext(pa_sdbm_datum_t *key, pa_sdbm_t *db) { pa_status_t status; for (;;) { db->keyptr++; *key = getnkey(db->pagbuf, db->keyptr); if (key->dptr != NULL) return PA_SUCCESS; /* * we either run out, or there is nothing on this page.. * try the next one... If we lost our position on the * file, we will have to seek. */ db->keyptr = 0; if (db->pagbno != db->blkptr++) { pa_off_t off = OFF_PAG(db->blkptr); if ((status = pa_file_seek(db->pagf, PA_SET, &off) != PA_SUCCESS)) return status; } db->pagbno = db->blkptr; /* ### EOF acceptable here too? */ if ((status = pa_file_read_full(db->pagf, db->pagbuf, PBLKSIZ, NULL)) != PA_SUCCESS) return status; if (!chkpage(db->pagbuf)) return PA_EGENERAL; /* ### need better error */ } /* NOTREACHED */ } int pa_sdbm_rdonly(pa_sdbm_t *db) { /* ### Should we return true if the first lock is a share lock, * to reflect that pa_sdbm_store and pa_sdbm_delete will fail? */ return (db->flags & SDBM_RDONLY) != 0; } parser-3.5.1/src/lib/sdbm/Makefile.am0000644000076400007640000000037713211622356014273 00000000000000SUBDIRS = pa-include AM_CPPFLAGS = -Ipa-include noinst_HEADERS = sdbm_pair.h sdbm_private.h sdbm_tune.h noinst_LTLIBRARIES = libsdbm.la libsdbm_la_SOURCES = sdbm.c sdbm_hash.c sdbm_lock.c sdbm_pair.c pa_file_io.C pa_strings.C EXTRA_DIST = sdbm.vcproj parser-3.5.1/src/lib/sdbm/pa_file_io.C0000644000076400007640000000665514712200421014426 00000000000000/** @file Parser: implementation of apr functions. Copyright (c) 2000-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_file_io.h" #include "pa_memory.h" #include "pa_os.h" volatile const char * IDENT_PA_FILE_IO_C="$Id: pa_file_io.C,v 1.10 2024/11/04 17:14:57 moko Exp $"; struct pa_file_t { int handle; }; pa_status_t pa_file_open(pa_file_t **new_file, const char *fname, pa_int32_t flag, pa_fileperms_t perm, pa_pool_t *) { int oflags = 0; #if PA_HAS_THREADS pa_status_t rv; #endif (*new_file) = (pa_file_t*)pa_malloc_atomic(sizeof(pa_file_t)); // (*new_file)->flags = flag; (*new_file)->handle = -1; if ((flag & PA_READ) && (flag & PA_WRITE)) { oflags = O_RDWR; } else if (flag & PA_READ) { oflags = O_RDONLY; } else if (flag & PA_WRITE) { oflags = O_WRONLY; } else { return PA_EACCES; } if (flag & PA_CREATE) { oflags |= O_CREAT; if (flag & PA_EXCL) { oflags |= O_EXCL; } } if ((flag & PA_EXCL) && !(flag & PA_CREATE)) { return PA_EACCES; } if (flag & PA_APPEND) { oflags |= O_APPEND; } if (flag & PA_TRUNCATE) { oflags |= O_TRUNC; } #ifdef O_BINARY if (flag & PA_BINARY) { oflags |= O_BINARY; } #endif if(((*new_file)->handle = open(fname, oflags, /*pa_unix_perms2mode*/(perm))) <0 ) return errno; return PA_SUCCESS; } pa_status_t pa_file_close(pa_file_t *file) { return close(file->handle); } pa_status_t pa_file_lock(pa_file_t *file, int type) { if ((type & PA_FLOCK_TYPEMASK) == PA_FLOCK_SHARED) return pa_lock_shared_blocking(file->handle); return pa_lock_exclusive_blocking(file->handle); } pa_status_t pa_file_unlock(pa_file_t *file) { return pa_unlock(file->handle); } pa_status_t pa_file_info_get(pa_finfo_t *finfo, pa_int32_t /*wanted*/, pa_file_t *file) { struct stat info; if (fstat(file->handle, &info) == 0) { finfo->size=info.st_size; return PA_SUCCESS; } else { return errno; } } pa_status_t pa_file_seek(pa_file_t *file, pa_seek_where_t where, pa_off_t *offset) { pa_off_t rv = lseek(file->handle, *offset, where); *offset = rv; return rv == -1? errno: PA_SUCCESS; } pa_status_t pa_file_read_full(pa_file_t *file, void *buf, pa_size_t nbytes, pa_size_t *p_bytes_read) { int l_bytes_read = read(file->handle, buf, nbytes); if (l_bytes_read == 0) { return PA_EOF; } else if (l_bytes_read == -1) { return errno; } if(p_bytes_read) *p_bytes_read=(pa_size_t)l_bytes_read; return PA_SUCCESS; } pa_status_t pa_file_write_full(pa_file_t *file, const void *buf, pa_size_t nbytes, pa_size_t *bytes_written) { pa_size_t rv; do { rv = write(file->handle, buf, nbytes); } while (rv == (pa_size_t)-1 && errno == EINTR); if (rv == (pa_size_t)-1) { if(bytes_written) *bytes_written = 0; return errno; } if(bytes_written) *bytes_written=rv; return PA_SUCCESS; } parser-3.5.1/src/lib/sdbm/sdbm_tune.h0000644000076400007640000000202414733136276014372 00000000000000/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * sdbm - ndbm work-alike hashed database library * tuning and portability constructs [not nearly enough] * author: oz@nexus.yorku.ca */ #ifndef SDBM_TUNE_H #define SDBM_TUNE_H #include "pa_errno.h" /* ### this might be better off as sizeof(char *) */ #define BYTESIZ 8 /* * misc */ #ifdef DEBUG #define debug(x) printf x #else #define debug(x) #endif #endif /* SDBM_TUNE_H */ parser-3.5.1/src/lib/sdbm/sdbm_lock.c0000644000076400007640000000450314733136276014346 00000000000000/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "pa_file_info.h" #include "pa_file_io.h" #include "pa_sdbm.h" #include "sdbm_private.h" #include "sdbm_tune.h" /* NOTE: this function blocks until it acquires the lock */ pa_status_t pa_sdbm_lock(pa_sdbm_t *db, int type) { pa_status_t status; if (!(type == PA_FLOCK_SHARED || type == PA_FLOCK_EXCLUSIVE)) return PA_EINVAL; if (db->flags & SDBM_EXCLUSIVE_LOCK) { ++db->lckcnt; return PA_SUCCESS; } else if (db->flags & SDBM_SHARED_LOCK) { /* * Cannot promote a shared lock to an exlusive lock * in a cross-platform compatibile manner. */ if (type == PA_FLOCK_EXCLUSIVE) return PA_EINVAL; ++db->lckcnt; return PA_SUCCESS; } /* * zero size: either a fresh database, or one with a single, * unsplit data page: dirpage is all zeros. */ if ((status = pa_file_lock(db->dirf, type)) == PA_SUCCESS) { pa_finfo_t finfo; if ((status = pa_file_info_get(&finfo, PA_FINFO_SIZE, db->dirf)) != PA_SUCCESS) { (void) pa_file_unlock(db->dirf); return status; } SDBM_INVALIDATE_CACHE(db, finfo); ++db->lckcnt; if (type == PA_FLOCK_SHARED) db->flags |= SDBM_SHARED_LOCK; else if (type == PA_FLOCK_EXCLUSIVE) db->flags |= SDBM_EXCLUSIVE_LOCK; } return status; } pa_status_t pa_sdbm_unlock(pa_sdbm_t *db) { if (!(db->flags & (SDBM_SHARED_LOCK | SDBM_EXCLUSIVE_LOCK))) return PA_EINVAL; if (--db->lckcnt > 0) return PA_SUCCESS; db->flags &= ~(SDBM_SHARED_LOCK | SDBM_EXCLUSIVE_LOCK); return pa_file_unlock(db->dirf); } parser-3.5.1/src/lib/sdbm/sdbm_pair.c0000644000076400007640000001441114733136276014350 00000000000000/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as * applicable. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * sdbm - ndbm work-alike hashed database library * based on Per-Aake Larson's Dynamic Hashing algorithms. BIT 18 (1978). * author: oz@nexus.yorku.ca * status: ex-public domain. * * page-level routines */ #include "pa_sdbm.h" #include "sdbm_tune.h" #include "sdbm_pair.h" #include "sdbm_private.h" #define exhash(item) sdbm_hash((item).dptr, (item).dsize) /* * forward */ static int seepair(char *, int, char *, int); /* * page format: * +------------------------------+ * ino | n | keyoff | datoff | keyoff | * +------------+--------+--------+ * | datoff | - - - ----> | * +--------+---------------------+ * | F R E E A R E A | * +--------------+---------------+ * | <---- - - - | data | * +--------+-----+----+----------+ * | key | data | key | * +--------+----------+----------+ * * calculating the offsets for free area: if the number * of entries (ino[0]) is zero, the offset to the END of * the free area is the block size. Otherwise, it is the * nth (ino[ino[0]]) entry's offset. */ int fitpair(pag, need) char *pag; int need; { register int n; register int off; register int avail; register short *ino = (short *) pag; off = ((n = ino[0]) > 0) ? ino[n] : PBLKSIZ; avail = off - (n + 1) * sizeof(short); need += 2 * sizeof(short); debug(("avail %d need %d\n", avail, need)); return need <= avail; } void putpair(pag, key, val) char *pag; pa_sdbm_datum_t key; pa_sdbm_datum_t val; { register int n; register int off; register short *ino = (short *) pag; off = ((n = ino[0]) > 0) ? ino[n] : PBLKSIZ; /* * enter the key first */ off -= key.dsize; (void) memcpy(pag + off, key.dptr, key.dsize); ino[n + 1] = off; /* * now the data */ off -= val.dsize; (void) memcpy(pag + off, val.dptr, val.dsize); ino[n + 2] = off; /* * adjust item count */ ino[0] += 2; } pa_sdbm_datum_t getpair(pag, key) char *pag; pa_sdbm_datum_t key; { register int i; register int n; pa_sdbm_datum_t val; register short *ino = (short *) pag; if ((n = ino[0]) == 0) return sdbm_nullitem; if ((i = seepair(pag, n, key.dptr, key.dsize)) == 0) return sdbm_nullitem; val.dptr = pag + ino[i + 1]; val.dsize = ino[i] - ino[i + 1]; return val; } int duppair(pag, key) char *pag; pa_sdbm_datum_t key; { register short *ino = (short *) pag; return ino[0] > 0 && seepair(pag, ino[0], key.dptr, key.dsize) > 0; } pa_sdbm_datum_t getnkey(pag, num) char *pag; int num; { pa_sdbm_datum_t key; register int off; register short *ino = (short *) pag; num = num * 2 - 1; if (ino[0] == 0 || num > ino[0]) return sdbm_nullitem; off = (num > 1) ? ino[num - 1] : PBLKSIZ; key.dptr = pag + ino[num]; key.dsize = off - ino[num]; return key; } int delpair(pag, key) char *pag; pa_sdbm_datum_t key; { register int n; register int i; register short *ino = (short *) pag; if ((n = ino[0]) == 0) return 0; if ((i = seepair(pag, n, key.dptr, key.dsize)) == 0) return 0; /* * found the key. if it is the last entry * [i.e. i == n - 1] we just adjust the entry count. * hard case: move all data down onto the deleted pair, * shift offsets onto deleted offsets, and adjust them. * [note: 0 < i < n] */ if (i < n - 1) { register int m; register char *dst = pag + (i == 1 ? PBLKSIZ : ino[i - 1]); register char *src = pag + ino[i + 1]; register int zoo = dst - src; debug(("free-up %d ", zoo)); /* * shift data/keys down */ m = ino[i + 1] - ino[n]; #undef DUFF /* just use memmove. it should be plenty fast. */ #ifdef DUFF #define MOVB *--dst = *--src if (m > 0) { register int loop = (m + 8 - 1) >> 3; switch (m & (8 - 1)) { case 0: do { MOVB; case 7: MOVB; case 6: MOVB; case 5: MOVB; case 4: MOVB; case 3: MOVB; case 2: MOVB; case 1: MOVB; } while (--loop); } } #else dst -= m; src -= m; memmove(dst, src, m); #endif /* * adjust offset index up */ while (i < n - 1) { ino[i] = ino[i + 2] + zoo; i++; } } ino[0] -= 2; return 1; } /* * search for the key in the page. * return offset index in the range 0 < i < n. * return 0 if not found. */ static int seepair(pag, n, key, siz) char *pag; register int n; register char *key; register int siz; { register int i; register int off = PBLKSIZ; register short *ino = (short *) pag; for (i = 1; i < n; i += 2) { if (siz == off - ino[i] && memcmp(key, pag + ino[i], siz) == 0) return i; off = ino[i + 1]; } return 0; } void splpage(pag, new, sbit) char *pag; char *new; long sbit; { pa_sdbm_datum_t key; pa_sdbm_datum_t val; register int n; register int off = PBLKSIZ; char cur[PBLKSIZ]; register short *ino = (short *) cur; (void) memcpy(cur, pag, PBLKSIZ); (void) memset(pag, 0, PBLKSIZ); (void) memset(new, 0, PBLKSIZ); n = ino[0]; for (ino++; n > 0; ino += 2) { key.dptr = cur + ino[0]; key.dsize = off - ino[0]; val.dptr = cur + ino[1]; val.dsize = ino[0] - ino[1]; /* * select the page pointer (by looking at sbit) and insert */ (void) putpair((exhash(key) & sbit) ? new : pag, key, val); off = ino[1]; n -= 2; } debug(("%d split %d/%d\n", ((short *) cur)[0] / 2, ((short *) new)[0] / 2, ((short *) pag)[0] / 2)); } /* * check page sanity: * number of entries should be something * reasonable, and all offsets in the index should be in order. * this could be made more rigorous. */ int chkpage(pag) char *pag; { register int n; register int off; register short *ino = (short *) pag; if ((n = ino[0]) < 0 || n > PBLKSIZ / sizeof(short)) return 0; if (n > 0) { off = PBLKSIZ; for (ino++; n > 0; ino += 2) { if (ino[0] > off || ino[1] > off || ino[1] > ino[0]) return 0; off = ino[1]; n -= 2; } } return 1; } parser-3.5.1/src/lib/sdbm/pa_strings.C0000644000076400007640000000103214733136276014514 00000000000000/** @file Parser: implementation of apr functions. Copyright (c) 2000-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_strings.h" #include "pa_memory.h" #include "pa_common.h" volatile const char * IDENT_PA_STRINGS_C="$Id: pa_strings.C,v 1.9 2024/12/26 02:16:31 moko Exp $"; char *pa_pstrcat(const char *a, const char *b){ return pa_strcat(a, b); } void* pa_sdbm_malloc(unsigned int size){ return pa_malloc(size); } parser-3.5.1/src/lib/sdbm/sdbm.vcproj0000644000076400007640000001022013622760246014404 00000000000000 parser-3.5.1/src/lib/punycode/0000755000076400007640000000000014740300546013213 500000000000000parser-3.5.1/src/lib/punycode/punycode.vcproj0000644000076400007640000001166013622760246016217 00000000000000 parser-3.5.1/src/lib/punycode/pa_idna.h0000644000076400007640000000370314712042465014704 00000000000000/** @file Parser: IDNA support, modified Libidn Version 1.28. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) */ /* idna.h --- Prototypes for Internationalized Domain Name library. Copyright (C) 2002-2013 Simon Josefsson This file is part of GNU Libidn. GNU Libidn is free software: you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. or * 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. or both in parallel, as here. GNU Libidn 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 copies of the GNU General Public License and the GNU Lesser General Public License along with this program. If not, see . */ #ifndef PA_IDNA_H #define PA_IDNA_H #include "pa_config_includes.h" # ifdef __cplusplus extern "C" { # endif /* Error codes. */ typedef enum { IDNA_SUCCESS = 0, IDNA_CONTAINS_NON_LDH = 4, IDNA_CONTAINS_MINUS = 5, IDNA_NO_ACE_PREFIX = 6, IDNA_ROUNDTRIP_VERIFY_ERROR = 7, IDNA_CONTAINS_ACE_PREFIX = 8 } Idna_rc; /* IDNA flags */ typedef enum { IDNA_ALLOW_UNASSIGNED = 0x0001, IDNA_USE_STD3_ASCII_RULES = 0x0002 } Idna_flags; #ifndef IDNA_ACE_PREFIX #define IDNA_ACE_PREFIX "xn--" #endif const char *pa_idna_strerror (int rc); int pa_idna_to_ascii_4z (const uint32_t *in, char *out, size_t out_len, int flags); int pa_idna_to_unicode_4z (const char *in, uint32_t *out, size_t out_len, int flags); # ifdef __cplusplus } # endif #endif /* PA_IDNA_H */ parser-3.5.1/src/lib/punycode/Makefile.in0000644000076400007640000004601714740273415015214 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/punycode ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libpunycode_la_LIBADD = am_libpunycode_la_OBJECTS = pa_idna.lo pa_punycode.lo \ pa_convert_utf.lo libpunycode_la_OBJECTS = $(am_libpunycode_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/pa_convert_utf.Plo \ ./$(DEPDIR)/pa_idna.Plo ./$(DEPDIR)/pa_punycode.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libpunycode_la_SOURCES) DIST_SOURCES = $(libpunycode_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = pa_idna.h pa_punycode.h pa_convert_utf.h noinst_LTLIBRARIES = libpunycode.la libpunycode_la_SOURCES = pa_idna.c pa_punycode.c pa_convert_utf.c EXTRA_DIST = punycode.vcproj all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/punycode/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/punycode/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libpunycode.la: $(libpunycode_la_OBJECTS) $(libpunycode_la_DEPENDENCIES) $(EXTRA_libpunycode_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libpunycode_la_OBJECTS) $(libpunycode_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_convert_utf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_idna.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_punycode.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/pa_convert_utf.Plo -rm -f ./$(DEPDIR)/pa_idna.Plo -rm -f ./$(DEPDIR)/pa_punycode.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/pa_convert_utf.Plo -rm -f ./$(DEPDIR)/pa_idna.Plo -rm -f ./$(DEPDIR)/pa_punycode.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/punycode/Makefile.am0000644000076400007640000000027612513304734015173 00000000000000noinst_HEADERS = pa_idna.h pa_punycode.h pa_convert_utf.h noinst_LTLIBRARIES = libpunycode.la libpunycode_la_SOURCES = pa_idna.c pa_punycode.c pa_convert_utf.c EXTRA_DIST = punycode.vcproj parser-3.5.1/src/lib/punycode/pa_punycode.h0000644000076400007640000002143612516460745015627 00000000000000/* punycode.h --- Declarations for punycode functions. Copyright (C) 2002-2013 Simon Josefsson This file is part of GNU Libidn. GNU Libidn is free software: you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. or * 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. or both in parallel, as here. GNU Libidn 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 copies of the GNU General Public License and the GNU Lesser General Public License along with this program. If not, see . */ /* * This file contains content derived from RFC 3492bis written by Adam * M. Costello. * * Disclaimer and license: Regarding this entire document or any * portion of it (including the pseudocode and C code), the author * makes no guarantees and is not responsible for any damage resulting * from its use. The author grants irrevocable permission to anyone * to use, modify, and distribute it in any way that does not diminish * the rights of anyone else to use, modify, and distribute it, * provided that redistributed derivative works do not contain * misleading author or version information. Derivative works need * not be licensed under similar terms. * * Copyright (C) The Internet Society (2003). All Rights Reserved. * * This document and translations of it may be copied and furnished to * others, and derivative works that comment on or otherwise explain it * or assist in its implementation may be prepared, copied, published * and distributed, in whole or in part, without restriction of any * kind, provided that the above copyright notice and this paragraph are * included on all such copies and derivative works. However, this * document itself may not be modified in any way, such as by removing * the copyright notice or references to the Internet Society or other * Internet organizations, except as needed for the purpose of * developing Internet standards in which case the procedures for * copyrights defined in the Internet Standards process must be * followed, or as required to translate it into languages other than * English. * * The limited permissions granted above are perpetual and will not be * revoked by the Internet Society or its successors or assigns. * * This document and the information contained herein is provided on an * "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING * TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION * HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef PA_PUNYCODE_H # define PA_PUNYCODE_H #ifdef __cplusplus extern "C" { #endif #include "pa_config_includes.h" enum punycode_status { punycode_success = 0, punycode_bad_input = 1, /* Input is invalid. */ punycode_big_output = 2, /* Output would exceed the space provided. */ punycode_overflow = 3 /* Wider integers needed to process input. */ }; typedef enum { PUNYCODE_SUCCESS = punycode_success, PUNYCODE_BAD_INPUT = punycode_bad_input, PUNYCODE_BIG_OUTPUT = punycode_big_output, PUNYCODE_OVERFLOW = punycode_overflow } Punycode_status; const char *punycode_strerror (Punycode_status rc); /* punycode_uint needs to be unsigned and needs to be */ /* at least 26 bits wide. */ typedef uint32_t punycode_uint; int punycode_encode (size_t input_length, const punycode_uint input[], const unsigned char case_flags[], size_t * output_length, char output[]); /* punycode_encode() converts a sequence of code points (presumed to be Unicode code points) to Punycode. Input arguments (to be supplied by the caller): input_length The number of code points in the input array and the number of flags in the case_flags array. input An array of code points. They are presumed to be Unicode code points, but that is not strictly REQUIRED. The array contains code points, not code units. UTF-16 uses code units D800 through DFFF to refer to code points 10000..10FFFF. The code points D800..DFFF do not occur in any valid Unicode string. The code points that can occur in Unicode strings (0..D7FF and E000..10FFFF) are also called Unicode scalar values. case_flags A null pointer or an array of boolean values parallel to the input array. Nonzero (true, flagged) suggests that the corresponding Unicode character be forced to uppercase after being decoded (if possible), and zero (false, unflagged) suggests that it be forced to lowercase (if possible). ASCII code points (0..7F) are encoded literally, except that ASCII letters are forced to uppercase or lowercase according to the corresponding case flags. If case_flags is a null pointer then ASCII letters are left as they are, and other code points are treated as unflagged. Output arguments (to be filled in by the function): output An array of ASCII code points. It is *not* null-terminated; it will contain zeros if and only if the input contains zeros. (Of course the caller can leave room for a terminator and add one if needed.) Input/output arguments (to be supplied by the caller and overwritten by the function): output_length The caller passes in the maximum number of ASCII code points that it can receive. On successful return it will contain the number of ASCII code points actually output. Return value: Can be any of the punycode_status values defined above except punycode_bad_input. If not punycode_success, then output_size and output might contain garbage. */ int punycode_decode (size_t input_length, const char input[], size_t * output_length, punycode_uint output[], unsigned char case_flags[]); /* punycode_decode() converts Punycode to a sequence of code points (presumed to be Unicode code points). Input arguments (to be supplied by the caller): input_length The number of ASCII code points in the input array. input An array of ASCII code points (0..7F). Output arguments (to be filled in by the function): output An array of code points like the input argument of punycode_encode() (see above). case_flags A null pointer (if the flags are not needed by the caller) or an array of boolean values parallel to the output array. Nonzero (true, flagged) suggests that the corresponding Unicode character be forced to uppercase by the caller (if possible), and zero (false, unflagged) suggests that it be forced to lowercase (if possible). ASCII code points (0..7F) are output already in the proper case, but their flags will be set appropriately so that applying the flags would be harmless. Input/output arguments (to be supplied by the caller and overwritten by the function): output_length The caller passes in the maximum number of code points that it can receive into the output array (which is also the maximum number of flags that it can receive into the case_flags array, if case_flags is not a null pointer). On successful return it will contain the number of code points actually output (which is also the number of flags actually output, if case_flags is not a null pointer). The decoder will never need to output more code points than the number of ASCII code points in the input, because of the way the encoding is defined. The number of code points output cannot exceed the maximum possible value of a punycode_uint, even if the supplied output_length is greater than that. Return value: Can be any of the punycode_status values defined above. If not punycode_success, then output_length, output, and case_flags might contain garbage. */ #ifdef __cplusplus } #endif #endif /* PA_PUNYCODE_H */ parser-3.5.1/src/lib/punycode/pa_idna.c0000644000076400007640000002554114712042465014703 00000000000000/** @file Parser: IDNA support, modified Libidn Version 1.28. Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) */ /* idna.c --- Prototypes for Internationalized Domain Name library. Copyright (C) 2002-2013 Simon Josefsson This file is part of GNU Libidn. GNU Libidn is free software: you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. or * 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. or both in parallel, as here. GNU Libidn 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 copies of the GNU General Public License and the GNU Lesser General Public License along with this program. If not, see . */ #include "pa_punycode.h" #include "pa_idna.h" volatile const char * IDENT_PA_IDNA_C="$Id: pa_idna.c,v 1.9 2024/11/04 03:53:25 moko Exp $"; #define DOTP(c) ((c) == 0x002E || (c) == 0x3002 || (c) == 0xFF0E || (c) == 0xFF61) #ifdef _MSC_VER # define strncasecmp _strnicmp #endif /* Core functions */ /** * idna_to_ascii_4z_internal: * @src: input array with unicode code points. * @len: length of input array with unicode code points. * @out: output zero terminated string that must have room for at * least 63 characters plus the terminating zero. * @flags: an #Idna_flags value, e.g., %IDNA_ALLOW_UNASSIGNED or * %IDNA_USE_STD3_ASCII_RULES. * * The ToASCII operation takes a sequence of Unicode code points that * make up one domain label and transforms it into a sequence of code * points in the ASCII range (0..7F). If ToASCII succeeds, the * original sequence and the resulting sequence are equivalent labels. * * It is important to note that the ToASCII operation can fail. ToASCII * fails if any step of it fails. If any step of the ToASCII operation * fails on any label in a domain name, that domain name MUST NOT be used * as an internationalized domain name. The method for deadling with this * failure is application-specific. * * The inputs to ToASCII are a sequence of code points, the AllowUnassigned * flag, and the UseSTD3ASCIIRules flag. The output of ToASCII is either a * sequence of ASCII code points or a failure condition. * * ToASCII never alters a sequence of code points that are all in the ASCII * range to begin with (although it could fail). Applying the ToASCII * operation multiple times has exactly the same effect as applying it just * once. * * Return value: Returns 0 on success, or an #Idna_rc error code. */ static int idna_to_ascii_4i_internal (const uint32_t *src, size_t len, char *out, int flags) { int rc; size_t out_len; /* * 3. If the UseSTD3ASCIIRules flag is set, then perform these checks: * * (a) Verify the absence of non-LDH ASCII code points; that is, * the absence of 0..2C, 2E..2F, 3A..40, 5B..60, and 7B..7F. * * (b) Verify the absence of leading and trailing hyphen-minus; * that is, the absence of U+002D at the beginning and end of * the sequence. */ if (flags & IDNA_USE_STD3_ASCII_RULES) { size_t i; for (i = 0; i < len; i++) if (src[i] <= 0x2C || src[i] == 0x2E || src[i] == 0x2F || (src[i] >= 0x3A && src[i] <= 0x40) || (src[i] >= 0x5B && src[i] <= 0x60) || (src[i] >= 0x7B && src[i] <= 0x7F)) return IDNA_CONTAINS_NON_LDH; if (src[0] == 0x002D || (i > 0 && src[i - 1] == 0x002D)) return IDNA_CONTAINS_MINUS; } /* * 4. If all code points in the sequence are in the ASCII range * (0..7F), then skip to step 8. */ { size_t i; for (i = 0; i < len; i++) { if (src[i] > 0x7F) goto step5; } if (len > 63) return PUNYCODE_BIG_OUTPUT; /* copy string to output buffer if we are about to skip to step8 */ for (i = 0; i < len; i++) out[i]=(char)src[i]; out[len] = '\0'; goto step8; } /* * 5. Verify that the sequence does NOT begin with the ACE prefix. */ step5: if (len >= strlen (IDNA_ACE_PREFIX)) { size_t i; for (i = 0; i < strlen (IDNA_ACE_PREFIX); i++) if (((uint32_t) IDNA_ACE_PREFIX[i] & 0xFF) != src[i]) goto step6; return IDNA_CONTAINS_ACE_PREFIX; } /* * 6. Encode the sequence using the encoding algorithm in [PUNYCODE] * and fail if there is an error. */ step6: out_len = 63 - strlen (IDNA_ACE_PREFIX); rc = punycode_encode (len, src, NULL, &out_len, out + strlen(IDNA_ACE_PREFIX)); if (rc != PUNYCODE_SUCCESS) return rc; out[strlen (IDNA_ACE_PREFIX) + out_len] = '\0'; /* * 7. Prepend the ACE prefix. */ memcpy (out, IDNA_ACE_PREFIX, strlen (IDNA_ACE_PREFIX)); step8: return IDNA_SUCCESS; } /** * idna_to_ascii_4z: * @in: zero terminated input Unicode string. * @out: pointer to output string. * @flags: an #Idna_flags value, e.g., %IDNA_ALLOW_UNASSIGNED or * %IDNA_USE_STD3_ASCII_RULES. * * Convert UCS-4 domain name to ASCII string. The domain name may * contain several labels, separated by dots. * * Return value: Returns %IDNA_SUCCESS on success, or error code. **/ int pa_idna_to_ascii_4z (const uint32_t *in, char *out, size_t out_len, int flags) { int rc; const uint32_t *start = in; const uint32_t *end; size_t add_len; char buf[64]; /* 1) Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61 (halfwidth ideographic full stop). */ do { for (end = start; *end && !DOTP (*end); end++); if (end > start) { rc = idna_to_ascii_4i_internal (start, (size_t) (end - start), buf, flags); if (rc != IDNA_SUCCESS) return rc; add_len = strlen (buf); if (add_len >= out_len) return PUNYCODE_BIG_OUTPUT; memcpy (out, buf, add_len); out += add_len; out_len -= add_len; } if (*end) { if (!out_len) return PUNYCODE_BIG_OUTPUT; *(out++)='.'; out_len--; } start = end + 1; } while (*end); if (!out_len) return PUNYCODE_BIG_OUTPUT; *out='\0'; return IDNA_SUCCESS; } /* ToUnicode(). */ static int idna_to_unicode_internal (const char *in, size_t in_len, uint32_t *out, size_t *out_len, int flags) { int rc; char tmpout[64]; /* 3. Verify that the sequence begins with the ACE prefix * ... The ToASCII and ToUnicode operations MUST recognize the ACE prefix in a case-insensitive manner. */ if ( (in_len < strlen (IDNA_ACE_PREFIX)) || (strncasecmp (in, IDNA_ACE_PREFIX, strlen (IDNA_ACE_PREFIX)) != 0) ){ size_t i; if (in_len >= *out_len) return PUNYCODE_BIG_OUTPUT; for(i=0; i 0x7F) return PUNYCODE_BAD_INPUT; out[i]=in[i]; } *out_len=in_len; return IDNA_SUCCESS; } else { /* 4. Remove the ACE prefix. */ in += strlen (IDNA_ACE_PREFIX); in_len-=strlen (IDNA_ACE_PREFIX); /* 5. Decode the sequence using the decoding algorithm in [PUNYCODE] * and fail if there is an error. Save a copy of the result of * this step. */ rc = punycode_decode (in_len, in, out_len, out, NULL); if (rc != PUNYCODE_SUCCESS) return rc; /* 6. Apply ToASCII. */ rc = idna_to_ascii_4i_internal (out, *out_len, tmpout, flags); if (rc != IDNA_SUCCESS) return rc; /* 7. Verify that the result of step 6 matches the saved copy from * step 3, using a case-insensitive ASCII comparison. */ if (strncasecmp (in, tmpout + strlen (IDNA_ACE_PREFIX), in_len) != 0) return IDNA_ROUNDTRIP_VERIFY_ERROR; /* 8. Return the saved copy from step 5. */ return IDNA_SUCCESS; } } /** * idna_to_unicode_4z: * @in: zero-terminated string. * @output: pointer to output Unicode string. * @flags: an #Idna_flags value, e.g., %IDNA_ALLOW_UNASSIGNED or * %IDNA_USE_STD3_ASCII_RULES. * * Convert possibly ACE encoded domain name into a * UCS-4 string. The domain name may contain several labels, * separated by dots. The output buffer must be deallocated by the * caller. * * Return value: Returns %IDNA_SUCCESS on success, or error code. **/ int pa_idna_to_unicode_4z (const char *in, uint32_t *out, size_t out_len, int flags) { int rc; const char *start = in; const char *end; size_t add_len; do { for (end = start; *end && (*end != '.'); end++); if (end > start) { add_len=out_len; rc = idna_to_unicode_internal (start, (size_t) (end - start), out, &add_len, flags); if (rc != IDNA_SUCCESS) return rc; if (add_len >= out_len) return PUNYCODE_BIG_OUTPUT; out+=add_len; out_len-=add_len; } if (*end) { if (!out_len) return PUNYCODE_BIG_OUTPUT; *(out++) = 0x002E; /* '.' (full stop) */ out_len--; } start = end + 1; } while (*end); if (!out_len) return PUNYCODE_BIG_OUTPUT; *out=0; return IDNA_SUCCESS; } /** * IDNA_ACE_PREFIX * * The IANA allocated prefix to use for IDNA. "xn--" */ /** * Idna_rc: * @IDNA_SUCCESS: Successful operation. This value is guaranteed to * always be zero, the remaining ones are only guaranteed to hold * non-zero values, for logical comparison purposes. * @IDNA_CONTAINS_NON_LDH: For IDNA_USE_STD3_ASCII_RULES, indicate that * the string contains non-LDH ASCII characters. * @IDNA_CONTAINS_MINUS: For IDNA_USE_STD3_ASCII_RULES, indicate that * the string contains a leading or trailing hyphen-minus (U+002D). * @IDNA_ROUNDTRIP_VERIFY_ERROR: The ToASCII operation on output * string does not equal the input. * @IDNA_CONTAINS_ACE_PREFIX: The input contains the ACE prefix (for * ToASCII). * * Enumerated return codes of idna_to_ascii_4i(), * idna_to_unicode_44i() functions (and functions derived from those * functions). The value 0 is guaranteed to always correspond to * success. */ const char *pa_idna_strerror(int rc) { switch (rc) { case IDNA_SUCCESS: return "Success"; case PUNYCODE_BAD_INPUT: return "Input is invalid"; case PUNYCODE_BIG_OUTPUT: return "String is too long"; case PUNYCODE_OVERFLOW: return "Wider integers needed to process input"; case IDNA_CONTAINS_NON_LDH: return "Non-digit/letter/hyphen in input"; case IDNA_CONTAINS_MINUS: return "Forbidden leading or trailing minus sign (`-')"; case IDNA_ROUNDTRIP_VERIFY_ERROR: return "String not idempotent under ToASCII"; case IDNA_CONTAINS_ACE_PREFIX: return "Input already contain ACE prefix (`xn--')"; default: return "Unknown error"; } } /** * Idna_flags: * @IDNA_ALLOW_UNASSIGNED: Don't reject strings containing unassigned * Unicode code points. * @IDNA_USE_STD3_ASCII_RULES: Validate strings according to STD3 * rules (i.e., normal host name rules). * * Flags to pass to idna_to_ascii_4i(), idna_to_unicode_44i() etc. */ parser-3.5.1/src/lib/punycode/pa_convert_utf.c0000644000076400007640000006430212515556555016335 00000000000000/*===--- pa_convert_utf.c - Universal Character Names conversions ---------------=== * * The LLVM Compiler Infrastructure * * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. * *===------------------------------------------------------------------------=*/ /* * Copyright 2001-2004 Unicode, Inc. * * Disclaimer * * This source code is provided as is by Unicode, Inc. No claims are * made as to fitness for any particular purpose. No warranties of any * kind are expressed or implied. The recipient agrees to determine * applicability of information provided. If this file has been * purchased on magnetic or optical media from Unicode, Inc., the * sole remedy for any claim will be exchange of defective media * within 90 days of receipt. * * Limitations on Rights to Redistribute This Code * * Unicode, Inc. hereby grants the right to freely use the information * supplied in this file in the creation of products supporting the * Unicode Standard, and to make copies of this file in any form * for internal or external distribution as long as this notice * remains attached. */ /* --------------------------------------------------------------------- Conversions between UTF32, UTF-16, and UTF-8. Source code file. Author: Mark E. Davis, 1994. Rev History: Rick McGowan, fixes & updates May 2001. Sept 2001: fixed const & error conditions per mods suggested by S. Parent & A. Lillich. June 2002: Tim Dodd added detection and handling of incomplete source sequences, enhanced error detection, added casts to eliminate compiler warnings. July 2003: slight mods to back out aggressive FFFE detection. Jan 2004: updated switches in from-UTF8 conversions. Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions. See the header file "ConvertUTF.h" for complete documentation. ------------------------------------------------------------------------ */ #include "pa_convert_utf.h" static const int halfShift = 10; /* used for shifting by 10 bits */ static const UTF32 halfBase = 0x0010000UL; static const UTF32 halfMask = 0x3FFUL; #define UNI_SUR_HIGH_START (UTF32)0xD800 #define UNI_SUR_HIGH_END (UTF32)0xDBFF #define UNI_SUR_LOW_START (UTF32)0xDC00 #define UNI_SUR_LOW_END (UTF32)0xDFFF #define false 0 #define true 1 /* --------------------------------------------------------------------- */ /* * Index into the table below with the first byte of a UTF-8 sequence to * get the number of trailing bytes that are supposed to follow it. * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is * left as-is for anyone who may want to do such conversion, which was * allowed in earlier algorithms. */ static const char trailingBytesForUTF8[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; /* * Magic values subtracted from a buffer value during UTF8 conversion. * This table contains as many values as there might be trailing bytes * in a UTF-8 sequence. */ static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; /* * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed * into the first byte, depending on how many bytes follow. There are * as many entries in this table as there are UTF-8 sequence types. * (I.e., one byte sequence, two byte... etc.). Remember that sequencs * for *legal* UTF-8 will be 4 or fewer bytes total. */ static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; /* --------------------------------------------------------------------- */ /* The interface converts a whole buffer to avoid function-call overhead. * Constants have been gathered. Loops & conditionals have been removed as * much as possible for efficiency, in favor of drop-through switches. * (See "Note A" at the bottom of the file for equivalent code.) * If your compiler supports it, the "isLegalUTF8" call can be turned * into an inline function. */ /* --------------------------------------------------------------------- */ ConversionResult pa_convertUTF32toUTF16 ( const UTF32** sourceStart, const UTF32* sourceEnd, UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const UTF32* source = *sourceStart; UTF16* target = *targetStart; while (source < sourceEnd) { UTF32 ch; if (target >= targetEnd) { result = targetExhausted; break; } ch = *source++; if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { if (flags == strictConversion) { --source; /* return to the illegal value itself */ result = sourceIllegal; break; } else { *target++ = UNI_REPLACEMENT_CHAR; } } else { *target++ = (UTF16)ch; /* normal case */ } } else if (ch > UNI_MAX_LEGAL_UTF32) { if (flags == strictConversion) { result = sourceIllegal; } else { *target++ = UNI_REPLACEMENT_CHAR; } } else { /* target is a character in range 0xFFFF - 0x10FFFF. */ if (target + 1 >= targetEnd) { --source; /* Back up source pointer! */ result = targetExhausted; break; } ch -= halfBase; *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); } } *sourceStart = source; *targetStart = target; return result; } /* --------------------------------------------------------------------- */ ConversionResult pa_convertUTF16toUTF32 ( const UTF16** sourceStart, const UTF16* sourceEnd, UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const UTF16* source = *sourceStart; UTF32* target = *targetStart; UTF32 ch, ch2; while (source < sourceEnd) { const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ ch = *source++; /* If we have a surrogate pair, convert to UTF32 first. */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { /* If the 16 bits following the high surrogate are in the source buffer... */ if (source < sourceEnd) { ch2 = *source; /* If it's a low surrogate, convert to UTF32. */ if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START) + halfBase; ++source; } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ --source; /* return to the illegal value itself */ result = sourceIllegal; break; } } else { /* We don't have the 16 bits following the high surrogate. */ --source; /* return to the high surrogate */ result = sourceExhausted; break; } } else if (flags == strictConversion) { /* UTF-16 surrogate values are illegal in UTF-32 */ if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { --source; /* return to the illegal value itself */ result = sourceIllegal; break; } } if (target >= targetEnd) { source = oldSource; /* Back up source pointer! */ result = targetExhausted; break; } *target++ = ch; } *sourceStart = source; *targetStart = target; return result; } ConversionResult pa_convertUTF16toUTF8 ( const UTF16** sourceStart, const UTF16* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const UTF16* source = *sourceStart; UTF8* target = *targetStart; while (source < sourceEnd) { UTF32 ch; unsigned short bytesToWrite = 0; const UTF32 byteMask = 0xBF; const UTF32 byteMark = 0x80; const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ ch = *source++; /* If we have a surrogate pair, convert to UTF32 first. */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { /* If the 16 bits following the high surrogate are in the source buffer... */ if (source < sourceEnd) { UTF32 ch2 = *source; /* If it's a low surrogate, convert to UTF32. */ if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START) + halfBase; ++source; } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ --source; /* return to the illegal value itself */ result = sourceIllegal; break; } } else { /* We don't have the 16 bits following the high surrogate. */ --source; /* return to the high surrogate */ result = sourceExhausted; break; } } else if (flags == strictConversion) { /* UTF-16 surrogate values are illegal in UTF-32 */ if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { --source; /* return to the illegal value itself */ result = sourceIllegal; break; } } /* Figure out how many bytes the result will require */ if (ch < (UTF32)0x80) { bytesToWrite = 1; } else if (ch < (UTF32)0x800) { bytesToWrite = 2; } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; } else { bytesToWrite = 3; ch = UNI_REPLACEMENT_CHAR; } target += bytesToWrite; if (target > targetEnd) { source = oldSource; /* Back up source pointer! */ target -= bytesToWrite; result = targetExhausted; break; } switch (bytesToWrite) { /* note: everything falls through. */ case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); } target += bytesToWrite; } *sourceStart = source; *targetStart = target; return result; } /* --------------------------------------------------------------------- */ ConversionResult pa_convertUTF32toUTF8 ( const UTF32** sourceStart, const UTF32* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const UTF32* source = *sourceStart; UTF8* target = *targetStart; while (source < sourceEnd) { UTF32 ch; unsigned short bytesToWrite = 0; const UTF32 byteMask = 0xBF; const UTF32 byteMark = 0x80; ch = *source++; if (flags == strictConversion ) { /* UTF-16 surrogate values are illegal in UTF-32 */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { --source; /* return to the illegal value itself */ result = sourceIllegal; break; } } /* * Figure out how many bytes the result will require. Turn any * illegally large UTF32 things (> Plane 17) into replacement chars. */ if (ch < (UTF32)0x80) { bytesToWrite = 1; } else if (ch < (UTF32)0x800) { bytesToWrite = 2; } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; } else { bytesToWrite = 3; ch = UNI_REPLACEMENT_CHAR; result = sourceIllegal; } target += bytesToWrite; if (target > targetEnd) { --source; /* Back up source pointer! */ target -= bytesToWrite; result = targetExhausted; break; } switch (bytesToWrite) { /* note: everything falls through. */ case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); } target += bytesToWrite; } *sourceStart = source; *targetStart = target; return result; } /* --------------------------------------------------------------------- */ /* * Utility routine to tell whether a sequence of bytes is legal UTF-8. * This must be called with the length pre-determined by the first byte. * If not calling this from ConvertUTF8to*, then the length can be set by: * length = trailingBytesForUTF8[*source]+1; * and the sequence is illegal right away if there aren't that many bytes * available. * If presented with a length > 4, this returns false. The Unicode * definition of UTF-8 goes up to 4-byte sequences. */ static Boolean isLegalUTF8(const UTF8 *source, int length) { UTF8 a; const UTF8 *srcptr = source+length; switch (length) { default: return false; /* Everything else falls through when "true"... */ case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; case 2: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; switch (*source) { /* no fall-through in this inner switch */ case 0xE0: if (a < 0xA0) return false; break; case 0xED: if (a > 0x9F) return false; break; case 0xF0: if (a < 0x90) return false; break; case 0xF4: if (a > 0x8F) return false; break; default: if (a < 0x80) return false; } case 1: if (*source >= 0x80 && *source < 0xC2) return false; } if (*source > 0xF4) return false; return true; } /* --------------------------------------------------------------------- */ /* * Exported function to return whether a UTF-8 sequence is legal or not. * This is not used here; it's just exported. */ Boolean pa_isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { int length = trailingBytesForUTF8[*source]+1; if (length > sourceEnd - source) { return false; } return isLegalUTF8(source, length); } /* --------------------------------------------------------------------- */ static unsigned findMaximalSubpartOfIllFormedUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { UTF8 b1, b2, b3; assert(!pa_isLegalUTF8Sequence(source, sourceEnd)); /* * Unicode 6.3.0, D93b: * * Maximal subpart of an ill-formed subsequence: The longest code unit * subsequence starting at an unconvertible offset that is either: * a. the initial subsequence of a well-formed code unit sequence, or * b. a subsequence of length one. */ if (source == sourceEnd) return 0; /* * Perform case analysis. See Unicode 6.3.0, Table 3-7. Well-Formed UTF-8 * Byte Sequences. */ b1 = *source; ++source; if (b1 >= 0xC2 && b1 <= 0xDF) { /* * First byte is valid, but we know that this code unit sequence is * invalid, so the maximal subpart has to end after the first byte. */ return 1; } if (source == sourceEnd) return 1; b2 = *source; ++source; if (b1 == 0xE0) { return (b2 >= 0xA0 && b2 <= 0xBF) ? 2 : 1; } if (b1 >= 0xE1 && b1 <= 0xEC) { return (b2 >= 0x80 && b2 <= 0xBF) ? 2 : 1; } if (b1 == 0xED) { return (b2 >= 0x80 && b2 <= 0x9F) ? 2 : 1; } if (b1 >= 0xEE && b1 <= 0xEF) { return (b2 >= 0x80 && b2 <= 0xBF) ? 2 : 1; } if (b1 == 0xF0) { if (b2 >= 0x90 && b2 <= 0xBF) { if (source == sourceEnd) return 2; b3 = *source; return (b3 >= 0x80 && b3 <= 0xBF) ? 3 : 2; } return 1; } if (b1 >= 0xF1 && b1 <= 0xF3) { if (b2 >= 0x80 && b2 <= 0xBF) { if (source == sourceEnd) return 2; b3 = *source; return (b3 >= 0x80 && b3 <= 0xBF) ? 3 : 2; } return 1; } if (b1 == 0xF4) { if (b2 >= 0x80 && b2 <= 0x8F) { if (source == sourceEnd) return 2; b3 = *source; return (b3 >= 0x80 && b3 <= 0xBF) ? 3 : 2; } return 1; } assert((b1 >= 0x80 && b1 <= 0xC1) || b1 >= 0xF5); /* * There are no valid sequences that start with these bytes. Maximal subpart * is defined to have length 1 in these cases. */ return 1; } /* --------------------------------------------------------------------- */ /* * Exported function to return the total number of bytes in a codepoint * represented in UTF-8, given the value of the first byte. */ unsigned pa_getNumBytesForUTF8(UTF8 first) { return trailingBytesForUTF8[first] + 1; } /* --------------------------------------------------------------------- */ /* * Exported function to return whether a UTF-8 string is legal or not. * This is not used here; it's just exported. */ Boolean pa_isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd) { while (*source != sourceEnd) { int length = trailingBytesForUTF8[**source] + 1; if (length > sourceEnd - *source || !isLegalUTF8(*source, length)) return false; *source += length; } return true; } /* --------------------------------------------------------------------- */ ConversionResult pa_convertUTF8toUTF16 ( const UTF8** sourceStart, const UTF8* sourceEnd, UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const UTF8* source = *sourceStart; UTF16* target = *targetStart; while (source < sourceEnd) { UTF32 ch = 0; unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; if (extraBytesToRead >= sourceEnd - source) { result = sourceExhausted; break; } /* Do this check whether lenient or strict */ if (!isLegalUTF8(source, extraBytesToRead+1)) { result = sourceIllegal; break; } /* * The cases all fall through. See "Note A" below. */ switch (extraBytesToRead) { case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ case 3: ch += *source++; ch <<= 6; case 2: ch += *source++; ch <<= 6; case 1: ch += *source++; ch <<= 6; case 0: ch += *source++; } ch -= offsetsFromUTF8[extraBytesToRead]; if (target >= targetEnd) { source -= (extraBytesToRead+1); /* Back up source pointer! */ result = targetExhausted; break; } if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ /* UTF-16 surrogate values are illegal in UTF-32 */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { if (flags == strictConversion) { source -= (extraBytesToRead+1); /* return to the illegal value itself */ result = sourceIllegal; break; } else { *target++ = UNI_REPLACEMENT_CHAR; } } else { *target++ = (UTF16)ch; /* normal case */ } } else if (ch > UNI_MAX_UTF16) { if (flags == strictConversion) { result = sourceIllegal; source -= (extraBytesToRead+1); /* return to the start */ break; /* Bail out; shouldn't continue */ } else { *target++ = UNI_REPLACEMENT_CHAR; } } else { /* target is a character in range 0xFFFF - 0x10FFFF. */ if (target + 1 >= targetEnd) { source -= (extraBytesToRead+1); /* Back up source pointer! */ result = targetExhausted; break; } ch -= halfBase; *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); } } *sourceStart = source; *targetStart = target; return result; } /* --------------------------------------------------------------------- */ static ConversionResult ConvertUTF8toUTF32Impl( const UTF8** sourceStart, const UTF8* sourceEnd, UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags, Boolean InputIsPartial) { ConversionResult result = conversionOK; const UTF8* source = *sourceStart; UTF32* target = *targetStart; while (source < sourceEnd) { UTF32 ch = 0; unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; if (extraBytesToRead >= sourceEnd - source) { if (flags == strictConversion || InputIsPartial) { result = sourceExhausted; break; } else { result = sourceIllegal; /* * Replace the maximal subpart of ill-formed sequence with * replacement character. */ source += findMaximalSubpartOfIllFormedUTF8Sequence(source, sourceEnd); *target++ = UNI_REPLACEMENT_CHAR; continue; } } if (target >= targetEnd) { result = targetExhausted; break; } /* Do this check whether lenient or strict */ if (!isLegalUTF8(source, extraBytesToRead+1)) { result = sourceIllegal; if (flags == strictConversion) { /* Abort conversion. */ break; } else { /* * Replace the maximal subpart of ill-formed sequence with * replacement character. */ source += findMaximalSubpartOfIllFormedUTF8Sequence(source, sourceEnd); *target++ = UNI_REPLACEMENT_CHAR; continue; } } /* * The cases all fall through. See "Note A" below. */ switch (extraBytesToRead) { case 5: ch += *source++; ch <<= 6; case 4: ch += *source++; ch <<= 6; case 3: ch += *source++; ch <<= 6; case 2: ch += *source++; ch <<= 6; case 1: ch += *source++; ch <<= 6; case 0: ch += *source++; } ch -= offsetsFromUTF8[extraBytesToRead]; if (ch <= UNI_MAX_LEGAL_UTF32) { /* * UTF-16 surrogate values are illegal in UTF-32, and anything * over Plane 17 (> 0x10FFFF) is illegal. */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { if (flags == strictConversion) { source -= (extraBytesToRead+1); /* return to the illegal value itself */ result = sourceIllegal; break; } else { *target++ = UNI_REPLACEMENT_CHAR; } } else { *target++ = ch; } } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */ result = sourceIllegal; *target++ = UNI_REPLACEMENT_CHAR; } } *sourceStart = source; *targetStart = target; return result; } ConversionResult pa_convertUTF8toUTF32Partial(const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags) { return ConvertUTF8toUTF32Impl(sourceStart, sourceEnd, targetStart, targetEnd, flags, /*InputIsPartial=*/true); } ConversionResult pa_convertUTF8toUTF32(const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags) { return ConvertUTF8toUTF32Impl(sourceStart, sourceEnd, targetStart, targetEnd, flags, /*InputIsPartial=*/false); } /* --------------------------------------------------------------------- Note A. The fall-through switches in UTF-8 reading code save a temp variable, some decrements & conditionals. The switches are equivalent to the following loop: { int tmpBytesToRead = extraBytesToRead+1; do { ch += *source++; --tmpBytesToRead; if (tmpBytesToRead) ch <<= 6; } while (tmpBytesToRead > 0); } In UTF-8 writing code, the switches on "bytesToWrite" are similarly unrolled loops. --------------------------------------------------------------------- */ parser-3.5.1/src/lib/punycode/pa_convert_utf.h0000644000076400007640000001576312513304734016335 00000000000000/*===--- pa_convert_utf.h - Universal Character Names conversions ---------------=== * * The LLVM Compiler Infrastructure * * This file is distributed under the University of Illinois Open Source * License. See LICENSE.TXT for details. * *==------------------------------------------------------------------------==*/ /* * Copyright 2001-2004 Unicode, Inc. * * Disclaimer * * This source code is provided as is by Unicode, Inc. No claims are * made as to fitness for any particular purpose. No warranties of any * kind are expressed or implied. The recipient agrees to determine * applicability of information provided. If this file has been * purchased on magnetic or optical media from Unicode, Inc., the * sole remedy for any claim will be exchange of defective media * within 90 days of receipt. * * Limitations on Rights to Redistribute This Code * * Unicode, Inc. hereby grants the right to freely use the information * supplied in this file in the creation of products supporting the * Unicode Standard, and to make copies of this file in any form * for internal or external distribution as long as this notice * remains attached. */ /* --------------------------------------------------------------------- Conversions between UTF32, UTF-16, and UTF-8. Header file. Several funtions are included here, forming a complete set of conversions between the three formats. UTF-7 is not included here, but is handled in a separate source file. Each of these routines takes pointers to input buffers and output buffers. The input buffers are const. Each routine converts the text between *sourceStart and sourceEnd, putting the result into the buffer between *targetStart and targetEnd. Note: the end pointers are *after* the last item: e.g. *(sourceEnd - 1) is the last item. The return result indicates whether the conversion was successful, and if not, whether the problem was in the source or target buffers. (Only the first encountered problem is indicated.) After the conversion, *sourceStart and *targetStart are both updated to point to the end of last text successfully converted in the respective buffers. Input parameters: sourceStart - pointer to a pointer to the source buffer. The contents of this are modified on return so that it points at the next thing to be converted. targetStart - similarly, pointer to pointer to the target buffer. sourceEnd, targetEnd - respectively pointers to the ends of the two buffers, for overflow checking only. These conversion functions take a ConversionFlags argument. When this flag is set to strict, both irregular sequences and isolated surrogates will cause an error. When the flag is set to lenient, both irregular sequences and isolated surrogates are converted. Whether the flag is strict or lenient, all illegal sequences will cause an error return. This includes sequences such as: , , or in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code must check for illegal sequences. When the flag is set to lenient, characters over 0x10FFFF are converted to the replacement character; otherwise (when the flag is set to strict) they constitute an error. Output parameters: The value "sourceIllegal" is returned from some routines if the input sequence is malformed. When "sourceIllegal" is returned, the source value will point to the illegal value that caused the problem. E.g., in UTF-8 when a sequence is malformed, it points to the start of the malformed sequence. Author: Mark E. Davis, 1994. Rev History: Rick McGowan, fixes & updates May 2001. Fixes & updates, Sept 2001. ------------------------------------------------------------------------ */ #ifndef PA_CONVERT_UTF_H #define PA_CONVERT_UTF_H #include "pa_config_includes.h" /* --------------------------------------------------------------------- The following 4 definitions are compiler-specific. The C standard does not guarantee that wchar_t has at least 16 bits, so wchar_t is no less portable than unsigned short! All should be unsigned values to avoid sign extension during bit mask & shift operations. ------------------------------------------------------------------------ */ typedef uint32_t UTF32; /* at least 32 bits */ typedef uint16_t UTF16; /* at least 16 bits */ typedef unsigned char UTF8; /* typically 8 bits */ typedef unsigned char Boolean; /* 0 or 1 */ /* Some fundamental constants */ #define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD #define UNI_MAX_BMP (UTF32)0x0000FFFF #define UNI_MAX_UTF16 (UTF32)0x0010FFFF #define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF #define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF #define UNI_MAX_UTF8_BYTES_PER_CODE_POINT 4 #define UNI_UTF16_BYTE_ORDER_MARK_NATIVE 0xFEFF #define UNI_UTF16_BYTE_ORDER_MARK_SWAPPED 0xFFFE typedef enum { conversionOK, /* conversion successful */ sourceExhausted, /* partial character in source, but hit end */ targetExhausted, /* insuff. room in target for conversion */ sourceIllegal /* source sequence is illegal/malformed */ } ConversionResult; typedef enum { strictConversion = 0, lenientConversion } ConversionFlags; /* This is for C++ and does no harm in C */ #ifdef __cplusplus extern "C" { #endif ConversionResult pa_convertUTF8toUTF16 ( const UTF8** sourceStart, const UTF8* sourceEnd, UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); /** * Convert a partial UTF8 sequence to UTF32. If the sequence ends in an * incomplete code unit sequence, returns \c sourceExhausted. */ ConversionResult pa_convertUTF8toUTF32Partial( const UTF8** sourceStart, const UTF8* sourceEnd, UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); /** * Convert a partial UTF8 sequence to UTF32. If the sequence ends in an * incomplete code unit sequence, returns \c sourceIllegal. */ ConversionResult pa_convertUTF8toUTF32( const UTF8** sourceStart, const UTF8* sourceEnd, UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); ConversionResult pa_convertUTF16toUTF8 ( const UTF16** sourceStart, const UTF16* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); ConversionResult pa_convertUTF32toUTF8 ( const UTF32** sourceStart, const UTF32* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); ConversionResult pa_convertUTF16toUTF32 ( const UTF16** sourceStart, const UTF16* sourceEnd, UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); ConversionResult pa_convertUTF32toUTF16 ( const UTF32** sourceStart, const UTF32* sourceEnd, UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); Boolean pa_isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); Boolean pa_isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd); unsigned pa_getNumBytesForUTF8(UTF8 firstByte); #ifdef __cplusplus } #endif #endif parser-3.5.1/src/lib/punycode/pa_punycode.c0000644000076400007640000004003512607017632015610 00000000000000/* punycode.c --- Implementation of punycode used to ASCII encode IDN's. Copyright (C) 2002-2013 Simon Josefsson This file is part of GNU Libidn. GNU Libidn is free software: you can redistribute it and/or modify it under the terms of either: * the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. or * 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. or both in parallel, as here. GNU Libidn 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 copies of the GNU General Public License and the GNU Lesser General Public License along with this program. If not, see . */ /* * This file is derived from RFC 3492bis written by Adam M. Costello. * * Disclaimer and license: Regarding this entire document or any * portion of it (including the pseudocode and C code), the author * makes no guarantees and is not responsible for any damage resulting * from its use. The author grants irrevocable permission to anyone * to use, modify, and distribute it in any way that does not diminish * the rights of anyone else to use, modify, and distribute it, * provided that redistributed derivative works do not contain * misleading author or version information. Derivative works need * not be licensed under similar terms. * * Copyright (C) The Internet Society (2003). All Rights Reserved. * * This document and translations of it may be copied and furnished to * others, and derivative works that comment on or otherwise explain it * or assist in its implementation may be prepared, copied, published * and distributed, in whole or in part, without restriction of any * kind, provided that the above copyright notice and this paragraph are * included on all such copies and derivative works. However, this * document itself may not be modified in any way, such as by removing * the copyright notice or references to the Internet Society or other * Internet organizations, except as needed for the purpose of * developing Internet standards in which case the procedures for * copyrights defined in the Internet Standards process must be * followed, or as required to translate it into languages other than * English. * * The limited permissions granted above are perpetual and will not be * revoked by the Internet Society or its successors or assigns. * * This document and the information contained herein is provided on an * "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING * TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING * BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION * HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. */ #include "pa_punycode.h" /*** Bootstring parameters for Punycode ***/ enum { base = 36, tmin = 1, tmax = 26, skew = 38, damp = 700, initial_bias = 72, initial_n = 0x80, delimiter = 0x2D }; /* basic(cp) tests whether cp is a basic code point: */ #define basic(cp) ((punycode_uint)(cp) < 0x80) /* delim(cp) tests whether cp is a delimiter: */ #define delim(cp) ((cp) == delimiter) /* decode_digit(cp) returns the numeric value of a basic code */ /* point (for use in representing integers) in the range 0 to */ /* base-1, or base if cp does not represent a value. */ static punycode_uint decode_digit (punycode_uint cp) { return cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : cp - 97 < 26 ? cp - 97 : base; } /* encode_digit(d,flag) returns the basic code point whose value */ /* (when used for representing integers) is d, which needs to be in */ /* the range 0 to base-1. The lowercase form is used unless flag is */ /* nonzero, in which case the uppercase form is used. The behavior */ /* is undefined if flag is nonzero and digit d has no uppercase form. */ static char encode_digit (punycode_uint d, int flag) { return (char)(d + 22 + 75 * (d < 26) - ((flag != 0) << 5)); /* 0..25 map to ASCII a..z or A..Z */ /* 26..35 map to ASCII 0..9 */ } /* flagged(bcp) tests whether a basic code point is flagged */ /* (uppercase). The behavior is undefined if bcp is not a */ /* basic code point. */ #define flagged(bcp) (unsigned char)((punycode_uint)(bcp) - 65 < 26) /* encode_basic(bcp,flag) forces a basic code point to lowercase */ /* if flag is zero, uppercase if flag is nonzero, and returns */ /* the resulting code point. The code point is unchanged if it */ /* is caseless. The behavior is undefined if bcp is not a basic */ /* code point. */ static char encode_basic (punycode_uint bcp, int flag) { bcp -= (bcp - 97 < 26) << 5; return (char)(bcp + ((!flag && (bcp - 65 < 26)) << 5)); } /*** Platform-specific constants ***/ /* maxint is the maximum value of a punycode_uint variable: */ static const punycode_uint maxint = 0xFFFFFFFF; /* Because maxint is unsigned, -1 becomes the maximum value. */ /*** Bias adaptation function ***/ static punycode_uint adapt (punycode_uint delta, punycode_uint numpoints, int firsttime) { punycode_uint k; delta = firsttime ? delta / damp : delta >> 1; /* delta >> 1 is a faster way of doing delta / 2 */ delta += delta / numpoints; for (k = 0; delta > ((base - tmin) * tmax) / 2; k += base) { delta /= base - tmin; } return k + (base - tmin + 1) * delta / (delta + skew); } /*** Main encode function ***/ /** * punycode_encode: * @input_length: The number of code points in the @input array and * the number of flags in the @case_flags array. * @input: An array of code points. They are presumed to be Unicode * code points, but that is not strictly REQUIRED. The array * contains code points, not code units. UTF-16 uses code units * D800 through DFFF to refer to code points 10000..10FFFF. The * code points D800..DFFF do not occur in any valid Unicode string. * The code points that can occur in Unicode strings (0..D7FF and * E000..10FFFF) are also called Unicode scalar values. * @case_flags: A %NULL pointer or an array of boolean values parallel * to the @input array. Nonzero (true, flagged) suggests that the * corresponding Unicode character be forced to uppercase after * being decoded (if possible), and zero (false, unflagged) suggests * that it be forced to lowercase (if possible). ASCII code points * (0..7F) are encoded literally, except that ASCII letters are * forced to uppercase or lowercase according to the corresponding * case flags. If @case_flags is a %NULL pointer then ASCII letters * are left as they are, and other code points are treated as * unflagged. * @output_length: The caller passes in the maximum number of ASCII * code points that it can receive. On successful return it will * contain the number of ASCII code points actually output. * @output: An array of ASCII code points. It is *not* * null-terminated; it will contain zeros if and only if the @input * contains zeros. (Of course the caller can leave room for a * terminator and add one if needed.) * * Converts a sequence of code points (presumed to be Unicode code * points) to Punycode. * * Return value: The return value can be any of the #Punycode_status * values defined above except %PUNYCODE_BAD_INPUT. If not * %PUNYCODE_SUCCESS, then @output_size and @output might contain * garbage. **/ int punycode_encode (size_t input_length, const punycode_uint input[], const unsigned char case_flags[], size_t * output_length, char output[]) { punycode_uint input_len, n, delta, h, b, bias, j, m, q, k, t; size_t out, max_out; /* The Punycode spec assumes that the input length is the same type */ /* of integer as a code point, so we need to convert the size_t to */ /* a punycode_uint, which could overflow. */ if (input_length > maxint) return punycode_overflow; input_len = (punycode_uint) input_length; /* Initialize the state: */ n = initial_n; delta = 0; out = 0; max_out = *output_length; bias = initial_bias; /* Handle the basic code points: */ for (j = 0; j < input_len; ++j) { if (basic (input[j])) { if (max_out - out < 2) return punycode_big_output; output[out++] = case_flags ? encode_basic (input[j], case_flags[j]) : (char) input[j]; } /* else if (input[j] < n) return punycode_bad_input; */ /* (not needed for Punycode with unsigned code points) */ } h = b = (punycode_uint) out; /* cannot overflow because out <= input_len <= maxint */ /* h is the number of code points that have been handled, b is the */ /* number of basic code points, and out is the number of ASCII code */ /* points that have been output. */ if (b > 0) output[out++] = delimiter; /* Main encoding loop: */ while (h < input_len) { /* All non-basic code points < n have been */ /* handled already. Find the next larger one: */ for (m = maxint, j = 0; j < input_len; ++j) { /* if (basic(input[j])) continue; */ /* (not needed for Punycode) */ if (input[j] >= n && input[j] < m) m = input[j]; } /* Increase delta enough to advance the decoder's */ /* state to , but guard against overflow: */ if (m - n > (maxint - delta) / (h + 1)) return punycode_overflow; delta += (m - n) * (h + 1); n = m; for (j = 0; j < input_len; ++j) { /* Punycode does not need to check whether input[j] is basic: */ if (input[j] < n /* || basic(input[j]) */ ) { if (++delta == 0) return punycode_overflow; } if (input[j] == n) { /* Represent delta as a generalized variable-length integer: */ for (q = delta, k = base;; k += base) { if (out >= max_out) return punycode_big_output; t = k <= bias /* + tmin */ ? tmin : /* +tmin not needed */ k >= bias + tmax ? tmax : k - bias; if (q < t) break; output[out++] = encode_digit (t + (q - t) % (base - t), 0); q = (q - t) / (base - t); } output[out++] = encode_digit (q, case_flags && case_flags[j]); bias = adapt (delta, h + 1, h == b); delta = 0; ++h; } } ++delta, ++n; } *output_length = out; return punycode_success; } /*** Main decode function ***/ /** * punycode_decode: * @input_length: The number of ASCII code points in the @input array. * @input: An array of ASCII code points (0..7F). * @output_length: The caller passes in the maximum number of code * points that it can receive into the @output array (which is also * the maximum number of flags that it can receive into the * @case_flags array, if @case_flags is not a %NULL pointer). On * successful return it will contain the number of code points * actually output (which is also the number of flags actually * output, if case_flags is not a null pointer). The decoder will * never need to output more code points than the number of ASCII * code points in the input, because of the way the encoding is * defined. The number of code points output cannot exceed the * maximum possible value of a punycode_uint, even if the supplied * @output_length is greater than that. * @output: An array of code points like the input argument of * punycode_encode() (see above). * @case_flags: A %NULL pointer (if the flags are not needed by the * caller) or an array of boolean values parallel to the @output * array. Nonzero (true, flagged) suggests that the corresponding * Unicode character be forced to uppercase by the caller (if * possible), and zero (false, unflagged) suggests that it be forced * to lowercase (if possible). ASCII code points (0..7F) are output * already in the proper case, but their flags will be set * appropriately so that applying the flags would be harmless. * * Converts Punycode to a sequence of code points (presumed to be * Unicode code points). * * Return value: The return value can be any of the #Punycode_status * values defined above. If not %PUNYCODE_SUCCESS, then * @output_length, @output, and @case_flags might contain garbage. * **/ int punycode_decode (size_t input_length, const char input[], size_t * output_length, punycode_uint output[], unsigned char case_flags[]) { punycode_uint n, out, i, max_out, bias, oldi, w, k, digit, t; size_t b, j, in; /* Initialize the state: */ n = initial_n; out = i = 0; max_out = *output_length > maxint ? maxint : (punycode_uint) * output_length; bias = initial_bias; /* Handle the basic code points: Let b be the number of input code */ /* points before the last delimiter, or 0 if there is none, then */ /* copy the first b code points to the output. */ for (b = j = 0; j < input_length; ++j) if (delim (input[j])) b = j; if (b > max_out) return punycode_big_output; for (j = 0; j < b; ++j) { if (case_flags) case_flags[out] = flagged (input[j]); if (!basic (input[j])) return punycode_bad_input; output[out++] = input[j]; } /* Main decoding loop: Start just after the last delimiter if any */ /* basic code points were copied; start at the beginning otherwise. */ for (in = b > 0 ? b + 1 : 0; in < input_length; ++out) { /* in is the index of the next ASCII code point to be consumed, */ /* and out is the number of code points in the output array. */ /* Decode a generalized variable-length integer into delta, */ /* which gets added to i. The overflow checking is easier */ /* if we increase i as we go, then subtract off its starting */ /* value at the end to obtain delta. */ for (oldi = i, w = 1, k = base;; k += base) { if (in >= input_length) return punycode_bad_input; digit = decode_digit (input[in++]); if (digit >= base) return punycode_bad_input; if (digit > (maxint - i) / w) return punycode_overflow; i += digit * w; t = k <= bias /* + tmin */ ? tmin : /* +tmin not needed */ k >= bias + tmax ? tmax : k - bias; if (digit < t) break; if (w > maxint / (base - t)) return punycode_overflow; w *= (base - t); } bias = adapt (i - oldi, out + 1, oldi == 0); /* i was supposed to wrap around from out+1 to 0, */ /* incrementing n each time, so we'll fix that now: */ if (i / (out + 1) > maxint - n) return punycode_overflow; n += i / (out + 1); i %= (out + 1); /* Insert n at position i of the output: */ /* not needed for Punycode: */ /* if (basic(n)) return punycode_invalid_input; */ if (out >= max_out) return punycode_big_output; if (case_flags) { memmove (case_flags + i + 1, case_flags + i, out - i); /* Case of last ASCII code point determines case flag: */ case_flags[i] = flagged (input[in - 1]); } memmove (output + i + 1, output + i, (out - i) * sizeof *output); output[i++] = n; } *output_length = (size_t) out; /* cannot overflow because out <= old value of *output_length */ return punycode_success; } /** * punycode_uint * * Unicode code point data type, this is always a 32 bit unsigned * integer. */ /** * Punycode_status * @PUNYCODE_SUCCESS: Successful operation. This value is guaranteed * to always be zero, the remaining ones are only guaranteed to hold * non-zero values, for logical comparison purposes. * @PUNYCODE_BAD_INPUT: Input is invalid. * @PUNYCODE_BIG_OUTPUT: Output would exceed the space provided. * @PUNYCODE_OVERFLOW: Input needs wider integers to process. * * Enumerated return codes of punycode_encode() and punycode_decode(). * The value 0 is guaranteed to always correspond to success. */ parser-3.5.1/src/lib/md5/0000755000076400007640000000000014740300546012052 500000000000000parser-3.5.1/src/lib/md5/Makefile.in0000644000076400007640000004521514740273415014052 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/md5 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmd5_la_LIBADD = am_libmd5_la_OBJECTS = pa_md5c.lo pa_sha2.lo libmd5_la_OBJECTS = $(am_libmd5_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/pa_md5c.Plo ./$(DEPDIR)/pa_sha2.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libmd5_la_SOURCES) DIST_SOURCES = $(libmd5_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = pa_md5.h pa_sha2.h noinst_LTLIBRARIES = libmd5.la libmd5_la_SOURCES = pa_md5c.c pa_sha2.c EXTRA_DIST = md5.vcproj all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/md5/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/md5/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libmd5.la: $(libmd5_la_OBJECTS) $(libmd5_la_DEPENDENCIES) $(EXTRA_libmd5_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libmd5_la_OBJECTS) $(libmd5_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_md5c.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_sha2.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/pa_md5c.Plo -rm -f ./$(DEPDIR)/pa_sha2.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/pa_md5c.Plo -rm -f ./$(DEPDIR)/pa_sha2.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/md5/md5.vcproj0000644000076400007640000001046013622760246013712 00000000000000 parser-3.5.1/src/lib/md5/Makefile.am0000644000076400007640000000020412170071637014023 00000000000000noinst_HEADERS = pa_md5.h pa_sha2.h noinst_LTLIBRARIES = libmd5.la libmd5_la_SOURCES = pa_md5c.c pa_sha2.c EXTRA_DIST = md5.vcproj parser-3.5.1/src/lib/md5/pa_sha2.h0000644000076400007640000000747212171337664013501 00000000000000/* * FILE: sha2.h * AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/ * * Copyright (c) 2000-2001, Aaron D. Gifford * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the names of contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``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 OR CONTRIBUTOR(S) 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. * * $Id: pa_sha2.h,v 1.2 2013/07/16 21:48:36 moko Exp $ */ #ifndef __PA_SHA2_H__ #define __PA_SHA2_H__ #ifdef __cplusplus extern "C" { #endif #include "pa_config_includes.h" /*** SHA-256/384/512 Various Length Definitions ***********************/ #define SHA256_BLOCK_LENGTH 64 #define SHA256_DIGEST_LENGTH 32 #define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) #define SHA384_BLOCK_LENGTH 128 #define SHA384_DIGEST_LENGTH 48 #define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) #define SHA512_BLOCK_LENGTH 128 #define SHA512_DIGEST_LENGTH 64 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) /*** SHA-256/384/512 Context Structures *******************************/ /* NOTE: If your architecture does not define either u_intXX_t types or * uintXX_t (from inttypes.h), you may need to define things by hand * for your system: */ typedef struct _SHA256_CTX { uint32_t state[8]; uint64_t bitcount; uint8_t buffer[SHA256_BLOCK_LENGTH]; } SHA256_CTX; typedef struct _SHA512_CTX { uint64_t state[8]; uint64_t bitcount[2]; uint8_t buffer[SHA512_BLOCK_LENGTH]; } SHA512_CTX; typedef SHA512_CTX SHA384_CTX; /*** SHA-256/384/512 Function Prototypes ******************************/ void pa_SHA256_Init(SHA256_CTX *); void pa_SHA256_Update(SHA256_CTX*, const uint8_t*, size_t); void pa_SHA256_Final(uint8_t[SHA256_DIGEST_LENGTH], SHA256_CTX*); char* pa_SHA256_End(SHA256_CTX*, char[SHA256_DIGEST_STRING_LENGTH]); char* pa_SHA256_Data(const uint8_t*, size_t, char[SHA256_DIGEST_STRING_LENGTH]); void pa_SHA384_Init(SHA384_CTX*); void pa_SHA384_Update(SHA384_CTX*, const uint8_t*, size_t); void pa_SHA384_Final(uint8_t[SHA384_DIGEST_LENGTH], SHA384_CTX*); char* pa_SHA384_End(SHA384_CTX*, char[SHA384_DIGEST_STRING_LENGTH]); char* pa_SHA384_Data(const uint8_t*, size_t, char[SHA384_DIGEST_STRING_LENGTH]); void pa_SHA512_Init(SHA512_CTX*); void pa_SHA512_Update(SHA512_CTX*, const uint8_t*, size_t); void pa_SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*); char* pa_SHA512_End(SHA512_CTX*, char[SHA512_DIGEST_STRING_LENGTH]); char* pa_SHA512_Data(const uint8_t*, size_t, char[SHA512_DIGEST_STRING_LENGTH]); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __SHA2_H__ */ parser-3.5.1/src/lib/md5/pa_md5c.c0000644000076400007640000003174214740300505013450 00000000000000/** @file taken from libmd, added pa_ prefixes, Parser 3 includes, Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) */ /* $OpenBSD: md5.c,v 1.7 2004/05/28 15:10:27 millert Exp $ */ /* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to MD5Init, call MD5Update as * needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. */ /* * The pa_MD5Encode() routine uses much code obtained from the FreeBSD 3.0 * MD5 crypt() function, which is licenced as follows: * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- */ #include "pa_md5.h" volatile const char * IDENT_PA_MD5_C="$Id: pa_md5c.c,v 1.24 2025/01/10 20:12:17 moko Exp $" IDENT_PA_MD5_H; #define PUT_64BIT_LE(cp, value) do { \ (cp)[7] = (uint8_t)((value) >> 56); \ (cp)[6] = (uint8_t)((value) >> 48); \ (cp)[5] = (uint8_t)((value) >> 40); \ (cp)[4] = (uint8_t)((value) >> 32); \ (cp)[3] = (uint8_t)((value) >> 24); \ (cp)[2] = (uint8_t)((value) >> 16); \ (cp)[1] = (uint8_t)((value) >> 8); \ (cp)[0] = (uint8_t)(value); } while (0) #define PUT_32BIT_LE(cp, value) do { \ (cp)[3] = (unsigned char)((value) >> 24); \ (cp)[2] = (unsigned char)((value) >> 16); \ (cp)[1] = (unsigned char)((value) >> 8); \ (cp)[0] = (unsigned char)(value); } while (0) static uint8_t PADDING[MD5_BLOCK_LENGTH] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants. */ void pa_MD5Init(PA_MD5_CTX *ctx) { ctx->count = 0; ctx->state[0] = 0x67452301; ctx->state[1] = 0xefcdab89; ctx->state[2] = 0x98badcfe; ctx->state[3] = 0x10325476; } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void pa_MD5Update(PA_MD5_CTX *ctx, const unsigned char *input, size_t len) { size_t have, need; /* Check how many bytes we already have and how many more we need. */ have = (size_t)((ctx->count >> 3) & (MD5_BLOCK_LENGTH - 1)); need = MD5_BLOCK_LENGTH - have; /* Update bitcount */ ctx->count += (uint64_t)len << 3; if (len >= need) { if (have != 0) { memcpy(ctx->buffer + have, input, need); pa_MD5Transform(ctx->state, ctx->buffer); input += need; len -= need; have = 0; } /* Process data in MD5_BLOCK_LENGTH-byte chunks. */ while (len >= MD5_BLOCK_LENGTH) { pa_MD5Transform(ctx->state, input); input += MD5_BLOCK_LENGTH; len -= MD5_BLOCK_LENGTH; } } /* Handle any remaining bytes of data. */ if (len != 0) memcpy(ctx->buffer + have, input, len); } /* * Pad pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ void pa_MD5Pad(PA_MD5_CTX *ctx) { uint8_t count[8]; size_t padlen; /* Convert count to 8 bytes in little endian order. */ PUT_64BIT_LE(count, ctx->count); /* Pad out to 56 mod 64. */ padlen = MD5_BLOCK_LENGTH - ((ctx->count >> 3) & (MD5_BLOCK_LENGTH - 1)); if (padlen < 1 + 8) padlen += MD5_BLOCK_LENGTH; pa_MD5Update(ctx, PADDING, padlen - 8); /* padlen - 8 <= 64 */ pa_MD5Update(ctx, count, 8); } /* * Final wrapup--call MD5Pad, fill in digest and zero out ctx. */ void pa_MD5Final(unsigned char digest[MD5_DIGEST_LENGTH], PA_MD5_CTX *ctx) { int i; pa_MD5Pad(ctx); if (digest != NULL) { for (i = 0; i < 4; i++) PUT_32BIT_LE(digest + i * 4, ctx->state[i]); memset(ctx, 0, sizeof(*ctx)); } } /* The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ #define MD5STEP(f, w, x, y, z, data, s) \ ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) /* * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ void pa_MD5Transform(uint32_t state[4], const uint8_t block[MD5_BLOCK_LENGTH]) { uint32_t a, b, c, d, in[MD5_BLOCK_LENGTH / 4]; #ifndef WORDS_BIGENDIAN memcpy(in, block, sizeof(in)); #else for (a = 0; a < MD5_BLOCK_LENGTH / 4; a++) { in[a] = (uint32_t)( (uint32_t)(block[a * 4 + 0]) | (uint32_t)(block[a * 4 + 1]) << 8 | (uint32_t)(block[a * 4 + 2]) << 16 | (uint32_t)(block[a * 4 + 3]) << 24); } #endif a = state[0]; b = state[1]; c = state[2]; d = state[3]; MD5STEP(F1, a, b, c, d, in[ 0] + 0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[ 1] + 0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[ 2] + 0x242070db, 17); MD5STEP(F1, b, c, d, a, in[ 3] + 0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[ 4] + 0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[ 5] + 0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[ 6] + 0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[ 7] + 0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[ 8] + 0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[ 9] + 0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[ 1] + 0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[ 6] + 0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[ 0] + 0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[ 5] + 0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[ 4] + 0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d, in[ 9] + 0x21e1cde6, 5); MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); MD5STEP(F2, c, d, a, b, in[ 3] + 0xf4d50d87, 14); MD5STEP(F2, b, c, d, a, in[ 8] + 0x455a14ed, 20); MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); MD5STEP(F2, d, a, b, c, in[ 2] + 0xfcefa3f8, 9); MD5STEP(F2, c, d, a, b, in[ 7] + 0x676f02d9, 14); MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); MD5STEP(F3, a, b, c, d, in[ 5] + 0xfffa3942, 4); MD5STEP(F3, d, a, b, c, in[ 8] + 0x8771f681, 11); MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); MD5STEP(F3, a, b, c, d, in[ 1] + 0xa4beea44, 4); MD5STEP(F3, d, a, b, c, in[ 4] + 0x4bdecfa9, 11); MD5STEP(F3, c, d, a, b, in[ 7] + 0xf6bb4b60, 16); MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); MD5STEP(F3, d, a, b, c, in[ 0] + 0xeaa127fa, 11); MD5STEP(F3, c, d, a, b, in[ 3] + 0xd4ef3085, 16); MD5STEP(F3, b, c, d, a, in[ 6] + 0x04881d05, 23); MD5STEP(F3, a, b, c, d, in[ 9] + 0xd9d4d039, 4); MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP(F3, b, c, d, a, in[2 ] + 0xc4ac5665, 23); MD5STEP(F4, a, b, c, d, in[ 0] + 0xf4292244, 6); MD5STEP(F4, d, a, b, c, in[7 ] + 0x432aff97, 10); MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); MD5STEP(F4, b, c, d, a, in[5 ] + 0xfc93a039, 21); MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); MD5STEP(F4, d, a, b, c, in[3 ] + 0x8f0ccc92, 10); MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); MD5STEP(F4, b, c, d, a, in[1 ] + 0x85845dd1, 21); MD5STEP(F4, a, b, c, d, in[8 ] + 0x6fa87e4f, 6); MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); MD5STEP(F4, c, d, a, b, in[6 ] + 0xa3014314, 15); MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); MD5STEP(F4, a, b, c, d, in[4 ] + 0xf7537e82, 6); MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP(F4, c, d, a, b, in[2 ] + 0x2ad7d2bb, 15); MD5STEP(F4, b, c, d, a, in[9 ] + 0xeb86d391, 21); state[0] += a; state[1] += b; state[2] += c; state[3] += d; } /* * The following MD5 password encryption code was largely borrowed from * the FreeBSD 3.0 /usr/src/lib/libcrypt/crypt.c file, which is * licenced as stated at the top of this file. */ void pa_to64(char *s, unsigned long v, int n) { static unsigned char itoa64[] = /* 0 ... 63 => ASCII - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; while (--n >= 0) { *s++ = itoa64[v&0x3f]; v >>= 6; } } void pa_MD5Encode(const unsigned char *pw, const unsigned char *salt, char *result, size_t nbytes) { /* * Minimum size is 8 bytes for salt, plus 1 for the trailing NUL, * plus 4 for the '$' separators, plus the password hash itself. * Let's leave a goodly amount of leeway. */ char passwd[120], *p; const unsigned char *sp, *ep; unsigned char final[16]; int i; unsigned int sl; int pl; unsigned int pwlen; PA_MD5_CTX ctx, ctx1; unsigned long l; /* * Refine the salt first. It's possible we were given an already-hashed * string as the salt argument, so extract the actual salt value from it * if so. Otherwise just use the string up to the first '$' as the salt. */ sp = salt; /* * If it starts with the magic string, then skip that. */ if (strncmp((char *)sp, PA_MD5PW_ID, PA_MD5PW_IDLEN) == 0) { sp += PA_MD5PW_IDLEN; } /* * It stops at the first '$' or 8 chars, whichever comes first */ for (ep = sp; (*ep != '\0') && (*ep != '$') && (ep < (sp + 8)); ep++) { continue; } /* * Get the length of the true salt */ sl = ep - sp; /* * 'Time to make the doughnuts..' */ pa_MD5Init(&ctx); pwlen = strlen((char *)pw); /* * The password first, since that is what is most unknown */ pa_MD5Update(&ctx, pw, pwlen); /* * Then our magic string */ pa_MD5Update(&ctx, (const unsigned char *) PA_MD5PW_ID, PA_MD5PW_IDLEN); /* * Then the raw salt */ pa_MD5Update(&ctx, sp, sl); /* * Then just as many characters of the MD5(pw, salt, pw) */ pa_MD5Init(&ctx1); pa_MD5Update(&ctx1, pw, pwlen); pa_MD5Update(&ctx1, sp, sl); pa_MD5Update(&ctx1, pw, pwlen); pa_MD5Final(final, &ctx1); for(pl = pwlen; pl > 0; pl -= 16) { pa_MD5Update(&ctx, final, (pl > 16) ? 16 : (unsigned int) pl); } /* * Don't leave anything around in vm they could use. */ memset(final, 0, sizeof(final)); /* * Then something really weird... */ for (i = pwlen; i != 0; i >>= 1) { if (i & 1) { pa_MD5Update(&ctx, final, 1); } else { pa_MD5Update(&ctx, pw, 1); } } /* * Now make the output string. We know our limitations, so we * can use the string routines without bounds checking. */ strncpy(passwd, PA_MD5PW_ID, PA_MD5PW_IDLEN + 1); strncpy(passwd + PA_MD5PW_IDLEN, (char *)sp, sl + 1); passwd[PA_MD5PW_IDLEN + sl] = '$'; passwd[PA_MD5PW_IDLEN + sl + 1] = '\0'; pa_MD5Final(final, &ctx); /* * And now, just to make sure things don't run too fast.. * On a 60 Mhz Pentium this takes 34 msec, so you would * need 30 seconds to build a 1000 entry dictionary... */ for (i = 0; i < 1000; i++) { pa_MD5Init(&ctx1); if (i & 1) { pa_MD5Update(&ctx1, pw, pwlen); } else { pa_MD5Update(&ctx1, final, 16); } if (i % 3) { pa_MD5Update(&ctx1, sp, sl); } if (i % 7) { pa_MD5Update(&ctx1, pw, pwlen); } if (i & 1) { pa_MD5Update(&ctx1, final, 16); } else { pa_MD5Update(&ctx1, pw, pwlen); } pa_MD5Final(final,&ctx1); } p = passwd + strlen(passwd); l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; pa_to64(p, l, 4); p += 4; l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; pa_to64(p, l, 4); p += 4; l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; pa_to64(p, l, 4); p += 4; l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; pa_to64(p, l, 4); p += 4; l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; pa_to64(p, l, 4); p += 4; l = final[11] ; pa_to64(p, l, 2); p += 2; *p = '\0'; /* * Don't leave anything around in vm they could use. */ memset(final, 0, sizeof(final)); strncpy(result, passwd, nbytes - 1); } parser-3.5.1/src/lib/md5/pa_sha2.c0000644000076400007640000007404512175721563013473 00000000000000/* * FILE: sha2.c * AUTHOR: Aaron D. Gifford - http://www.aarongifford.com/ * * Copyright (c) 2000-2001, Aaron D. Gifford * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holder nor the names of contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``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 OR CONTRIBUTOR(S) 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 "pa_sha2.h" /* * ASSERT NOTE: * Some sanity checking code is included using assert(). On my FreeBSD * system, this additional code can be removed by compiling with NDEBUG * defined. Check your own systems manpage on assert() to see how to * compile WITHOUT the sanity checking code on your system. * * UNROLLED TRANSFORM LOOP NOTE: * You can define SHA2_UNROLL_TRANSFORM to use the unrolled transform * loop version for the hash transform rounds (defined using macros * later in this file). Either define on the command line, for example: * * cc -DSHA2_UNROLL_TRANSFORM -o sha2 sha2.c sha2prog.c * * or define below: * * #define SHA2_UNROLL_TRANSFORM * */ /*** SHA-256/384/512 Machine Architecture Definitions *****************/ /* * Define the followingsha2_* types to types of the correct length on * the native archtecture. Most BSD systems and Linux define u_intXX_t * types. Machines with very recent ANSI C headers, can use the * uintXX_t definintions from inttypes.h by defining SHA2_USE_INTTYPES_H * during compile or in the sha.h header file. * * Machines that support neither u_intXX_t nor inttypes.h's uintXX_t * will need to define these three typedefs below (and the appropriate * ones in sha.h too) by hand according to their system architecture. * * Thank you, Jun-ichiro itojun Hagino, for suggesting using u_intXX_t * types and pointing out recent ANSI C support for uintXX_t in inttypes.h. */ typedef uint8_t sha2_byte; /* Exactly 1 byte */ typedef uint32_t sha2_word32; /* Exactly 4 bytes */ typedef uint64_t sha2_word64; /* Exactly 8 bytes */ /*** SHA-256/384/512 Various Length Definitions ***********************/ /* NOTE: Most of these are in sha2.h */ #define SHA256_SHORT_BLOCK_LENGTH (SHA256_BLOCK_LENGTH - 8) #define SHA384_SHORT_BLOCK_LENGTH (SHA384_BLOCK_LENGTH - 16) #define SHA512_SHORT_BLOCK_LENGTH (SHA512_BLOCK_LENGTH - 16) /*** ENDIAN REVERSAL MACROS *******************************************/ #ifdef PA_LITTLE_ENDIAN #define REVERSE32(w,x) { \ sha2_word32 tmp = (w); \ tmp = (tmp >> 16) | (tmp << 16); \ (x) = ((tmp & 0xff00ff00UL) >> 8) | ((tmp & 0x00ff00ffUL) << 8); \ } #define REVERSE64(w,x) { \ sha2_word64 tmp = (w); \ tmp = (tmp >> 32) | (tmp << 32); \ tmp = ((tmp & 0xff00ff00ff00ff00ULL) >> 8) | \ ((tmp & 0x00ff00ff00ff00ffULL) << 8); \ (x) = ((tmp & 0xffff0000ffff0000ULL) >> 16) | \ ((tmp & 0x0000ffff0000ffffULL) << 16); \ } #endif /* PA_LITTLE_ENDIAN */ /* * Macro for incrementally adding the unsigned 64-bit integer n to the * unsigned 128-bit integer (represented using a two-element array of * 64-bit words): */ #define ADDINC128(w,n) { \ (w)[0] += (sha2_word64)(n); \ if ((w)[0] < (n)) { \ (w)[1]++; \ } \ } /* * Macros for copying blocks of memory and for zeroing out ranges * of memory. Using these macros makes it easy to switch from * using memset()/memcpy() and using bzero()/bcopy(). * * Please define either SHA2_USE_MEMSET_MEMCPY or define * SHA2_USE_BZERO_BCOPY depending on which function set you * choose to use: */ #if !defined(SHA2_USE_MEMSET_MEMCPY) && !defined(SHA2_USE_BZERO_BCOPY) /* Default to memset()/memcpy() if no option is specified */ #define SHA2_USE_MEMSET_MEMCPY 1 #endif #if defined(SHA2_USE_MEMSET_MEMCPY) && defined(SHA2_USE_BZERO_BCOPY) /* Abort with an error if BOTH options are defined */ #error Define either SHA2_USE_MEMSET_MEMCPY or SHA2_USE_BZERO_BCOPY, not both! #endif #ifdef SHA2_USE_MEMSET_MEMCPY #define MEMSET_BZERO(p,l) memset((p), 0, (l)) #define MEMCPY_BCOPY(d,s,l) memcpy((d), (s), (l)) #endif #ifdef SHA2_USE_BZERO_BCOPY #define MEMSET_BZERO(p,l) bzero((p), (l)) #define MEMCPY_BCOPY(d,s,l) bcopy((s), (d), (l)) #endif /*** THE SIX LOGICAL FUNCTIONS ****************************************/ /* * Bit shifting and rotation (used by the six SHA-XYZ logical functions: * * NOTE: The naming of R and S appears backwards here (R is a SHIFT and * S is a ROTATION) because the SHA-256/384/512 description document * (see http://csrc.nist.gov/cryptval/shs/sha256-384-512.pdf) uses this * same "backwards" definition. */ /* Shift-right (used in SHA-256, SHA-384, and SHA-512): */ #define R(b,x) ((x) >> (b)) /* 32-bit Rotate-right (used in SHA-256): */ #define S32(b,x) (((x) >> (b)) | ((x) << (32 - (b)))) /* 64-bit Rotate-right (used in SHA-384 and SHA-512): */ #define S64(b,x) (((x) >> (b)) | ((x) << (64 - (b)))) /* Two of six logical functions used in SHA-256, SHA-384, and SHA-512: */ #define Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z))) #define Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) /* Four of six logical functions used in SHA-256: */ #define Sigma0_256(x) (S32(2, (x)) ^ S32(13, (x)) ^ S32(22, (x))) #define Sigma1_256(x) (S32(6, (x)) ^ S32(11, (x)) ^ S32(25, (x))) #define sigma0_256(x) (S32(7, (x)) ^ S32(18, (x)) ^ R(3 , (x))) #define sigma1_256(x) (S32(17, (x)) ^ S32(19, (x)) ^ R(10, (x))) /* Four of six logical functions used in SHA-384 and SHA-512: */ #define Sigma0_512(x) (S64(28, (x)) ^ S64(34, (x)) ^ S64(39, (x))) #define Sigma1_512(x) (S64(14, (x)) ^ S64(18, (x)) ^ S64(41, (x))) #define sigma0_512(x) (S64( 1, (x)) ^ S64( 8, (x)) ^ R( 7, (x))) #define sigma1_512(x) (S64(19, (x)) ^ S64(61, (x)) ^ R( 6, (x))) /*** INTERNAL FUNCTION PROTOTYPES *************************************/ /* NOTE: These should not be accessed directly from outside this * library -- they are intended for private internal visibility/use * only. */ void pa_SHA512_Last(SHA512_CTX*); void pa_SHA256_Transform(SHA256_CTX*, const sha2_word32*); void pa_SHA512_Transform(SHA512_CTX*, const sha2_word64*); /*** SHA-XYZ INITIAL HASH VALUES AND CONSTANTS ************************/ /* Hash constant words K for SHA-256: */ const static sha2_word32 K256[64] = { 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL }; /* Initial hash value H for SHA-256: */ const static sha2_word32 sha256_initial_hash_value[8] = { 0x6a09e667UL, 0xbb67ae85UL, 0x3c6ef372UL, 0xa54ff53aUL, 0x510e527fUL, 0x9b05688cUL, 0x1f83d9abUL, 0x5be0cd19UL }; /* Hash constant words K for SHA-384 and SHA-512: */ const static sha2_word64 K512[80] = { 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, 0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL, 0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL, 0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL, 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL, 0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL, 0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL, 0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL, 0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL, 0x92722c851482353bULL, 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL, 0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL, 0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL, 0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL, 0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL, 0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL, 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL, 0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL, 0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL, 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL }; /* Initial hash value H for SHA-384 */ const static sha2_word64 sha384_initial_hash_value[8] = { 0xcbbb9d5dc1059ed8ULL, 0x629a292a367cd507ULL, 0x9159015a3070dd17ULL, 0x152fecd8f70e5939ULL, 0x67332667ffc00b31ULL, 0x8eb44a8768581511ULL, 0xdb0c2e0d64f98fa7ULL, 0x47b5481dbefa4fa4ULL }; /* Initial hash value H for SHA-512 */ const static sha2_word64 sha512_initial_hash_value[8] = { 0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL }; /* * Constant used by SHA256/384/512_End() functions for converting the * digest to a readable hexadecimal character string: */ static const char *sha2_hex_digits = "0123456789abcdef"; /*** SHA-256: *********************************************************/ void pa_SHA256_Init(SHA256_CTX* context) { if (context == (SHA256_CTX*)0) { return; } MEMCPY_BCOPY(context->state, sha256_initial_hash_value, SHA256_DIGEST_LENGTH); MEMSET_BZERO(context->buffer, SHA256_BLOCK_LENGTH); context->bitcount = 0; } #ifdef SHA2_UNROLL_TRANSFORM /* Unrolled SHA-256 round macros: */ #ifdef PA_LITTLE_ENDIAN #define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ REVERSE32(*data++, W256[j]); \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ K256[j] + W256[j]; \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ #else /* PA_LITTLE_ENDIAN */ #define ROUND256_0_TO_15(a,b,c,d,e,f,g,h) \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + \ K256[j] + (W256[j] = *data++); \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ #endif /* PA_LITTLE_ENDIAN */ #define ROUND256(a,b,c,d,e,f,g,h) \ s0 = W256[(j+1)&0x0f]; \ s0 = sigma0_256(s0); \ s1 = W256[(j+14)&0x0f]; \ s1 = sigma1_256(s1); \ T1 = (h) + Sigma1_256(e) + Ch((e), (f), (g)) + K256[j] + \ (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); \ (d) += T1; \ (h) = T1 + Sigma0_256(a) + Maj((a), (b), (c)); \ j++ void pa_SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, *W256; int j; W256 = (sha2_word32*)context->buffer; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { /* Rounds 0 to 15 (unrolled): */ ROUND256_0_TO_15(a,b,c,d,e,f,g,h); ROUND256_0_TO_15(h,a,b,c,d,e,f,g); ROUND256_0_TO_15(g,h,a,b,c,d,e,f); ROUND256_0_TO_15(f,g,h,a,b,c,d,e); ROUND256_0_TO_15(e,f,g,h,a,b,c,d); ROUND256_0_TO_15(d,e,f,g,h,a,b,c); ROUND256_0_TO_15(c,d,e,f,g,h,a,b); ROUND256_0_TO_15(b,c,d,e,f,g,h,a); } while (j < 16); /* Now for the remaining rounds to 64: */ do { ROUND256(a,b,c,d,e,f,g,h); ROUND256(h,a,b,c,d,e,f,g); ROUND256(g,h,a,b,c,d,e,f); ROUND256(f,g,h,a,b,c,d,e); ROUND256(e,f,g,h,a,b,c,d); ROUND256(d,e,f,g,h,a,b,c); ROUND256(c,d,e,f,g,h,a,b); ROUND256(b,c,d,e,f,g,h,a); } while (j < 64); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ void pa_SHA256_Transform(SHA256_CTX* context, const sha2_word32* data) { sha2_word32 a, b, c, d, e, f, g, h, s0, s1; sha2_word32 T1, T2, *W256; int j; W256 = (sha2_word32*)context->buffer; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { #ifdef PA_LITTLE_ENDIAN /* Copy data while converting to host byte order */ REVERSE32(*data++,W256[j]); /* Apply the SHA-256 compression function to update a..h */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + W256[j]; #else /* PA_LITTLE_ENDIAN */ /* Apply the SHA-256 compression function to update a..h with copy */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j] = *data++); #endif /* PA_LITTLE_ENDIAN */ T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 16); do { /* Part of the message block expansion: */ s0 = W256[(j+1)&0x0f]; s0 = sigma0_256(s0); s1 = W256[(j+14)&0x0f]; s1 = sigma1_256(s1); /* Apply the SHA-256 compression function to update a..h */ T1 = h + Sigma1_256(e) + Ch(e, f, g) + K256[j] + (W256[j&0x0f] += s1 + W256[(j+9)&0x0f] + s0); T2 = Sigma0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 64); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */ void pa_SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) { unsigned int freespace, usedspace; if (len == 0) { /* Calling with no data is valid - we do nothing */ return; } /* Sanity check: */ assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0); usedspace = (unsigned int)((context->bitcount >> 3) % SHA256_BLOCK_LENGTH); if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = SHA256_BLOCK_LENGTH - usedspace; if (len >= freespace) { /* Fill the buffer completely and process it */ MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); context->bitcount += freespace << 3; len -= freespace; data += freespace; pa_SHA256_Transform(context, (sha2_word32*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); context->bitcount += len << 3; /* Clean up: */ usedspace = freespace = 0; return; } } while (len >= SHA256_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ pa_SHA256_Transform(context, (sha2_word32*)data); context->bitcount += SHA256_BLOCK_LENGTH << 3; len -= SHA256_BLOCK_LENGTH; data += SHA256_BLOCK_LENGTH; } if (len > 0) { /* There's left-overs, so save 'em */ MEMCPY_BCOPY(context->buffer, data, len); context->bitcount += len << 3; } /* Clean up: */ usedspace = freespace = 0; } void pa_SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { sha2_word32 *d = (sha2_word32*)digest; unsigned int usedspace; /* Sanity check: */ assert(context != (SHA256_CTX*)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { usedspace = (unsigned int)((context->bitcount >> 3) % SHA256_BLOCK_LENGTH); #ifdef PA_LITTLE_ENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount,context->bitcount); #endif if (usedspace > 0) { /* Begin padding with a 1 bit: */ context->buffer[usedspace++] = 0x80; if (usedspace <= SHA256_SHORT_BLOCK_LENGTH) { /* Set-up for the last transform: */ MEMSET_BZERO(&context->buffer[usedspace], SHA256_SHORT_BLOCK_LENGTH - usedspace); } else { if (usedspace < SHA256_BLOCK_LENGTH) { MEMSET_BZERO(&context->buffer[usedspace], SHA256_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ pa_SHA256_Transform(context, (sha2_word32*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); } } else { /* Set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA256_SHORT_BLOCK_LENGTH); /* Begin padding with a 1 bit: */ *context->buffer = 0x80; } /* Set the bit count: */ *(sha2_word64*)&context->buffer[SHA256_SHORT_BLOCK_LENGTH] = context->bitcount; /* Final transform: */ pa_SHA256_Transform(context, (sha2_word32*)context->buffer); #ifdef PA_LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 8; j++) { REVERSE32(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else MEMCPY_BCOPY(d, context->state, SHA256_DIGEST_LENGTH); #endif } /* Clean up state data: */ MEMSET_BZERO(context, sizeof(SHA256_CTX)); usedspace = 0; } char *pa_SHA256_End(SHA256_CTX* context, char buffer[]) { sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; int i; /* Sanity check: */ assert(context != (SHA256_CTX*)0); if (buffer != (char*)0) { pa_SHA256_Final(digest, context); for (i = 0; i < SHA256_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } *buffer = (char)0; } else { MEMSET_BZERO(context, sizeof(SHA256_CTX)); } MEMSET_BZERO(digest, SHA256_DIGEST_LENGTH); return buffer; } char* pa_SHA256_Data(const sha2_byte* data, size_t len, char digest[SHA256_DIGEST_STRING_LENGTH]) { SHA256_CTX context; pa_SHA256_Init(&context); pa_SHA256_Update(&context, data, len); return pa_SHA256_End(&context, digest); } /*** SHA-512: *********************************************************/ void pa_SHA512_Init(SHA512_CTX* context) { if (context == (SHA512_CTX*)0) { return; } MEMCPY_BCOPY(context->state, sha512_initial_hash_value, SHA512_DIGEST_LENGTH); MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH); context->bitcount[0] = context->bitcount[1] = 0; } #ifdef SHA2_UNROLL_TRANSFORM /* Unrolled SHA-512 round macros: */ #ifdef PA_LITTLE_ENDIAN #define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ REVERSE64(*data++, W512[j]); \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ K512[j] + W512[j]; \ (d) += T1, \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)), \ j++ #else /* PA_LITTLE_ENDIAN */ #define ROUND512_0_TO_15(a,b,c,d,e,f,g,h) \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + \ K512[j] + (W512[j] = *data++); \ (d) += T1; \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ #endif /* PA_LITTLE_ENDIAN */ #define ROUND512(a,b,c,d,e,f,g,h) \ s0 = W512[(j+1)&0x0f]; \ s0 = sigma0_512(s0); \ s1 = W512[(j+14)&0x0f]; \ s1 = sigma1_512(s1); \ T1 = (h) + Sigma1_512(e) + Ch((e), (f), (g)) + K512[j] + \ (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); \ (d) += T1; \ (h) = T1 + Sigma0_512(a) + Maj((a), (b), (c)); \ j++ void pa_SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, *W512 = (sha2_word64*)context->buffer; int j; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { ROUND512_0_TO_15(a,b,c,d,e,f,g,h); ROUND512_0_TO_15(h,a,b,c,d,e,f,g); ROUND512_0_TO_15(g,h,a,b,c,d,e,f); ROUND512_0_TO_15(f,g,h,a,b,c,d,e); ROUND512_0_TO_15(e,f,g,h,a,b,c,d); ROUND512_0_TO_15(d,e,f,g,h,a,b,c); ROUND512_0_TO_15(c,d,e,f,g,h,a,b); ROUND512_0_TO_15(b,c,d,e,f,g,h,a); } while (j < 16); /* Now for the remaining rounds up to 79: */ do { ROUND512(a,b,c,d,e,f,g,h); ROUND512(h,a,b,c,d,e,f,g); ROUND512(g,h,a,b,c,d,e,f); ROUND512(f,g,h,a,b,c,d,e); ROUND512(e,f,g,h,a,b,c,d); ROUND512(d,e,f,g,h,a,b,c); ROUND512(c,d,e,f,g,h,a,b); ROUND512(b,c,d,e,f,g,h,a); } while (j < 80); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = 0; } #else /* SHA2_UNROLL_TRANSFORM */ void pa_SHA512_Transform(SHA512_CTX* context, const sha2_word64* data) { sha2_word64 a, b, c, d, e, f, g, h, s0, s1; sha2_word64 T1, T2, *W512 = (sha2_word64*)context->buffer; int j; /* Initialize registers with the prev. intermediate value */ a = context->state[0]; b = context->state[1]; c = context->state[2]; d = context->state[3]; e = context->state[4]; f = context->state[5]; g = context->state[6]; h = context->state[7]; j = 0; do { #ifdef PA_LITTLE_ENDIAN /* Convert TO host byte order */ REVERSE64(*data++, W512[j]); /* Apply the SHA-512 compression function to update a..h */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + W512[j]; #else /* PA_LITTLE_ENDIAN */ /* Apply the SHA-512 compression function to update a..h with copy */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j] = *data++); #endif /* PA_LITTLE_ENDIAN */ T2 = Sigma0_512(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 16); do { /* Part of the message block expansion: */ s0 = W512[(j+1)&0x0f]; s0 = sigma0_512(s0); s1 = W512[(j+14)&0x0f]; s1 = sigma1_512(s1); /* Apply the SHA-512 compression function to update a..h */ T1 = h + Sigma1_512(e) + Ch(e, f, g) + K512[j] + (W512[j&0x0f] += s1 + W512[(j+9)&0x0f] + s0); T2 = Sigma0_512(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; j++; } while (j < 80); /* Compute the current intermediate hash value */ context->state[0] += a; context->state[1] += b; context->state[2] += c; context->state[3] += d; context->state[4] += e; context->state[5] += f; context->state[6] += g; context->state[7] += h; /* Clean up */ a = b = c = d = e = f = g = h = T1 = T2 = 0; } #endif /* SHA2_UNROLL_TRANSFORM */ void pa_SHA512_Update(SHA512_CTX* context, const sha2_byte *data, size_t len) { unsigned int freespace, usedspace; if (len == 0) { /* Calling with no data is valid - we do nothing */ return; } /* Sanity check: */ assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0); usedspace = (unsigned int)((context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH); if (usedspace > 0) { /* Calculate how much free space is available in the buffer */ freespace = SHA512_BLOCK_LENGTH - usedspace; if (len >= freespace) { /* Fill the buffer completely and process it */ MEMCPY_BCOPY(&context->buffer[usedspace], data, freespace); ADDINC128(context->bitcount, freespace << 3); len -= freespace; data += freespace; pa_SHA512_Transform(context, (sha2_word64*)context->buffer); } else { /* The buffer is not yet full */ MEMCPY_BCOPY(&context->buffer[usedspace], data, len); ADDINC128(context->bitcount, len << 3); /* Clean up: */ usedspace = freespace = 0; return; } } while (len >= SHA512_BLOCK_LENGTH) { /* Process as many complete blocks as we can */ pa_SHA512_Transform(context, (sha2_word64*)data); ADDINC128(context->bitcount, SHA512_BLOCK_LENGTH << 3); len -= SHA512_BLOCK_LENGTH; data += SHA512_BLOCK_LENGTH; } if (len > 0) { /* There's left-overs, so save 'em */ MEMCPY_BCOPY(context->buffer, data, len); ADDINC128(context->bitcount, len << 3); } /* Clean up: */ usedspace = freespace = 0; } void pa_SHA512_Last(SHA512_CTX* context) { unsigned int usedspace; usedspace = (unsigned int)((context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH); #ifdef PA_LITTLE_ENDIAN /* Convert FROM host byte order */ REVERSE64(context->bitcount[0],context->bitcount[0]); REVERSE64(context->bitcount[1],context->bitcount[1]); #endif if (usedspace > 0) { /* Begin padding with a 1 bit: */ context->buffer[usedspace++] = 0x80; if (usedspace <= SHA512_SHORT_BLOCK_LENGTH) { /* Set-up for the last transform: */ MEMSET_BZERO(&context->buffer[usedspace], SHA512_SHORT_BLOCK_LENGTH - usedspace); } else { if (usedspace < SHA512_BLOCK_LENGTH) { MEMSET_BZERO(&context->buffer[usedspace], SHA512_BLOCK_LENGTH - usedspace); } /* Do second-to-last transform: */ pa_SHA512_Transform(context, (sha2_word64*)context->buffer); /* And set-up for the last transform: */ MEMSET_BZERO(context->buffer, SHA512_BLOCK_LENGTH - 2); } } else { /* Prepare for final transform: */ MEMSET_BZERO(context->buffer, SHA512_SHORT_BLOCK_LENGTH); /* Begin padding with a 1 bit: */ *context->buffer = 0x80; } /* Store the length of input data (in bits): */ *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH] = context->bitcount[1]; *(sha2_word64*)&context->buffer[SHA512_SHORT_BLOCK_LENGTH+8] = context->bitcount[0]; /* Final transform: */ pa_SHA512_Transform(context, (sha2_word64*)context->buffer); } void pa_SHA512_Final(sha2_byte digest[], SHA512_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ assert(context != (SHA512_CTX*)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { pa_SHA512_Last(context); /* Save the hash data for output: */ #ifdef PA_LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 8; j++) { REVERSE64(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else MEMCPY_BCOPY(d, context->state, SHA512_DIGEST_LENGTH); #endif } /* Zero out state data */ MEMSET_BZERO(context, sizeof(SHA512_CTX)); } char *pa_SHA512_End(SHA512_CTX* context, char buffer[]) { sha2_byte digest[SHA512_DIGEST_LENGTH], *d = digest; int i; /* Sanity check: */ assert(context != (SHA512_CTX*)0); if (buffer != (char*)0) { pa_SHA512_Final(digest, context); for (i = 0; i < SHA512_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } *buffer = (char)0; } else { MEMSET_BZERO(context, sizeof(SHA512_CTX)); } MEMSET_BZERO(digest, SHA512_DIGEST_LENGTH); return buffer; } char* pa_SHA512_Data(const sha2_byte* data, size_t len, char digest[SHA512_DIGEST_STRING_LENGTH]) { SHA512_CTX context; pa_SHA512_Init(&context); pa_SHA512_Update(&context, data, len); return pa_SHA512_End(&context, digest); } /*** SHA-384: *********************************************************/ void pa_SHA384_Init(SHA384_CTX* context) { if (context == (SHA384_CTX*)0) { return; } MEMCPY_BCOPY(context->state, sha384_initial_hash_value, SHA512_DIGEST_LENGTH); MEMSET_BZERO(context->buffer, SHA384_BLOCK_LENGTH); context->bitcount[0] = context->bitcount[1] = 0; } void pa_SHA384_Update(SHA384_CTX* context, const sha2_byte* data, size_t len) { pa_SHA512_Update((SHA512_CTX*)context, data, len); } void pa_SHA384_Final(sha2_byte digest[], SHA384_CTX* context) { sha2_word64 *d = (sha2_word64*)digest; /* Sanity check: */ assert(context != (SHA384_CTX*)0); /* If no digest buffer is passed, we don't bother doing this: */ if (digest != (sha2_byte*)0) { pa_SHA512_Last((SHA512_CTX*)context); /* Save the hash data for output: */ #ifdef PA_LITTLE_ENDIAN { /* Convert TO host byte order */ int j; for (j = 0; j < 6; j++) { REVERSE64(context->state[j],context->state[j]); *d++ = context->state[j]; } } #else MEMCPY_BCOPY(d, context->state, SHA384_DIGEST_LENGTH); #endif } /* Zero out state data */ MEMSET_BZERO(context, sizeof(SHA384_CTX)); } char *pa_SHA384_End(SHA384_CTX* context, char buffer[]) { sha2_byte digest[SHA384_DIGEST_LENGTH], *d = digest; int i; /* Sanity check: */ assert(context != (SHA384_CTX*)0); if (buffer != (char*)0) { pa_SHA384_Final(digest, context); for (i = 0; i < SHA384_DIGEST_LENGTH; i++) { *buffer++ = sha2_hex_digits[(*d & 0xf0) >> 4]; *buffer++ = sha2_hex_digits[*d & 0x0f]; d++; } *buffer = (char)0; } else { MEMSET_BZERO(context, sizeof(SHA384_CTX)); } MEMSET_BZERO(digest, SHA384_DIGEST_LENGTH); return buffer; } char* pa_SHA384_Data(const sha2_byte* data, size_t len, char digest[SHA384_DIGEST_STRING_LENGTH]) { SHA384_CTX context; pa_SHA384_Init(&context); pa_SHA384_Update(&context, data, len); return pa_SHA384_End(&context, digest); } parser-3.5.1/src/lib/md5/pa_md5.h0000644000076400007640000000313714740300505013307 00000000000000/** @file taken from libmd, added pa_ prefixes, Parser 3 includes, Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) */ /* $OpenBSD: md5.h,v 1.15 2004/05/03 17:30:14 millert Exp $ */ /* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. */ #ifndef PA_MD5_H #define PA_MD5_H #define IDENT_PA_MD5_H "$Id: pa_md5.h,v 1.19 2025/01/06 18:22:23 moko Exp $" #ifdef __cplusplus extern "C" { #endif #include "pa_config_includes.h" #define MD5_BLOCK_LENGTH 64 #define MD5_DIGEST_LENGTH 16 #define MD5_DIGEST_STRING_LENGTH (MD5_DIGEST_LENGTH * 2 + 1) typedef struct MD5Context { uint32_t state[4]; /* state */ uint64_t count; /* number of bits, mod 2^64 */ uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */ } PA_MD5_CTX; void pa_MD5Init(PA_MD5_CTX *); void pa_MD5Update(PA_MD5_CTX *, const uint8_t *, size_t); void pa_MD5Final(uint8_t [MD5_DIGEST_LENGTH], PA_MD5_CTX *); void pa_MD5Transform(uint32_t [4], const uint8_t [MD5_BLOCK_LENGTH]); void pa_MD5Encode(const unsigned char *password, const unsigned char *salt, char *result, size_t nbytes); void pa_to64(char *s, unsigned long v, int n); #define PA_MD5PW_ID "$apr1$" #define PA_MD5PW_IDLEN 6 #ifdef __cplusplus } #endif #endif /* !PA_MD5_H */ parser-3.5.1/src/lib/cord/0000755000076400007640000000000014740300546012314 500000000000000parser-3.5.1/src/lib/cord/include/0000755000076400007640000000000014740300546013737 500000000000000parser-3.5.1/src/lib/cord/include/Makefile.in0000644000076400007640000004620014740273415015732 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/cord/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = private noinst_HEADERS = cord.h ec.h all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/cord/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/cord/include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(HEADERS) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/cord/include/private/0000755000076400007640000000000014740300546015411 500000000000000parser-3.5.1/src/lib/cord/include/private/Makefile.in0000644000076400007640000003562214740273415017412 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/cord/include/private ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = cord_pos.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/cord/include/private/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/cord/include/private/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/cord/include/private/Makefile.am0000644000076400007640000000003407707741612017372 00000000000000noinst_HEADERS = cord_pos.h parser-3.5.1/src/lib/cord/include/private/cord_pos.h0000644000076400007640000001005311275661023017311 00000000000000/* * Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. */ /* Boehm, May 19, 1994 2:23 pm PDT */ # ifndef CORD_POSITION_H /* The representation of CORD_position. This is private to the */ /* implementation, but the size is known to clients. Also */ /* the implementation of some exported macros relies on it. */ /* Don't use anything defined here and not in cord.h. */ # define MAX_DEPTH 48 /* The maximum depth of a balanced cord + 1. */ /* We don't let cords get deeper than MAX_DEPTH. */ struct CORD_pe { CORD pe_cord; size_t pe_start_pos; }; /* A structure describing an entry on the path from the root */ /* to current position. */ typedef struct CORD_Pos { size_t cur_pos; int path_len; # define CORD_POS_INVALID (0x55555555) /* path_len == INVALID <==> position invalid */ const char *cur_leaf; /* Current leaf, if it is a string. */ /* If the current leaf is a function, */ /* then this may point to function_buf */ /* containing the next few characters. */ /* Always points to a valid string */ /* containing the current character */ /* unless cur_end is 0. */ size_t cur_start; /* Start position of cur_leaf */ size_t cur_end; /* Ending position of cur_leaf */ /* 0 if cur_leaf is invalid. */ struct CORD_pe path[MAX_DEPTH + 1]; /* path[path_len] is the leaf corresponding to cur_pos */ /* path[0].pe_cord is the cord we point to. */ # define FUNCTION_BUF_SZ 32 char function_buf[FUNCTION_BUF_SZ]; /* Space for next few chars */ /* from function node. */ } CORD_pos[1]; /* Extract the cord from a position: */ CORD CORD_pos_to_cord(CORD_pos p); /* Extract the current index from a position: */ size_t CORD_pos_to_index(CORD_pos p); /* Fetch the character located at the given position: */ char CORD_pos_fetch(CORD_pos p); /* Initialize the position to refer to the give cord and index. */ /* Note that this is the most expensive function on positions: */ void CORD_set_pos(CORD_pos p, CORD x, size_t i); /* Advance the position to the next character. */ /* P must be initialized and valid. */ /* Invalidates p if past end: */ void CORD_next(CORD_pos p); /* Move the position to the preceding character. */ /* P must be initialized and valid. */ /* Invalidates p if past beginning: */ void CORD_prev(CORD_pos p); /* Is the position valid, i.e. inside the cord? */ int CORD_pos_valid(CORD_pos p); char CORD__pos_fetch(CORD_pos); void CORD__next(CORD_pos); void CORD__prev(CORD_pos); #define CORD_pos_fetch(p) \ (((p)[0].cur_end != 0)? \ (p)[0].cur_leaf[(p)[0].cur_pos - (p)[0].cur_start] \ : CORD__pos_fetch(p)) #define CORD_next(p) \ (((p)[0].cur_pos + 1 < (p)[0].cur_end)? \ (p)[0].cur_pos++ \ : (CORD__next(p), 0)) #define CORD_prev(p) \ (((p)[0].cur_end != 0 && (p)[0].cur_pos > (p)[0].cur_start)? \ (p)[0].cur_pos-- \ : (CORD__prev(p), 0)) #define CORD_pos_to_index(p) ((p)[0].cur_pos) #define CORD_pos_to_cord(p) ((p)[0].path[0].pe_cord) #define CORD_pos_valid(p) ((p)[0].path_len != CORD_POS_INVALID) /* Some grubby stuff for performance-critical friends: */ #define CORD_pos_chars_left(p) ((long)((p)[0].cur_end) != 0 ? ((long)((p)[0].cur_end) - (long)((p)[0].cur_pos)) : 0 ) /* Number of characters in cache. <= 0 ==> none */ #define CORD_pos_advance(p,n) ((p)[0].cur_pos += (n) - 1, CORD_next(p)) /* Advance position by n characters */ /* 0 < n < CORD_pos_chars_left(p) */ #define CORD_pos_cur_char_addr(p) \ (p)[0].cur_leaf + ((p)[0].cur_pos - (p)[0].cur_start) /* address of current character in cache. */ #endif parser-3.5.1/src/lib/cord/include/Makefile.am0000644000076400007640000000006007707741612015717 00000000000000SUBDIRS = private noinst_HEADERS = cord.h ec.h parser-3.5.1/src/lib/cord/include/cord.h0000644000076400007640000002765313765777453015021 00000000000000/* * Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. * * Author: Hans-J. Boehm (boehm@parc.xerox.com) */ /* Boehm, October 5, 1995 4:20 pm PDT */ /* * Cords are immutable character strings. A number of operations * on long cords are much more efficient than their strings.h counterpart. * In particular, concatenation takes constant time independent of the length * of the arguments. (Cords are represented as trees, with internal * nodes representing concatenation and leaves consisting of either C * strings or a functional description of the string.) * * The following are reasonable applications of cords. They would perform * unacceptably if C strings were used: * - A compiler that produces assembly language output by repeatedly * concatenating instructions onto a cord representing the output file. * - A text editor that converts the input file to a cord, and then * performs editing operations by producing a new cord representing * the file after echa character change (and keeping the old ones in an * edit history) * * For optimal performance, cords should be built by * concatenating short sections. * This interface is designed for maximum compatibility with C strings. * ASCII NUL characters may be embedded in cords using CORD_from_fn. * This is handled correctly, but CORD_to_char_star will produce a string * with embedded NULs when given such a cord. * * This interface is fairly big, largely for performance reasons. * The most basic constants and functions: * * CORD - the type of a cord; * CORD_EMPTY - empty cord; * CORD_len(cord) - length of a cord; * CORD_cat(cord1,cord2) - concatenation of two cords; * CORD_substr(cord, start, len) - substring (or subcord); * CORD_pos i; CORD_FOR(i, cord) { ... CORD_pos_fetch(i) ... } - * examine each character in a cord. CORD_pos_fetch(i) is the char. * CORD_fetch(int i) - Retrieve i'th character (slowly). * CORD_cmp(cord1, cord2) - compare two cords. * CORD_from_file(FILE * f) - turn a read-only file into a cord. * CORD_to_char_star(cord) - convert to C string. * (Non-NULL C constant strings are cords.) * CORD_printf (etc.) - cord version of printf. Use %r for cords. */ # ifndef CORD_H # define CORD_H # include # include /* Cords have type const char *. This is cheating quite a bit, and not */ /* 100% portable. But it means that nonempty character string */ /* constants may be used as cords directly, provided the string is */ /* never modified in place. The empty cord is represented by, and */ /* can be written as, 0. */ typedef const unsigned char * CORD; /* An empty cord is always represented as nil */ # define CORD_EMPTY 0 /* Is a nonempty cord represented as a C string? */ #define CORD_IS_STRING(s) (*(s) != '\0') /* Allows struct Concatenation modification on merge in CORD_cat, thus all source Concatenation structs must be prepared for this */ #define CORD_CAT_OPTIMIZATION /* Caches CORD_chars result to avoide useless allocations */ #define CORD_CHARS_CACHE /* Concatenate two cords. If the arguments are C strings, they may */ /* not be subsequently altered. */ CORD CORD_cat(CORD x, CORD y); /* Concatenate a cord and a C string with known length. Except for the */ /* empty string case, this is a special case of CORD_cat. Since the */ /* length is known, it can be faster. */ /* The string y is shared with the resulting CORD. Hence it should */ /* not be altered by the caller. */ /* PAF@design.ru: but there is a ~bug in case (0, "123", 2), it returns "123", and later appends after '3', not '2'. so BEWARE: NOT USE IT THAT WAY and changing 'leny' convention: now, if it's 0, then function does leny=strlen(y) */ CORD CORD_cat_char_star(CORD x, const char * y, size_t leny); #ifdef CORD_CAT_OPTIMIZATION void CORD_concatenation_protect(CORD x); CORD CORD_cat_optimized(CORD x, CORD y); CORD CORD_cat_char_star_optimized(CORD x, const char * y, size_t leny); #endif /* Compute the length of a cord */ size_t CORD_len(CORD x); /* Cords may be represented by functions defining the ith character */ typedef char (* CORD_fn)(size_t i, void * client_data); /* Turn a functional description into a cord. */ CORD CORD_from_fn(CORD_fn fn, void * client_data, size_t len); /* Turn a functional description into a cord, only conjunction&func. */ CORD CORD_from_fn_gen(CORD_fn fn, void * client_data, size_t len); /* Return the substring (subcord really) of x with length at most n, */ /* starting at position i. (The initial character has position 0.) */ CORD CORD_substr(CORD x, size_t i, size_t n, size_t len); /* Return the argument, but rebalanced to allow more efficient */ /* character retrieval, substring operations, and comparisons. */ /* This is useful only for cords that were built using repeated */ /* concatenation. Guarantees log time access to the result, unless */ /* x was obtained through a large number of repeated substring ops */ /* or the embedded functional descriptions take longer to evaluate. */ /* May reallocate significant parts of the cord. The argument is not */ /* modified; only the result is balanced. */ CORD CORD_balance(CORD x); /* The following traverse a cord by applying a function to each */ /* character. This is occasionally appropriate, especially where */ /* speed is crucial. But, since C doesn't have nested functions, */ /* clients of this sort of traversal are clumsy to write. Consider */ /* the functions that operate on cord positions instead. */ /* Function to iteratively apply to individual characters in cord. */ typedef int (* CORD_iter_fn)(char c, void * client_data); /* Function to iteratively apply to individual block in cord. */ typedef int (* CORD_block_iter_fn)(char c, size_t len, void* client_data); /* Function to apply to substrings of a cord. Each substring is a */ /* a C character string, not a general cord. */ typedef int (* CORD_batched_iter_fn)(const char * s, void * client_data); # define CORD_NO_FN ((CORD_batched_iter_fn)0) /* Apply f1 to each character in the cord, in ascending order, */ /* starting at position i. If */ /* f2 is not CORD_NO_FN, then multiple calls to f1 may be replaced by */ /* a single call to f2. The parameter f2 is provided only to allow */ /* some optimization by the client. This terminates when the right */ /* end of this string is reached, or when f1 or f2 return != 0. In the */ /* latter case CORD_iter returns != 0. Otherwise it returns 0. */ /* The specified value of i must be < CORD_len(x). */ int CORD_iter5(CORD x, size_t i, CORD_iter_fn f1, CORD_batched_iter_fn f2, void * client_data); /* iterate over function block in cord */ int CORD_block_iter(CORD x, size_t i, CORD_block_iter_fn f1, void * client_data); /* A simpler version that starts at 0, and without f2: */ int CORD_iter(CORD x, CORD_iter_fn f1, void * client_data); # define CORD_iter(x, f1, cd) CORD_iter5(x, 0, f1, CORD_NO_FN, cd) /* Similar to CORD_iter5, but end-to-beginning. No provisions for */ /* CORD_batched_iter_fn. */ int CORD_riter4(CORD x, size_t i, CORD_iter_fn f1, void * client_data); /* A simpler version that starts at the end: */ int CORD_riter(CORD x, CORD_iter_fn f1, void * client_data); /* Functions that operate on cord positions. The easy way to traverse */ /* cords. A cord position is logically a pair consisting of a cord */ /* and an index into that cord. But it is much faster to retrieve a */ /* charcter based on a position than on an index. Unfortunately, */ /* positions are big (order of a few 100 bytes), so allocate them with */ /* caution. */ /* Things in cord_pos.h should be treated as opaque, except as */ /* described below. Also note that */ /* CORD_pos_fetch, CORD_next and CORD_prev have both macro and function */ /* definitions. The former may evaluate their argument more than once. */ # include "private/cord_pos.h" /* Visible definitions from above: typedef CORD_pos[1]; * Extract the cord from a position: CORD CORD_pos_to_cord(CORD_pos p); * Extract the current index from a position: size_t CORD_pos_to_index(CORD_pos p); * Fetch the character located at the given position: char CORD_pos_fetch(CORD_pos p); * Initialize the position to refer to the given cord and index. * Note that this is the most expensive function on positions: void CORD_set_pos(CORD_pos p, CORD x, size_t i); * Advance the position to the next character. * P must be initialized and valid. * Invalidates p if past end: void CORD_next(CORD_pos p); * Move the position to the preceding character. * P must be initialized and valid. * Invalidates p if past beginning: void CORD_prev(CORD_pos p); * Is the position valid, i.e. inside the cord? int CORD_pos_valid(CORD_pos p); */ # define CORD_FOR(pos, cord) \ for (CORD_set_pos(pos, cord, 0); CORD_pos_valid(pos); CORD_next(pos)) /* An out of memory handler to call. May be supplied by client. */ /* Must not return. */ extern void (* CORD_oom_fn)(void); /* Dump the representation of x to stdout in an implementation defined */ /* manner. Intended for debugging only. */ void CORD_dump(CORD x); /* The following could easily be implemented by the client. They are */ /* provided in cordxtra.c for convenience. */ /* Concatenate a character to the end of a cord. */ CORD CORD_cat_char(CORD x, char c); /* Concatenate n cords. */ CORD CORD_catn(int n, /* CORD */ ...); /* Return the character in CORD_substr(x, i, 1) */ char CORD_fetch(CORD x, size_t i); /* Return < 0, 0, or > 0, depending on whether x < y, x = y, x > y */ int CORD_cmp(CORD x, CORD y); /* A generalization that takes both starting positions for the */ /* comparison, and a limit on the number of characters to be compared. */ int CORD_ncmp(CORD x, size_t x_start, CORD y, size_t y_start, size_t len); /* Find the first occurrence of s in x at position start or later. */ /* Return the position of the first character of s in x, or */ /* CORD_NOT_FOUND if there is none. */ size_t CORD_str(CORD x, size_t start, CORD s, size_t xlen); /* Return a cord consisting of i copies of (possibly NUL) c. Dangerous */ /* in conjunction with CORD_to_char_star. */ /* The resulting representation takes constant space, independent of i. */ CORD CORD_chars(char c, size_t i); # define CORD_nul(i) CORD_chars('\0', (i)) /* Turn a cord into a C string. The result shares no structure with */ /* x, and is thus modifiable. */ char * CORD_to_char_star(CORD x, size_t len); /* Turn a C string into a CORD. The C string is copied, and so may */ /* subsequently be modified. */ CORD CORD_from_char_star(const char *s); /* Identical to the above, but the result may share structure with */ /* the argument and is thus not modifiable. */ const char * CORD_to_const_char_star(CORD x, size_t len); /* Write a cord to a file, starting at the current position. No */ /* trailing NULs are newlines are added. */ /* Returns EOF if a write error occurs, 1 otherwise. */ int CORD_put(CORD x, FILE * f); /* "Not found" result for the following two functions. */ # define CORD_NOT_FOUND ((size_t)(-1)) /* A vague analog of strchr. Returns the position (an integer, not */ /* a pointer) of the first occurrence of (char) c inside x at position */ /* i or later. The value i must be < CORD_len(x). */ size_t CORD_chr(CORD x, size_t i, int c); /* A vague analog of strrchr. Returns index of the last occurrence */ /* of (char) c inside x at position i or earlier. The value i */ /* must be < CORD_len(x). */ size_t CORD_rchr(CORD x, size_t i, int c); # endif /* CORD_H */ parser-3.5.1/src/lib/cord/include/ec.h0000644000076400007640000000336207707741612014433 00000000000000# ifndef EC_H # define EC_H # ifndef CORD_H # include "cord.h" # endif /* Extensible cords are strings that may be destructively appended to. */ /* They allow fast construction of cords from characters that are */ /* being read from a stream. */ /* * A client might look like: * * { * CORD_ec x; * CORD result; * char c; * FILE *f; * * ... * CORD_ec_init(x); * while(...) { * c = getc(f); * ... * CORD_ec_append(x, c); * } * result = CORD_balance(CORD_ec_to_cord(x)); * * If a C string is desired as the final result, the call to CORD_balance * may be replaced by a call to CORD_to_char_star. */ # ifndef CORD_BUFSZ # define CORD_BUFSZ 128 # endif typedef struct CORD_ec_struct { CORD ec_cord; char * ec_bufptr; char ec_buf[CORD_BUFSZ+1]; } CORD_ec[1]; /* This structure represents the concatenation of ec_cord with */ /* ec_buf[0 ... (ec_bufptr-ec_buf-1)] */ /* Flush the buffer part of the extended chord into ec_cord. */ /* Note that this is almost the only real function, and it is */ /* implemented in 6 lines in cordxtra.c */ void CORD_ec_flush_buf(CORD_ec x); /* Convert an extensible cord to a cord. */ # define CORD_ec_to_cord(x) (CORD_ec_flush_buf(x), (x)[0].ec_cord) /* Initialize an extensible cord. */ # define CORD_ec_init(x) ((x)[0].ec_cord = 0, (x)[0].ec_bufptr = (x)[0].ec_buf) /* Append a character to an extensible cord. */ # define CORD_ec_append(x, c) \ { \ if ((x)[0].ec_bufptr == (x)[0].ec_buf + CORD_BUFSZ) { \ CORD_ec_flush_buf(x); \ } \ *((x)[0].ec_bufptr)++ = (c); \ } /* Append a cord to an extensible cord. Structure remains shared with */ /* original. */ void CORD_ec_append_cord(CORD_ec x, CORD s); # endif /* EC_H */ parser-3.5.1/src/lib/cord/cordbscs.c0000644000076400007640000010221413211622356014200 00000000000000/* * Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. * * Author: Hans-J. Boehm (boehm@parc.xerox.com) */ /* Boehm, October 3, 1994 5:19 pm PDT */ #include "pa_config_includes.h" #include "include/cord.h" /* An implementation of the cord primitives. These are the only */ /* Functions that understand the representation. We perform only */ /* minimal checks on arguments to these functions. Out of bounds */ /* arguments to the iteration functions may result in client functions */ /* invoked on garbage data. In most cases, client functions should be */ /* programmed defensively enough that this does not result in memory */ /* smashes. */ typedef void (* oom_fn)(void); oom_fn CORD_oom_fn = (oom_fn) 0; # define OUT_OF_MEMORY { if (CORD_oom_fn != (oom_fn) 0) (*CORD_oom_fn)(); \ ABORT("Out of memory\n"); } # define ABORT(msg) { fprintf(stderr, "%s\n", msg); abort(); } typedef unsigned long word; typedef union { struct Concatenation { char null; char header; char depth; /* concatenation nesting depth. */ unsigned char left_len; /* Length of left child if it is sufficiently */ /* short; 0 otherwise. */ # define MAX_LEFT_LEN 255 word len; CORD left; /* length(left) > 0 */ CORD right; /* length(right) > 0 */ } concatenation; struct Function { char null; char header; char depth; /* always 0 */ char left_len; /* always 0 */ word len; CORD_fn fn; void * client_data; } function; struct Generic { char null; char header; char depth; char left_len; word len; } generic; char string[1]; } CordRep; # define CONCAT_HDR 1 # define FN_HDR 4 # define SUBSTR_HDR 6 /* Substring nodes are a special case of function nodes. */ /* The client_data field is known to point to a substr_args */ /* structure, and the function is either CORD_apply_access_fn */ /* or CORD_index_access_fn. */ #ifdef CORD_CAT_OPTIMIZATION #define CONCAT_HDR_RO 3 #define IS_CONCATENATION(s) ((((CordRep *)s)->generic.header & CONCAT_HDR) != 0) #define IS_RW_CONCATENATION(s) (((CordRep *)s)->generic.header == CONCAT_HDR) #else /* The following may be applied only to function and concatenation nodes: */ #define IS_CONCATENATION(s) (((CordRep *)s)->generic.header == CONCAT_HDR) #endif #define IS_FUNCTION(s) ((((CordRep *)s)->generic.header & FN_HDR) != 0) #define IS_SUBSTR(s) (((CordRep *)s)->generic.header == SUBSTR_HDR) #define LEN(s) (((CordRep *)s) -> generic.len) #define DEPTH(s) (((CordRep *)s) -> generic.depth) #define GEN_LEN(s) (CORD_IS_STRING(s) ? strlen(s) : LEN(s)) #define LEFT_LEN(c) ((c) -> left_len != 0? \ (c) -> left_len \ : (CORD_IS_STRING((c) -> left) ? \ (c) -> len - GEN_LEN((c) -> right) \ : LEN((c) -> left))) #define SHORT_LIMIT (sizeof(CordRep) - 1) /* Cords shorter than this are C strings */ /* paf: using knowledge of interal structure to speedup */ char CORD_nul_func(size_t i, void * client_data); /* Dump the internal representation of x to stdout, with initial */ /* indentation level n. */ void CORD_dump_inner(CORD x, unsigned n) { register size_t i; for (i = 0; i < (size_t)n; i++) { fputs(" ", stdout); } if (x == 0) { fputs("NIL\n", stdout); } else if (CORD_IS_STRING(x)) { for (i = 0; i <= SHORT_LIMIT*1000; i++) { if (x[i] == '\0') { putchar('!'); break; } switch(x[i]){ case '\n': putchar('|'); break; case '\r': putchar('#'); break; case '\t': putchar('@'); break; default: putchar(x[i]); break; } } if (x[i] != '\0') fputs("...", stdout); putchar('\n'); } else if (IS_CONCATENATION(x)) { register struct Concatenation * conc = &(((CordRep *)x) -> concatenation); printf("Concatenation: %p (len: %d, depth: %d)\n", x, (int)(conc -> len), (int)(conc -> depth)); CORD_dump_inner(conc -> left, n+1); CORD_dump_inner(conc -> right, n+1); } else /* function */{ register struct Function * func = &(((CordRep *)x) -> function); if (IS_SUBSTR(x)) printf("(Substring) "); printf("Function: %p (len: %d): ", x, (int)(func -> len)); for (i = 0; i < 20*1000 && i < func -> len; i++) { putchar((*(func -> fn))(i, func -> client_data)); } if (i < func -> len) fputs("...", stdout); putchar('\n'); } } /* Dump the internal representation of x to stdout */ void CORD_dump(CORD x) { CORD_dump_inner(x, 0); fflush(stdout); } CORD CORD_cat_char_star(CORD x, const char* y, size_t leny) { register size_t result_len; register size_t lenx; register int depth; if (x == CORD_EMPTY) return(y); //if (leny == 0) leny=strlen(y); // PAF if (y == 0) ABORT("CORD_cat_char_star(,y,) y==0"); // PAF if (*y == 0) ABORT("CORD_cat_char_star(,y,) y==\"\""); // PAF if (leny == 0) ABORT("CORD_cat_char_star(,y,) leny==0"); // PAF if (CORD_IS_STRING(x)) { lenx = strlen(x); result_len = lenx + leny; if (result_len <= SHORT_LIMIT) { register char * result = GC_MALLOC_ATOMIC(result_len+1); if (result == 0) OUT_OF_MEMORY; memcpy(result, x, lenx); memcpy(result + lenx, y, leny); result[result_len] = '\0'; return((CORD) result); } else { depth = 1; } } else { register CORD right; register CORD left; register char * new_right; register size_t right_len; lenx = LEN(x); if (leny <= SHORT_LIMIT/2 && IS_CONCATENATION(x) && CORD_IS_STRING(right = ((CordRep *)x) -> concatenation.right)) { /* Merge y into right part of x. */ if (!CORD_IS_STRING(left = ((CordRep *)x) -> concatenation.left)) { right_len = lenx - LEN(left); } else if (((CordRep *)x) -> concatenation.left_len != 0) { right_len = lenx - ((CordRep *)x) -> concatenation.left_len; } else { right_len = strlen(right); } result_len = right_len + leny; /* length of new_right */ if (result_len <= SHORT_LIMIT) { new_right = GC_MALLOC_ATOMIC(result_len + 1); if (new_right == 0) OUT_OF_MEMORY; memcpy(new_right, right, right_len); memcpy(new_right + right_len, y, leny); new_right[result_len] = '\0'; y = new_right; leny = result_len; x = left; lenx -= right_len; /* Now fall through to concatenate the two pieces: */ } if (CORD_IS_STRING(x)) { depth = 1; } else { depth = DEPTH(x) + 1; } } else { depth = DEPTH(x) + 1; } result_len = lenx + leny; } { /* The general case; lenx, result_len is known: */ register struct Concatenation * result; result = GC_NEW(struct Concatenation); if (result == 0) OUT_OF_MEMORY; result->header = CONCAT_HDR; result->depth = depth; if (lenx <= MAX_LEFT_LEN) result->left_len = lenx; result->len = result_len; result->left = x; result->right = y; if (depth >= MAX_DEPTH) { return(CORD_balance((CORD)result)); } else { return((CORD) result); } } } CORD CORD_cat(CORD x, CORD y) { register size_t result_len; register int depth; register size_t lenx; if (x == CORD_EMPTY) return(y); if (y == CORD_EMPTY) return(x); if (CORD_IS_STRING(y)) { return(CORD_cat_char_star(x, y, strlen(y))); } else if (CORD_IS_STRING(x)) { lenx = strlen(x); depth = DEPTH(y) + 1; } else { register int depthy = DEPTH(y); lenx = LEN(x); depth = DEPTH(x) + 1; if (depthy >= depth) depth = depthy + 1; } result_len = lenx + LEN(y); { register struct Concatenation * result; result = GC_NEW(struct Concatenation); if (result == 0) OUT_OF_MEMORY; result->header = CONCAT_HDR; result->depth = depth; // printf("depth=%d\n", depth); if (lenx <= MAX_LEFT_LEN) result->left_len = lenx; result->len = result_len; result->left = x; result->right = y; // PAF@design.ru bug fix: if (depth >= MAX_DEPTH) { return(CORD_balance((CORD)result)); } else { return((CORD) result); } } } #ifdef CORD_CAT_OPTIMIZATION void CORD_concatenation_protect(CORD x){ if(IS_RW_CONCATENATION(x)) ((struct Concatenation*)x)->header = CONCAT_HDR_RO; } /* Optimized version to be called from parser code */ CORD CORD_cat_char_star_optimized(CORD x, const char* y, size_t leny) { register size_t result_len; register size_t lenx; register int depth; if (x == CORD_EMPTY) return(y); //if (leny == 0) leny=strlen(y); // PAF if (y == 0) ABORT("CORD_cat_char_star(,y,) y==0"); // PAF if (*y == 0) ABORT("CORD_cat_char_star(,y,) y==\"\""); // PAF if (leny == 0) ABORT("CORD_cat_char_star(,y,) leny==0"); // PAF if (CORD_IS_STRING(x)) { lenx = strlen(x); result_len = lenx + leny; if (result_len <= SHORT_LIMIT) { register char * result = GC_MALLOC_ATOMIC(result_len+1); if (result == 0) OUT_OF_MEMORY; memcpy(result, x, lenx); memcpy(result + lenx, y, leny); result[result_len] = '\0'; return((CORD) result); } else { depth = 1; } } else { register CORD right; register CORD left; register char * new_right; register size_t right_len; lenx = LEN(x); if ( leny <= SHORT_LIMIT/2 && IS_CONCATENATION(x) && CORD_IS_STRING(right = ((CordRep *)x) -> concatenation.right) ){ /* Merge y into right part of x. */ if (!CORD_IS_STRING(left = ((CordRep *)x) -> concatenation.left)) { right_len = lenx - LEN(left); } else if (((CordRep *)x) -> concatenation.left_len != 0) { right_len = lenx - ((CordRep *)x) -> concatenation.left_len; } else { right_len = strlen(right); } result_len = right_len + leny; /* length of new_right */ if (result_len <= SHORT_LIMIT) { new_right = GC_MALLOC_ATOMIC(result_len + 1); if (new_right == 0) OUT_OF_MEMORY; memcpy(new_right, right, right_len); memcpy(new_right + right_len, y, leny); new_right[result_len] = '\0'; if (IS_RW_CONCATENATION(x)) { // Optimization: instead of new Concatenation current is modified ((CordRep *)x) -> concatenation.right=new_right; ((CordRep *)x) -> concatenation.len += leny; return x; } y = new_right; leny = result_len; x = left; lenx -= right_len; /* Now fall through to concatenate the two pieces: */ } if (CORD_IS_STRING(x)) { depth = 1; } else { depth = DEPTH(x) + 1; } } else { depth = DEPTH(x) + 1; } result_len = lenx + leny; } { /* The general case; lenx, result_len is known: */ register struct Concatenation * result; result = GC_NEW(struct Concatenation); if (result == 0) OUT_OF_MEMORY; result->header = CONCAT_HDR; result->depth = depth; if (lenx <= MAX_LEFT_LEN) result->left_len = lenx; result->len = result_len; result->left = x; result->right = y; if (depth >= MAX_DEPTH) { return(CORD_balance((CORD)result)); } else { return((CORD) result); } } } /* Optimized version to be called from parser code */ CORD CORD_cat_optimized(CORD x, CORD y) { register size_t result_len; register int depth; register size_t lenx; if (x == CORD_EMPTY){ CORD_concatenation_protect(y); // to guarantee y won't be modified return(y); } if (y == CORD_EMPTY) return(x); if (CORD_IS_STRING(y)) { return(CORD_cat_char_star_optimized(x, y, strlen(y))); // optimized version is called } else if (CORD_IS_STRING(x)) { lenx = strlen(x); depth = DEPTH(y) + 1; } else { register int depthy = DEPTH(y); lenx = LEN(x); depth = DEPTH(x) + 1; if (depthy >= depth) depth = depthy + 1; } result_len = lenx + LEN(y); { register struct Concatenation * result; result = GC_NEW(struct Concatenation); if (result == 0) OUT_OF_MEMORY; result->header = CONCAT_HDR; result->depth = depth; // printf("depth=%d\n", depth); if (lenx <= MAX_LEFT_LEN) result->left_len = lenx; result->len = result_len; result->left = x; result->right = y; // PAF@design.ru bug fix: if (depth >= MAX_DEPTH) { return(CORD_balance((CORD)result)); } else { return((CORD) result); } } } #endif CORD CORD_from_fn(CORD_fn fn, void * client_data, size_t len) { if (len <= 0) return(0); if (len <= SHORT_LIMIT) { register char * result; register size_t i; char buf[SHORT_LIMIT+1]; register char c; for (i = 0; i < len; i++) { c = (*fn)(i, client_data); if (c == '\0') goto gen_case; buf[i] = c; } buf[i] = '\0'; result = GC_MALLOC_ATOMIC(len+1); if (result == 0) OUT_OF_MEMORY; strcpy(result, buf); result[len] = '\0'; return((CORD) result); } gen_case: { register struct Function * result; result = GC_NEW(struct Function); if (result == 0) OUT_OF_MEMORY; result->header = FN_HDR; /* depth is already 0 */ result->len = len; result->fn = fn; result->client_data = client_data; return((CORD) result); } } size_t CORD_len(CORD x) { if (x == 0) { return(0); } else { return(GEN_LEN(x)); } } struct substr_args { CordRep * sa_cord; size_t sa_index; }; char CORD_index_access_fn(size_t i, void * client_data) { register struct substr_args *descr = (struct substr_args *)client_data; return(((char *)(descr->sa_cord))[i + descr->sa_index]); } char CORD_apply_access_fn(size_t i, void * client_data) { register struct substr_args *descr = (struct substr_args *)client_data; register struct Function * fn_cord = &(descr->sa_cord->function); return((*(fn_cord->fn))(i + descr->sa_index, fn_cord->client_data)); } /* A version of CORD_substr that simply returns a function node, thus */ /* postponing its work. The fourth argument is a function that may */ /* be used for efficient access to the ith character. */ /* Assumes i >= 0 and i + n < length(x). */ CORD CORD_substr_closure(CORD x, size_t i, size_t n, CORD_fn f) { register struct substr_args * sa = GC_NEW(struct substr_args); CORD result; if (sa == 0) OUT_OF_MEMORY; sa->sa_cord = (CordRep *)x; sa->sa_index = i; result = CORD_from_fn(f, (void *)sa, n); ((CordRep *)result) -> function.header = SUBSTR_HDR; return (result); } # define SUBSTR_LIMIT (10 * SHORT_LIMIT) /* Substrings of function nodes and flat strings shorter than */ /* this are flat strings. Othewise we use a functional */ /* representation, which is significantly slower to access. */ /* A version of CORD_substr that assumes i >= 0, n > 0, and i + n < length(x).*/ CORD CORD_substr_checked(CORD x, size_t i, size_t n) { if (CORD_IS_STRING(x)) { if (n > SUBSTR_LIMIT) { return(CORD_substr_closure(x, i, n, CORD_index_access_fn)); } else { register char * result = GC_MALLOC_ATOMIC(n+1); if (result == 0) OUT_OF_MEMORY; strncpy(result, x+i, n); result[n] = '\0'; return(result); } } else if (IS_CONCATENATION(x)) { register struct Concatenation * conc = &(((CordRep *)x) -> concatenation); register size_t left_len; register size_t right_len; left_len = LEFT_LEN(conc); right_len = conc -> len - left_len; if (i >= left_len) { if (n == right_len) return(conc -> right); return(CORD_substr_checked(conc -> right, i - left_len, n)); } else if (i+n <= left_len) { if (n == left_len) return(conc -> left); return(CORD_substr_checked(conc -> left, i, n)); } else { /* Need at least one character from each side. */ register CORD left_part; register CORD right_part; register size_t left_part_len = left_len - i; if (i == 0) { left_part = conc -> left; } else { left_part = CORD_substr_checked(conc -> left, i, left_part_len); } if (i + n == right_len + left_len) { right_part = conc -> right; } else { right_part = CORD_substr_checked(conc -> right, 0, n - left_part_len); } return(CORD_cat(left_part, right_part)); } } else /* function */ { if (n > SUBSTR_LIMIT) { if (IS_SUBSTR(x)) { /* Avoid nesting substring nodes. */ register struct Function * f = &(((CordRep *)x) -> function); register struct substr_args *descr = (struct substr_args *)(f -> client_data); return(CORD_substr_closure((CORD)descr->sa_cord, i + descr->sa_index, n, f -> fn)); } else { return(CORD_substr_closure(x, i, n, CORD_apply_access_fn)); } } else { char * result; register struct Function * f = &(((CordRep *)x) -> function); char buf[SUBSTR_LIMIT+1]; register char * p = buf; register char c; register int j; register int lim = i + n; for (j = i; j < lim; j++) { c = (*(f -> fn))(j, f -> client_data); if (c == '\0') { return(CORD_substr_closure(x, i, n, CORD_apply_access_fn)); } *p++ = c; } *p = '\0'; result = GC_MALLOC_ATOMIC(n+1); if (result == 0) OUT_OF_MEMORY; strcpy(result, buf); return(result); } } } CORD CORD_substr(CORD x, size_t i, size_t n, size_t len) { if(0 == len) len = CORD_len(x); if (i >= len || n <= 0) return(0); /* n < 0 is impossible in a correct C implementation, but */ /* quite possible under SunOS 4.X. */ if (i + n > len) n = len - i; # ifndef __STDC__ if (i < 0) ABORT("CORD_substr: second arg. negative"); /* Possible only if both client and C implementation are buggy. */ /* But empirically this happens frequently. */ # endif return(CORD_substr_checked(x, i, n)); } /* See cord.h for definition. We assume i is in range. */ int CORD_iter5(CORD x, size_t i, CORD_iter_fn f1, CORD_batched_iter_fn f2, void * client_data) { int result; if (x == 0) return(0); if (CORD_IS_STRING(x)) { register const char* p = x+i; if (*p == '\0') ABORT("2nd arg to CORD_iter5 too big"); if (f2 != CORD_NO_FN) { return((*f2)(p, client_data)); } else { while (*p) { if (result=(*f1)(*p, client_data)) return result; p++; } return(0); } } else if (IS_CONCATENATION(x)) { register struct Concatenation * conc = &(((CordRep *)x) -> concatenation); if (i > 0) { register size_t left_len = LEFT_LEN(conc); if (i >= left_len) { return(CORD_iter5(conc -> right, i - left_len, f1, f2, client_data)); } } result=CORD_iter5(conc -> left, i, f1, f2, client_data); if (result) return result; return(CORD_iter5(conc -> right, 0, f1, f2, client_data)); } else /* function */ { register struct Function * f = &(((CordRep *)x) -> function); register size_t j; register size_t lim = f -> len; for (j = i; j < lim; j++) { if (result=(*f1)((*(f -> fn))(j, f -> client_data), client_data)) return result; } return(0); } } /* See cord.h for definition. We assume i is in range. */ int CORD_block_iter(CORD x, size_t i, CORD_block_iter_fn fb, void * client_data) { int result; if (x == 0) return(0); if (CORD_IS_STRING(x)) { register const char* p = x+i; const char *b=p; char bc=*b; int pc; if (bc == '\0') ABORT("2nd arg to CORD_iter5 too big"); do { pc=*++p; if(pc!=bc) { if (result=fb(bc, p-b, client_data)) return result; b=p; bc=pc; } } while (pc); return(0); } else if (IS_CONCATENATION(x)) { register struct Concatenation * conc= &(((CordRep *)x) -> concatenation); if (i > 0) { register size_t left_len = LEFT_LEN(conc); if (i >= left_len) { return(CORD_block_iter(conc -> right, i - left_len, fb, client_data)); } } result=CORD_block_iter(conc -> left, i, fb, client_data); if (result) return result; return(CORD_block_iter(conc -> right, 0, fb, client_data)); } else /* function */ { register struct Function * f = &(((CordRep *)x) -> function); register size_t lim = f -> len; if(f->fn == CORD_nul_func ) { if (result=fb((char)(unsigned long)f -> client_data, f -> len-i, client_data)) return result; } else if(f->fn == CORD_apply_access_fn) { register struct substr_args *descr = (struct substr_args *)f->client_data; register struct Function * fn_cord = &(descr->sa_cord->function); if(fn_cord->fn == CORD_nul_func ) { if (result=fb((char)(unsigned long)fn_cord->client_data, f -> len-i, client_data)) return result; } else ABORT("CORD_block_iter:CORD_apply_access_fn:unknown_fn should not happen"); } else { if(f->fn == CORD_index_access_fn) ABORT("CORD_block_iter:CORD_index_access_fn should not happen"); ABORT("CORD_block_iter:unknown_fn should not happen"); } } return(0); } #undef CORD_iter int CORD_iter(CORD x, CORD_iter_fn f1, void * client_data) { return(CORD_iter5(x, 0, f1, CORD_NO_FN, client_data)); } int CORD_riter4(CORD x, size_t i, CORD_iter_fn f1, void * client_data) { if (x == 0) return(0); if (CORD_IS_STRING(x)) { register const char* p = x + i; register char c; for(;;) { c = *p; if (c == '\0') ABORT("2nd arg to CORD_riter4 too big"); if ((*f1)(c, client_data)) return(1); if (p == (const char *)x) break; p--; } return(0); } else if (IS_CONCATENATION(x)) { register struct Concatenation * conc = &(((CordRep *)x) -> concatenation); register CORD left_part = conc -> left; register size_t left_len; left_len = LEFT_LEN(conc); if (i >= left_len) { if (CORD_riter4(conc -> right, i - left_len, f1, client_data)) { return(1); } return(CORD_riter4(left_part, left_len - 1, f1, client_data)); } else { return(CORD_riter4(left_part, i, f1, client_data)); } } else /* function */ { register struct Function * f = &(((CordRep *)x) -> function); register size_t j; for (j = i; ; j--) { if ((*f1)((*(f -> fn))(j, f -> client_data), client_data)) { return(1); } if (j == 0) return(0); } } } int CORD_riter(CORD x, CORD_iter_fn f1, void * client_data) { return(CORD_riter4(x, CORD_len(x) - 1, f1, client_data)); } /* * The following functions are concerned with balancing cords. * Strategy: * Scan the cord from left to right, keeping the cord scanned so far * as a forest of balanced trees of exponentialy decreasing length. * When a new subtree needs to be added to the forest, we concatenate all * shorter ones to the new tree in the appropriate order, and then insert * the result into the forest. * Crucial invariants: * 1. The concatenation of the forest (in decreasing order) with the * unscanned part of the rope is equal to the rope being balanced. * 2. All trees in the forest are balanced. * 3. forest[i] has depth at most i. */ typedef struct { CORD c; size_t len; /* Actual length of c */ } ForestElement; static size_t min_len [ MAX_DEPTH ]; static int min_len_init = 0; int CORD_max_len; typedef ForestElement Forest [ MAX_DEPTH ]; /* forest[i].len >= fib(i+1) */ /* The string is the concatenation */ /* of the forest in order of DECREASING */ /* indices. */ void CORD_init_min_len() { register int i; register size_t last, previous, current; min_len[0] = previous = 1; min_len[1] = last = 2; for (i = 2; i < MAX_DEPTH; i++) { current = last + previous; if (current < last) /* overflow */ current = last; min_len[i] = current; previous = last; last = current; } CORD_max_len = last - 1; min_len_init = 1; } void CORD_init_forest(ForestElement * forest, size_t max_len) { register int i; for (i = 0; i < MAX_DEPTH; i++) { forest[i].c = 0; if (min_len[i] > max_len) return; } ABORT("Cord too long"); } /* Add a leaf to the appropriate level in the forest, cleaning */ /* out lower levels as necessary. */ /* Also works if x is a balanced tree of concatenations; however */ /* in this case an extra concatenation node may be inserted above x; */ /* This node should not be counted in the statement of the invariants. */ void CORD_add_forest(ForestElement * forest, CORD x, size_t len) { register int i = 0; register CORD sum = CORD_EMPTY; register size_t sum_len = 0; while (len > min_len[i + 1]) { if (forest[i].c != 0) { sum = CORD_cat(forest[i].c, sum); sum_len += forest[i].len; forest[i].c = 0; } i++; } /* Sum has depth at most 1 greter than what would be required */ /* for balance. */ sum = CORD_cat(sum, x); sum_len += len; /* If x was a leaf, then sum is now balanced. To see this */ /* consider the two cases in which forest[i-1] either is or is */ /* not empty. */ while (sum_len >= min_len[i]) { if (forest[i].c != 0) { sum = CORD_cat(forest[i].c, sum); sum_len += forest[i].len; /* This is again balanced, since sum was balanced, and has */ /* allowable depth that differs from i by at most 1. */ forest[i].c = 0; } i++; } i--; forest[i].c = sum; forest[i].len = sum_len; } CORD CORD_concat_forest(ForestElement * forest, size_t expected_len) { register int i = 0; CORD sum = 0; size_t sum_len = 0; while (sum_len != expected_len) { if (forest[i].c != 0) { sum = CORD_cat(forest[i].c, sum); sum_len += forest[i].len; } i++; } return(sum); } /* Insert the frontier of x into forest. Balanced subtrees are */ /* treated as leaves. This potentially adds one to the depth */ /* of the final tree. */ void CORD_balance_insert(CORD x, size_t len, ForestElement * forest) { register int depth; if (CORD_IS_STRING(x)) { CORD_add_forest(forest, x, len); } else if (IS_CONCATENATION(x) && ((depth = DEPTH(x)) >= MAX_DEPTH || len < min_len[depth])) { register struct Concatenation * conc = &(((CordRep *)x) -> concatenation); size_t left_len = LEFT_LEN(conc); CORD_balance_insert(conc -> left, left_len, forest); CORD_balance_insert(conc -> right, len - left_len, forest); } else /* function or balanced */ { CORD_add_forest(forest, x, len); } } CORD CORD_balance(CORD x) { Forest forest; register size_t len; if (x == 0) return(0); if (CORD_IS_STRING(x)) return(x); if (!min_len_init) CORD_init_min_len(); len = LEN(x); CORD_init_forest(forest, len); CORD_balance_insert(x, len, forest); return(CORD_concat_forest(forest, len)); } /* Position primitives */ /* Private routines to deal with the hard cases only: */ /* P contains a prefix of the path to cur_pos. Extend it to a full */ /* path and set up leaf info. */ /* Return 0 if past the end of cord, 1 o.w. */ void CORD__extend_path(register CORD_pos p) { register struct CORD_pe * current_pe = &(p[0].path[p[0].path_len]); register CORD top = current_pe -> pe_cord; register size_t pos = p[0].cur_pos; register size_t top_pos = current_pe -> pe_start_pos; register size_t top_len = GEN_LEN(top); /* Fill in the rest of the path. */ while(!CORD_IS_STRING(top) && IS_CONCATENATION(top)) { register struct Concatenation * conc = &(((CordRep *)top) -> concatenation); register size_t left_len; left_len = LEFT_LEN(conc); current_pe++; if (pos >= top_pos + left_len) { current_pe -> pe_cord = top = conc -> right; current_pe -> pe_start_pos = top_pos = top_pos + left_len; top_len -= left_len; } else { current_pe -> pe_cord = top = conc -> left; current_pe -> pe_start_pos = top_pos; top_len = left_len; } p[0].path_len++; } /* Fill in leaf description for fast access. */ if (CORD_IS_STRING(top)) { p[0].cur_leaf = top; p[0].cur_start = top_pos; p[0].cur_end = top_pos + top_len; } else { p[0].cur_end = 0; } if (pos >= top_pos + top_len) p[0].path_len = CORD_POS_INVALID; } char CORD__pos_fetch(register CORD_pos p) { /* Leaf is a function node */ struct CORD_pe * pe = &((p)[0].path[(p)[0].path_len]); CORD leaf = pe -> pe_cord; register struct Function * f = &(((CordRep *)leaf) -> function); if (!IS_FUNCTION(leaf)) ABORT("CORD_pos_fetch: bad leaf"); return ((*(f -> fn))(p[0].cur_pos - pe -> pe_start_pos, f -> client_data)); } void CORD__next(register CORD_pos p) { register size_t cur_pos = p[0].cur_pos + 1; register struct CORD_pe * current_pe = &((p)[0].path[(p)[0].path_len]); register CORD leaf = current_pe -> pe_cord; /* Leaf is not a string or we're at end of leaf */ p[0].cur_pos = cur_pos; if (!CORD_IS_STRING(leaf)) { /* Function leaf */ register struct Function * f = &(((CordRep *)leaf) -> function); register size_t start_pos = current_pe -> pe_start_pos; register size_t end_pos = start_pos + f -> len; if (cur_pos < end_pos) { /* Fill cache and return. */ register size_t i; register size_t limit = cur_pos + FUNCTION_BUF_SZ; register CORD_fn fn = f -> fn; register void * client_data = f -> client_data; if (limit > end_pos) { limit = end_pos; } for (i = cur_pos; i < limit; i++) { p[0].function_buf[i - cur_pos] = (*fn)(i - start_pos, client_data); } p[0].cur_start = cur_pos; p[0].cur_leaf = p[0].function_buf; p[0].cur_end = limit; return; } } /* End of leaf */ /* Pop the stack until we find two concatenation nodes with the */ /* same start position: this implies we were in left part. */ { while (p[0].path_len > 0 && current_pe[0].pe_start_pos != current_pe[-1].pe_start_pos) { p[0].path_len--; current_pe--; } if (p[0].path_len == 0) { p[0].path_len = CORD_POS_INVALID; return; } } p[0].path_len--; CORD__extend_path(p); } void CORD__prev(register CORD_pos p) { register struct CORD_pe * pe = &(p[0].path[p[0].path_len]); if (p[0].cur_pos == 0) { p[0].path_len = CORD_POS_INVALID; return; } p[0].cur_pos--; if (p[0].cur_pos >= pe -> pe_start_pos) return; /* Beginning of leaf */ /* Pop the stack until we find two concatenation nodes with the */ /* different start position: this implies we were in right part. */ { register struct CORD_pe * current_pe = &((p)[0].path[(p)[0].path_len]); while (p[0].path_len > 0 && current_pe[0].pe_start_pos == current_pe[-1].pe_start_pos) { p[0].path_len--; current_pe--; } } p[0].path_len--; CORD__extend_path(p); } #undef CORD_pos_fetch #undef CORD_next #undef CORD_prev #undef CORD_pos_to_index #undef CORD_pos_to_cord #undef CORD_pos_valid char CORD_pos_fetch(register CORD_pos p) { if (p[0].cur_start <= p[0].cur_pos && p[0].cur_pos < p[0].cur_end) { return(p[0].cur_leaf[p[0].cur_pos - p[0].cur_start]); } else { return(CORD__pos_fetch(p)); } } void CORD_next(CORD_pos p) { if (p[0].cur_pos < p[0].cur_end - 1) { p[0].cur_pos++; } else { CORD__next(p); } } void CORD_prev(CORD_pos p) { if (p[0].cur_end != 0 && p[0].cur_pos > p[0].cur_start) { p[0].cur_pos--; } else { CORD__prev(p); } } size_t CORD_pos_to_index(CORD_pos p) { return(p[0].cur_pos); } CORD CORD_pos_to_cord(CORD_pos p) { return(p[0].path[0].pe_cord); } int CORD_pos_valid(CORD_pos p) { return(p[0].path_len != CORD_POS_INVALID); } void CORD_set_pos(CORD_pos p, CORD x, size_t i) { if (x == CORD_EMPTY) { p[0].path_len = CORD_POS_INVALID; return; } p[0].path[0].pe_cord = x; p[0].path[0].pe_start_pos = 0; p[0].path_len = 0; p[0].cur_pos = i; CORD__extend_path(p); } parser-3.5.1/src/lib/cord/Makefile.in0000644000076400007640000005554014740273415014316 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/cord ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcord_la_LIBADD = am_libcord_la_OBJECTS = cordbscs.lo cordxtra.lo libcord_la_OBJECTS = $(am_libcord_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/cordbscs.Plo \ ./$(DEPDIR)/cordxtra.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcord_la_SOURCES) DIST_SOURCES = $(libcord_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libcord.la libcord_la_SOURCES = cordbscs.c cordxtra.c EXTRA_DIST = cord.vcproj source.url SUBDIRS = include all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/cord/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/cord/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libcord.la: $(libcord_la_OBJECTS) $(libcord_la_DEPENDENCIES) $(EXTRA_libcord_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libcord_la_OBJECTS) $(libcord_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cordbscs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cordxtra.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/cordbscs.Plo -rm -f ./$(DEPDIR)/cordxtra.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/cordbscs.Plo -rm -f ./$(DEPDIR)/cordxtra.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/cord/Makefile.am0000644000076400007640000000020313211622356014261 00000000000000noinst_LTLIBRARIES = libcord.la libcord_la_SOURCES = cordbscs.c cordxtra.c EXTRA_DIST = cord.vcproj source.url SUBDIRS = include parser-3.5.1/src/lib/cord/cordxtra.c0000644000076400007640000003005013765777453014251 00000000000000/* * Copyright (c) 1993-1994 by Xerox Corporation. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. * * Author: Hans-J. Boehm (boehm@parc.xerox.com) */ /* * These are functions on cords that do not need to understand their * implementation. They serve also serve as example client code for * cord_basics. */ /* Boehm, December 8, 1995 1:53 pm PST */ #include "pa_config_includes.h" #include "include/cord.h" #include "include/ec.h" # define I_HIDE_POINTERS /* So we get access to allocation lock. */ /* We use this for lazy file reading, */ /* so that we remain independent */ /* of the threads primitives. */ /* For now we assume that pointer reads and writes are atomic, */ /* i.e. another thread always sees the state before or after */ /* a write. This might be false on a Motorola M68K with */ /* pointers that are not 32-bit aligned. But there probably */ /* aren't too many threads packages running on those. */ # define ATOMIC_WRITE(x,y) (x) = (y) # define ATOMIC_READ(x) (*(x)) /* The standard says these are in stdio.h, but they aren't always: */ # ifndef SEEK_SET # define SEEK_SET 0 # endif # ifndef SEEK_END # define SEEK_END 2 # endif # define BUFSZ 2048 /* Size of stack allocated buffers when */ /* we want large buffers. */ typedef void (* oom_fn)(void); # define OUT_OF_MEMORY { if (CORD_oom_fn != (oom_fn) 0) (*CORD_oom_fn)(); \ ABORT("Out of memory\n"); } # define ABORT(msg) { fprintf(stderr, "%s\n", msg); abort(); } CORD CORD_cat_char(CORD x, char c) { register char * string; if (c == '\0') return(CORD_cat(x, CORD_nul(1))); string = GC_MALLOC_ATOMIC(2); if (string == 0) OUT_OF_MEMORY; string[0] = c; string[1] = '\0'; return(CORD_cat_char_star(x, string, 1)); } CORD CORD_catn(int nargs, ...) { register CORD result = CORD_EMPTY; va_list args; register int i; va_start(args, nargs); for (i = 0; i < nargs; i++) { register CORD next = va_arg(args, CORD); result = CORD_cat(result, next); } va_end(args); return(result); } typedef struct { size_t len; size_t count; char * buf; } CORD_fill_data; int CORD_fill_proc(char c, void * client_data) { register CORD_fill_data * d = (CORD_fill_data *)client_data; register size_t count = d -> count; (d -> buf)[count] = c; d -> count = ++count; if (count >= d -> len) { return(1); } else { return(0); } } int CORD_batched_fill_proc(const char* s, void * client_data) { register CORD_fill_data * d = (CORD_fill_data *)client_data; register size_t count = d -> count; register size_t max = d -> len; register char * buf = d -> buf; register const char* t = s; while((buf[count] = *t++) != '\0') { count++; if (count >= max) { d -> count = count; return(1); } } d -> count = count; return(0); } /* Fill buf with len characters starting at i. */ /* Assumes len characters are available. */ void CORD_fill_buf(CORD x, size_t i, size_t len, char * buf) { CORD_fill_data fd; fd.len = len; fd.buf = buf; fd.count = 0; (void)CORD_iter5(x, i, CORD_fill_proc, CORD_batched_fill_proc, &fd); } int CORD_cmp(CORD x, CORD y) { CORD_pos xpos; CORD_pos ypos; register size_t avail, yavail; if (y == CORD_EMPTY) return(x != CORD_EMPTY); if (x == CORD_EMPTY) return(-1); if (x == y) return (0); if (CORD_IS_STRING(y) && CORD_IS_STRING(x)) return(strcmp(x,y)); CORD_set_pos(xpos, x, 0); CORD_set_pos(ypos, y, 0); for(;;) { if (!CORD_pos_valid(xpos)) { if (CORD_pos_valid(ypos)) { return(-1); } else { return(0); } } if (!CORD_pos_valid(ypos)) { return(1); } if ((avail = CORD_pos_chars_left(xpos)) <= 0 || (yavail = CORD_pos_chars_left(ypos)) <= 0) { register char xcurrent = CORD_pos_fetch(xpos); register char ycurrent = CORD_pos_fetch(ypos); if (xcurrent != ycurrent) return(xcurrent - ycurrent); CORD_next(xpos); CORD_next(ypos); } else { /* process as many characters as we can */ register int result; if (avail > yavail) avail = yavail; result = strncmp(CORD_pos_cur_char_addr(xpos), CORD_pos_cur_char_addr(ypos), avail); if (result != 0) return(result); CORD_pos_advance(xpos, avail); CORD_pos_advance(ypos, avail); } } } int CORD_ncmp(CORD x, size_t x_start, CORD y, size_t y_start, size_t len) { CORD_pos xpos; CORD_pos ypos; register size_t count; register long avail, yavail; CORD_set_pos(xpos, x, x_start); CORD_set_pos(ypos, y, y_start); for(count = 0; count < len;) { if (!CORD_pos_valid(xpos)) { if (CORD_pos_valid(ypos)) { return(-1); } else { return(0); } } if (!CORD_pos_valid(ypos)) { return(1); } if ((avail = CORD_pos_chars_left(xpos)) <= 0 || (yavail = CORD_pos_chars_left(ypos)) <= 0) { register char xcurrent = CORD_pos_fetch(xpos); register char ycurrent = CORD_pos_fetch(ypos); if (xcurrent != ycurrent) return(xcurrent - ycurrent); CORD_next(xpos); CORD_next(ypos); count++; } else { /* process as many characters as we can */ register int result; if (avail > yavail) avail = yavail; count += avail; if (count > len) avail -= (count - len); result = strncmp(CORD_pos_cur_char_addr(xpos), CORD_pos_cur_char_addr(ypos), (size_t)avail); if (result != 0) return(result); CORD_pos_advance(xpos, (size_t)avail); CORD_pos_advance(ypos, (size_t)avail); } } return(0); } char * CORD_to_char_star(CORD x, size_t len) { char * result; if(0 == len) len = CORD_len(x); result = GC_MALLOC_ATOMIC(len + 1); if (result == 0) OUT_OF_MEMORY; CORD_fill_buf(x, 0, len, result); result[len] = '\0'; return(result); } CORD CORD_from_char_star(const char* s) { char * result; size_t len = strlen(s); if (0 == len) return(CORD_EMPTY); result = GC_MALLOC_ATOMIC(len + 1); if (result == 0) OUT_OF_MEMORY; memcpy(result, s, len+1); return(result); } const char* CORD_to_const_char_star(CORD x, size_t len) { if (x == 0) return(""); if (CORD_IS_STRING(x)) return((const char* )x); return(CORD_to_char_star(x, len)); } char CORD_fetch(CORD x, size_t i) { CORD_pos xpos; CORD_set_pos(xpos, x, i); if (!CORD_pos_valid(xpos)) ABORT("bad index?"); return(CORD_pos_fetch(xpos)); } int CORD_put_proc(char c, void * client_data) { register FILE * f = (FILE *)client_data; return(putc(c, f) == EOF); } int CORD_batched_put_proc(const char* s, void * client_data) { register FILE * f = (FILE *)client_data; return(fputs(s, f) == EOF); } int CORD_put(CORD x, FILE * f) { if (CORD_iter5(x, 0, CORD_put_proc, CORD_batched_put_proc, f)) { return(EOF); } else { return(1); } } typedef struct { size_t pos; /* Current position in the cord */ char target; /* Character we're looking for */ } chr_data; int CORD_chr_proc(char c, void * client_data) { register chr_data * d = (chr_data *)client_data; if (c == d -> target) return(1); (d -> pos) ++; return(0); } int CORD_rchr_proc(char c, void * client_data) { register chr_data * d = (chr_data *)client_data; if (c == d -> target) return(1); (d -> pos) --; return(0); } int CORD_batched_chr_proc(const char* s, void * client_data) { register chr_data * d = (chr_data *)client_data; register char * occ = strchr(s, d -> target); if (occ == 0) { d -> pos += strlen(s); return(0); } else { d -> pos += occ - s; return(1); } } size_t CORD_chr(CORD x, size_t i, int c) { chr_data d; d.pos = i; d.target = c; if (CORD_iter5(x, i, CORD_chr_proc, CORD_batched_chr_proc, &d)) { return(d.pos); } else { return(CORD_NOT_FOUND); } } size_t CORD_rchr(CORD x, size_t i, int c) { chr_data d; d.pos = i; d.target = c; if (CORD_riter4(x, i, CORD_rchr_proc, &d)) { return(d.pos); } else { return(CORD_NOT_FOUND); } } /* Find the first occurrence of s in x at position start or later. */ /* This uses an asymptotically poor algorithm, which should typically */ /* perform acceptably. We compare the first few characters directly, */ /* and call CORD_ncmp whenever there is a partial match. */ /* This has the advantage that we allocate very little, or not at all. */ /* It's very fast if there are few close misses. */ size_t CORD_str(CORD x, size_t start, CORD s, size_t xlen) { CORD_pos xpos; size_t slen; register size_t start_len; const char* s_start; unsigned long s_buf = 0; /* The first few characters of s */ unsigned long x_buf = 0; /* Start of candidate substring. */ /* Initialized only to make compilers */ /* happy. */ unsigned long mask = 0; register size_t i; register size_t match_pos; if (s == CORD_EMPTY) return(start); if (CORD_IS_STRING(s)) { s_start = s; slen = strlen(s); } else { s_start = CORD_to_char_star(CORD_substr(s, 0, sizeof(unsigned long), 0), 0); slen = CORD_len(s); } if (xlen < start || xlen - start < slen) return(CORD_NOT_FOUND); start_len = slen; if (start_len > sizeof(unsigned long)) start_len = sizeof(unsigned long); CORD_set_pos(xpos, x, start); for (i = 0; i < start_len; i++) { mask <<= 8; mask |= 0xff; s_buf <<= 8; s_buf |= (unsigned char)s_start[i]; x_buf <<= 8; x_buf |= (unsigned char)CORD_pos_fetch(xpos); CORD_next(xpos); } for (match_pos = start; ; match_pos++) { if ((x_buf & mask) == s_buf) { if (slen == start_len || CORD_ncmp(x, match_pos + start_len, s, start_len, slen - start_len) == 0) { return(match_pos); } } if ( match_pos == xlen - slen ) { return(CORD_NOT_FOUND); } x_buf <<= 8; x_buf |= (unsigned char)CORD_pos_fetch(xpos); CORD_next(xpos); } } void CORD_ec_flush_buf(CORD_ec x) { register size_t len = x[0].ec_bufptr - x[0].ec_buf; char * s; if (len == 0) return; s = GC_MALLOC_ATOMIC(len+1); if (s == 0) OUT_OF_MEMORY; memcpy(s, x[0].ec_buf, len); s[len] = '\0'; x[0].ec_cord = CORD_cat_char_star(x[0].ec_cord, s, len); x[0].ec_bufptr = x[0].ec_buf; } void CORD_ec_append_cord(CORD_ec x, CORD s) { CORD_ec_flush_buf(x); x[0].ec_cord = CORD_cat(x[0].ec_cord, s); } /*ARGSUSED*/ char CORD_nul_func(size_t i, void * client_data) { return((char)(unsigned long)client_data); } #ifdef CORD_CHARS_CACHE static char* cord_chars_cache[256][15]={0}; #endif CORD CORD_chars(char c, size_t i) { if (i>0 && i<16 /* SHORT_LIMIT */) { register char* result; #ifdef CORD_CHARS_CACHE if(cord_chars_cache[(unsigned char)c][i]) return((CORD) cord_chars_cache[(unsigned char)c][i]); #endif result=GC_MALLOC_ATOMIC(i+1); if(result==0) OUT_OF_MEMORY; memset(result, c, i); result[i] = '\0'; #ifdef CORD_CHARS_CACHE cord_chars_cache[(unsigned char)c][i]=result; #endif return((CORD) result); } else { return(CORD_from_fn(CORD_nul_func, (void *)(unsigned long)c, i)); } } parser-3.5.1/src/lib/cord/source.url0000644000076400007640000000013307707741612014265 00000000000000[InternetShortcut] URL=http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.1.tar.gz parser-3.5.1/src/lib/cord/cord.vcproj0000644000076400007640000001073713622760245014424 00000000000000 parser-3.5.1/src/lib/json/0000755000076400007640000000000014740300546012336 500000000000000parser-3.5.1/src/lib/json/json.vcproj0000644000076400007640000000760513622760245014470 00000000000000 parser-3.5.1/src/lib/json/pa_json.h0000644000076400007640000000754512532437741014100 00000000000000/* * Copyright (C) 2009-2011 Vincent Hanquez * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; version 2.1 or version 3.0 only. * * 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. */ #ifndef JSON_H #define JSON_H #include "pa_config_includes.h" #ifdef __cplusplus extern "C" { #endif typedef enum { JSON_NONE, JSON_ARRAY_BEGIN, JSON_OBJECT_BEGIN, JSON_ARRAY_END, JSON_OBJECT_END, JSON_INT, JSON_FLOAT, JSON_STRING, JSON_KEY, JSON_TRUE, JSON_FALSE, JSON_NULL } json_type; typedef enum { /* SUCCESS = 0 */ /* running out of memory */ JSON_ERROR_NO_MEMORY = 1, /* character < 32, except space newline tab */ JSON_ERROR_BAD_CHAR, /* trying to pop more object/array than pushed on the stack */ JSON_ERROR_POP_EMPTY, /* trying to pop wrong type of mode. popping array in object mode, vice versa */ JSON_ERROR_POP_UNEXPECTED_MODE, /* reach nesting limit on stack */ JSON_ERROR_NESTING_LIMIT, /* reach data limit on buffer */ JSON_ERROR_DATA_LIMIT, /* comment are not allowed with current configuration */ JSON_ERROR_COMMENT_NOT_ALLOWED, /* unexpected char in the current parser context */ JSON_ERROR_UNEXPECTED_CHAR, /* unicode low surrogate missing after high surrogate */ JSON_ERROR_UNICODE_MISSING_LOW_SURROGATE, /* unicode low surrogate missing without previous high surrogate */ JSON_ERROR_UNICODE_UNEXPECTED_LOW_SURROGATE, /* found a comma not in structure (array/object) */ JSON_ERROR_COMMA_OUT_OF_STRUCTURE, /* callback returns error */ JSON_ERROR_CALLBACK } json_error; #define LIBJSON_DEFAULT_STACK_SIZE 256 #define LIBJSON_DEFAULT_BUFFER_SIZE 4096 typedef int (*json_parser_callback)(void *userdata, int type, const char *data, uint32_t length); typedef struct { uint32_t buffer_initial_size; uint32_t max_nesting; uint32_t max_data; int allow_c_comments; int allow_yaml_comments; void * (*user_malloc)(size_t size); void * (*user_realloc)(void *ptr, size_t size); void (*user_free)(void *ptr); } json_config; typedef struct json_parser { json_config config; /* SAJ callback */ json_parser_callback callback; void *userdata; /* parser state */ uint8_t state; uint8_t save_state; uint8_t expecting_key; uint16_t unicode_multi; json_type type; /* state stack */ uint8_t *stack; uint32_t stack_offset; uint32_t stack_size; /* parse buffer */ char *buffer; uint32_t buffer_size; uint32_t buffer_offset; } json_parser; /** json_parser_init initialize a parser structure taking a config, * a config and its userdata. * return JSON_ERROR_NO_MEMORY if memory allocation failed or SUCCESS. */ int json_parser_init(json_parser *parser, json_config *cfg, json_parser_callback callback, void *userdata); /** json_parser_free freed memory structure allocated by the parser */ int json_parser_free(json_parser *parser); /** json_parser_string append a string s with a specific length to the parser * return 0 if everything went ok, a JSON_ERROR_* otherwise. * the user can supplied a valid processed pointer that will * be fill with the number of processed characters before returning */ int json_parser_string(json_parser *parser, const char *string, uint32_t length, uint32_t *processed); /** json_parser_char append one single char to the parser * return 0 if everything went ok, a JSON_ERROR_* otherwise */ int json_parser_char(json_parser *parser, unsigned char next_char); /** json_parser_is_done return 0 is the parser isn't in a finish state. !0 if it is */ int json_parser_is_done(json_parser *parser); #ifdef __cplusplus } #endif #endif /* JSON_H */ parser-3.5.1/src/lib/json/Makefile.in0000644000076400007640000004504514740273415014337 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/json ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libjson_la_LIBADD = am_libjson_la_OBJECTS = pa_json.lo libjson_la_OBJECTS = $(am_libjson_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/pa_json.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libjson_la_SOURCES) DIST_SOURCES = $(libjson_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = pa_json.h noinst_LTLIBRARIES = libjson.la libjson_la_SOURCES = pa_json.C EXTRA_DIST = json.vcproj all: all-am .SUFFIXES: .SUFFIXES: .C .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/json/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/json/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libjson.la: $(libjson_la_OBJECTS) $(libjson_la_DEPENDENCIES) $(EXTRA_libjson_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libjson_la_OBJECTS) $(libjson_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pa_json.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .C.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .C.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .C.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/pa_json.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/pa_json.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/src/lib/json/Makefile.am0000644000076400007640000000016413211622356014311 00000000000000noinst_HEADERS = pa_json.h noinst_LTLIBRARIES = libjson.la libjson_la_SOURCES = pa_json.C EXTRA_DIST = json.vcproj parser-3.5.1/src/lib/json/pa_json.C0000644000076400007640000007035613030271207014016 00000000000000/* * Copyright (C) 2009-2011 Vincent Hanquez * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; version 2.1 or version 3.0 only. * * 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. */ /* * the class, states and state transition tables has been inspired by the JSON_parser.c * available at http://json.org, but are quite different on the way that the * parser handles its parse buffer and contains significant differences that affect * the JSON compliance. */ #include "pa_json.h" enum classes { C_SPACE, /* space */ C_NL, /* newline */ C_WHITE, /* tab, CR */ C_LCURB, C_RCURB, /* object opening/closing */ C_LSQRB, C_RSQRB, /* array opening/closing */ /* syntax symbols */ C_COLON, C_COMMA, C_QUOTE, /* " */ C_BACKS, /* \ */ C_SLASH, /* / */ C_PLUS, C_MINUS, C_DOT, C_ZERO, C_DIGIT, /* digits */ C_a, C_b, C_c, C_d, C_e, C_f, C_l, C_n, C_r, C_s, C_t, C_u, /* nocaps letters */ C_ABCDF, C_E, /* caps letters */ C_OTHER, /* all other */ C_STAR, /* star in C style comment */ C_HASH, /* # for YAML comment */ C_ERROR = 0xfe, }; /* map from character < 128 to classes. from 128 to 256 all C_OTHER */ static uint8_t character_class[128] = { C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_WHITE, C_NL, C_ERROR, C_ERROR, C_WHITE, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_ERROR, C_SPACE, C_OTHER, C_QUOTE, C_HASH, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_STAR, C_PLUS, C_COMMA, C_MINUS, C_DOT, C_SLASH, C_ZERO, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_DIGIT, C_COLON, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_ABCDF, C_ABCDF, C_ABCDF, C_ABCDF, C_E, C_ABCDF, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_LSQRB, C_BACKS, C_RSQRB, C_OTHER, C_OTHER, C_OTHER, C_a, C_b, C_c, C_d, C_e, C_f, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_l, C_OTHER, C_n, C_OTHER, C_OTHER, C_OTHER, C_r, C_s, C_t, C_u, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_OTHER, C_LCURB, C_OTHER, C_RCURB, C_OTHER, C_OTHER }; /* define all states and actions that will be taken on each transition. * * states are defined first because of the fact they are use as index in the * transitions table. they usually contains either a number or a prefix _ * for simple state like string, object, value ... * * actions are defined starting from 0x80. state error is defined as 0xff */ enum states { STATE_GO, /* start */ STATE_OK, /* ok */ STATE_OO, /* object */ STATE_KK, /* key */ STATE_CO, /* colon */ STATE_VV, /* value */ STATE_AA, /* array */ STATE_SS, /* string */ STATE_E0, /* escape */ STATE_U1, STATE_U2, STATE_U3, STATE_U4, /* unicode states */ STATE_M0, STATE_Z0, STATE_I0, /* number states */ STATE_R1, STATE_R2, /* real states (after-dot digits) */ STATE_X1, STATE_X2, STATE_X3, /* exponant states */ STATE_T1, STATE_T2, STATE_T3, /* true constant states */ STATE_F1, STATE_F2, STATE_F3, STATE_F4, /* false constant states */ STATE_N1, STATE_N2, STATE_N3, /* null constant states */ STATE_C1, STATE_C2, STATE_C3, /* C-comment states */ STATE_Y1, /* YAML-comment state */ STATE_D1, STATE_D2, /* multi unicode states */ }; /* the following are actions that need to be taken */ enum actions { STATE_KS = 0x80, /* key separator */ STATE_SP, /* comma separator */ STATE_AB, /* array begin */ STATE_AE, /* array ending */ STATE_OB, /* object begin */ STATE_OE, /* object end */ STATE_CB, /* C-comment begin */ STATE_YB, /* YAML-comment begin */ STATE_CE, /* YAML/C comment end */ STATE_FA, /* false */ STATE_TR, /* true */ STATE_NU, /* null */ STATE_DE, /* double detected by exponent */ STATE_DF, /* double detected by . */ STATE_SE, /* string end */ STATE_MX, /* integer detected by minus */ STATE_ZX, /* integer detected by zero */ STATE_IX, /* integer detected by 1-9 */ STATE_UC, /* Unicode character read */ }; /* some compilers have the following names defined */ #undef _C2 #undef ST_ #undef PT_ /* error state */ #define STATE___ 0xff #define NR_STATES (STATE_D2 + 1) #define NR_CLASSES (C_HASH + 1) #define IS_STATE_ACTION(s) ((s) & 0x80) #define ST_(x) STATE##x #define PT_(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a1,b1,c1,d1,e1,f1,g1,h1) \ { ST_(a),ST_(b),ST_(c),ST_(d),ST_(e),ST_(f),ST_(g),ST_(h),ST_(i),ST_(j),ST_(k),ST_(l),ST_(m),ST_(n), \ ST_(o),ST_(p),ST_(q),ST_(r),ST_(s),ST_(t),ST_(u),ST_(v),ST_(w),ST_(x),ST_(y),ST_(z),ST_(a1),ST_(b1), \ ST_(c1),ST_(d1),ST_(e1),ST_(f1),ST_(g1),ST_(h1) } /* map from the (previous state+new character class) to the next parser transition */ static const uint8_t state_transition_table[NR_STATES][NR_CLASSES] = { /* white ABCDF other */ /* sp nl | { } [ ] : , " \ / + - . 0 19 a b c d e f l n r s t u | E | * # */ /*GO*/ PT_(_GO,_GO,_GO,_OB,___,_AB,___,___,___,___,___,_CB,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_YB), /*OK*/ PT_(_OK,_OK,_OK,___,_OE,___,_AE,___,_SP,___,___,_CB,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_YB), /*OO*/ PT_(_OO,_OO,_OO,___,_OE,___,___,___,___,_SS,___,_CB,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_YB), /*KK*/ PT_(_KK,_KK,_KK,___,___,___,___,___,___,_SS,___,_CB,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_YB), /*CO*/ PT_(_CO,_CO,_CO,___,___,___,___,_KS,___,___,___,_CB,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_YB), /*VV*/ PT_(_VV,_VV,_VV,_OB,___,_AB,___,___,___,_SS,___,_CB,___,_MX,___,_ZX,_IX,___,___,___,___,___,_F1,___,_N1,___,___,_T1,___,___,___,___,___,_YB), /*AA*/ PT_(_AA,_AA,_AA,_OB,___,_AB,_AE,___,___,_SS,___,_CB,___,_MX,___,_ZX,_IX,___,___,___,___,___,_F1,___,_N1,___,___,_T1,___,___,___,___,___,_YB), /**************************************************************************************************************************************************/ /*SS*/ PT_(_SS,___,___,_SS,_SS,_SS,_SS,_SS,_SS,_SE,_E0,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS,_SS), /*E0*/ PT_(___,___,___,___,___,___,___,___,___,_SS,_SS,_SS,___,___,___,___,___,___,_SS,___,___,___,_SS,___,_SS,_SS,___,_SS,_U1,___,___,___,___,___), /*U1*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_U2,_U2,_U2,_U2,_U2,_U2,_U2,_U2,___,___,___,___,___,___,_U2,_U2,___,___,___), /*U2*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_U3,_U3,_U3,_U3,_U3,_U3,_U3,_U3,___,___,___,___,___,___,_U3,_U3,___,___,___), /*U3*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_U4,_U4,_U4,_U4,_U4,_U4,_U4,_U4,___,___,___,___,___,___,_U4,_U4,___,___,___), /*U4*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_UC,_UC,_UC,_UC,_UC,_UC,_UC,_UC,___,___,___,___,___,___,_UC,_UC,___,___,___), /**************************************************************************************************************************************************/ /*M0*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_Z0,_I0,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___), /*Z0*/ PT_(_OK,_OK,_OK,___,_OE,___,_AE,___,_SP,___,___,_CB,___,___,_DF,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_YB), /*I0*/ PT_(_OK,_OK,_OK,___,_OE,___,_AE,___,_SP,___,___,_CB,___,___,_DF,_I0,_I0,___,___,___,___,_DE,___,___,___,___,___,___,___,___,_DE,___,___,_YB), /*R1*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_R2,_R2,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___), /*R2*/ PT_(_OK,_OK,_OK,___,_OE,___,_AE,___,_SP,___,___,_CB,___,___,___,_R2,_R2,___,___,___,___,_X1,___,___,___,___,___,___,___,___,_X1,___,___,_YB), /*X1*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,_X2,_X2,___,_X3,_X3,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___), /*X2*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_X3,_X3,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___), /*X3*/ PT_(_OK,_OK,_OK,___,_OE,___,_AE,___,_SP,___,___,___,___,___,___,_X3,_X3,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___), /**************************************************************************************************************************************************/ /*T1*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_T2,___,___,___,___,___,___,___,___), /*T2*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_T3,___,___,___,___,___), /*T3*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_TR,___,___,___,___,___,___,___,___,___,___,___,___), /*F1*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_F2,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___), /*F2*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_F3,___,___,___,___,___,___,___,___,___,___), /*F3*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_F4,___,___,___,___,___,___,___), /*F4*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_FA,___,___,___,___,___,___,___,___,___,___,___,___), /*N1*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_N2,___,___,___,___,___), /*N2*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_N3,___,___,___,___,___,___,___,___,___,___), /*N3*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_NU,___,___,___,___,___,___,___,___,___,___), /**************************************************************************************************************************************************/ /*C1*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_C2,___), /*C2*/ PT_(_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C3,_C2), /*C3*/ PT_(_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_CE,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C2,_C3,_C2), /*Y1*/ PT_(_Y1,_CE,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1,_Y1), /*D1*/ PT_(___,___,___,___,___,___,___,___,___,___,_D2,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___), /*D2*/ PT_(___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,___,_U1,___,___,___,___,___), }; /* map from (previous state+new character class) to the buffer policy. ignore=0/append=1/escape=2 */ static const uint8_t buffer_policy_table[NR_STATES][NR_CLASSES] = { /* white ABCDF other */ /* sp nl | { } [ ] : , " \ / + - . 0 19 a b c d e f l n r s t u | E | * # */ /*GO*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*OK*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*OO*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*KK*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*CO*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*VV*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*AA*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /**************************************************************************************************************/ /*SS*/ { 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /*E0*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 2, 2, 0, 2, 0, 0, 0, 0, 0, 0 }, /*U1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0 }, /*U2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0 }, /*U3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0 }, /*U4*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0 }, /**************************************************************************************************************/ /*M0*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*Z0*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*I0*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, /*R1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*R2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, /*X1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*X2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*X3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /**************************************************************************************************************/ /*T1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*T2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*T3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*F1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*F2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*F3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*F4*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*N1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*N2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*N3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /**************************************************************************************************************/ /*C1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*C2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*C3*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*Y1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*D1*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /*D2*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }; #define MODE_ARRAY 0 #define MODE_OBJECT 1 #define parser_malloc(parser, s) parser->config.user_malloc(s) #define parser_realloc(parser, p, s) parser->config.user_realloc(p, s) #define parser_free(parser, p) parser->config.user_free(p) static int state_grow(json_parser *parser) { uint32_t newsize = parser->stack_size * 2; void *ptr; if (parser->config.max_nesting != 0) return JSON_ERROR_NESTING_LIMIT; ptr = parser_realloc(parser, parser->stack, newsize * sizeof(uint8_t)); if (!ptr) return JSON_ERROR_NO_MEMORY; parser->stack = (uint8_t *)ptr; parser->stack_size = newsize; return 0; } static int state_push(json_parser *parser, uint8_t mode) { if (parser->stack_offset >= parser->stack_size) { int ret = state_grow(parser); if (ret) return ret; } parser->stack[parser->stack_offset++] = mode; return 0; } static int state_pop(json_parser *parser, uint8_t mode) { if (parser->stack_offset == 0) return JSON_ERROR_POP_EMPTY; parser->stack_offset--; if (parser->stack[parser->stack_offset] != mode) return JSON_ERROR_POP_UNEXPECTED_MODE; return 0; } static int buffer_grow(json_parser *parser) { uint32_t newsize; void *ptr; uint32_t max = parser->config.max_data; if (max > 0 && parser->buffer_size == max) return JSON_ERROR_DATA_LIMIT; newsize = parser->buffer_size * 2; if (max > 0 && newsize > max) newsize = max; ptr = parser_realloc(parser, parser->buffer, newsize * sizeof(char)); if (!ptr) return JSON_ERROR_NO_MEMORY; parser->buffer = (char *)ptr; parser->buffer_size = newsize; return 0; } static int buffer_push(json_parser *parser, unsigned char c) { int ret; if (parser->buffer_offset + 1 >= parser->buffer_size) { ret = buffer_grow(parser); if (ret) return ret; } parser->buffer[parser->buffer_offset++] = c; return 0; } static int do_callback_withbuf(json_parser *parser, int type) { if (!parser->callback) return 0; parser->buffer[parser->buffer_offset] = '\0'; return (*parser->callback)(parser->userdata, type, parser->buffer, parser->buffer_offset); } static int do_callback(json_parser *parser, int type) { if (!parser->callback) return 0; return (*parser->callback)(parser->userdata, type, NULL, 0); } static int do_buffer(json_parser *parser) { int ret = 0; switch (parser->type) { case JSON_KEY: case JSON_STRING: case JSON_FLOAT: case JSON_INT: case JSON_NULL: case JSON_TRUE: case JSON_FALSE: ret = do_callback_withbuf(parser, parser->type); if (ret) return ret; break; default: break; } parser->buffer_offset = 0; return ret; } static const uint8_t hextable[] = { 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255, 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, }; #define hex(c) (hextable[(uint8_t) c]) /* high surrogate range from d800 to dbff */ /* low surrogate range dc00 to dfff */ #define IS_HIGH_SURROGATE(uc) (((uc) & 0xfc00) == 0xd800) #define IS_LOW_SURROGATE(uc) (((uc) & 0xfc00) == 0xdc00) /* transform an unicode [0-9A-Fa-f]{4} sequence into a proper value */ static int decode_unicode_char(json_parser *parser) { uint32_t uval; char *b = parser->buffer; uint32_t offset = parser->buffer_offset; uval = (hex(b[offset - 4]) << 12) | (hex(b[offset - 3]) << 8) | (hex(b[offset - 2]) << 4) | hex(b[offset - 1]); parser->buffer_offset -= 4; /* fast case */ if (!parser->unicode_multi && uval < 0x80) { b[parser->buffer_offset++] = (char) uval; return 0; } if (parser->unicode_multi) { if (!IS_LOW_SURROGATE(uval)) return JSON_ERROR_UNICODE_MISSING_LOW_SURROGATE; uval = 0x10000 + ((parser->unicode_multi & 0x3ff) << 10) + (uval & 0x3ff); b[parser->buffer_offset++] = (char) ((uval >> 18) | 0xf0); b[parser->buffer_offset++] = (char) (((uval >> 12) & 0x3f) | 0x80); b[parser->buffer_offset++] = (char) (((uval >> 6) & 0x3f) | 0x80); b[parser->buffer_offset++] = (char) ((uval & 0x3f) | 0x80); parser->unicode_multi = 0; return 0; } if (IS_LOW_SURROGATE(uval)) return JSON_ERROR_UNICODE_UNEXPECTED_LOW_SURROGATE; if (IS_HIGH_SURROGATE(uval)) { parser->unicode_multi = (uint16_t)uval; return 0; } if (uval < 0x800) { b[parser->buffer_offset++] = (char) ((uval >> 6) | 0xc0); b[parser->buffer_offset++] = (char) ((uval & 0x3f) | 0x80); } else { b[parser->buffer_offset++] = (char) ((uval >> 12) | 0xe0); b[parser->buffer_offset++] = (char) (((uval >> 6) & 0x3f) | 0x80); b[parser->buffer_offset++] = (char) (((uval >> 0) & 0x3f) | 0x80); } return 0; } static int buffer_push_escape(json_parser *parser, unsigned char next) { char c = '\0'; switch (next) { case 'b': c = '\b'; break; case 'f': c = '\f'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 't': c = '\t'; break; case '"': c = '"'; break; case '/': c = '/'; break; case '\\': c = '\\'; break; } /* push the escaped character */ return buffer_push(parser, c); } #define CHK(f) { ret = f; if (ret) return ret; } static int act_uc(json_parser *parser) { int ret; CHK(decode_unicode_char(parser)); parser->state = (uint8_t)((parser->unicode_multi) ? STATE_D1 : STATE_SS); return 0; } static int act_yb(json_parser *parser) { if (!parser->config.allow_yaml_comments) return JSON_ERROR_COMMENT_NOT_ALLOWED; parser->save_state = parser->state; return 0; } static int act_cb(json_parser *parser) { if (!parser->config.allow_c_comments) return JSON_ERROR_COMMENT_NOT_ALLOWED; parser->save_state = parser->state; return 0; } static int act_ce(json_parser *parser) { parser->state = (parser->save_state > STATE_AA) ? (uint8_t)(STATE_OK) : (uint8_t)(parser->save_state); return 0; } static int act_ob(json_parser *parser) { int ret; CHK(do_callback(parser, JSON_OBJECT_BEGIN)); CHK(state_push(parser, MODE_OBJECT)); parser->expecting_key = 1; return 0; } static int act_oe(json_parser *parser) { int ret; CHK(state_pop(parser, MODE_OBJECT)); CHK(do_callback(parser, JSON_OBJECT_END)); parser->expecting_key = 0; return 0; } static int act_ab(json_parser *parser) { int ret; CHK(do_callback(parser, JSON_ARRAY_BEGIN)); CHK(state_push(parser, MODE_ARRAY)); return 0; } static int act_ae(json_parser *parser) { int ret; CHK(state_pop(parser, MODE_ARRAY)); CHK(do_callback(parser, JSON_ARRAY_END)); return 0; } static int act_se(json_parser *parser) { int ret; CHK(do_callback_withbuf(parser, (parser->expecting_key) ? JSON_KEY : JSON_STRING)); parser->buffer_offset = 0; parser->state = (uint8_t)((parser->expecting_key) ? STATE_CO : STATE_OK); parser->expecting_key = 0; return 0; } static int act_sp(json_parser *parser) { if (parser->stack_offset == 0) return JSON_ERROR_COMMA_OUT_OF_STRUCTURE; if (parser->stack[parser->stack_offset - 1] == MODE_OBJECT) { parser->expecting_key = 1; parser->state = STATE_KK; } else parser->state = STATE_VV; return 0; } struct action_descr { int (*call)(json_parser *parser); json_type type; uint8_t state; /* 0 if we let the callback set the value it want */ uint8_t dobuffer; }; static struct action_descr actions_map[] = { { NULL, JSON_NONE, STATE_VV, 0 }, /* KS */ { act_sp, JSON_NONE, 0, 1 }, /* SP */ { act_ab, JSON_NONE, STATE_AA, 0 }, /* AB */ { act_ae, JSON_NONE, STATE_OK, 1 }, /* AE */ { act_ob, JSON_NONE, STATE_OO, 0 }, /* OB */ { act_oe, JSON_NONE, STATE_OK, 1 }, /* OE */ { act_cb, JSON_NONE, STATE_C1, 1 }, /* CB */ { act_yb, JSON_NONE, STATE_Y1, 1 }, /* YB */ { act_ce, JSON_NONE, 0, 0 }, /* CE */ { NULL, JSON_FALSE, STATE_OK, 0 }, /* FA */ { NULL, JSON_TRUE, STATE_OK, 0 }, /* TR */ { NULL, JSON_NULL, STATE_OK, 0 }, /* NU */ { NULL, JSON_FLOAT, STATE_X1, 0 }, /* DE */ { NULL, JSON_FLOAT, STATE_R1, 0 }, /* DF */ { act_se, JSON_NONE, 0, 0 }, /* SE */ { NULL, JSON_INT, STATE_M0, 0 }, /* MX */ { NULL, JSON_INT, STATE_Z0, 0 }, /* ZX */ { NULL, JSON_INT, STATE_I0, 0 }, /* IX */ { act_uc, JSON_NONE, 0, 0 }, /* UC */ }; static int do_action(json_parser *parser, uint8_t next_state) { struct action_descr *descr = &actions_map[next_state & ~0x80]; if (descr->call) { int ret; if (descr->dobuffer) CHK(do_buffer(parser)); CHK((descr->call)(parser)); } if (descr->state) parser->state = descr->state; parser->type = descr->type; return 0; } /** json_parser_init initialize a parser structure taking a config, * a config and its userdata. * return JSON_ERROR_NO_MEMORY if memory allocation failed or SUCCESS. */ int json_parser_init(json_parser *parser, json_config *config, json_parser_callback callback, void *userdata) { memset(parser, 0, sizeof(*parser)); if (config) memcpy(&parser->config, config, sizeof(json_config)); parser->callback = callback; parser->userdata = userdata; /* initialise parsing stack and state */ parser->stack_offset = 0; parser->state = STATE_GO; /* initialize the parse stack */ parser->stack_size = (parser->config.max_nesting > 0) ? parser->config.max_nesting : LIBJSON_DEFAULT_STACK_SIZE; parser->stack = (uint8_t *)parser_malloc(parser, parser->stack_size * sizeof(parser->stack[0])); if (!parser->stack) return JSON_ERROR_NO_MEMORY; /* initialize the parse buffer */ parser->buffer_size = (parser->config.buffer_initial_size > 0) ? parser->config.buffer_initial_size : LIBJSON_DEFAULT_BUFFER_SIZE; if (parser->config.max_data > 0 && parser->buffer_size > parser->config.max_data) parser->buffer_size = parser->config.max_data; parser->buffer = (char *)parser_malloc(parser, parser->buffer_size * sizeof(char)); if (!parser->buffer) { parser_free(parser, parser->stack); return JSON_ERROR_NO_MEMORY; } return 0; } /** json_parser_free freed memory structure allocated by the parser */ int json_parser_free(json_parser *parser) { if (!parser) return 0; parser_free(parser, parser->stack); parser_free(parser, parser->buffer); parser->stack = NULL; parser->buffer = NULL; return 0; } /** json_parser_is_done return 0 is the parser isn't in a finish state. !0 if it is */ int json_parser_is_done(json_parser *parser) { /* need to compare the state to !GO to not accept empty document */ return parser->stack_offset == 0 && parser->state != STATE_GO; } /** json_parser_string append a string s with a specific length to the parser * return 0 if everything went ok, a JSON_ERROR_* otherwise. * the user can supplied a valid processed pointer that will * be fill with the number of processed characters before returning */ int json_parser_string(json_parser *parser, const char *s, uint32_t length, uint32_t *processed) { int ret; uint8_t next_class, next_state; uint32_t buffer_policy; uint32_t i; ret = 0; for (i = 0; i < length; i++) { unsigned char ch = s[i]; ret = 0; next_class = (ch >= 128) ? (uint8_t)(C_OTHER) : (uint8_t)(character_class[ch]); if (next_class == C_ERROR) { ret = JSON_ERROR_BAD_CHAR; break; } next_state = state_transition_table[parser->state][next_class]; buffer_policy = buffer_policy_table[parser->state][next_class]; if (next_state == STATE___) { ret = JSON_ERROR_UNEXPECTED_CHAR; break; } /* add char to buffer */ if (buffer_policy) { ret = (buffer_policy == 2) ? buffer_push_escape(parser, ch) : buffer_push(parser, ch); if (ret) break; } /* move to the next level */ if (IS_STATE_ACTION(next_state)) ret = do_action(parser, next_state); else parser->state = next_state; if (ret) break; } if (processed) *processed = i; return ret; } /** json_parser_char append one single char to the parser * return 0 if everything went ok, a JSON_ERROR_* otherwise */ int json_parser_char(json_parser *parser, unsigned char ch) { return json_parser_string(parser, (char *) &ch, 1, NULL); } parser-3.5.1/Makefile.in0000644000076400007640000006405214740273415012030 00000000000000# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/src/lib/ltdl/m4/argz.m4 \ $(top_srcdir)/src/lib/ltdl/m4/libtool.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltdl.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltoptions.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltsugar.m4 \ $(top_srcdir)/src/lib/ltdl/m4/ltversion.m4 \ $(top_srcdir)/src/lib/ltdl/m4/lt~obsolete.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/pa_config_auto.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in AUTHORS COPYING ChangeLog \ INSTALL NEWS README compile config.guess config.sub depcomp \ install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APACHE = @APACHE@ APACHE_CFLAGS = @APACHE_CFLAGS@ APACHE_INC = @APACHE_INC@ AR = @AR@ ARGZ_H = @ARGZ_H@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GC_LIBS = @GC_LIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MIME_INCLUDES = @MIME_INCLUDES@ MIME_LIBS = @MIME_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ P3S = @P3S@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCRE_INCLUDES = @PCRE_INCLUDES@ PCRE_LIBS = @PCRE_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XML_INCLUDES = @XML_INCLUDES@ XML_LIBS = @XML_LIBS@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ dll_extension = @dll_extension@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ subdirs = @subdirs@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src etc ACLOCAL_AMFLAGS = -I src/lib/ltdl/m4 EXTRA_DIST = operators.txt operators.ru.txt parser3.sln gnu.vcproj buildall acsite.m4 all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip dist-zstd distcheck distclean \ distclean-generic distclean-libtool distclean-tags \ distcleancheck distdir distuninstallcheck dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile commit: # trick to make 'make' happy at check out time # and avoid redundant remaking: aclocal+autoconf+automake cvs commit -m "no message" -f configure.ac acsite.m4 aclocal.m4 Makefile.am Makefile.in configure src/include/pa_config_auto.h.in # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: parser-3.5.1/AUTHORS0000644000076400007640000000025414712043206011015 00000000000000Konstantin Morshnev (https://moko.ru) Alexandr Petrosian (https://paf.design.ru) Michael Petrushin (http://fifonik.com/) parser-3.5.1/depcomp0000755000076400007640000005601613111545410011325 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.5.1/Makefile.am0000644000076400007640000000062014731544543012011 00000000000000SUBDIRS = src etc ACLOCAL_AMFLAGS = -I src/lib/ltdl/m4 EXTRA_DIST = operators.txt operators.ru.txt parser3.sln gnu.vcproj buildall acsite.m4 commit: # trick to make 'make' happy at check out time # and avoid redundant remaking: aclocal+autoconf+automake cvs commit -m "no message" -f configure.ac acsite.m4 aclocal.m4 Makefile.am Makefile.in configure src/include/pa_config_auto.h.in parser-3.5.1/operators.txt0000644000076400007640000017460314740300505012535 00000000000000operators ^eval(expression)[format] expressions, apart from the usual functions, supports: #comments allowed they work until the end of the line or the closing parenthesis nested parentheses are allowed inside comments among the non-obvious operators: | bitwise XOR || logical XOR ~ bitwise negation \ integer division 10\3=3 def checks if defined: an empty string is not defined an empty table is not defined an empty hash is not defined eq ne lt gt le ge for string comparison, in "/dir/" to check if the current document is located in the specified directory ["no expressions allowed inside; if you need a complex comparison, assign it to a variable"] is 'type' to check the type of the left operand, e.g., "is the method parameter not a hash?" -f checks if a file exists on disk, -d checks if a directory exists on disk, a quoted string (double or single quotes) is treated as a string, unquoted text is a string until the nearest whitespace numeric literals can be in hex format like 0xABC priorities: /* logical */ %left "!||" %left "||" %left "&&" %left '<' '>' "<=" ">=" "lt" "gt" "le" "ge" %left "==" "!=" "eq" "ne" %left "is" "def" "in" "-f" "-d" %left '!' /* bitwise */ %left '!|' %left '|' %left '&' %left '~' /* numerical */ %left '-' '+' %left '*' '/' '%' '\\' %left '~' /* negation: unary */ literals: true false ^if(condition){then}{else} ^if(condition1){yes}[(condition2){yes}[(condition3){yes}[...]]]{no} unlimited number of additional conditions (elseif) ^switch[value]{^case[var1[;var2...]]{action}^case[DEFAULT]{default action}} ^while(condition){body}[[delimiter]|{delimiter executed before each non-empty non-first body}] ^for[i](0;4){body}[[delimiter]|{delimiter executed before each non-empty non-first body}] ^try{ ... ^throw[sql.connect[;vasya[;mistaken]]] // previously ^error[text] ^throw[ $.type[sql.connect] $.source[vasya] $.comment[mistaken] ] ... }{ ^if($exception.type eq "sql"){ $exception.handled(1|true) ^rem{flag that exception is handled} .... } ^switch[$exception.type]{ ^case[sql;mail]{ $exception.handled(1) code handling sql error $exception.type = sql.connect $exception.file $exception.lineno $exception.colno [if not disabled at compile time] $exception.source = vasya $exception.comment = mistaken } ^case[DEFAULT]{ code handling another error ^throw[$exception] << re-throw // DON'T! It's default behaviour! } } } ^break[] breaks the loop ^break(true|false) breaks the loop if true ^continue[] breaks the current iteration of the loop ^continue(true|false) breaks the current iteration if true ^return[] stops method execution ^return[value] assigns $result the value and stops method execution ^untaint[[as-is|file-spec|uri|http-header|mail-header|sql|js|json|parser-code|regex|xml|html|optimized-[as-is|xml|html]]]{code} default as-is ^taint[[lang]][code] default "just tainted, language unknown" ^apply-taint[[lang;]text] applies transformations specified in the string, "indefinitely dirty" is considered as lang, producing a clean string ^process[[$caller.CLASS|$object|$CLASS:CLASS]]{string to be processed as code}[ $.main[what to rename @main to] $.file[name of the file supposedly containing this text] $.lineno(line number in the file from where this text originated, can be negative) ] ^process..[path][what to rename @main to] by default, methods are compiled into $self [in case of operator, $self=$MAIN:CLASS] ^connect[protocol://connection-string]]{code with ^sql[...] calls} mysql://user:pass@{host[:port][, host[:port]]|[/unix/socket]}/database? ClientCharset=parser-charset << charset in which parser thinks client works charset=UTF-8& timeout=3& compress=0& named_pipe=1& multi_statements=1& allow executing more than one query in a single :sql{} request config_file=.my.cnf& config_group=parser3& use group name from .my.cnf autocommit=1 if autocommit is set to 0, it will perform commit/rollback pgsql://user:pass@{host[:port]|[local]}/database? client_encoding=win,[to-find-out] &datestyle=ISO,SQL,Postgres,European,NonEuropean=US,German,DEFAULT=ISO &ClientCharset=parser-charset << charset in which parser thinks client works odbc://DSN=dsn^;UID=user^;PWD=password^;ClientCharset=parser-charset ClientCharset << charset in which parser thinks client works sqlite://DBfile? ClientCharset=parser-charset& << charset in which parser thinks client works autocommit=1 to use ^connect, the $SQL table must be defined beforehand (recommended in the system configuration auto.p) #sql drivers $SQL[ $.drivers[^table::create{protocol driver client mysql $prefix/libparser3mysql.so libmysqlclient.so pgsql $prefix/libparser3pgsql.so libpq.so sqlite $prefix/libparser3sqlite.so sqlite3.so odbc parser3odbc.dll }] ] ^rem{} a comment, removed at compile time ^syslog[ident;message[;info|warning|error|debug]] writes a message to syslog ^cache[file](seconds){code}[{catch code}] relative time assignment caches the string resulting from the code execution for 'seconds' seconds if 0 seconds, do not cache, and remove any existing old cache in the catch code, $exception.handled[cache] ^rem{flag that exception is handled} ^cache[file][expires date]{code}[{catch code}] absolute time assignment ^cache[file] deletes the file [no error if it doesn't exist] ^cache(seconds) ^cache[expires date] signals to the upper-level ^cache "reduce it to these many 'seconds'/'expires'" ultimately: ^cache(0) cancels caching ^cache[] returns the current expires date each method has a local variable $result. If you put something in it, that will be the method's result, not its body each method has a local variable $caller, containing the parent stack frame, you can write to its local variables use(^use or @USE) searches for and includes a file: 1. If the path starts with /, it is considered a path from the web root 2. Relative to the current directory 3. Relative to strings from the $MAIN:CLASS_PATH table, bottom-up $MAIN:CLASS_PATH is a global string or table with a path or paths to a directory with classes (from the web root), set it in the configuration auto.p A global table $CHARSETS[$.name[filename]] defines which characters are considered what (whitespace, letter, etc.), as well as their Unicode format: tab-delimited file, with a header: char white-space digit hex-digit letter word lowercase unicode1 unicode2 A x x x a 0x0041 0xFF21 where char and lowercase can be letters or 0xCODES if the character has a single Unicode representation equal to itself, you can omit unicode UTF-8 is always available and is the default encoding for request and response WARNING: the encoding name is case-insensitive syntax $name[new value] $name(arithmetic expression of new value) $name{code of new value} $name whitespace or ${name}something - variable value ^name parameters - call $name.CLASS - class of the value $name.CLASS_NAME - name of the class $name[$.key[] () {}] - constructor of a hash variable with element $name.key ^method[$.key[] () {}] - constructor of a hash parameter with element $parameter.key $CLASS.name access a class variable the name ends before: space tab linefeed ; ] } ) " < > + * / % & | = ! ' , ? i.e. you can do $name,aaaa but if you need a character after the name, say -, then ${name}- in expressions, + and - are additional name boundaries you can access compound objects as: $name.subname where subname can be: a string a $variable a string$variable [code computing a string] for example: $hash[$.age(88)] $get[$.field[age]] ^hash.[$get.field].format{%05d} parameters := one or more parameters parameter := (arithmetic expression) evaluated multiple times inside the call, | [code] evaluated once before the call, | {code} evaluated zero or many times inside the call, ';' are allowed, making multiple parameters in a single bracket void all methods present in the string class object are available, the result behaves as if it were an empty string ^void:sql{query without result}{$.bind[see table::sql]} int,double ^name.int[] integer value ^name.double[] double value ^name.bool[] ^name.bool(true|false) boolean value ^name.inc(how much +) ^name.dec(how much -) ^name.mul(how much *) ^name.div(how much /) ^name.mod(how much %) ^name.format[format] ^int/double:sql{query}[[$.limit(2) $.offset(4) $.default{0} $.bind[see table::sql]]] the query result should be one column/one row string in expression def value means "not empty?" logical/numerical value equals an attempt to convert to double, an empty string quietly converts to 0 example: ^if(def $form:name) not empty? ^if($user.isAlive) true? [auto-convert to number, not zero?] ^string:sql{query}[[$.limit(1) $.offset(4) $.default{n/a} $.bind[see table::sql]]] the query result should be one column/one row ^string.int[] ^string.int(default) integer value of the string, if conversion fails, default is taken ^string.double[] ^string.double(default) double value of the string, if conversion fails, default is taken ^string.bool[] ^string.bool(default) boolean value of the string, if conversion fails, default is taken ^string.format[format] %d %.2f %02d... ^string.match[string-pattern|regex-pattern][[search options]] $prematch $match $postmatch $1 $2... search options: i CASELESS x whitespace in regex ignored s singleline = $ matches end of entire text m multiline = $ matches end of line[\n], not end of entire text g find all occurrences, not just one ' create columns prematch, match, postmatch n return the number of matches instead of a table U invert the meaning of the '?' modifier ^string.match[string-pattern|regex-pattern][search options]{replacement} additional search option: g replace all occurrences, not just one ^string.split[delimiter|regex][[lrhva]][[column name for vertical splitting]] l left to right [default] r right to left h nameless table with keys 0, 1, 2, ... v table of one column 'piece' or as provided [default] a array ^string.{l|r}split[delimiter] a table from the $piece column kept for compatibility ^string.upper|lower[] ^string.length[] ^string.mid(P[;N]) without N - "until the end of the string" ^string.left(N), -1 returns the entire string ^string.right(N) ^string.pos[substring] ^string.pos[substring](position from which to search) <0 = not found ^string.replace[$table_of_substitutions_string_to_string] ^string.replace[$what;$to] ^string.save[[append;]path] ^string.save[path[;$.charset[in which encoding save] $.append(true)]] saves the string to a file ^string.trim[start|both|end|left|right[;chars]] removes chars from the start/end/or both start and end default 'chars' = whitespace chars ^string.trim[chars] removes chars from start and end ^string.base64[ $.pad(bool) $.wrap(bool) $.url-safe(bool) ] encode ^string:base64[encoded[; $.pad(bool) $.strict(bool) $.url-safe(bool) ]] decode ^string.idna[] IDNA encoding, supports Cyrillic domains ^string:idna[encoded] IDNA decoding, supports Cyrillic domains ^string.js-escape[] encoding for passing to JS (%uXXXX) ^string:js-unescape[escaped] decoding from js ^string:unescape[js|uri;escaped; $.charset[] ] decoding passed from js or uri ^string.contains[key] for compatibility with hashtable table in expression logical value means "not empty?" numerical value equals count[] $table.field $table.field[new value] $table.fields from a named table returns the current record as a Hash ^table::create[[nameless]]{data}[[$.separator[^#09] $.encloser[]]] ^table::create[table][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]] clones the table reverse - in reverse order ^table::load[[nameless;]path[;options]] if not nameless, column names are taken from the first line empty lines, and lines in the first column containing '#' are ignored $.separator[^#09] $.encloser["] by default, none ^table::sql{query}[[$.limit(2) $.offset(4) $.bind[hash]]] bind associates variables in the query with their values currently implemented only for oracle in the query you need to write ":name" in the bind parameter pass a hash from which the value is taken (or where it is written) ^table.save[[nameless|append;]path[;options, see load]] saves the table to a file ^table.menu{body}[[delimiter]] executes the body code for each row of the table ^table.foreach[position;value]{body}[[delimiter]] ^table.line[] current table row, starting from 1 ^table.offset[] offset of the current row from the start, starting from 0 ^table.offset[[whence]](5) shifts whence=cur|set, without whence = cur ^table.count[], ^table.count[rows] number of rows in the table ^table.count[columns] number of columns ^table.count[cells] number of cells in the current row ^table.sort{{string-key-maker}|(numeric-key-maker)}[{desc|asc}] default=asc ^table.append{data} ^table.append[ $.column_name[column_value] ] ^table.insert{data} add a record at the current position ^table.insert[ $.column_name[column_value] ] ^table.delete[] deletes the record at the current position ^table.join[table][$.limit(1) $.offset(5) $.offset[cur]] adds records from the table, tables must have the same structure ^table.flip[] returns the transposed version ^table.locate[field;value][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]] moves the current row if found. returns bool ^table.locate(logical expression)[[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]] moves the current row if found. returns bool ^table.hash{[field]|{code}|(expression)}[[value field(s)|table of value fields]{value code}][[$.distinct(1) $.distinct[tables] $.type[hash]]] by default $hash.key value is a hash where value fields are keys value fields may not be specified, then they are all columns including the key if distinct is true, no error if duplicate keys if distinct is tables, a hash of tables is created, containing rows with that key $.type[string/table] changes the element value to a string (specify one column) or a table ^table.columns[[column name]] table of one column 'column' or as provided ^table.cells[], ^table.cells(limit) returns an array of cells of the current row ^table.array[] returns an array of hashes, each hash representing the data of one row ^table.array[column] returns an array of values from the specified column ^table.array{code} returns an array of results from executing the given code for each row ^table.rename[column name;new column name] ^table.rename[ $.column_name[new column name] ...] renames a column or multiple columns $selected[^table.select(expression)] a table from those columns and rows where the condition matched $adults[^man.select($man.age>=18)] ^table.color[color1;color2] alternates color1 and color2 for each row hash in expression logical value means "not empty?", a hash with _default is already not empty numerical value equals count[] $hash.key _default - a special key, if defined, then when accessing a non-existing key, _default value is returned $hash.fields returns $hash, making hash class more similar to table class ^hash::create[[|copy_from_hash|copy_from_hashfile]] creates a new hash, a copy of the old one ^hash.add[term] overwrites entries with the same name ^hash.sub[subtracted] ^hash.union[b] union, same-named remain ^hash.intersection[b][[$.order[self|arg]]] intersection, new hash, order defines the element order (as in the source hash or parameter hash) ^hash.intersects[b] = bool ^hash::sql{query}[[$.distinct(1) $.limit(2) $.offset(4) $.type[hash|string|table]]] results is hash(keys = values of the first column of the response) of hash(keys = names of the other columns), or string = each element's value is a string (need exactly two columns), or table = each element's value is a table ^hash.keys[[name of key column]] a table of one 'key' column or as provided ^hash.count[] ^hash.foreach[key;value]{body}[[delimiter]|{delimiter executed before each non-empty non-first body}] ^hash.delete[key] delete key ^hash.contains[key] checks if hash contains a key (bool) ^hash.at[first|last][[key|value|hash]] ^hash.at([-]N)[[key|value|hash]] access specified elements of an ordered hash ^hash.set[first|last;value] ^hash.set([-+]N)[value] sets the value of the specified ordered hash element ^hash.rename[old_key;new_key] ^hash.rename[ $.old_key[new_key] ...] renames the specified hash keys ^hash.sort[key;value]{{string-key-maker}|(numeric-key-maker)}[[desc|asc]] default=asc $reversed_hash[^hash.reverse[]] $selected[^hash.select[key;value](expression)[ $.limit(N) $.reverse(bool) $.default(bool) ]] a hash of keys and values for which the condition is true hashfile ^hashfile::open[filename] ^hashfile.clear[] forget all $hashfile.key[value] put value $hashfile.key[$.value[value] $.expires[VALUE]] put value until expires expires can be a date, or number of days (0days=forever) $hashfile.key retrieve ^hashfile.delete[key] delete key ^hashfile.delete[] delete files containing data ^hashfile.hash[] convert to a regular hash removing expired pairs along the way ^hashfile.foreach[key;value]{body}[[delimiter]|{delimiter executed before each non-empty non-first body}] ^hashfile.release[] write data and release locks. next access to elements will reopen automatically. ^hashfile.cleanup[] iterate all elements and delete expired ones. example: $sessions[^hashfile::open[/db/sessions]] $sid[^math:uuid[]] $sessions.$sid[$.value[$uid] $.expires(1)] $uid[$sessions.$sid] array in expression logical value means "not empty?" numerical value equals count[] $array.index, $array.(expression) returns the value at the given index $array.index[value], $array.(expression)[value] assigns a value by index $array[value;value;...] creates an array with the given values ^array::create[] ^array::create[value;value;...] creates an array with the given values or an empty array ^array::copy[array or hash with numeric keys] copies an array or a hash with numeric keys ^array.add[array or hash with numeric keys] adds elements from another array or hash, overwriting values for matching indexes ^array.join[array or any hash] appends elements from another array or hash to the end of the array ^array.append[value;value;...] appends elements to the end of the array ^array.insert(index)[value;value;...] inserts elements at the specified position in the array ^array.left(n) returns a new array of the first n elements ^array.right(n) returns a new array of the last n elements ^array.mid(m;n) returns a new array containing n initialized elements starting from position m ^array.delete(index) deletes an array element, leaving an empty spot ^array.remove(index) deletes an element and shifts subsequent elements to fill the gap ^array.push[value] adds an element to the end of the array ^array.pop[] returns the last element and removes it from the array ^array.contains(index) checks if an element exists at the given index (bool) ^array::sql{query}[ $.sparse(false|true) $.distinct(false|true) $.limit(n) $.offset(n) $.type[hash|string|table] ] creates an array based on a database query $.sparse(false), default - create a normal array. Row values from the query are added sequentially $.sparse(true) - create a sparse array. The first column must contain indexes at which values will be placed (similar to ^hash::sql{}) result is an array of hash (keys=column names of the rest of the answer) or string = each element's value is a string (need exactly two columns), or table = each element's value is a table ^array.keys[[column name for keys]] a table of one 'key' column (or as provided) with the indexes of initialized elements ^array.count[] the number of initialized elements in the array ^array.count[all] the total number of elements, including uninitialized ones ^array.foreach[index;value]{code}[[delimiter]|{delimiter executed before each non-empty non-first body}] iterates over all initialized elements ^array.for[index;value]{code}[[delimiter]|{delimiter executed before each non-empty non-first body}] iterates over all elements ^array.at[first|last][[key|value|hash]] ^array.at([-]number)[[key|value|hash]] accesses an array element by its ordinal number ^array.set[first|last][value] ^array.set([-]number)[value] sets the value of an array element by ordinal number ^array.compact[] removes uninitialized elements ^array.compact[undef] removes uninitialized and empty elements ^array.sort[key;value]{{string-key-maker}|(numeric-key-maker)}[[desc|asc]] default=asc sorts the array $reversed_array[^array.reverse[]] returns a new array with elements in reverse order $selected[^array.select[key;value](expression)[ $.limit(N) $.reverse(bool) ]] selects array elements for which the condition is true date date type can be used in expressions, substituting the number of days since epoch [1 January 1970 (UTC)], fractional the string value is in local time, numerically in UTC, range from 0000-00-00 00:00:00 to 9999-12-31 23:59:59 by default the OS-defined timezone is used ^date::now[] ^date::now(days offset) returns now+offset ^date::today[] date at 00:00:00 of the current day ^date::today(integer days offset) date at 00:00:00 of current day+offset ^date::create(days since epoch) ^date::create(year;month[;day[;hour[;minute[;second[;TZ]]]]]) ^date::create[date in format %Y-%m-%d %H:%M:%S] convenient creation from a value from a database format1: %Y[-%m[-%d[ %H[:%M[:%S]]]]] format2: %H:%M[:%S] ^date::create[date in format %Y-%m-%dT%H:%M[:%S]TZ] for creation from ISO 8601 format TZ format: Z(UTC) or +-hour[:minute] (offset from UTC) ^date::unix-timestamp() ^date.unix-timestamp[] $date.year month day hour minute second weekday yearday(0...) daylightsaving TZ weekyear TZ="" << local zone $date.year month day hour minute second can be set to new values, others are read-only ^date.double[] ^date.int[] the number of days since epoch [1 January 1970 (UTC)], fractional or truncated ^date.roll[year|month|day](+-offset) shifts the date ^date.roll[TZ;New zone] says that the date is in such a timezone: affects .hour & Co ^date:roll[TZ;New zone] says that by default all dates are in that timezone ^date.sql-string[[datetime|date|time]] datetime or without parameter - %Y-%m-%d %H:%M:%S date - %Y-%m-%d time - %H:%M:%S where published='^date.sql-string[]' ^date:calendar[rus|eng](year;month) returns an unnamed table, columns: 0..6, week, year ^date:calendar[rus|eng](year;month;day) returns a named table, columns: year, month, day, weekday ^date:last-day(year;month) returns the last day of the month ^date.last-day[] returns the last day of $date's month ^date.gmt-string[] Fri, 23 Mar 2001 09:32:23 GMT ^date.iso-string[] 2001-03-23T12:32:23+03 file $uploaded_file_from_post.name $uploaded_file_from_post.size $uploaded_file_from_post.text ^file.save[text|binary;filename[;$.charset[which charset to save in]]] ^file:delete[filename] ^file:find[filename][{if not found}] ^file:list[path[;pattern-string|pattern-regex]] table with columns name dir ^file:list[path;$.filter[pattern-string|pattern-regex] $.stat(true)] table with columns name dir size [mca]date ^file::load[text|binary;big.zip[;domain_press_release_2001_03_01.zip][;options]] ^file::create[text|binary;filename;data] ^file::create[text|binary;filename;data[;$.charset[charset of the created file] $.content-type[...]]] ^file::create[string-or-file-content[;$.name[name] $.mode[text|binary] $.content-type[...] $.charset[...]]] $loaded_file.size $loaded_or_created_file.mode = text/binary ^file::stat[filename] $stated_or_loaded_file.size .adate .mdate .cdate ^file::cgi[[text|binary;]filename[;env hash +options[;1cmd[;2line[;3ar[;4g[;5s]]]]]]] any argument can be string or array of strings the returned header is split into $fields $status $stderr ^file::exec[[text|binary;]filename[;env hash[;1cmd[;2line[;3ar[;4g[;5s;...under unix max 50 args]]]]]]] any argument can be string or array of strings options: $.stdin[text|file] if empty, disables automatic passing of HTTP-POST data ^file:move[oldfilename;newfilename] can rename and move directories [win32: but not across disk boundaries] directories for dest are created with 775 permissions source directory is removed if empty after move ^file:copy[filename;copy_filename[; $.append(1) ]] can only copy files ^file:lock[filename]{code} the file is created if necessary locked code executed unlocked ^file:dirname[/a/some.tar.gz|file]=/a (works like *nix command) ^file:dirname[/a/b/|file]=/a (works like *nix command) ^file:basename[/a/some.tar.gz|file]=some.tar.gz (like *nix) ^file:basename[/a/b/|file]=b (like *nix) ^file:justname[/a/some.tar.gz|file]=some.tar ^file:justext[/a/some.tar.gz|file]=gz /some/page.html: ^file:fullpath[a.gif] => /some/a.gif ^file.sql-string[] inside ^connect gives a correctly escaped string that can be used in queries ^file::sql{query}[[ $.name[filename_for_download] $.content-type[user content-type] ]] the query result should be "one row". columns: first column - data if second exists - filename if third - content-type ^file.base64[ $.pad(bool) $.wrap(bool) $.url-safe(bool) ] encode ^file:base64[filename[; $.pad(bool) $.wrap(bool) $.url-safe(bool) ]] encode ^file::base64[encoded string[; $.pad(bool) $.strict(bool) $.url-safe(bool) ]] decode ^file::base64[mode;filename;encoded string[; $.content-type[...] $.pad(bool) $.strict(bool) $.url-safe(bool) ]] decode ^file:crc32[filename] calculates crc32 of the specified file ^file.crc32[] calculates crc32 of the object ^file.md5[], ^file:md5[filename] returns the file's digest, 16 bytes as a string, bytes in hex, contiguous, lowercase image $image[^image::measure[DATA[; $.exif(bool) $.xmp(bool) $.xmp-charset[] $.video(bool) ]]] checks the file extension case-insensitively can measure gif, jpg, tiff, bmp, webp and mp4 (mov) $image.exif << hash after measure jpeg with exif information and $.exif(true) $image.exif.DateTime & co [full list see https://exiftool.org/TagNames/EXIF.html] numbers as int/double, dates as date, enumerations as hash with keys 0..count-1 $image.src .width .height $image.line-width number=line width $image.line-style string=line style '*** * '='*** * *** * *** * ' ^image.html[[hash]] ^image::load[background.gif] only gif so far ^image::create(width X;height Y[;background color default white]]) ^image.line(x0;y0;x1;y1;0xffFFff) ^image.fill(x;y;0xffFFff) ^image.rectangle(x0;y0;x1;y1;0xffFFff) ^image.bar(x0;y0;x1;y1;0xffFFff) ^image.replace(hex-color1;hex-color2)[table x:y polygon_vertices] ^image.polyline(color)[table x:y points] ^image.polygon(color)[table x:y polygon_vertices] ^image.polybar(color)[table x;y polygon_vertices] ^image.font[set_of_letters;font_file.gif][(space_width[;char_width])] the character height = image height/number of letters in the set if char_width is specified, then monospaced, if 0, char_width = gif width ^image.font[set_of_letters;font_file.gif; $.space(space_width) // default = gif width $.width(char_width) // see above, default proportional $.spacing(letter_spacing) // default = 1 ] ^image.text(x;y)[text] AS_IS ^image.length[text] AS_IS ^image.gif[optional filename] encodes to FILE with content-type=image/gif the filename will be used by $response:download ^image.arc(center x;center y;width;height;start in degrees;end in degrees;color) ^image.sector(center x;center y;width;height;start in degrees;end in degrees;color) ^image.circle(center x;center y;r;color) ^image.copy[source](src x;src y;src w;src h;dst x;dst y[;dest w[;dest h[;tolerance]]]) if dest_w/dest_h are specified, resizes the piece when reducing size, does resample only suitable for simplifying low-color graphics like charts/pie, not suitable for thumbnails if dest_h is not specified, aspect ratio is kept tolerance - a number [square distance in RGB space to the target color], defining how greedy the color approximation from the palette is [default=150] smaller - more accurate but colors run out quickly larger - less accurate approximation, but covers a bigger part ^image.pixel(x;y)[(color)] get or set pixel color regex in expression logical value is always true numerical value is equal to the number of bytes of the compiled pattern ^regex::create[pattern-string|regex][[search options]] ^pattern.size[] number of bytes of the compiled pattern if the value is very large - it is worth consulting pcre documentation and possibly rewriting the pattern ^pattern.study_size[] size of the study-structure. if == 0 - the pattern cannot be "studied" $pattern.pattern the text of the pattern $pattern.options the string with the original text of the options console $console:timeout $console:line read/write string cookie $cookie:name read old or newly set cookie $cookie:name[value] for 90 days $cookie:name[$.value[value] $.expires[VALUE] $.secure(true) $.domain[domain name] $.httponly(true)] the expires field value can be 'session', a date, or a number of days (0days=forever) if it's a date, it will be converted to "Sun, 25-Aug-2002 12:03:45 GMT" $cookie:fields hash with all cookies curl ^curl:load[[ $.url[http://URL] $.timeout(N) $.ssl_verifypeer(0) $.mode[text|binary] type of the created file ]] downloads a file from a remote server, can be called multiple times within one session; any libcurl option can be specified, option names in lowercase without the CURLOPT_ prefix ^curl:options[[ $.library[libcurl.so.4] $.charset[UTF-8] ... ]] subsequent ^curl:load calls inherit the specified options, the path to libcurl must be set before using curl ^curl:session{code} creates a cURL session, common options can be set, multiple downloads performed ^curl:info[name], ^curl:info[] information about the last request (a value or a hash) ^curl:version[] the version of the cURL library in use env $env:variable $env:fields hash with environment variables $env:PARSER_VERSION parser version form [the first element with the same name is taken from GET, then from POST] $form:field string/file $form:nameless field with a value from a nameless parameter "?value&...", "...&value&...", "...&value" $form:qtail string with the value after the second "?xxxxx" if there was no ',' [imap] $form:fields hash with all form fields $form:elements.field array with all values of the field - both string and file $form:tables.field table with one column "field" containing the values for multiple entries $form:files.field hash with file-type field values, keys - 0, 1, ..., value - file $form:imap a hash with keys 'x' and 'y' with ?1,2 suffixes when using server-side image map inet ^inet:ntoa(long) ^inet:aton[IP] ^inet:name2ip[name][[ $.ipv[4|6|any] $.table(true) ]] direct conversion of a name to an IP address ^inet:ip2name[ip][ $.ipv[4|6|any] ] reverse conversion from IP address to name ^inet:hostname[] host name json ^json:parse[-json-string-[; $.depth(maximum depth, default == 19) $.double(false) disable built-in parsing of floating-point numbers (enabled by default) in this case they will appear in the resulting object as strings $.int(false) disable built-in parsing of integers (enabled by default) in this case they will appear in the resulting object as strings $.distinct[first|last|all] how duplicate keys in objects are handled first - keep the first encountered element last - keep the last encountered element all - keep all elements. starting from the 2nd, they get numeric suffixes (key_2 etc) by default duplicate keys cause an exception $.object[method-junction] user method[key;object], called for all parsed objects and object keys; method returns a new object $.array[method-junction] user method called for arrays $.taint[taint language] sets the transformation language for all result strings ]] parses a json-string into a hash ^json:string[system or user object[; $.skip-unknown(false) disable exception and output 'null' when serializing objects of types other than void, bool, string, int, double, date, table, hash, and file $.indent(true) format the resulting string with indentation according to nesting depth $.date[sql-string|gmt-string|iso-string|unix-timestamp] date output format, default = sql-string $.table[object|array|compact] format for tables, default=object object: [{"c1":"v11","c2":"v12",...},{"c1":"v21","c2":"v22",...},...] array: [["c1","c2",...] || null (for nameless),["v11","v12",...],...] compact: ["v11" || ["v11","v12",...],...] $.file[text|base64|stat] output file content in the specified mode (by default file content is not included in output) $.xdoc[hash] parameters for converting xdoc to string (as in ^xdoc.string[]) $.type[method-junction] any type can be output using a user method that must take 3 parameters: key, object of that type, and options of the ^json:string[] call $._default[method] user method, called to output all user-class objects. The method must take 3 parameters: key, object, and call options. $._default[method name] method name of a user method, if present it will be called for serialization $.void[null|string] undefined value will be output as null (default) or as an empty string ]] serializes a system or user object into a json-string mail $mail.received=MESSAGE: .from .reply-to .subject .date of class date .message-id .raw[ .RAW_USER_HEADER_FIELD ] $.{text|html|file#}[ << numbered as in mail:send (text, text2, ...) (file, file2, ...) $.content-type[ $.value[{text|...|x-unknown}/{plain|html|...|x-unknown}] [$.charset[windows-1251]] << in which it arrived, now already transcoded $.USER_DEFINED_HEADER_FIELD ] $.description $.content-id $.content-md5 $.content-location .raw[ .RAW_USER_HEADER_FIELD ] $.value[string|FILE] ] $.message#[MESSAGE] (message, message2, ...) ^mail:send[ $.options[-odd] unix: a string that will be added to the sendmail startup command -odd means "quickly put in the queue without email checking" win32: ignored $.charset[the encoding of the headers and text blocks] $.any-header-field $.text[string] $.text[ $.any-header-field $.value[string] ] $.html{string} $.html[ $.any-header-field $.value{string} ] $.file#[FILE] $.file#[ $.any-header-field $value[FILE] ] ] if charset is specified, the email is transcoded to this charset content-type.charset does not affect transcoding after the part name a # number can follow ^mail:send[ # by default, matches the source encoding. # sets the body encoding $.charset[windows-1251] # no default $.content-type[$.value[text/plain] $.charset[windows-1251]] $.from["vasya" ] $.to["petya" ] $.subject[subject] $.body[ text ] ] ^mail:send[$.header-field[] $.charset[mail encoding] $.body[if body is not a string, but a hash, a multipart email is sent]] if charset is specified, the email is transcoded to that charset content-type.charset does not affect transcoding after the part name, an integer can follow, parts go in numerical order. if body is a string, then it's just the email text, no attachments. if body is a hash, then these are parts, text blocks first, then attachments this is the old format, supported for backward compatibility if the part name begins with "text", it's a text block. if the part name begins with "file", it's an attachment, format: $file[$.format[uue|base64] $.value[DATA] $.name[user-file-name]] important: for multipart do not specify content-type ^mail:send[ # by default, matches the source encoding # sets the body encoding $.charset[windows-1251] # no default $.content-type[$.value[text/plain] $.charset[windows-1251]] $.from["vasya" ] $.to["petya" ] $.subject[subject] $.body[ text ] ] ^mail:send[ $.from["vasya" ] $.to["petya" ] $.subject[subject] $.body[ $.text[ # sets the body encoding $.charset[windows-1251] # no default $.content-type[$.value[text/plain] $.charset[windows-1251]] $.body[words] ] # for convenience you can specify only one part, then it won't be multipart $.file[ $.value[^file::load[my beloved.doc]] $.name[my beloved.doc] $.format[base64] ] $.file2[ $.value[^file::load[my beloved.doc]] $.name[my beloved.doc] ] ] ] under unix, the program with arguments is used, set by $MAIL.sendmail[command] if not specified, checks if /usr/sbin/sendmail or /usr/lib/sendmail is available and if so, runs with "-t". under Windows, SMTP protocol is used, server is set by $MAIL.SMTP[smtp.domain.ru] math $math:PI ^math:round floor ceiling ^math:trunc frac ^math:abs sign ^math:exp log log10 ^math:sin asin cos acos tan atan atan2 ^math:degrees radians ^math:pow sqrt ^math:random(range_width) ^math:convert[number|file](base-from;base-to)[[ $.format[string|file] ]] ^math:convert[number|file][alphabet](base-to)[[ $.format[string|file] ]] ^math:convert[number|file](base-from)[alphabet][[ $.format[string|file] ]] converts a string or file with a number from one numeral system to another the numeral system can be set by an alphabet, a number from 2 to 16 (equivalent to the alphabet 0123456789ABCDEF), or 256 (all ASCII characters) ^math:uuid[ $.lower(bool) $.solid(bool) ] 22C0983C-E26E-4169-BD07-77ECE9405BA5 win32: uses cryptapi unix: uses /dev/urandom, if not present, /dev/random, if not, rand ^math:uuid7[ $.lower(bool) $.solid(bool) ] 0193CBF0-7898-7000-A391-AC513CC15658 https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7 ^math:uid64[ $.lower(bool) ] BA39BAB6340BE370 ^math:md5[string] returns the digest of the string, 16 bytes as a string, bytes in hex, contiguous, lowercase ^math:crypt[password;salt] salt prefix $apr1$ triggers built-in MD5 algorithm, if salt body is empty, it is generated randomly $1$ calls the OS 'crypt' MD5 algorithm if supported. for other salts see OS 'crypt' documentation. ^math:crc32[string] calculates crc32 of the string ^math:sha1[string] ^math:digest[[md5|sha1|sha256|sha512];string or file][[ $.format[hex|base64|file] $.hmac[key string|key file] ]] combines the ability to use various cryptographic hashing algorithms. $.hmac[key] for verifying the integrity of transmitted data memory ^memory:compact[] collect garbage, freeing space for new data (warning: process memory is never released) useful before XSL transform ^memory:auto-compact(frequency) sets automatic garbage collection frequency, from 0 (off) up to 5 (max) reflection ^reflection:create[class;constructor[;pa[;ra[;ms]]]] calls the specified class constructor (no more than 100 parameters) ^reflection:create[ $.class[name] $.constructor[name] $.arguments[ $.1[pa] $.2[ra] $.3[ms] ] ] calls the specified class constructor ^reflection:classes[] a hash of all classes. key = class name, value can be methoded (a class with methods) or void ^reflection:class[object] the class of the given object ^reflection:class_name[object] the class name of the given object ^reflection:base[object] the parent class of the given object ^reflection:base_name[object] the parent class name of the given object ^reflection:class_by_name[class name] obtains the class by name ^reflection:class_alias[class name;new class name] sets an alias for the specified class ^reflection:def[class;class name] checks if the class exists ^reflection:methods[class] a hash with a list of methods of the specified class, values are strings 'native' or 'parser' ^reflection:method[class or object;method name] returns the junction-method of the class or object ^reflection:filename[object or class or method] returns the filename where the object, class or method is defined ^reflection:fields[class or object] a hash with the list of static fields of the specified class or dynamic fields of the specified object ^reflection:fields_reference[object] an editable hash of the dynamic fields of the specified object ^reflection:field[class or object;field name] returns the value of the specified field of the class or object. getters are ignored. ^reflection:copy[source;destination] copies fields from one object or class to another ^reflection:uid[class or object] returns the identifier of the object or class ^reflection:method_info[class;method] a hash with parameters of the specified class method $.inherited[class] name of the class where the method was defined (returned only if the method was defined in an ancestor) $.overridden[class] name of the class where the method was defined (returned only if the method was defined in an ancestor) for native classes a hash is returned: .min_params(minimum required number of parameters) .max_params(maximum possible number of parameters) .call_type[dynamic|static|any] for parser classes a hash is returned: key is parameter number (0, 1, ...), value is parameter name ^reflection:dynamical[[object or class, caller if absent]] returns true if the method was called from a dynamic context when passing a parameter returns true if a dynamic object was passed, false if a class ^reflection:delete[class or object;variable name] deletes the variable with the specified name in the specified class or object ^reflection:is[element name;class name][[context]] analogous to the 'is' operator, allowing to determine if the element is code. ^reflection:tainting[[language|tainted|optimized];string] a string in which each character of the original string corresponds to a character with a transformation code ^reflection:stack[ $.args(false/true) $.locals(false/true) $.limit(n) $.offset(o)] the current state of the method call stack in the parser ^reflection:mixin[source; $.to[target] $.name[name] $.methods(true/false) $.fields(true/false) $.overwrite(false/true)] copies methods and fields from one class to another request https://site.name/a%20b/?name=some%20value $request:query name=some%20value $request:uri /a%20b/?name=value $request:path /a b/ $request:document-root directory relative to which paths are considered in parser, default = $env:DOCUMENT_ROOT $request:argv hash with command-line parameters. keys 0, 1, ... [0 - name of the processed file] $request:charset the source document encoding used in upper/lower and match[][i] WARNING: you must set $request/response:charset before using form class fields $request:method request method (GET|POST|PUT) $request:body POST-request body as text $request:body-file POST-request body as a file $request:body-charset POST-request encoding $request:headers hash with request headers (without HTTP_ prefix) response $response:field[value] and can read old - $response:field the value can be string or hash: $value[abc] field: {abc}<} old name 'set' ::create[[URI]][qualifiedName] URI default = disk path to requested document for directories a trailing / is mandatory ::create[file] can be usable: $f[^file::load[binary;http://;some HTTP options here...]] $x[^xdoc::create[$f]] ::load[file.xml[;options]] .transform[rules.xsl|xdoc][[params hash]] returns dom the template is cached, cache is updated if the template file date changes, or the date of "template_name.stamp" changes [stamp date check has priority] parameters are passed as is, not xpath expressions .string[[output options]] .save[file.xml[;output options]] with header .file[[output options]] = file output options are identical to xsl:output attributes [exception: cdata-section-elements ignored] returns media-type when substituting $response:body[here] if the document is referenced as: parser://method/param/to/that/method then ^MAIN:method[/param/to/that/method] is used as the document [note: the parameter always comes with a leading /, even if there were no parameters] xnode DOM1 attributes: $node.nodeName $node.nodeValue read write $node.nodeType = int ELEMENT_NODE = 1 ATTRIBUTE_NODE = 2 TEXT_NODE = 3 CDATA_SECTION_NODE = 4 ENTITY_REFERENCE_NODE = 5 ENTITY_NODE = 6 PROCESSING_INSTRUCTION_NODE = 7 COMMENT_NODE = 8 DOCUMENT_NODE = 9 DOCUMENT_TYPE_NODE = 10 DOCUMENT_FRAGMENT_NODE = 11 NOTATION_NODE = 12 $vasyaNode.type==$xnode:ELEMENT_NODE $node.parentNode $node.childNodes = array of nodes $node.firstChild $node.lastChild $node.previousSibling $node.nextSibling $node.ownerDocument = xdoc $node.prefix $node.namespaceURI $element_node.attributes = hash of xnodes $element_node.tagName $attribute_node.specified = boolean true if the attribute received its value explicitly in the XML document, or if a value was assigned programmatically with the setValue function. false if the attribute value came from the default value declared in the document's DTD. $attribute_node.name $attribute_node.value $text_node/cdata_node/comment_node.substringData $pi_node.target = target of this processing instruction XML defines this as the first token following the markup that begins the processing instruction. $pi_node.data = The content of this processing instruction From the first non-whitespace character after the target to the character immediately preceding the ?>. document_node. readonly attribute DocumentType doctype readonly attribute DOMImplementation implementation readonly attribute Element documentElement document_type_node. readonly attribute DOMString name readonly attribute NamedNodeMap entities readonly attribute NamedNodeMap notations notation_node. readonly attribute DOMString publicId readonly attribute DOMString systemId DOM1 node methods: Node insertBefore(in Node newChild,in Node refChild) Node replaceChild(in Node newChild,in Node oldChild) Node removeChild(in Node oldChild) Node appendChild(in Node newChild) boolean hasChildNodes() Node cloneNode(in boolean deep) DOM1 element methods: DOMString getAttribute(in DOMString name) void setAttribute(in DOMString name, in DOMString value) raises(DOMException) void removeAttribute(in DOMString name) raises(DOMException) Attr getAttributeNode(in DOMString name) Attr setAttributeNode(in Attr newAttr) raises(DOMException) Attr removeAttributeNode(in Attr oldAttr) raises(DOMException) NodeList getElementsByTagName(in DOMString name) void normalize() Introduced in DOM Level 2: Node importNode(in Node importedNode, in boolean deep) raises(DOMException) NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString localName) boolean hasAttributes() XPath: ^node.select[xpath/query/expression] = array of nodes, empty array if nothing found ^node.selectSingle[xpath/query/expression] = first node if any ^node.selectBool[xpath/query/expression] = bool if any or die ^node.selectNumber[xpath/query/expression] = double if any or die ^node.selectString[xpath/query/expression] = string if any or die DATA::=string | file | hash hash of the form [ $.file[filename on disk] $.name[filename for user] $.mdate[date] ] MAIN this is the class automatically loaded from the configuration auto.p, a bunch of auto.p and the requested document: configuration auto.p cgi: 1. either full path from environment variable CGI_PARSER_SITE_CONFIG or next to parser binary isapi: windows directory apache module: 1) ParserConfig [can be in .htaccess] auto.p goes down from DOCUMENT_ROOT/ through the directory tree to the directory of the processed file, inclusive the class is assembled from all these files, subsequent ones become parents of the previous ones the name of the last loaded is MAIN, previous ones have no names after loading MAIN class, its @main[] is called the result is passed to its @postprocess[data] if($data is string) ... the result is then returned to the user if an error occurs and try is not specified, it can be nicely reported to the user by defining @unhandled_exception[exception;stack] $exception.type string "type of problem" $exception.file $exception.lineno $exception.colno file, line and position where the problem occurred [if not disabled at compile time] $exception.source line that caused the problem $exception.comment English comment stack table with columns file line name, in reverse order the names[name] and places[file line] of the operators/methods that caused the error. when loading a file (file::load, table::load, xdoc::load) you can specify such a filename: http://domain/document[?params<> creates http.status error, can be disabled by $.any-status(1) $.charset[default encoding of remote documents], if server returns content-type:charset - IT OVERRIDES $.response-charset[encoding of remote documents], not overridden by content-type:charset $.user[user] $.password[password] file::load writes additional fields FIELD:value (response field names in uppercase) tables << a hash of FIELD->table with a single column "value" in such tables you can get repeating headers, e.g. multiple set-cookies todo: make separate cookies system error types: parser.compile ^test[} compilation (unmatched bracket, ...) parser.runtime ^if(0). parameters (more/less than needed, wrong types, ...) number.zerodivision ^eval(1/0) ^eval(1%0) number.format ^eval(abc*5) file.lock shared/exclusive lock error file.missing ^file:delete[delme] not found file.access ^table::load[.] no rights file.read ^file::load[...] error while reading file file.seek seek failed file.execute ^file::cgi[...] incorrect cgi header/can't execute image.format ^image::measure[index.html] not gif/jpg sql.connect ^connect[mysql://baduser:pass@host/db]{} not found/timeout sql.execute ^void:sql{select bad} syntax error sql.duplicate sql.access sql.missing xml ^xdoc::create{} any error in xml/xslt libs smtp.connect not found/timeout smtp.execute communication error email.format hren tam@null.ru wrong email format (bad chars/empty) email.send $MAIL.sendmail[/shit] sendmail not executable http.host ^file::load[http://notfound/there] host not found http.connect ^file::load[http://not_accepting/there] host found, but does not accept connections http.timeout ^file::load[http://host/doc] load operation failed to complete in # seconds http.response ^file::load[http://ok/there] host found, connection accepted, bad answer http.status ^file::load[http://ok/there] host found, connection accepted, status!=200 date.range ^date::create(10000;1;1) date out of valid range if $SIGPIPE(1) is defined in MAIN, then if processing was interrupted by the user, a message about this is written to parser3.log if the method description explicitly contains the local variable result (there is also an implicit variable), then the code for outputting whitespace literals does not get into the final bytecode $Id: operators.txt,v 1.267 2025/01/10 20:02:21 moko Exp $ parser-3.5.1/configure.ac0000644000076400007640000003516614740273410012250 00000000000000dnl Autoconf initialization AC_PREREQ(2.59) AC_INIT(parser, 3.5.1) AC_CONFIG_SRCDIR(README) dnl Automake Initialization AM_INIT_AUTOMAKE dnl Expand srcdir P3S=`cd $srcdir/src ; pwd` AC_SUBST(P3S) dnl Parser version update AC_CANONICAL_HOST AC_DEFINE_UNQUOTED(PARSER_VERSION,"$VERSION (compiled on $host)",parser version) AC_SUBST(host_os) case $host_os in *cygwin* ) AC_DEFINE(CYGWIN,,using cygwin building environment);; esac dnl Checks for programs AC_PROG_INSTALL AC_PROG_AWK AC_PROG_YACC if test "$YACC" != "bison -y"; then AC_MSG_WARN(to regenerate Parser grammar YOU WOULD NEED BISON) else AC_MSG_CHECKING(bison version) oldIFS=$IFS; IFS=. set `bison -V | sed -e 's/^GNU Bison version //' -e 's/^bison (GNU Bison) //' -e 's/$/./'` IFS=$oldIFS if test "$1" = "1" -a "$2" -lt "25"; then AC_MSG_WARN(Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2).) fi AC_MSG_RESULT($1.$2 (ok)) fi AC_PROG_CXX AC_PROG_CC dnl most tests should be compiled with C compiler [especially qsort test] AC_LANG_C dnl Dll extension AC_MSG_CHECKING(for dynamic-link library extension) case "$host_os" in *cygwin* ) dll_extension=dll;; * ) dll_extension=so esac AC_MSG_RESULT($dll_extension) AC_SUBST(dll_extension) dnl Misc arguments AC_ARG_WITH(build-warnings, [ --with-build-warnings to enable build-time compiler warnings if gcc is used], AC_MSG_WARN(enabling compiler warnings) CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2 -Wextra -Wall -Wno-parentheses" ) AC_ARG_WITH(coverage, [ --with-coverage to enable gcov code coverage support], AC_MSG_WARN(enabling gcov support) CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'` CXXFLAGS=`echo "$XXCFLAGS" | $SED -e 's/-O[0-9]*//g'` CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage" CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage" LDFLAGS="$LDFLAGS -lgcov" ) AC_ARG_WITH(profiler, [ --with-profiler to enable gprof code profiler support], AC_MSG_WARN(enabling gprof support) CFLAGS="$CFLAGS -O0 -pg -g" CXXFLAGS="$CXXFLAGS -O0 -pg -g" ) AC_ARG_WITH(assertions, [ --with-assertions to enable assertions], AC_MSG_WARN(enabling assertions) , AC_DEFINE(NDEBUG,,assertions disabled) ) AC_ARG_WITH(sjlj-exceptions, [ --with-sjlj-exceptions to enable simple 'throw' from dynamic library], AC_DEFINE(PA_WITH_SJLJ_EXCEPTIONS,,one can throw from dynamic library) ) AC_ARG_WITH(system-cfg, [ --with-system-cfg=FILE to specify system-wide auto.p], AC_DEFINE_UNQUOTED(SYSTEM_CONFIG_FILE,"$withval",system-wide auto.p) ) dnl Safe mode argument AC_ARG_ENABLE(safe-mode, [ --disable-safe-mode to enable reading and executing files belonging to group+user other then effective], [ SAFE_MODE=$enableval ] ) if test "$SAFE_MODE" = "no"; then AC_MSG_WARN(enabling reading of files belonging to group+user other then effective) else AC_DEFINE(PA_SAFE_MODE,,disabled reading of files belonging to group+user other then effective) fi dnl Disable execs argument AC_ARG_ENABLE(execs, [ --disable-execs to disable any execs (file::exec, file::cgi, unix mail:send)], [ if test "$enableval" = "no"; then AC_MSG_WARN(disabling file execs) AC_DEFINE(NO_PA_EXECS,,pa_exec disabled) fi ] ) dnl String stream argument AC_ARG_ENABLE(stringstream, [ --disable-stringstream to disable stringstream usage. when disabled table.save uses more memory, but more compilers are supported], [ if test "$enableval" = "no"; then AC_MSG_WARN(disabling stringstream usage) AC_DEFINE(NO_STRINGSTREAM,,stringstream disabled) fi ] ) dnl GC argument AC_ARG_WITH(gc,[ --with-gc[=DIR] DIR is the directory where Boehm garbage collecting library is installed],[ GC=$withval GC_LIBS="$GC/libgc.la" if test -f $GC_LIBS; then GC_OK="yes" else GC_LIBS="-L$GC -lgc" fi if test "$GC" = "yes"; then GC="" GC_LIBS="-lgc" AC_MSG_WARN([--with-gc value was not specified, hoping linker would find it]) fi ],[ GC_LIBS="-lgc" AC_MSG_WARN([--with-gc was not specified, hoping linker would find it]) ]) if test -z "$GC_OK"; then AC_MSG_CHECKING(for libgc) SAVE_LIBS=$LIBS LIBS="$LIBS $GC_LIBS" AC_TRY_LINK([ extern int GC_dont_gc; ],[ GC_dont_gc=0; ], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no) if test -z "$GC"; then AC_MSG_ERROR(please specify path to libgc: --with-gc=DIR) else AC_MSG_ERROR($GC does not seem to be valid libgc installation directory) fi ) LIBS=$SAVE_LIBS fi AC_SUBST(GC_LIBS) dnl PCRE argument AC_ARG_WITH(pcre,[ --with-pcre=DIR DIR is the directory where PCRE library is installed],[ PCRE=$withval if test "$PCRE" = "yes"; then PCRE="" AC_MSG_WARN([--with-pcre value was not specified, hoping linker would find it]) else PCRE_INCLUDES="-I$PCRE/include" if test -f $PCRE/include/pcre.h -a -f $PCRE/lib/libpcre.la; then PCRE_OK="yes" PCRE_LIBS="$PCRE/lib/libpcre.la" else if test -f $PCRE/include/pcre2.h -a -f $PCRE/lib/libpcre2-8.la; then PCRE_OK="yes" PCRE_LIBS="$PCRE/lib/libpcre2-8.la" AC_DEFINE(HAVE_PCRE2,,PCRE2 is available) else PCRE_LIBS="-L$PCRE/lib" fi fi fi ],[ AC_MSG_WARN([--with-pcre was not specified, hoping linker would find it]) ]) if test -z "$PCRE_OK"; then AC_MSG_CHECKING(for pcre2) SAVE_LIBS=$LIBS LIBS="$LIBS $PCRE_LIBS $PCRE_INCLUDES -lpcre2-8" AC_TRY_LINK([ #define PCRE2_CODE_UNIT_WIDTH 8 #include ],[ void *v=pcre2_general_context_create(0,0,0); ], AC_MSG_RESULT(yes) PCRE_LIBS="$PCRE_LIBS -lpcre2-8" AC_DEFINE(HAVE_PCRE2,,PCRE2 is available) PCRE_OK="yes" , AC_MSG_RESULT(no) ) LIBS=$SAVE_LIBS fi if test -z "$PCRE_OK"; then AC_MSG_CHECKING(for pcre) PCRE_LIBS="$PCRE_LIBS -lpcre" SAVE_LIBS=$LIBS LIBS="$LIBS $PCRE_LIBS $PCRE_INCLUDES" AC_TRY_LINK([ #include ],[ const char *v=pcre_version(); ], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no) if test -z "$PCRE"; then AC_MSG_ERROR(please specify path to PCRE: --with-pcre=DIR) else AC_MSG_ERROR($PCRE does not seem to be valid PCRE installation directory) fi ) LIBS=$SAVE_LIBS fi AC_SUBST(PCRE_INCLUDES) AC_SUBST(PCRE_LIBS) dnl XML/XSLT argument AC_ARG_WITH(xml,[ --with-xml=DIR DIR is the directory where Gnome XML libraries are installed],[ XML=$withval XML_LIBS="-lxml2 -lxslt -lexslt" if test -z "$XML" -o "$XML" = "yes"; then XML="" XML_INCLUDES="-I/usr/include/libxml2" AC_MSG_WARN([--with-xml value was not specified, hoping linker would find it]) else XML_INCLUDES="-I$XML/include -I$XML/include/libxml2" XML_LIBS="-L$XML/lib $XML_LIBS" if test -f $XML/include/libxslt/xslt.h -a -f $XML/lib/libxml2.la \ -a -f $XML/lib/libxslt.la -a -f $XML/lib/libexslt.la; then XML_LIBS="$XML/lib/libxml2.la $XML/lib/libxslt.la $XML/lib/libexslt.la" XML_OK="yes" fi fi if test -z "$XML_OK"; then AC_MSG_CHECKING(for xml) SAVE_LIBS=$LIBS LIBS="$LIBS $XML_LIBS $XML_INCLUDES" AC_TRY_LINK([ #include ],[ const char *v=xsltEngineVersion; ], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no) if test -z "$XML"; then AC_MSG_ERROR(please specify path to Gnome XML libraries: --with-xml=DIR) else AC_MSG_ERROR($XML does not seem to be valid Gnome XML installation directory) fi ) LIBS=$SAVE_LIBS fi AC_DEFINE(XML,,xml-abled parser) ]) AC_SUBST(XML_INCLUDES) AC_SUBST(XML_LIBS) dnl Mail receive argument AC_ARG_WITH(mailreceive,[ --with-mailreceive=DIR is the directory where Gnome MIME library is installed],[ MIME=$withval GLIB="glib-2.0" GMIME="gmime-2.4" if test -z "$MIME" -o "$MIME" = "yes"; then MIME="" MIME_INCLUDES=`pkg-config --cflags $GMIME 2>/dev/null` MIME_LIBS=`pkg-config --libs $GMIME 2>/dev/null` if test -z "$MIME_LIBS"; then GMIME="gmime-3.0" MIME_INCLUDES=`pkg-config --cflags $GMIME 2>/dev/null` MIME_LIBS=`pkg-config --libs $GMIME 2>/dev/null` fi AC_MSG_WARN([--with-mailreceive value was not specified, hoping linker would find Gnome MIME library]) else MIME_INCLUDES="-I$MIME/include/$GMIME" MIME_LIBS="-l$GMIME" if test -f $MIME/include/$GMIME/gmime/gmime.h -a -f $MIME/lib/lib$GMIME.la; then MIME_LIBS="$MIME/lib/lib$GMIME.la" if test -f $MIME/lib/lib$GLIB.la; then MIME_INCLUDES="$MIME_INCLUDES -I$MIME/include/$GLIB -I$MIME/lib/$GLIB/include" else GLIB_INCLUDES=`pkg-config --cflags $GLIB 2>/dev/null` MIME_INCLUDES="$MIME_INCLUDES $GLIB_INCLUDES" fi MIME_OK="yes" fi fi if test -z "$MIME_OK"; then AC_MSG_CHECKING(for mime) SAVE_LIBS=$LIBS LIBS="$LIBS $MIME_LIBS $MIME_INCLUDES" AC_TRY_LINK([ #include ],[ guint v=gmime_major_version; ], AC_MSG_RESULT(yes) , AC_MSG_RESULT(no) if test -z "$MIME"; then AC_MSG_ERROR(please specify path to Gnome MIME library: --with-mailreceive=DIR) else AC_MSG_ERROR($MIME does not seem to be valid Gnome MIME installation directory) fi ) LIBS=$SAVE_LIBS fi AC_DEFINE(WITH_MAILRECEIVE,,has \$mail:received) ]) AC_SUBST(MIME_INCLUDES) AC_SUBST(MIME_LIBS) dnl Sendmail argument AC_ARG_WITH(sendmail,[ \"--with-sendmail=COMMAND\" forces this command to send mail. example: \"--with-sendmail=/usr/sbin/sendmail -t\" (makes parser ignore user-defined sendmail commands)], AC_DEFINE_UNQUOTED(PA_FORCED_SENDMAIL,"$withval",parser uses this command instead of user-defined sendmail commands) ) dnl Apache module argument AC_ARG_WITH(apache,[ --with-apache=FILE FILE is the full path for APXS builds apache DSO module using apxs],[ APXS=$withval if test -z "$APXS" -o "$APXS" = "yes"; then APXS=`which apxs 2>/dev/null` if test -z "$APXS"; then APXS=`which apxs2 2>/dev/null` fi fi APACHE=`$APXS -q TARGET 2>/dev/null` if test -z "$APACHE"; then AC_MSG_ERROR($APXS does not seem to be valid apache apxs utility path) fi APACHE_MAIN_INC=`$APXS -q INCLUDEDIR` APACHE_EXTRA_INC=`$APXS -q EXTRA_INCLUDES 2>/dev/null` APACHE_INC="-I$APACHE_MAIN_INC $APACHE_EXTRA_INC" APACHE_CFLAGS=`$APXS -q CFLAGS` ]) AC_SUBST(APACHE) AC_SUBST(APACHE_INC) AC_SUBST(APACHE_CFLAGS) AM_CONDITIONAL(COMPILE_APACHE_MODULE, test -n "$APACHE") dnl Enable building of the convenience library LT_CONFIG_LTDL_DIR(src/lib/ltdl) LT_INIT(dlopen win32-dll no-pic) LTDL_INIT dnl Checks for typedefs, structures, and compiler characteristics AC_C_BIGENDIAN( AC_DEFINE(PA_BIG_ENDIAN,,compile for sparc processor) , AC_DEFINE(PA_LITTLE_ENDIAN,,compile for intel processor or compatible) , AC_MSG_ERROR(word endianness not determined for some obscure reason) ) AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_STRUCT_DIRENT_D_TYPE AC_SYS_LARGEFILE dnl Checks for C header files AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS(stdio.h sys/types.h sys/stat.h stdlib.h stddef.h memory.h string.h strings.h inttypes.h stdint.h unistd.h) AC_CHECK_HEADERS(assert.h limits.h ctype.h math.h process.h stdarg.h setjmp.h signal.h pthread.h) AC_CHECK_HEADERS(errno.h dirent.h fcntl.h io.h sys/file.h sys/locking.h sys/select.h sys/resource.h sys/wait.h) AC_CHECK_HEADERS(sys/socket.h netinet/in.h arpa/inet.h netdb.h) dnl Checks for libraries case "$host" in *-freebsd4*) AC_DEFINE(FREEBSD4,,FreeBSD4.X target platform) ;; *-freebsd1*) AC_DEFINE(FREEBSD1X,,FreeBSD1X.X target platform) ;; *-sunos5.6* | *-solaris2.6*) AC_CHECK_LIB(xnet, main) ;; *-sunos5* | *-solaris2*) AC_CHECK_LIB(socket, main) AC_CHECK_LIB(nsl, main) ;; *-nec-sysv4*) AC_CHECK_LIB(nsl, gethostbyname) AC_CHECK_LIB(socket, socket) ;; *-cygwin*) AC_DEFINE(WIN32,,Windows32 target platform) ;; esac AC_CHECK_LIB(m, sin) AC_CHECK_LIB(crypt, crypt) dnl Checks for functions AC_CHECK_FUNCS(flock fcntl lockf ftruncate fchmod) AC_CHECK_FUNCS(getrusage gettimeofday crypt sigsetjmp siglongjmp unsetenv syslog) dnl on some linux[seen on 2.4] it's a macro PA_CHECK_SIGSETJMP dnl see comment above AC_LANG_PUSH(C++) PA_CHECK_MATH_FUNCS_ONE_ARG(trunc round sign isfinite) AC_LANG_POP dnl We require qsort(3) AC_CHECK_FUNCS(qsort, , AC_MSG_ERROR([No qsort library function.])) dnl For build-in date implementation we need to know local offset from GMT AC_LANG_PUSH(C++) AC_MSG_CHECKING(for timezone variable) AC_TRY_COMPILE([#include ], [int test=timezone;], AC_DEFINE(HAVE_TIMEZONE) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_LANG_POP AC_MSG_CHECKING(for tm_gmtoff in struct tm) AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff=0;], AC_DEFINE(HAVE_TM_GMTOFF) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_MSG_CHECKING(for tm_tzadj in struct tm) AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj=0;], AC_DEFINE(HAVE_TM_TZADJ) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_MSG_CHECKING(for gettid) AC_TRY_COMPILE([ #include #include ], [uint tid=syscall(__NR_gettid);], AC_DEFINE(HAVE_GETTID) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_MSG_CHECKING(for TLS) AC_TRY_COMPILE([__thread int i=0;], [], AC_DEFINE(HAVE_TLS) AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) AC_MSG_CHECKING(for 0..9999 year date range support) AC_TRY_RUN([ #include #include int main() { struct tm tmL,tmH; memset(&tmL, 0, sizeof(tmL)); memset(&tmH, 0, sizeof(tmH)); tmL.tm_year=-1900; tmL.tm_mon=-1; tmH.tm_year=9999-1900; tmH.tm_mon=12-1; tmH.tm_mday=31; return mktime(&tmL)==-1 || mktime(&tmH)==-1; } ], AC_DEFINE(PA_DATE64) AC_MSG_RESULT(yes), AC_MSG_RESULT(no), AC_MSG_RESULT(no)) dnl Output header and makefiles AH_TEMPLATE([HAVE_TIMEZONE],[Define if you have timezone external variable in ]) AH_TEMPLATE([HAVE_TM_GMTOFF],[Define if you have tm_gmtoff member of tm structure in ]) AH_TEMPLATE([HAVE_TM_TZADJ],[Define if you have tm_tzadj member of tm structure in ]) AH_TEMPLATE([HAVE_GETTID],[Define if you have gettid()]) AH_TEMPLATE([HAVE_TLS],[Define if you have Thread-Local Storage]) AH_TEMPLATE([PA_DATE64],[Define if you have 0..9999 year date range support]) AM_CONFIG_HEADER(src/include/pa_config_auto.h) AC_OUTPUT( Makefile src/Makefile src/types/Makefile src/classes/Makefile src/include/Makefile src/main/Makefile src/sql/Makefile src/lib/Makefile src/lib/gd/Makefile src/lib/smtp/Makefile src/lib/gc/Makefile src/lib/gc/include/Makefile src/lib/pcre/Makefile src/lib/cord/Makefile src/lib/cord/include/Makefile src/lib/cord/include/private/Makefile src/lib/md5/Makefile src/lib/sdbm/Makefile src/lib/sdbm/pa-include/Makefile src/lib/json/Makefile src/lib/curl/Makefile src/lib/punycode/Makefile src/lib/memcached/Makefile src/targets/Makefile src/targets/cgi/Makefile src/targets/apache/Makefile src/targets/isapi/Makefile etc/Makefile etc/parser3.charsets/Makefile etc/auto.p) parser-3.5.1/README0000644000076400007640000000056513046665751010650 00000000000000Parser3 website is http://www.parser.ru/en/ Read the documentation at http://www.parser.ru/en/docs/ Check the ChangeLog to keep track of progresses. Check the INSTALL to find out how to compile and install Parser3. SQL drivers are in separate modules. Report bugs to mailbox@parser.ru or on http://www.parser.ru/forum/ $Id: README,v 1.6 2017/02/08 19:05:13 moko Exp $ parser-3.5.1/acsite.m40000644000076400007640000000170514731544543011474 00000000000000# paf@design.ru # included in configure.ac AC_DEFUN([PA_CHECK_MATH_FUNC_ONE_ARG],[ AC_MSG_CHECKING(for (maybe built-in) math function $1) AC_TRY_COMPILE([ #ifdef HAVE_MATH_H # include #endif ],[ double result=$1(1.6); ], [AC_MSG_RESULT(yes) $2], [AC_MSG_RESULT(no) $3]) ] ) AC_DEFUN([PA_CHECK_MATH_FUNCS_ONE_ARG],[ AC_FOREACH([AC_Func], [$1], [AH_TEMPLATE(AS_TR_CPP([HAVE_]AC_Func), [Define to 1 if you have the `]AC_Func[' (maybe built-in) math function function.])])dnl for pa_func in $1 do PA_CHECK_MATH_FUNC_ONE_ARG($pa_func, [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$pa_func]) $2)], [$3])dnl done ]) AC_DEFUN([PA_CHECK_SIGSETJMP],[ pa_func=sigsetjmp AC_MSG_CHECKING(for (maybe built-in) function $pa_func) AC_TRY_COMPILE([ #ifdef HAVE_SETJMP_H # include #endif ],[ $pa_func(0,0); ], [AC_MSG_RESULT(yes) AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$pa_func])) ], [AC_MSG_RESULT(no) ]) ] ) parser-3.5.1/config.guess0000644000076400007640000012443113111545410012262 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2015 Free Software Foundation, Inc. timestamp='2015-03-04' # 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 3 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches to . 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 1992-2015 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 "$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 case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # 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 tuples: *-*-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=`(uname -p 2>/dev/null || \ /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 ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-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*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ 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 # Determine ABI tags. case "${UNAME_MACHINE_ARCH}" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ;; 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}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_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 ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-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'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; 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 ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; 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:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-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:*:[4567]) 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/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` 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 -q __LP64__ 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:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-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-${LIBC}`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/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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 -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; e2k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #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-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${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-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 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.[02]*:*) 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 i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-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; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' 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; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; 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.[02]*:*) 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 ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku 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 ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-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 eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi 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 ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} 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 ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac 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: parser-3.5.1/compile0000755000076400007640000001624513111545410011326 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.5.1/INSTALL0000644000076400007640000001157114712047627011015 00000000000000$Id: INSTALL,v 1.58 2024/11/04 04:37:43 moko Exp $ 1. What is the process to compile Parser3? Just start ./buildall script and you would get $HOME/parser3install/bin/parser3 binary. NOTE: In case you do not need XML support, use ./buildall --without-xml NOTE: In case you need apache parser module (DSO), use ./buildall --with-apache NOTE: If you have gc, prce, libxml and libxslt installed, you can use ./configure --with-xml NOTE: In case you later would experience problems with gcc runtime exception handling (most notable when reporting sql-related problems), pass this to buildall script: --with-sjlj-exceptions (HPUX is reported to have such problems) NOTE: On some systems there are no "make" and you should run 'gmake', change buildall script accordingly then. 2. What is the process to install Parser3? Copy files from $HOME/parser3install directory into your cgi-bin directory. Then install Parser3 to handle documents, step-by-step instructions: http://www.parser.ru/en/docs/lang/install4apachecgi.htm" in English http://www.parser.ru/docs/lang/install4apachecgi.htm" in Russian Directory layout: bin/ parser3 -- CGI and command line Parser3 interpreter auto.p.dist -- configuration file sample, copy it to auto.p and adjust to your needs share/ charsets/ parser3.charsets/ -- charset definition files koi8-r.cfg -- cyrillic charset [KOI8-R encoding] windows-1251.cfg -- cyrillic charset [windows-1251 encoding] ... 3. I have heard about $mail:receive experimental support, how do I use it? Just start ./buildall --with-mailreceive. If you have glib and gmime installed, you can run ./configure --with-mailreceive. 4. Safety features You can disable any exec operations by setting --disable-execs option. file::exec, file::cgi and mail:send (unix version) methods would be disabled. You can enable reading and executing files, not belonging to group+user other than effective by setting --disable-safe-mode option. You can disable user-configured sendmail commands by forcing it, setting "--with=sendmail=COMMAND" option. 5. Since Parser 3.4.0 several optimizations were implemented. If you experience problems you can try to disable them by commenting corresponding defines and recompiling parser3. src/include/pa_opcode.h #define OPTIMIZE_BYTECODE_GET_CLASS -- $a: #define OPTIMIZE_BYTECODE_GET_ELEMENT -- $a ^a #define OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT -- $a.b ^a.b #define OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT -- $a.$b ^a.$b #define OPTIMIZE_BYTECODE_GET_SELF_ELEMENT -- $self.a ^self.a #define OPTIMIZE_BYTECODE_CONSTRUCT -- $a(expr), $a[value] $.a(expr), $.a[value] $self.a(expr), $self.a[value] #define OPTIMIZE_BYTECODE_CUT_REM_OPERATOR -- cut rem operator with any number of params during compilation #define OPTIMIZE_BYTECODE_STRING_POOL -- simplifying string's bytecode into expression #define OPTIMIZE_BYTECODE_GET_SELF_ELEMENT -- bytecode for $self.a ^self.a #define OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL -- bytecode for .CLASS, .CLASS_NAME #define FEATURE_GET_ELEMENT4CALL -- ^o.m[] calls get_element4call("m"), not get_element("m") src/include/pa_string.h #define HASH_CODE_CACHING -- calculated hash codes are cached and used for sequential hash lookups src/include/pa_memory.h #define USE_DESTRUCTORS -- destructors are used to decrease memory consumption during code processing and make ^memory:compact[] calls non-essential. src/types/pa_method.h #define OPTIMIZE_CALL -- allows faster operators execution by eliminating method frame with local variables creation and extra write context switches. #define OPTIMIZE_RESULT -- parser methods are marked when the $result variable was used. This allows write operations and context switching optimization. src/types/pa_wwrapper.h #define OPTIMIZE_SINGLE_STRING_WRITE -- reuse original VString in single string assignments. src/lib/cord/include/cord.h #define CORD_CAT_OPTIMIZATION -- CORD library never modifies source concatenations. But in parser write operations it is safe to modify them and save some memory. #define CORD_CHARS_CACHE -- language cords with same language and length are cached and reused. src/include/pa_string.h #define STRING_LENGTH_CACHING -- cache String::Body.length() for char* strings src/include/pa_hash.h #define HASH_ORDER -- hash keys are iterated in the order of insertion parser-3.5.1/configure0000755000076400007640000240323214740273416011672 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for parser 3.5.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" lt_ltdl_dir='src/lib/ltdl' SHELL=${CONFIG_SHELL-/bin/sh} lt_dlopen_dir="$lt_ltdl_dir" 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='parser' PACKAGE_TARNAME='parser' PACKAGE_VERSION='3.5.1' PACKAGE_STRING='parser 3.5.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="README" # 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" enable_option_checking=no ac_subst_vars='ltdl_LTLIBOBJS ltdl_LIBOBJS am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS LTDLOPEN LT_CONFIG_H subdirs CONVENIENCE_LTDL_FALSE CONVENIENCE_LTDL_TRUE INSTALL_LTDL_FALSE INSTALL_LTDL_TRUE ARGZ_H sys_symbol_underscore LIBADD_DL LT_DLPREOPEN LIBADD_DLD_LINK LIBADD_SHL_LOAD LIBADD_DLOPEN LT_DLLOADERS INCLTDL LTDLINCL LTDLDEPS LIBLTDL CXXCPP CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED LIBTOOL OBJDUMP DLLTOOL AS COMPILE_APACHE_MODULE_FALSE COMPILE_APACHE_MODULE_TRUE APACHE_CFLAGS APACHE_INC APACHE MIME_LIBS MIME_INCLUDES XML_LIBS XML_INCLUDES PCRE_LIBS PCRE_INCLUDES GC_LIBS dll_extension am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX YFLAGS YACC host_os host_vendor host_cpu host build_os build_vendor build_cpu build P3S AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking with_build_warnings with_coverage with_profiler with_assertions with_sjlj_exceptions with_system_cfg enable_safe_mode enable_execs enable_stringstream with_gc with_pcre with_xml with_mailreceive with_sendmail with_apache with_pic enable_shared enable_static enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock with_included_ltdl with_ltdl_include with_ltdl_lib enable_ltdl_install enable_largefile ' ac_precious_vars='build_alias host_alias target_alias YACC YFLAGS CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS CPP CXXCPP' ac_subdirs_all='src/lib/ltdl' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures parser 3.5.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/parser] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names 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 case $ac_init_help in short | recursive ) echo "Configuration of parser 3.5.1:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-safe-mode to enable reading and executing files belonging to group+user other then effective --disable-execs to disable any execs (file::exec, file::cgi, unix mail:send) --disable-stringstream to disable stringstream usage. when disabled table.save uses more memory, but more compilers are supported --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl --disable-largefile omit support for large files Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-build-warnings to enable build-time compiler warnings if gcc is used --with-coverage to enable gcov code coverage support --with-profiler to enable gprof code profiler support --with-assertions to enable assertions --with-sjlj-exceptions to enable simple 'throw' from dynamic library --with-system-cfg=FILE to specify system-wide auto.p --with-gc=DIR DIR is the directory where Boehm garbage collecting library is installed --with-pcre=DIR DIR is the directory where PCRE library is installed --with-xml=DIR DIR is the directory where Gnome XML libraries are installed --with-mailreceive=DIR is the directory where Gnome MIME library is installed \"--with-sendmail=COMMAND\" forces this command to send mail. example: \"--with-sendmail=/usr/sbin/sendmail -t\" (makes parser ignore user-defined sendmail commands) --with-apache=FILE FILE is the full path for APXS builds apache DSO module using apxs --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-included-ltdl use the GNU ltdl sources included here --with-ltdl-include=DIR use the ltdl headers installed in DIR --with-ltdl-lib=DIR use the libltdl.la installed in DIR Some influential environment variables: YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CXX C++ compiler command CXXFLAGS 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 CC C compiler command CFLAGS C compiler flags CPP C preprocessor CXXCPP 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 parser configure 3.5.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_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_cxx_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_cxx_try_compile # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_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_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_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_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_cxx_preproc_warn_flag$ac_cxx_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_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_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_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _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_decl # 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_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_uintX_t # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main () { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$4=yes" else eval "$4=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 eval ac_res=\$$4 { $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_member # 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 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 parser $as_me 3.5.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='parser' VERSION='3.5.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi P3S=`cd $srcdir/src ; pwd` # 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 cat >>confdefs.h <<_ACEOF #define PARSER_VERSION "$VERSION (compiled on $host)" _ACEOF case $host_os in *cygwin* ) $as_echo "#define CYGWIN /**/" >>confdefs.h ;; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$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 YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" if test "$YACC" != "bison -y"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: to regenerate Parser grammar YOU WOULD NEED BISON" >&5 $as_echo "$as_me: WARNING: to regenerate Parser grammar YOU WOULD NEED BISON" >&2;} else { $as_echo "$as_me:${as_lineno-$LINENO}: checking bison version" >&5 $as_echo_n "checking bison version... " >&6; } oldIFS=$IFS; IFS=. set `bison -V | sed -e 's/^GNU Bison version //' -e 's/^bison (GNU Bison) //' -e 's/$/./'` IFS=$oldIFS if test "$1" = "1" -a "$2" -lt "25"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2)." >&5 $as_echo "$as_me: WARNING: Bison 1.25 or newer needed to regenerate Parser compiler (found $1.$2)." >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $1.$2 (ok)" >&5 $as_echo "$1.$2 (ok)" >&6; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$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 CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $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_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$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_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" 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 CXX=$ac_ct_CXX fi fi fi fi # 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_cxx_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_cxx_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_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_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_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi 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 dynamic-link library extension" >&5 $as_echo_n "checking for dynamic-link library extension... " >&6; } case "$host_os" in *cygwin* ) dll_extension=dll;; * ) dll_extension=so esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dll_extension" >&5 $as_echo "$dll_extension" >&6; } # Check whether --with-build-warnings was given. if test "${with_build_warnings+set}" = set; then : withval=$with_build_warnings; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enabling compiler warnings" >&5 $as_echo "$as_me: WARNING: enabling compiler warnings" >&2;} CXXFLAGS="$CXXFLAGS -D_FORTIFY_SOURCE=2 -Wextra -Wall -Wno-parentheses" fi # Check whether --with-coverage was given. if test "${with_coverage+set}" = set; then : withval=$with_coverage; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enabling gcov support" >&5 $as_echo "$as_me: WARNING: enabling gcov support" >&2;} CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O0-9*//g'` CXXFLAGS=`echo "$XXCFLAGS" | $SED -e 's/-O0-9*//g'` CFLAGS="$CFLAGS -O0 -fprofile-arcs -ftest-coverage" CXXFLAGS="$CXXFLAGS -O0 -fprofile-arcs -ftest-coverage" LDFLAGS="$LDFLAGS -lgcov" fi # Check whether --with-profiler was given. if test "${with_profiler+set}" = set; then : withval=$with_profiler; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enabling gprof support" >&5 $as_echo "$as_me: WARNING: enabling gprof support" >&2;} CFLAGS="$CFLAGS -O0 -pg -g" CXXFLAGS="$CXXFLAGS -O0 -pg -g" fi # Check whether --with-assertions was given. if test "${with_assertions+set}" = set; then : withval=$with_assertions; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enabling assertions" >&5 $as_echo "$as_me: WARNING: enabling assertions" >&2;} else $as_echo "#define NDEBUG /**/" >>confdefs.h fi # Check whether --with-sjlj-exceptions was given. if test "${with_sjlj_exceptions+set}" = set; then : withval=$with_sjlj_exceptions; $as_echo "#define PA_WITH_SJLJ_EXCEPTIONS /**/" >>confdefs.h fi # Check whether --with-system-cfg was given. if test "${with_system_cfg+set}" = set; then : withval=$with_system_cfg; cat >>confdefs.h <<_ACEOF #define SYSTEM_CONFIG_FILE "$withval" _ACEOF fi # Check whether --enable-safe-mode was given. if test "${enable_safe_mode+set}" = set; then : enableval=$enable_safe_mode; SAFE_MODE=$enableval fi if test "$SAFE_MODE" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: enabling reading of files belonging to group+user other then effective" >&5 $as_echo "$as_me: WARNING: enabling reading of files belonging to group+user other then effective" >&2;} else $as_echo "#define PA_SAFE_MODE /**/" >>confdefs.h fi # Check whether --enable-execs was given. if test "${enable_execs+set}" = set; then : enableval=$enable_execs; if test "$enableval" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling file execs" >&5 $as_echo "$as_me: WARNING: disabling file execs" >&2;} $as_echo "#define NO_PA_EXECS /**/" >>confdefs.h fi fi # Check whether --enable-stringstream was given. if test "${enable_stringstream+set}" = set; then : enableval=$enable_stringstream; if test "$enableval" = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling stringstream usage" >&5 $as_echo "$as_me: WARNING: disabling stringstream usage" >&2;} $as_echo "#define NO_STRINGSTREAM /**/" >>confdefs.h fi fi # Check whether --with-gc was given. if test "${with_gc+set}" = set; then : withval=$with_gc; GC=$withval GC_LIBS="$GC/libgc.la" if test -f $GC_LIBS; then GC_OK="yes" else GC_LIBS="-L$GC -lgc" fi if test "$GC" = "yes"; then GC="" GC_LIBS="-lgc" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-gc value was not specified, hoping linker would find it" >&5 $as_echo "$as_me: WARNING: --with-gc value was not specified, hoping linker would find it" >&2;} fi else GC_LIBS="-lgc" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-gc was not specified, hoping linker would find it" >&5 $as_echo "$as_me: WARNING: --with-gc was not specified, hoping linker would find it" >&2;} fi if test -z "$GC_OK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libgc" >&5 $as_echo_n "checking for libgc... " >&6; } SAVE_LIBS=$LIBS LIBS="$LIBS $GC_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern int GC_dont_gc; int main () { GC_dont_gc=0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test -z "$GC"; then as_fn_error $? "please specify path to libgc: --with-gc=DIR" "$LINENO" 5 else as_fn_error $? "$GC does not seem to be valid libgc installation directory" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$SAVE_LIBS fi # Check whether --with-pcre was given. if test "${with_pcre+set}" = set; then : withval=$with_pcre; PCRE=$withval if test "$PCRE" = "yes"; then PCRE="" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-pcre value was not specified, hoping linker would find it" >&5 $as_echo "$as_me: WARNING: --with-pcre value was not specified, hoping linker would find it" >&2;} else PCRE_INCLUDES="-I$PCRE/include" if test -f $PCRE/include/pcre.h -a -f $PCRE/lib/libpcre.la; then PCRE_OK="yes" PCRE_LIBS="$PCRE/lib/libpcre.la" else if test -f $PCRE/include/pcre2.h -a -f $PCRE/lib/libpcre2-8.la; then PCRE_OK="yes" PCRE_LIBS="$PCRE/lib/libpcre2-8.la" $as_echo "#define HAVE_PCRE2 /**/" >>confdefs.h else PCRE_LIBS="-L$PCRE/lib" fi fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-pcre was not specified, hoping linker would find it" >&5 $as_echo "$as_me: WARNING: --with-pcre was not specified, hoping linker would find it" >&2;} fi if test -z "$PCRE_OK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre2" >&5 $as_echo_n "checking for pcre2... " >&6; } SAVE_LIBS=$LIBS LIBS="$LIBS $PCRE_LIBS $PCRE_INCLUDES -lpcre2-8" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define PCRE2_CODE_UNIT_WIDTH 8 #include int main () { void *v=pcre2_general_context_create(0,0,0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } PCRE_LIBS="$PCRE_LIBS -lpcre2-8" $as_echo "#define HAVE_PCRE2 /**/" >>confdefs.h PCRE_OK="yes" 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_exeext conftest.$ac_ext LIBS=$SAVE_LIBS fi if test -z "$PCRE_OK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre" >&5 $as_echo_n "checking for pcre... " >&6; } PCRE_LIBS="$PCRE_LIBS -lpcre" SAVE_LIBS=$LIBS LIBS="$LIBS $PCRE_LIBS $PCRE_INCLUDES" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { const char *v=pcre_version(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test -z "$PCRE"; then as_fn_error $? "please specify path to PCRE: --with-pcre=DIR" "$LINENO" 5 else as_fn_error $? "$PCRE does not seem to be valid PCRE installation directory" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$SAVE_LIBS fi # Check whether --with-xml was given. if test "${with_xml+set}" = set; then : withval=$with_xml; XML=$withval XML_LIBS="-lxml2 -lxslt -lexslt" if test -z "$XML" -o "$XML" = "yes"; then XML="" XML_INCLUDES="-I/usr/include/libxml2" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-xml value was not specified, hoping linker would find it" >&5 $as_echo "$as_me: WARNING: --with-xml value was not specified, hoping linker would find it" >&2;} else XML_INCLUDES="-I$XML/include -I$XML/include/libxml2" XML_LIBS="-L$XML/lib $XML_LIBS" if test -f $XML/include/libxslt/xslt.h -a -f $XML/lib/libxml2.la \ -a -f $XML/lib/libxslt.la -a -f $XML/lib/libexslt.la; then XML_LIBS="$XML/lib/libxml2.la $XML/lib/libxslt.la $XML/lib/libexslt.la" XML_OK="yes" fi fi if test -z "$XML_OK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xml" >&5 $as_echo_n "checking for xml... " >&6; } SAVE_LIBS=$LIBS LIBS="$LIBS $XML_LIBS $XML_INCLUDES" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { const char *v=xsltEngineVersion; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test -z "$XML"; then as_fn_error $? "please specify path to Gnome XML libraries: --with-xml=DIR" "$LINENO" 5 else as_fn_error $? "$XML does not seem to be valid Gnome XML installation directory" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$SAVE_LIBS fi $as_echo "#define XML /**/" >>confdefs.h fi # Check whether --with-mailreceive was given. if test "${with_mailreceive+set}" = set; then : withval=$with_mailreceive; MIME=$withval GLIB="glib-2.0" GMIME="gmime-2.4" if test -z "$MIME" -o "$MIME" = "yes"; then MIME="" MIME_INCLUDES=`pkg-config --cflags $GMIME 2>/dev/null` MIME_LIBS=`pkg-config --libs $GMIME 2>/dev/null` if test -z "$MIME_LIBS"; then GMIME="gmime-3.0" MIME_INCLUDES=`pkg-config --cflags $GMIME 2>/dev/null` MIME_LIBS=`pkg-config --libs $GMIME 2>/dev/null` fi { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-mailreceive value was not specified, hoping linker would find Gnome MIME library" >&5 $as_echo "$as_me: WARNING: --with-mailreceive value was not specified, hoping linker would find Gnome MIME library" >&2;} else MIME_INCLUDES="-I$MIME/include/$GMIME" MIME_LIBS="-l$GMIME" if test -f $MIME/include/$GMIME/gmime/gmime.h -a -f $MIME/lib/lib$GMIME.la; then MIME_LIBS="$MIME/lib/lib$GMIME.la" if test -f $MIME/lib/lib$GLIB.la; then MIME_INCLUDES="$MIME_INCLUDES -I$MIME/include/$GLIB -I$MIME/lib/$GLIB/include" else GLIB_INCLUDES=`pkg-config --cflags $GLIB 2>/dev/null` MIME_INCLUDES="$MIME_INCLUDES $GLIB_INCLUDES" fi MIME_OK="yes" fi fi if test -z "$MIME_OK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mime" >&5 $as_echo_n "checking for mime... " >&6; } SAVE_LIBS=$LIBS LIBS="$LIBS $MIME_LIBS $MIME_INCLUDES" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { guint v=gmime_major_version; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test -z "$MIME"; then as_fn_error $? "please specify path to Gnome MIME library: --with-mailreceive=DIR" "$LINENO" 5 else as_fn_error $? "$MIME does not seem to be valid Gnome MIME installation directory" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$SAVE_LIBS fi $as_echo "#define WITH_MAILRECEIVE /**/" >>confdefs.h fi # Check whether --with-sendmail was given. if test "${with_sendmail+set}" = set; then : withval=$with_sendmail; cat >>confdefs.h <<_ACEOF #define PA_FORCED_SENDMAIL "$withval" _ACEOF fi # Check whether --with-apache was given. if test "${with_apache+set}" = set; then : withval=$with_apache; APXS=$withval if test -z "$APXS" -o "$APXS" = "yes"; then APXS=`which apxs 2>/dev/null` if test -z "$APXS"; then APXS=`which apxs2 2>/dev/null` fi fi APACHE=`$APXS -q TARGET 2>/dev/null` if test -z "$APACHE"; then as_fn_error $? "$APXS does not seem to be valid apache apxs utility path" "$LINENO" 5 fi APACHE_MAIN_INC=`$APXS -q INCLUDEDIR` APACHE_EXTRA_INC=`$APXS -q EXTRA_INCLUDES 2>/dev/null` APACHE_INC="-I$APACHE_MAIN_INC $APACHE_EXTRA_INC" APACHE_CFLAGS=`$APXS -q CFLAGS` fi if test -n "$APACHE"; then COMPILE_APACHE_MODULE_TRUE= COMPILE_APACHE_MODULE_FALSE='#' else COMPILE_APACHE_MODULE_TRUE='#' COMPILE_APACHE_MODULE_FALSE= fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_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 do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_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 '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "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_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_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_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_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 fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "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_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_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_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$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 DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$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_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" 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 DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $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 OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" 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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $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 DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" 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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$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 AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$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_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" 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 AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $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 MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" 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 MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $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 DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $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_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" 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 DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $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 NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $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_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" 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 NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $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 LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $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_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" 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 LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $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 OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $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_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" 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 OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $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 OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $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_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" 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 OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac 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 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 # 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 dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=yes enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; 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_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" $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 AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; 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_AS+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" $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_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" 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 AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $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 DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" 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 DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $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 OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" 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 OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $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 ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $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; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer 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_cxx_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_cxx_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_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer 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_cxx_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_cxx_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 \"$CXXCPP\" 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 else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: { $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5 $as_echo_n "checking which extension is used for runtime loadable modules... " >&6; } if ${libltdl_cv_shlibext+:} false; then : $as_echo_n "(cached) " >&6 else module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 $as_echo "$libltdl_cv_shlibext" >&6; } if test -n "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_EXT "$libltdl_cv_shlibext" _ACEOF fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then cat >>confdefs.h <<_ACEOF #define LT_SHARED_EXT "$libltdl_cv_shrext" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variable specifies run-time module search path" >&5 $as_echo_n "checking which variable specifies run-time module search path... " >&6; } if ${lt_cv_module_path_var+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_module_path_var="$shlibpath_var" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 $as_echo "$lt_cv_module_path_var" >&6; } if test -n "$lt_cv_module_path_var"; then cat >>confdefs.h <<_ACEOF #define LT_MODULE_PATH_VAR "$lt_cv_module_path_var" _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 $as_echo_n "checking for the default library search path... " >&6; } if ${lt_cv_sys_dlsearch_path+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 $as_echo "$lt_cv_sys_dlsearch_path" >&6; } if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path="$dir" else sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir" fi done cat >>confdefs.h <<_ACEOF #define LT_DLSEARCH_PATH "$sys_dlsearch_path" _ACEOF fi LT_DLLOADERS= 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 LIBADD_DLOPEN= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 $as_echo_n "checking for library containing dlopen... " >&6; } if ${ac_cv_search_dlopen+:} 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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl; 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_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_dlopen+:} false; then : break fi done if ${ac_cv_search_dlopen+:} false; then : else ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 $as_echo "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LIBDL 1" >>confdefs.h if test "$ac_cv_search_dlopen" != "none required" ; then LIBADD_DLOPEN="-ldl" fi libltdl_cv_lib_dl_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main () { dlopen(0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $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 dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : $as_echo "#define HAVE_LIBDL 1" >>confdefs.h LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes" LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes then lt_save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" for ac_func in dlerror do : ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" if test "x$ac_cv_func_dlerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLERROR 1 _ACEOF fi done LIBS="$lt_save_LIBS" fi LIBADD_SHL_LOAD= ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : $as_echo "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD="-ldld" fi fi case $host_os in darwin[1567].*) # We only want this for pre-Mac OS X 10.4. ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" if test "x$ac_cv_func__dyld_func_lookup" = xyes; then : $as_echo "#define HAVE_DYLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" fi ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | os2* | pw32*) ac_fn_c_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include " if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl _ACEOF LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $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 dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : $as_echo "#define HAVE_DLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" fi LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done $as_echo "#define HAVE_LIBDLLOADER 1" >>confdefs.h fi LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" 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 _ prefix in compiled symbols" >&5 $as_echo_n "checking for _ prefix in compiled symbols... " >&6; } if ${lt_cv_sys_symbol_underscore+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&5 fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 $as_echo "$lt_cv_sys_symbol_underscore" >&6; } sys_symbol_underscore=$lt_cv_sys_symbol_underscore if test x"$lt_cv_sys_symbol_underscore" = xyes; then if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 $as_echo_n "checking whether we have to add an underscore for dlsym... " >&6; } if ${libltdl_cv_need_uscore+:} false; then : $as_echo_n "(cached) " >&6 else libltdl_cv_need_uscore=unknown save_LIBS="$LIBS" LIBS="$LIBS $LIBADD_DLOPEN" if test "$cross_compiling" = yes; then : libltdl_cv_need_uscore=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;; x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;; x$lt_dlunknown|x*) ;; esac else : # compilation failed fi fi rm -fr conftest* LIBS="$save_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 $as_echo "$libltdl_cv_need_uscore" >&6; } fi fi if test x"$libltdl_cv_need_uscore" = xyes; then $as_echo "#define NEED_USCORE 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 $as_echo_n "checking whether deplibs are loaded by dlopen... " >&6; } if ${lt_cv_sys_dlopen_deplibs+:} false; then : $as_echo_n "(cached) " >&6 else # PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this `case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[4-9]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[12345]*|irix6.[01]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[1234]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say `no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to `yes'. Without it, it would be `no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say `yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 $as_echo "$lt_cv_sys_dlopen_deplibs" >&6; } if test "$lt_cv_sys_dlopen_deplibs" != yes; then $as_echo "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h fi : for ac_header in argz.h do : ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default " if test "x$ac_cv_header_argz_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ARGZ_H 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) # include #endif " if test "x$ac_cv_type_error_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ERROR_T 1 _ACEOF else $as_echo "#define error_t int" >>confdefs.h $as_echo "#define __error_t_defined 1" >>confdefs.h fi ARGZ_H= for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify 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 else ARGZ_H=argz.h; _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" fi done if test -z "$ARGZ_H"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 $as_echo_n "checking if argz actually works... " >&6; } if ${lt_cv_sys_argz_works+:} false; then : $as_echo_n "(cached) " >&6 else case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test "$cross_compiling" != no; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | sed -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test "$lt_os_major" -gt 1 \ || { test "$lt_os_major" -eq 1 \ && { test "$lt_os_minor" -gt 5 \ || { test "$lt_os_minor" -eq 5 \ && test "$lt_os_micro" -gt 24; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 $as_echo "$lt_cv_sys_argz_works" >&6; } if test "$lt_cv_sys_argz_works" = yes; then : $as_echo "#define HAVE_WORKING_ARGZ 1" >>confdefs.h else ARGZ_H=argz.h _LT_LIBOBJS="$_LT_LIBOBJS argz.$ac_objext" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 $as_echo_n "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } if ${libltdl_cv_preloaded_symbols+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 $as_echo "$libltdl_cv_preloaded_symbols" >&6; } if test x"$libltdl_cv_preloaded_symbols" = xyes; then $as_echo "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h fi # Set options # Check whether --with-included_ltdl was given. if test "${with_included_ltdl+set}" = set; then : withval=$with_included_ltdl; fi if test "x$with_included_ltdl" != xyes; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. ac_fn_c_check_header_compile "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default " if test "x$ac_cv_header_ltdl_h" = xyes; then : ac_fn_c_check_decl "$LINENO" "lt_dlinterface_register" "ac_cv_have_decl_lt_dlinterface_register" "$ac_includes_default #include " if test "x$ac_cv_have_decl_lt_dlinterface_register" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dladvise_preload in -lltdl" >&5 $as_echo_n "checking for lt_dladvise_preload in -lltdl... " >&6; } if ${ac_cv_lib_ltdl_lt_dladvise_preload+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lltdl $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 lt_dladvise_preload (); int main () { return lt_dladvise_preload (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ltdl_lt_dladvise_preload=yes else ac_cv_lib_ltdl_lt_dladvise_preload=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dladvise_preload" >&5 $as_echo "$ac_cv_lib_ltdl_lt_dladvise_preload" >&6; } if test "x$ac_cv_lib_ltdl_lt_dladvise_preload" = xyes; then : with_included_ltdl=no else with_included_ltdl=yes fi else with_included_ltdl=yes fi else with_included_ltdl=yes fi fi # Check whether --with-ltdl_include was given. if test "${with_ltdl_include+set}" = set; then : withval=$with_ltdl_include; fi if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else as_fn_error $? "invalid ltdl include directory: \`$with_ltdl_include'" "$LINENO" 5 fi else with_ltdl_include=no fi # Check whether --with-ltdl_lib was given. if test "${with_ltdl_lib+set}" = set; then : withval=$with_ltdl_lib; fi if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else as_fn_error $? "invalid ltdl library directory: \`$with_ltdl_lib'" "$LINENO" 5 fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) case $enable_ltdl_convenience in no) as_fn_error $? "this package needs a convenience libltdl" "$LINENO" 5 ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_build_prefix}'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. $as_echo "#define HAVE_LTDL 1" >>confdefs.h LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) as_fn_error $? "\`--with-ltdl-include' and \`--with-ltdl-lib' options must be used together" "$LINENO" 5 ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL="-I$with_ltdl_include" ;; esac INCLTDL="$LTDLINCL" # Report our decision... { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl headers" >&5 $as_echo_n "checking where to find libltdl headers... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LTDLINCL" >&5 $as_echo "$LTDLINCL" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find libltdl library" >&5 $as_echo_n "checking where to find libltdl library... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBLTDL" >&5 $as_echo "$LIBLTDL" >&6; } # Check whether --enable-ltdl-install was given. if test "${enable_ltdl_install+set}" = set; then : enableval=$enable_ltdl_install; fi case ,${enable_ltdl_install},${enable_ltdl_convenience} in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac if test x"${enable_ltdl_install-no}" != xno; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else INSTALL_LTDL_TRUE='#' INSTALL_LTDL_FALSE= fi if test x"${enable_ltdl_convenience-no}" != xno; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else CONVENIENCE_LTDL_TRUE='#' CONVENIENCE_LTDL_FALSE= fi subdirs="$subdirs src/lib/ltdl" # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.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_func in closedir opendir readdir 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 else _LT_LIBOBJS="$_LT_LIBOBJS lt__dirent.$ac_objext" fi done for ac_func in strlcat strlcpy 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 else _LT_LIBOBJS="$_LT_LIBOBJS lt__strl.$ac_objext" fi done cat >>confdefs.h <<_ACEOF #define LT_LIBEXT "$libext" _ACEOF name= eval "lt_libprefix=\"$libname_spec\"" cat >>confdefs.h <<_ACEOF #define LT_LIBPREFIX "$lt_libprefix" _ACEOF name=ltdl eval "LTDLOPEN=\"$libname_spec\"" # Only expand once: { $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 PA_BIG_ENDIAN /**/" >>confdefs.h ;; #( no) $as_echo "#define PA_LITTLE_ENDIAN /**/" >>confdefs.h ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "word endianness not determined for some obscure reason" "$LINENO" 5 ;; esac 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 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "#define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) $as_echo "#define _UINT64_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint64_t $ac_cv_c_uint64_t _ACEOF ;; esac ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} 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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; 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_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} 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 opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; 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_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi ac_fn_c_check_member "$LINENO" "struct dirent" "d_type" "ac_cv_member_struct_dirent_d_type" " #include #ifdef HAVE_DIRENT_H # include #else # define dirent direct # ifdef HAVE_SYS_NDIR_H # include # endif # ifdef HAVE_SYS_DIR_H # include # endif # ifdef HAVE_NDIR_H # include # endif #endif " if test "x$ac_cv_member_struct_dirent_d_type" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_DIRENT_D_TYPE 1 _ACEOF fi # Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 $as_echo_n "checking for special C compiler options needed for large files... " >&6; } if ${ac_cv_sys_largefile_CC+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : break fi rm -f core conftest.err conftest.$ac_objext CC="$CC -n32" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 $as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if ${ac_cv_sys_file_offset_bits+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 $as_echo "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if ${ac_cv_sys_large_files+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 $as_echo "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF ;; esac rm -rf conftest* fi fi { $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 for ac_header in stdio.h sys/types.h sys/stat.h stdlib.h stddef.h memory.h string.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_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 assert.h limits.h ctype.h math.h process.h stdarg.h setjmp.h signal.h pthread.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 errno.h dirent.h fcntl.h io.h sys/file.h sys/locking.h sys/select.h sys/resource.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 for ac_header in sys/socket.h netinet/in.h arpa/inet.h netdb.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 case "$host" in *-freebsd4*) $as_echo "#define FREEBSD4 /**/" >>confdefs.h ;; *-freebsd1*) $as_echo "#define FREEBSD1X /**/" >>confdefs.h ;; *-sunos5.6* | *-solaris2.6*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lxnet" >&5 $as_echo_n "checking for main in -lxnet... " >&6; } if ${ac_cv_lib_xnet_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_xnet_main=yes else ac_cv_lib_xnet_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_main" >&5 $as_echo "$ac_cv_lib_xnet_main" >&6; } if test "x$ac_cv_lib_xnet_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXNET 1 _ACEOF LIBS="-lxnet $LIBS" fi ;; *-sunos5* | *-solaris2*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lsocket" >&5 $as_echo_n "checking for main in -lsocket... " >&6; } if ${ac_cv_lib_socket_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_main=yes else ac_cv_lib_socket_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_main" >&5 $as_echo "$ac_cv_lib_socket_main" >&6; } if test "x$ac_cv_lib_socket_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnsl" >&5 $as_echo_n "checking for main in -lnsl... " >&6; } if ${ac_cv_lib_nsl_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_main=yes else ac_cv_lib_nsl_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_main" >&5 $as_echo "$ac_cv_lib_nsl_main" >&6; } if test "x$ac_cv_lib_nsl_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi ;; *-nec-sysv4*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $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 gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $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 socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi ;; *-cygwin*) $as_echo "#define WIN32 /**/" >>confdefs.h ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 $as_echo_n "checking for sin in -lm... " >&6; } if ${ac_cv_lib_m_sin+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* 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 sin (); int main () { return sin (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_sin=yes else ac_cv_lib_m_sin=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 $as_echo "$ac_cv_lib_m_sin" >&6; } if test "x$ac_cv_lib_m_sin" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 $as_echo_n "checking for crypt in -lcrypt... " >&6; } if ${ac_cv_lib_crypt_crypt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $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 crypt (); int main () { return crypt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypt_crypt=yes else ac_cv_lib_crypt_crypt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 $as_echo "$ac_cv_lib_crypt_crypt" >&6; } if test "x$ac_cv_lib_crypt_crypt" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF LIBS="-lcrypt $LIBS" fi for ac_func in flock fcntl lockf ftruncate fchmod 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 getrusage gettimeofday crypt sigsetjmp siglongjmp unsetenv syslog 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 pa_func=sigsetjmp { $as_echo "$as_me:${as_lineno-$LINENO}: checking for (maybe built-in) function $pa_func" >&5 $as_echo_n "checking for (maybe built-in) function $pa_func... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_SETJMP_H # include #endif int main () { $pa_func(0,0); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$pa_func" | $as_tr_cpp` 1 _ACEOF 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 ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu for pa_func in trunc round sign isfinite do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for (maybe built-in) math function $pa_func" >&5 $as_echo_n "checking for (maybe built-in) math function $pa_func... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_MATH_H # include #endif int main () { double result=$pa_func(1.6); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$pa_func" | $as_tr_cpp` 1 _ACEOF 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 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 for ac_func in qsort do : ac_fn_c_check_func "$LINENO" "qsort" "ac_cv_func_qsort" if test "x$ac_cv_func_qsort" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_QSORT 1 _ACEOF else as_fn_error $? "No qsort library function." "$LINENO" 5 fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for timezone variable" >&5 $as_echo_n "checking for timezone variable... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int test=timezone; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : $as_echo "#define HAVE_TIMEZONE 1" >>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 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 tm_gmtoff in struct tm" >&5 $as_echo_n "checking for tm_gmtoff in struct tm... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct tm tm; tm.tm_gmtoff=0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_TM_GMTOFF 1" >>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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tm_tzadj in struct tm" >&5 $as_echo_n "checking for tm_tzadj in struct tm... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { struct tm tm; tm.tm_tzadj=0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_TM_TZADJ 1" >>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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettid" >&5 $as_echo_n "checking for gettid... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { uint tid=syscall(__NR_gettid); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_GETTID 1" >>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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TLS" >&5 $as_echo_n "checking for TLS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ __thread int i=0; int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : $as_echo "#define HAVE_TLS 1" >>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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 0..9999 year date range support" >&5 $as_echo_n "checking for 0..9999 year date range support... " >&6; } if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main() { struct tm tmL,tmH; memset(&tmL, 0, sizeof(tmL)); memset(&tmH, 0, sizeof(tmH)); tmL.tm_year=-1900; tmL.tm_mon=-1; tmH.tm_year=9999-1900; tmH.tm_mon=12-1; tmH.tm_mday=31; return mktime(&tmL)==-1 || mktime(&tmH)==-1; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : $as_echo "#define PA_DATE64 1" >>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 *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi ac_config_headers="$ac_config_headers src/include/pa_config_auto.h" ac_config_files="$ac_config_files Makefile src/Makefile src/types/Makefile src/classes/Makefile src/include/Makefile src/main/Makefile src/sql/Makefile src/lib/Makefile src/lib/gd/Makefile src/lib/smtp/Makefile src/lib/gc/Makefile src/lib/gc/include/Makefile src/lib/pcre/Makefile src/lib/cord/Makefile src/lib/cord/include/Makefile src/lib/cord/include/private/Makefile src/lib/md5/Makefile src/lib/sdbm/Makefile src/lib/sdbm/pa-include/Makefile src/lib/json/Makefile src/lib/curl/Makefile src/lib/punycode/Makefile src/lib/memcached/Makefile src/targets/Makefile src/targets/cgi/Makefile src/targets/apache/Makefile src/targets/isapi/Makefile etc/Makefile etc/parser3.charsets/Makefile etc/auto.p" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COMPILE_APACHE_MODULE_TRUE}" && test -z "${COMPILE_APACHE_MODULE_FALSE}"; then as_fn_error $? "conditional \"COMPILE_APACHE_MODULE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then as_fn_error $? "conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi LT_CONFIG_H=src/include/pa_config_auto.h _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi ltdl_LIBOBJS=$_ltdl_libobjs ltdl_LTLIBOBJS=$_ltdl_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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by parser $as_me 3.5.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ parser config.status 3.5.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _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 "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "src/include/pa_config_auto.h") CONFIG_HEADERS="$CONFIG_HEADERS src/include/pa_config_auto.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/types/Makefile") CONFIG_FILES="$CONFIG_FILES src/types/Makefile" ;; "src/classes/Makefile") CONFIG_FILES="$CONFIG_FILES src/classes/Makefile" ;; "src/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;; "src/main/Makefile") CONFIG_FILES="$CONFIG_FILES src/main/Makefile" ;; "src/sql/Makefile") CONFIG_FILES="$CONFIG_FILES src/sql/Makefile" ;; "src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;; "src/lib/gd/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/gd/Makefile" ;; "src/lib/smtp/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/smtp/Makefile" ;; "src/lib/gc/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/gc/Makefile" ;; "src/lib/gc/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/gc/include/Makefile" ;; "src/lib/pcre/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/pcre/Makefile" ;; "src/lib/cord/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/cord/Makefile" ;; "src/lib/cord/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/cord/include/Makefile" ;; "src/lib/cord/include/private/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/cord/include/private/Makefile" ;; "src/lib/md5/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/md5/Makefile" ;; "src/lib/sdbm/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/sdbm/Makefile" ;; "src/lib/sdbm/pa-include/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/sdbm/pa-include/Makefile" ;; "src/lib/json/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/json/Makefile" ;; "src/lib/curl/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/curl/Makefile" ;; "src/lib/punycode/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/punycode/Makefile" ;; "src/lib/memcached/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/memcached/Makefile" ;; "src/targets/Makefile") CONFIG_FILES="$CONFIG_FILES src/targets/Makefile" ;; "src/targets/cgi/Makefile") CONFIG_FILES="$CONFIG_FILES src/targets/cgi/Makefile" ;; "src/targets/apache/Makefile") CONFIG_FILES="$CONFIG_FILES src/targets/apache/Makefile" ;; "src/targets/isapi/Makefile") CONFIG_FILES="$CONFIG_FILES src/targets/isapi/Makefile" ;; "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "etc/parser3.charsets/Makefile") CONFIG_FILES="$CONFIG_FILES etc/parser3.charsets/Makefile" ;; "etc/auto.p") CONFIG_FILES="$CONFIG_FILES etc/auto.p" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # What type of objects to build. pic_mode=$pic_mode # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; 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 # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file, --srcdir, and --disable-option-checking arguments # so they do not pile up. ac_sub_configure_args= ac_prev= eval "set x $ac_configure_args" shift for ac_arg do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ | --c=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; --disable-option-checking) ;; *) case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_sub_configure_args " '$ac_arg'" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_arg="--prefix=$prefix" case $ac_arg in *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" # Pass --silent if test "$silent" = yes; then ac_sub_configure_args="--silent $ac_sub_configure_args" fi # Always prepend --disable-option-checking to silence warnings, since # different subdirs can have different --enable and --with options. ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d "$srcdir/$ac_dir" || continue ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 $as_echo "$ac_msg" >&6 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 cd "$ac_dir" # Check for guested configure; otherwise get Cygnus style configure. if test -f "$ac_srcdir/configure.gnu"; then ac_sub_configure=$ac_srcdir/configure.gnu elif test -f "$ac_srcdir/configure"; then ac_sub_configure=$ac_srcdir/configure elif test -f "$ac_srcdir/configure.in"; then # This should be Cygnus configure. ac_sub_configure=$ac_aux_dir/configure else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative name. ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 fi cd "$ac_popdir" done 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 parser-3.5.1/install-sh0000755000076400007640000003452313111545410011753 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.5.1/missing0000755000076400007640000001533013111545410011341 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: parser-3.5.1/aclocal.m40000644000076400007640000012432214740273414011617 00000000000000# generated automatically by aclocal 1.16.3 -*- Autoconf -*- # Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # -*- Autoconf -*- # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # # Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl AC_CONFIG_HEADERS($@)]) AC_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should simply use the 'AC][_PROG_CC' macro instead. Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', but upon 'ac_cv_prog_cc_stdc'.])]) AC_DEFUN([AM_C_PROTOTYPES], [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([src/lib/ltdl/m4/argz.m4]) m4_include([src/lib/ltdl/m4/libtool.m4]) m4_include([src/lib/ltdl/m4/ltdl.m4]) m4_include([src/lib/ltdl/m4/ltoptions.m4]) m4_include([src/lib/ltdl/m4/ltsugar.m4]) m4_include([src/lib/ltdl/m4/ltversion.m4]) m4_include([src/lib/ltdl/m4/lt~obsolete.m4]) parser-3.5.1/ltmain.sh0000644000076400007640000105152211764645505011610 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 parser-3.5.1/ChangeLog0000644000076400007640000344610114740300505011526 000000000000002025-01-10 moko * tests/results/320.processed: test result updated after syslog added * src/classes/op.C: minor MSVC fixes * src/lib/md5/pa_md5c.c: MSVC warnings fixed * operators.ru.txt, operators.txt: + ^syslog[ident;message[;info|warning|error|debug]] * src/classes/op.C: + ^syslog[ident;message[;info|warning|error|debug]] (implelents feature #1270) * configure, configure.ac, src/include/pa_config_auto.h.in, src/include/pa_version.h: 3.5.0 -> 3.5.1, syslog check 2025-01-06 moko * src/include/pa_hash.h: own prime numbers (nearest primes to 5 * 2^n) calculated and used * src/lib/md5/: pa_md5.h, pa_md5c.c: MD5 code now taken from https://www.hadrons.org/software/libmd/ 2024-12-28 moko * tests/httpd/run_tests.sh: for FreeBSD compatibility * tests/httpd/: 032.txt, 033.txt, 034.txt, 035.txt, 036.txt, 037.txt, 038.txt, ok.log, site/404.html, site/httpd.p: $request:uri and $request:path tests added (related to feature #1269) * operators.ru.txt, operators.txt: + $request:path documented (related to feature #1269) * tests/: 065.html, results/065.processed: $request:path, $request:uri tested * src/types/pa_vrequest.C: $request:path default is empty string to match an empty URI in console mode (related to feature #1269) * etc/auto.p.in: $request:path used (related to feature #1269) * src/types/: pa_vrequest.C, pa_vrequest.h: $request:path added (implements feature #1269) 2024-12-26 moko * configure, configure.ac, src/include/pa_version.h: 3.5.0rc -> 3.5.0 * src/lib/sdbm/: pa_strings.C, sdbm.c, sdbm_private.h, pa-include/pa_errno.h, pa-include/pa_file_info.h, pa-include/pa_file_io.h, pa-include/pa_sdbm.h, pa-include/pa_strings.h: unused code cleaned, pa_pstrcat uses pa_strcat * tests/results/223.processed: apache upgraded @parser.ru * src/lib/sdbm/: sdbm.c, sdbm_hash.c, sdbm_lock.c, sdbm_pair.c, sdbm_pair.h, sdbm_private.h, sdbm_tune.h, pa-include/pa_apr.h, pa-include/pa_errno.h, pa-include/pa_file_info.h, pa-include/pa_file_io.h, pa-include/pa_sdbm.h, pa-include/pa_strings.h: sdbm updated from version included in apache 2.0.43 to version included in apache 2.0.65 2024-12-24 moko * etc/auto.p.in: to avoid patching Debian package * src/main/: pa_exec.C, pa_http.C: final fixes for --with-build-warnings (dangling-reference warnings can be ignored) 2024-12-23 moko * src/: classes/file.C, classes/hash.C, classes/op.C, include/pa_common.h, main/pa_http.C, main/pa_request.C, types/pa_vcookie.C, types/pa_vform.C: more fixes for --with-build-warnings * src/: classes/date.C, classes/inet.C, classes/op.C, classes/reflection.C, include/pa_array.h, include/pa_config_includes.h, main/execute.C, main/pa_base64.C, main/pa_common.C, main/pa_globals.C, types/pa_vfile.C: fixes for --with-build-warnings 2024-12-21 moko * Makefile.am: +operators.ru.txt * operators.ru.txt, operators.txt: typo fixed 2024-12-20 moko * operators.txt: whitespace synced * operators.ru.txt, operators.txt: curl added * operators.ru.txt, operators.txt: logically sorted * operators.ru.txt: id added * operators.txt: ID added * operators.txt: translated * operators.ru.txt, operators.txt: operators.txt translated to english, synced format with operators.ru.txt * operators.ru.txt, operators.txt: renamed to operators.ru.txt, formatted * operators.ru.txt, operators.txt: formatted, actualized, oracle info moved to separate file 2024-12-19 moko * src/targets/cgi/parser3.C: avoid parser version requests logging in parser3.log 2024-12-18 moko * buildall: preventing --with-system-mailreceive linking with libglib-2.0/libgobject-2.0 left from --with-mailreceive (related to feature #1199) 2024-12-16 moko * operators.ru.txt, operators.txt: actualized for 3.5.0 * src/classes/table.C: exception text fixed 2024-12-15 moko * tests/: 102.html, results/102.processed: tests updated after $form:fields not editable again (related to feature #1254) * src/types/pa_vform.C: $form:tables/files (not $form:fields) can be edited (related to feature #1254) * src/types/pa_vform.C: reverted that $form:fields/tables/files/imap can be edited (related to feature #1254) for backward compatibility 2024-12-14 moko * operators.ru.txt, operators.txt: + array in operators.txt * tests/results/auto.p: avoid $mac execution unless on OS X * tests/388-sql.html: more OS support 2024-12-13 moko * tests/388-sql.html: sql tests under OS X now fixed * tests/results/auto.p: curl test under OS X now works * tests/: 346-curl.html, 347-curl.html, results/347-curl.processed: no dll name under Windows, hiding * tests/: 379-curl.html, results/379-curl.processed: some curl versions accept "HTTP/1.0 200OK? OK" status, some not, ignore * tests/: 030.html, 212.html, 219.html, 273.html, 346-curl.html, 389.html, results/030.processed, results/212.processed, results/219.processed, results/273.processed, results/320.processed, results/346-curl.processed, results/389.processed, results/auto.p: ^try-catch-filtered added and used * tests/: 347-curl.html, results/347-curl.processed: support for different error messages * src/classes/curl.C: several curl libraries supported, ^curl:options[ $.library[] ] resets to default * tests/: 223-curl.html, results/223-curl.processed: CONTENT_LENGTH removed as depends on curl version * tests/results/: 223-curl.processed, 394-curl.processed: curl fixed bug with \n in file names, test result updated * tests/388-sql.html: +libmysqlclient.so * etc/auto.p.in: +libmariadb 2024-12-12 moko * tests/: 388-sql.html, results/429-sql.processed: test results updated after test changed * tests/: 388-sql.html, 428-sql.html, 429-sql.html: tests updated for newer MariaDB compatibility * tests/: 388-sql.html, 429-sql.html, results/388-sql.processed, results/429-sql.processed: key -> id for new MariaDB compatibility * src/types/pa_vmethod_frame.h: warning war * src/: include/pa_charset.h, main/pa_charset.C: Adopted patch from Yavor Doganov with extra libxml2 headers including for Debian package 2024-12-11 moko * src/: targets/apache/mod_parser3_core.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vstatus.C: $status:log-filename added (related to feature #1262) * tests/: 440.html, results/440.processed: test for row is checked before accessing when table is modified during select (related to bug #1258) * src/: classes/table.C, include/pa_table.h: row should be checked before accessing as table can be modified during select (related to bug #1258) * src/types/pa_vmail.C: $mail:received tables -> elements array (related to feature #1226) * src/: classes/file.C, classes/image.C, classes/table.C, include/pa_exception.h: FIRST_ARG_MUST_NOT_BE_CODE replace with better messages (related to feature #1267) * tests/results/: 065.processed, 246.processed, 337.processed, 342.processed, 352.processed, 356.processed, 364.processed, 372.processed, 373.processed, 389.processed, 404.processed, 406.processed, 414.processed, 430.processed, 432.processed, 442.processed: tests updated after params.as_string error reporting was improved (related to feature #1267) * src/classes/reflection.C: error messages optimized (related to feature #1267) * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: even better error reporing for params.as_* (related to feature #1267) * src/: classes/file.C, classes/string.C, include/pa_exception.h: MODE_MUST_NOT_BE_CODE -> MODE_MUST_BE_STRING (related to feature #1267) * tests/results/: 246.processed, 414.processed, 432.processed: tests updated after params.as_string error reporting was improved (related to feature #1267) * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: better error reporing for params.as_string (implements feature #1267) * tests/: 065.html, results/065.processed: tests for file methods accepting file as filename added (related to feature #1265) * src/: classes/file.C, include/pa_exception.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: some file methods now accept file as path specification (adopted Sumo patch implements feature #1265) * tests/: 400.html, results/400.processed: tests for result optimization "locks" after first method call (related to feature #1266) 2024-12-10 moko * src/types/: pa_method.h, pa_vmethod_frame.h: detailed result_optimization comments (related to feature #1266) * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: optimization: $result now stored in my_result, not in local variables hash (implements feature #1266) 2024-12-09 moko * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: my.set -> set_my_variable in preparation for $result optimization (related to feature #1266) * tests/results/119.processed: newline corrected for some OS * tests/: 441.html, results/441.processed: Debian-specific test commented * buildall: pcre2 10.42 -> 10.44 2024-12-08 moko * buildall: external links fixed * src/include/pa_version.h: 3.4.7b -> 3.5.0rc * src/include/pa_table.h: some clang versions compilation fix * configure.ac: 3.4.7b -> 3.5.0rc 2024-12-07 moko * tests/: 443.html, 444.html, results/443.processed, results/444.processed: tests for named params (related to feature #1205) * src/: classes/reflection.C, types/pa_method.h: named_params support in reflection (related to feature #1205) * src/types/pa_vmethod_frame.h: extra_params and named params should be also inited in ^method[] call (related to feature #1205) * src/types/: pa_method.h, pa_vmethod_frame.h: named arguments support using @method[arg;.named_arg;.named_arg2] syntax (implements feature #1205) * tests/: 443.html, results/443.processed: test for *args inited added (related to bug #1264) * src/types/pa_vmethod_frame.h: *args are now inited even if not specified (fixes bug #1264) * tests/: 442.html, results/442.processed: tests for params.as_file_name(N) with empty file name added (related to feature #1121) * src/: classes/file.C, classes/hashfile.C, classes/image.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, include/pa_exception.h, types/pa_vmethod_frame.h: params.as_file_name(N) added and used instead of params.as_string(1, FILE_NAME_MUST_BE_STRING) where appropriate (implements feature #1121) * src/: classes/file.C, classes/image.C, classes/op.C, classes/table.C, include/pa_exception.h: filename is everywhere params.as_string, unify exception and remove FILE_NAME_MUST_NOT_BE_CODE (related to feature #1121) * tests/: 141.html, results/141.processed: test for ^math:digest[...; $.hmac[$file] $.format[file] ] added (related to feature #1263) * src/classes/math.C: ^math:digest[...; $.hmac[$file] $.format[file] ] now supported (implements feature #1263) 2024-12-06 moko * src/: targets/apache/mod_parser3_core.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vstatus.C: $status:mode (cgi/console/mail/httpd/apache/isapi) added (related to feature #1262) 2024-12-05 moko * src/targets/cgi/parser3.C: more correct arguments processing to block -fl config.file log.file logic (related to feature #1262) 2024-12-04 moko * src/targets/cgi/parser3.C: now only one log location is selected and tried. -l - supported for stderr specification (related to feature #1262) 2024-12-03 moko * tests/: 010.html, 415_dir/30.p, 415_dir/31.p, results/010.processed, results/415.processed: tests for $.(expression)[value], $a.(expression), ^v.(expression)[args] added (related to feature #1064) * src/main/compile.y: $.(expression)[value], $a.(expression), ^v.(expression)[args] now supported (implements feature #1064) 2024-12-02 moko * src/targets/cgi/parser3.C: -l /path/to/log options added (implements feature #1262) 2024-12-01 moko * tests/: 010.html, results/010.processed: some tests related to bug #1149 added * src/main/compile.y: the check pc.pos.col > 1 is not required because we can't be here without a '$' before. The begin == end check was incorrect since $[a]{b} fits this condition (fixes bug #1149) 2024-11-29 moko * src/classes/array.C: warning war 2024-11-26 moko * tests/: 441.html, results/441.processed: a bit more testing (related to bug #1238) * src/main/pa_exec.C: only " now quoted (related to bug #1239) * src/main/pa_exec.C: simplification arg_quote added (related to bug #1229) 2024-11-25 moko * src/main/pa_exec.C: separated cmd_quote and exe_quote (related to bug #1239) 2024-11-24 moko * src/main/pa_exec.C: added cmd.exe specific * tests/: 441.html, cat-windows.sh, cat.sh, results/441.processed: tests for ^file::exec env and args tainting tests (related to bug #1239) * src/main/pa_exec.C: shell_quote added (partial fix for bug #1239) * src/include/pa_config_includes.h: added recommendations for libxslt.a and and libexslt.a compilation under cygwin * tests/results/102.processed: $form:fields.value is now writable, as $form:value (related to feature #1254) * src/include/pa_config_includes.h: cigwin compilation fixes 2024-11-23 moko * tests/httpd/site/run_server.sh: to simplify testing * tests/httpd/: 030.txt, 031.curl, 040.txt, ok.log, run_tests.sh, site/form.html: $form:files and $form:elements tests added, tests with curl supported (related to feature #1254) * src/: include/pa_symbols.h, main/pa_symbols.C, types/pa_vform.C, types/pa_vform.h: $form:elements implemented, VForm::get_element uses faster SYMBOLS_EQ, hashes no longer copied when using $form:fields/tables/files/imap and can be edited (implements feature #1254) * src/main/pa_http.C: pa_send added to handle partial writes (fixes bug #1261) 2024-11-17 moko * tests/: 440.html, results/440.processed: tests for ^table.array[], offset restoration, iterators robust tests (related to bug #1258, features #1259 and #1260) * tests/: 439.html, results/439.processed: array and hash iterators robust tests (related to feature #1260) * src/: classes/array.C, classes/table.C, include/pa_array.h, include/pa_table.h: Array_robust_iterator added and used in cases where array can be modified during iteration (implements feature #1260) * src/classes/table.C: ^table.array[], ^table.array[column name], ^table.array{code} added (implements feature #1259) 2024-11-16 moko * src/: classes/table.C, include/pa_table.h, main/pa_table.C: fixed table current row restoration after exception and table changes (fixes bug #1258) 2024-11-13 moko * src/classes/table.C: minor optimization * src/main/pa_string.C: \r added to default ^string.trim chars list (https://www.parser.ru/forum/?id=86648) 2024-11-11 moko * src/classes/classes.C: set_base commented * src/classes/: classes.C, xdoc.C: cleanup after classes.awk deleted * src/classes/classes.vcproj: no more classes.awk and classes.inc * src/classes/: Makefile.am, classes.awk: no more classes.awk and classes.inc * src/: classes/classes.C, classes/classes.awk, classes/classes.h, main/pa_globals.C: classes.awk is useless, preparing to delete it * src/classes/classes.h: temp fix 2024-11-10 moko * src/: classes/date.C, classes/file.C, classes/image.C, classes/op.C, main/pa_string.C: minor optimization * src/: classes/date.C, classes/file.C, classes/image.C, classes/op.C, main/pa_string.C: typo fixed * src/: classes/classes.awk, classes/classes.h, classes/date.C, classes/file.C, classes/image.C, classes/op.C, main/pa_charsets.C, main/pa_string.C: singletones used to reduce memory allocation befor main(). Only 3 allocations in chatsets left (implements feature #1257) * src/targets/: apache/mod_parser3_core.C, isapi/parser3isapi.C: minor naming convention fix * tests/: 437.html, 438.html, httpd/ok.log, httpd/site/029.html, results/436.processed, results/437.processed, results/438.processed: tests for @unhandled_exception processing (related to feature #1256) * src/: main/pa_request.C, targets/apache/mod_parser3_core.C, targets/cgi/pa_sapi_info.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: Exceptions in @unhandled_exception are now processed in request::core for correct logging and reporting (feature #1256) * src/: include/pa_sapi.h, main/pa_request.C, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: unhandled exception now called if exception occures during $response:download processing (related to bug #1255) * etc/auto.p.in: better 404 error reporting 2024-11-09 moko * src/main/pa_memory.C: more detailed usage comment * src/main/pa_memory.C: usage commented * src/main/pa_memory.C: minor cleanup * src/types/: pa_varray.h, pa_vregex.h: warnings war * tests/: 436.html, httpd/029.txt, httpd/ok.log, httpd/site/029.html, results/436.processed: test for exception in $response:download[] added * src/targets/cgi/parser3.C: sync CGI mode behavior with httpd mode and avoid exit status 1 on die * tests/results/: 007.processed, 019.processed, 098.processed, 103.processed, 233.processed: windows headers matter for binary files * tests/httpd/ok.log: tests results updated as extra headers now cleared on error (related to bug #1255) * src/: include/pa_sapi.h, targets/apache/mod_parser3_core.C, targets/cgi/pa_sapi_info.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: headers buffering to avoid extra headers in errors, custom send_error in cgi/httpd mode to avoid memory allocations (fixes bug #1255) 2024-11-07 moko * tests/: 264.html, results/264.processed: tests updated to test removal of only trailing empty arguments for backward compatibility (related to feature #1252) * src/classes/file.C: remove trailing empty arguments for backward compatibility (related to feature #1252) 2024-11-05 moko * src/targets/cgi/: pa_sapi_info.h, parser3.C: avoid GPF in very low memory case, when static initialization failed even before main() start 2024-11-04 moko * configure, src/include/pa_config_auto.h.in, src/include/pa_config_fixed.h: _locking no longer used * configure.ac: _locking no longer used (related to bug #1231) * src/main/pa_os.C: lock error fine-tuning (related to bug #1231) * src/main/pa_os.C: lock errors tuning (related to bug #1231) * src/lib/sdbm/: pa_file_io.C, pa-include/pa_file_io.h: remove unused * src/: lib/sdbm/pa_file_io.C, main/pa_common.C: errno should not be used on locking errors (related to bug #1231) * src/main/pa_os.C: GetLastError used as errno is not set (related to bug #1231) * src/main/pa_os.C: under windows _locking replaced with LockFileEx allowing shared lock to work (fixes bug #1231) * INSTALL: actualized, minor fixes * etc/auto.p.in: default LIMITS added * AUTHORS: links actualized * src/: classes/array.C, classes/bool.C, classes/classes.C, classes/classes.awk, classes/classes.h, classes/curl.C, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/inet.C, classes/int.C, classes/json.C, classes/mail.C, classes/math.C, classes/memcached.C, classes/memory.C, classes/op.C, classes/reflection.C, classes/regex.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_base64.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_http.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_pool.h, include/pa_random.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_symbols.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, lib/punycode/pa_idna.c, lib/punycode/pa_idna.h, lib/sdbm/pa_file_io.C, lib/sdbm/pa_strings.C, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_base64.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_http.C, main/pa_memory.C, main/pa_os.C, main/pa_pool.C, main/pa_random.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_connection.C, main/pa_stylesheet_manager.C, main/pa_symbols.C, main/pa_table.C, main/pa_threads.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, sql/pa_sql_driver.h, targets/apache/mod_parser3.c, targets/apache/mod_parser3_core.C, targets/apache/pa_httpd.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_property.h, types/pa_value.C, types/pa_value.h, types/pa_varray.C, types/pa_varray.h, types/pa_vbool.h, types/pa_vcaller_wrapper.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.C, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.C, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.C, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemcached.C, types/pa_vmemcached.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vregex.C, types/pa_vregex.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.C, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: Copyright year updated 2024-10-28 moko * src/classes/array.C: avoid invalidate() * src/: classes/array.C, types/pa_varray.h: minor optimization for fused to survive in ^array::copy[$a] (related to feature #930) * src/types/pa_varray.h: minor optimization as last element is allways defined if present * tests/: 435.html, results/435.processed: tests for ^hash.set[first|last;value], ^hash.set([-+]index)[value] and same for array added (related to feature #1253) * src/classes/array.C: typo fixed * src/classes/: array.C, hash.C: ^hash.set[first|last;value] + ^hash.set([-+]index)[value], and same for array added (implements feature #1253) * tests/results/: 246.processed, 298.processed, 342.processed, 389.processed, 397.processed, 430.processed, 432.processed: tests results update after minor exceptions texts fixes 2024-10-27 moko * src/: classes/array.C, classes/hash.C, classes/math.C, classes/reflection.C, classes/string.C, classes/table.C, main/pa_string.C, types/pa_varray.h, types/pa_vfile.C, types/pa_vmethod_frame.h: handy as_index() added, several exceptions texts fixed (related to feature #930) * src/: classes/array.C, types/pa_varray.h: non-working $array.fields removed, ^array.delete[index] supported (related to feature #930) * tests/: 431.html, results/431.processed: tests updated after ^a.delete[3] supported * tests/: 431.html, 434.html, results/434.processed: tests for last element used, push/pop, exceptions during arguments processing and used caching (related to feature #930) * src/: classes/array.C, types/pa_varray.h: change_used added for better used caching and now no issues if exception occures during append arguments processing (related to feature #930) * src/: classes/array.C, types/pa_varray.h: ^array.push[] / ^array.pop[] added, last element is allways used (related to feature #930) 2024-10-26 moko * src/: classes/array.C, include/pa_array.h, types/pa_varray.C, types/pa_varray.h: confirm_all_used added where possible (related to feature #930) * src/: classes/array.C, include/pa_array.h, types/pa_varray.h: small array optimizations (related to feature #930) * src/types/pa_varray.h: DEBUG_ARRAY_USED added to simplify testing * tests/: 431.html, results/431.processed: test for ^array.compact[undef] added * src/classes/array.C: ^array.compact[] now have optional 'undef' argument to also compact undefined elements (related to feature #930) 2024-10-24 moko * src/: classes/array.C, types/pa_varray.C, types/pa_varray.h: VArray::hash is used rarery, no longer caching the result * tests/results/432.processed: testing removed from tests 2024-10-23 moko * tests/: 431.html, results/431.processed: ^array.compact[] test added * src/: classes/array.C, types/pa_varray.h: ^array.compact[] added * tests/: 432.html, results/432.processed: testing ^array.at[] for both "solid" and "sparse" arrays * src/classes/array.C: ^array.at[] speedup for "solid" arrays 2024-10-22 moko * tests/results/264.processed: spelling * src/classes/file.C: spelling * tests/: 264.html, cat-windows.sh, cat.sh, results/264.processed: tests updated after ^file::exec[cmd;;$array] implemented and empty arguments not skipped (related to feature #1252) * src/classes/file.C: ^file::exec[cmd;;$array] supported (implements feature #1252) bugfix: empty arguments no longer skipped 2024-10-21 moko * tests/httpd/: 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 030.txt, ok.log, run_tests.sh, site/httpd.p, site/index.html, site/test.txt: httpd tests added 2024-10-20 moko * src/classes/string.C: warnings war * src/: main/pa_string.C, classes/array.C: warnings war * src/classes/json.C: warnings war * src/classes/image.C: warnings war * src/: classes/table.C, types/pa_varray.C: warnings war * src/classes/array.C: warning war * src/: classes/classes.vcproj, types/types.vcproj: vcproj: +=array * src/main/main.vcproj: warnings war 2024-10-19 moko * tests/427.html: test updated after constructors renamed 2024-10-18 moko * tests/: 421.html, 430.html, 431.html, 432.html, 433.html, results/421.processed, results/430.processed, results/431.processed: test updated after constructors renamed * src/classes/array.C: create -> copy, new -> create according to https://www.parser.ru/forum/?id=86603 discussion (related to feature #930) 2024-10-16 moko * src/classes/json.C: $json:array[array or hash] added to provide more backward compatibility (implements feature #1251) 2024-10-15 moko * tests/: 421.html, results/421.processed: test results updated after missing constuctor error check added and array is_index check added * src/main/execute.C: absent constructor message fixed 2024-10-13 moko * src/types/pa_varray.h: ^array.$i[arg] is rare, thus checking i with is_index() before calling index() for better error reporting in method name typo (was invalid number, not method not found exception). 2024-10-08 moko * src/types/pa_varray.C: Visual Studio compatibilty issues fixed * src/include/pa_array.h: warnings war 2024-10-05 moko * src/classes/table.C: ^table.cells[] / ^table.cells(limit) added, returns current row cells array (implements feature #1250) * tests/: 405.html, results/169.processed, results/405.processed: tests updated after ^string.split[;a] implemented (related to feature #1249) * src/classes/string.C: ^string.split[] - 'a' option added for splitting into an array (implements feature #1249) 2024-10-04 moko * tests/: 431.html, results/431.processed: final code coverage array tests * src/: classes/array.C, include/pa_array.h, types/pa_varray.h: array: confirm_all_used() added and used where possible, expand() now expends faster 2024-10-03 moko * tests/: 357.html, results/auto.p: max_recoursion -> max_recursion * tests/: 256.html, results/256.processed: test for $.date[unix-timestamp] handling large dates * src/: classes/file.C, classes/op.C, classes/reflection.C, classes/string.C, classes/table.C, include/pa_common.h, main/pa_common.C, main/pa_http.C, main/pa_request.C, types/pa_vdate.C, types/pa_vmethod_frame.h, types/pa_vtable.C: format replaced with pa_uitoa where applicable, $.date[unix-timestamp] fixed for handling large dates * tests/: 433.html, results/433.processed: more tests, including test for possible endless recursion in ^o.GET[] * src/types/pa_vobject.C: bugfix: detecting possible endless recursion in get_scalar_value inside ^o.GET[] * src/: classes/json.C, include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vmethod_frame.C: Temp_recursion class added; spelling: $LIMITS.max_recoursion -> $LIMITS.max_recursion 2024-10-02 moko * tests/: 253.html, 287.html, 430.html, 431.html, 433.html, results/253.processed, results/287.processed, results/430.processed, results/433.processed: more tests for full array and json code coverage * tests/: 433.html, results/433.processed: tests for hash functions with array param * src/classes/: array.C, hash.C: ^hash::create[$array] optimized * tests/: 432.html, results/432.processed: modified ^hash.at tests in 246.html used to test ^array.at, same result produced * tests/: 430.html, 431.html, results/430.processed, results/431.processed: more array tests for 100% code coverage (related to feature #930) * tests/: 427.html, 430.html, results/427.processed, results/430.processed: first portion of array tests added (related to feature #930) * src/classes/array.C: allow only whitespace string as argument for add and join * src/classes/array.C: add behavour for array synced with hash 2024-09-30 moko * tests/: 429-sql.html, results/429-sql.processed: code coverage tests added * src/classes/array.C: $.distinct should not be used unless $.sparse(true) * tests/: 429-sql.html, results/388-sql.processed, results/429-sql.processed: tests for ^array::sql{}, including multi_statements mode (related to feature #930) 2024-09-29 moko * src/classes/array.C: synced ^array::sql multi_statements logic with ^hash::sql new behavour 2024-09-28 moko * tests/: 428-sql.html, results/388-sql.processed, results/428-sql.processed: tests updated after column names were fixed in multi_statements mode (related to feature #1197) * src/classes/hash.C: column names are fixed for most cases in multi_statements mode (related to feature #1197) * tests/: 428-sql.html, results/195.processed, results/224.processed, results/239.processed, results/254.processed, results/261.processed, results/306.processed, results/333.processed, results/341.processed, results/343.processed, results/344.processed, results/348.processed, results/364.processed, results/389.processed, results/390.processed, results/415.processed, results/420.processed, results/421.processed: tests results updated after error messages spelling minor fixes * src/types/: pa_value.h, pa_vstateless_class.h: a bit more spelling * src/: classes/curl.C, classes/file.C, classes/hash.C, classes/image.C, classes/math.C, classes/string.C, classes/table.C, lib/memcached/pa_memcached.C, main/compile.y, main/execute.C, main/pa_charset.C, main/pa_common.C, main/pa_http.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, types/pa_value.C, types/pa_value.h, types/pa_vmail.C, types/pa_vobject.C, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vxdoc.C: minor error messages spelling fixes * src/: classes/array.C, types/pa_varray.h: initial ^array::sql{} implementation (related to feature #930) * tests/: 388-sql.html, results/388-sql.processed: test results updated after rows number ^file::sql{} check added * src/classes/file.C: rows number now checked in ^file::sql{} * tests/: 428-sql.html, results/428-sql.processed: more tests * tests/: 428-sql.html, results/428-sql.processed: more multi_statements testing before bugfix * tests/: 388-sql.html, 428-sql.html, results/388-sql.processed, results/428-sql.processed: support for multiple sql test files added * tests/: 388-sql.html, results/388-sql.processed: more sql testing * src/classes/hash.C: more accurate one_bool_column processing * tests/: 427.html, results/427.processed: Constructors as methods behavour documented in test * src/classes/hash.C: HashStringValue::Iterator used for options * tests/: 388-sql.html, results/388-sql.processed: even more tests * tests/: 388-sql.html, results/388-sql.processed: a bit more testing * tests/results/367-curl.processed: test result updated after server charset changed * tests/results/347-curl.processed: error messages updated * tests/results/: 346-curl.processed, 379-curl.processed, 394-curl.processed: tests results updated after Type -> Exception type replacement * tests/results/388-sql.processed: tests result updated after Type -> Exception type 2024-09-27 moko * src/classes/hash.C: minor simplification 2024-09-24 moko * src/main/pa_string.C: atoui error messages improved * tests/: 165.html, 312.html, results/165.processed, results/312.processed, results/379.processed: tests updated after default endless loop limit increased, atoi error messages improved * src/classes/hash.C: VBool::get used, unification 2024-09-22 moko * src/classes/array.C: minor simplification * src/classes/array.C: ^array.left(N), ^array.right(N),^array.mid(P;N) added (related to feature #930) * src/: classes/array.C, include/pa_request.h, main/pa_request.C, types/pa_varray.C, types/pa_varray.h: $MAIN:LIMITS.max_array_size added, default 1000000 (related to feature #930) * tests/: 426.html, results/426.processed: test for negative limit and offset processing for table options added * src/: classes/table.C, include/pa_array.h, main/pa_table.C: bugfix: negative limit and offset processing for table options fixed 2024-09-21 moko * src/: classes/array.C, types/pa_varray.h: join supports hash; ^for added that also iterates holes; ^remove added (related to feature #930) * src/classes/array.C: ^array.join[$another_array; $.limit(N) $.offset(M) ] added (related to feature #930) 2024-09-20 moko * src/: classes/array.C, types/pa_varray.h: array: +foreach[value]{code}, + add[hash with numeric keys] (related to feature #930) 2024-09-19 moko * src/: include/pa_opcode.h, main/compile.y, main/compile_tools.h, main/execute.C, types/pa_varray.h: OP_CONSTRUCT_ARRAY added to support $a[v1;v2;...] syntax (related to feature #930) 2024-09-17 moko * src/: classes/reflection.C, include/pa_request.h, main/compile_tools.h, main/pa_request.C: ^reflection:class_alias[existing class name;alias class name] added. The array class can now be redefined regardless of the $.replace(bool) option value (related to feature #930) * src/main/: compile.y, compile_tools.h: class_add return value inverted to add it to request class * src/: classes/array.C, include/pa_array.h, include/pa_request.h, include/pa_stack.h, types/pa_varray.C, types/pa_varray.h, types/pa_vmethod_frame.h: array: fused -> fsize, fit(index) to resize if required. spared array - added fused, append. 2024-09-16 moko * src/types/pa_varray.h: get moved to where it belongs 2024-09-15 moko * src/: include/pa_array.h, types/pa_varray.h: more agressive expansion to minimize reallocs: fallocated/32 -> fallocated/4 * tests/: 421.html, results/323.processed, results/421.processed: tests updated after 'spared-array' class renamed to 'array' following a discussion on the forum (related to feature #930) * src/: include/pa_array.h, types/pa_value.h, types/pa_varray.h, types/pa_vmail.C: initial SparseArray separation from Array, parser class now 'array' 2024-09-14 moko * tests/: 030.html, results/030.processed: out of range expires check added * src/types/pa_vcookie.C: VDate range is narrower than gmtime, thus checking expires time using VDate 2024-09-13 moko * src/: classes/array.C, classes/curl.C, classes/date.C, classes/file.C, classes/hash.C, classes/image.C, classes/json.C, classes/memcached.C, classes/op.C, classes/regex.C, classes/string.C, classes/xdoc.C, classes/xnode.C, main/execute.C, main/pa_http.C, main/pa_request.C, types/pa_value.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcookie.C, types/pa_vhashfile.C, types/pa_vmail.C, types/pa_vobject.C, types/pa_vobject.h, types/pa_vxdoc.C, types/pa_vxdoc.h: optimization: Value::as() removed as dynamic_cast is faster, Value::is() is still required for is operator. 2024-09-12 moko * src/: classes/file.C, classes/image.C, classes/reflection.C, classes/table.C, classes/xnode.C, include/pa_array.h, include/pa_string.h, main/pa_common.C, main/pa_request.C, main/pa_string.C, targets/cgi/pa_sapi_info.h, types/pa_vform.C, types/pa_vhash.h, types/pa_vtable.C, types/pa_vxnode.C: faster templated pa_itoa/pa_uitoa added to work with any integer type, String::Body::Format removed 2024-09-10 moko * src/classes/array.C: append and insert methods added to sparse-array (related to feature #930) * tests/: 253.html, 255.html, 421.html, results/421.processed: tests updated after sparse-array was added to avoid ^json:parse[] using it in old tests (related to feature #930) * src/: classes/array.C, classes/json.C, types/pa_varray.C, types/pa_varray.h: sparse-array class added (initial feature #930 implementation) * src/: classes/Makefile.am, types/Makefile.am: Makefiles update for sparse-array class files (related to feature #930) * src/: classes/json.C, include/pa_array.h, types/pa_value.h, types/pa_vhash.h: VArray support functions without actual VArray files (related to feature #930) 2024-09-07 moko * src/: classes/curl.C, classes/string.C, classes/table.C, include/pa_array.h, main/execute.C, main/pa_dictionary.C, main/pa_http.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, main/pa_table.C, types/pa_vclass.C, types/pa_vmethod_frame.C, types/pa_vstateless_class.C, types/pa_vtable.C, types/pa_wcontext.C: Array::Iterator unified with Hash::Iterator, has_next() replaced with operator bool (related to feature #930) * src/: classes/string.C, include/pa_array.h, main/pa_http.C, main/pa_table.C, types/pa_vclass.C, types/pa_vmethod_frame.C, types/pa_vstateless_class.C: Array class extended, Array::Iterator added and used (related to feature #930) 2024-08-26 moko * src/targets/cgi/parser3.C: under Windows back_slashes_to_slashes should be used on argv[0] as well to match document root. 2024-08-25 moko * src/main/pa_request.C: be more specific * src/targets/cgi/parser3.C: parser3 t.html now behaves identically to /usr/bin/parser3 t.html in terms of /etc/parser3/auto.p load (fixes bug #1244) * src/targets/cgi/parser3.C: avoid "parser allready configured" exception when ./parser3.cgi is used; rsplit(..., '/') || rsplit(..., '\\') is not correct when / and \ are mixed in path * src/targets/cgi/parser3.C: full_disk_path now uses pa_strcat() 2024-07-24 moko * src/: include/pa_config_includes.h, lib/gd/gifio.C, main/execute.C, main/pa_string.C: Warning war: clang changed -Wdeprecated-register warning to -Wregister, it's easier to remove all register vars then continue this fight. :) * src/main/: compile.y, compile.tab.C: warning war: register removed 2024-07-14 moko * src/targets/cgi/pa_sapi_info.h: When accessing $env:name, checking the HTTP request environment; if the variable is not present, checking the web server process environment (implements feature #1242) 2024-05-26 moko * tests/: 195.html, 229.html, results/096.processed, results/097.processed, results/158.processed, results/186.processed, results/273.processed, results/293.processed, results/317.processed, results/389.processed, results/402.processed: tests updated as single quote now escaped with ' in HTML tainting mode (related to feature #1241) * src/main/untaint.C: single quote now escaped with ' in HTML tainting mode (implements feature #1241) * tests/results/: 020.processed, 021.processed, 026.processed, 042.processed, 043.processed, 057.processed, 110.processed, 115.processed, 116.processed, 117.processed, 118.processed, 119.processed, 120.processed, 125.processed, 126.processed, 128.processed, 130.processed, 131.processed, 132.processed, 133.processed, 135.processed, 136.processed, 138.processed, 139.processed, 140.processed, 145.processed, 150.processed, 151.processed, 165.processed, 174.processed, 181.processed, 182.processed, 192.processed, 193.processed, 201.processed, 213.processed, 224.processed, 226.processed, 230.processed, 239.processed, 240.processed, 244.processed, 253.processed, 254.processed, 261.processed, 264.processed, 269.processed, 274.processed, 275.processed, 288.processed, 294.processed, 296.processed, 303.processed, 306.processed, 307.processed, 308.processed, 311.processed, 312.processed, 314.processed, 315.processed, 316.processed, 320.processed, 323.processed, 324.processed, 325.processed, 328.processed, 330.processed, 332.processed, 333.processed, 337.processed, 338.processed, 341.processed, 342.processed, 343.processed, 344.processed, 345.processed, 348.processed, 352.processed, 356.processed, 357.processed, 363.processed, 364.processed, 368.processed, 372.processed, 373.processed, 376.processed, 378.processed, 379.processed, 385.processed, 386.processed, 387.processed, 389.processed, 390.processed, 395.processed, 397.processed, 398.processed, 399.processed, 404.processed, 406.processed, 413.processed, 414.processed, 420.processed, 421.processed, 424.processed, auto.p: Type -> Exception type for readability * tests/: 119.html, 165.html, 175.html, 192.html, 213.html, 217.html, 230.html, 240.html, 298.html, 380.html, 415.html, results/119.processed, results/165.processed, results/175.processed, results/192.processed, results/213.processed, results/217.processed, results/230.processed, results/240.processed, results/298.processed, results/380.processed, results/415.processed: try-catch, try-catch-comment used 2024-05-21 moko * tests/: 169.html, 180.html, 195.html, 224.html, 246.html, results/180.processed, results/195.processed, results/224.processed, results/auto.p: @try-catch-comment added and used * tests/: 175.html, 256.html, 269.html, 283.html, 341.html, 415.html, results/269.processed, results/283.processed, results/auto.p: more tests are updated to prepare for apostrophe escaping in HTML tainting * tests/results/: 181.processed, 294.processed, 296.processed, 315.processed, 379.processed, 389.processed, auto.p: $exception.comment printed as-is for whitespace reporting and to prepare for apostrophe escaping in HTML mode 2024-05-11 moko * tests/: 099.html, 100.html, results/099.processed, results/100.processed: a test for non-UTF-8 filename* added (related to feature #1240) * tests/: 293.html, results/293.processed: tainting modes tests added * tests/results/: 099.processed, 100.processed, 205.processed, 309.processed, 310.processed, 419.processed: tests results updated after filename* added (related to feature #1240) * src/: include/pa_common.h, main/pa_request.C: The filename* parameter was added to the Content-Disposition header to conform with RFC 6266, with code provided by Sumo (implements feature #1240) 2024-05-10 moko * src/main/pa_http.C: Testing shows that TCP_NODELAY has no positive performance effect in our case 2024-03-27 moko * src/lib/pcre/pcre_internal.vcproj: pa_config_includes.h used (related to feature #1236) 2024-03-15 moko * tests/: 413.html, results/413.processed: test for object still can be used as file parameter (related to bug #1218) * src/types/: pa_vobject.C, pa_vobject.h: regression fix: object still can be used in file context (fixes bug #1218) 2024-03-14 moko * src/include/pa_string.h: ArrayString get() null result assert also added (related to bug #1238) * src/types/: pa_vstring.h, pa_vtable.C: VString() optimized; VString::empty() used instead of new VString() 2024-03-12 moko * tests/: 379-curl.html, 379.html, results/379-curl.processed, results/379.processed: test added for cookie without value (related to bug #1238) * src/include/pa_string.h: In assertions enabled mode, ArrayString values are now required to be non-null (related to bug #1238) * src/main/pa_http.C: cookies without value are now parsed correctly (fixed bug #1238) 2024-03-11 moko * tests/run_parser.sh: for better error reporting 2023-12-30 moko * tests/: 038.html, results/038.processed: test for atan2 added 2023-12-29 moko * src/classes/math.C: atan2(y,x) math function added 2023-12-14 moko * tests/212.html: pcre2 compatibility (related to feature #1236) * tests/: 425.html, results/425.processed: test for pcre/pcre2 exceptions and behavour added (related to feature #1236) 2023-12-13 moko * buildall: by default parser is now bundled with pcre2 10.42, --without-pcre2 option added to build with pcre-8.45 (related to feature #1236) 2023-12-12 moko * configure.ac, src/include/pa_config_auto.h.in: pcre2 library support added (implements feature #1236) * src/: include/pa_charset.h, include/pa_config_includes.h, lib/pcre/pa_pcre_internal.h, lib/pcre/pa_pcre_valid_utf8.c, main/pa_common.C, main/pa_globals.C, types/pa_vregex.C, types/pa_vregex.h: Adopted patch from Yavor Doganov to add pcre2 library support (implements feature #1236) 2023-11-28 moko * src/include/pa_config_includes.h: warnings war continues * src/include/pa_config_includes.h: warning war * tests/: 424.html, results/424.processed: tests for '+' and '-' number strings, whitespace and sign in exception messages (related to bug #1234) 2023-11-26 moko * tests/: 274.html, results/224.processed, results/274.processed: tests for date double, int, bool added (related to feature #1235) * src/: classes/date.C, types/pa_vdate.h: double,int,bool methods added for date class (implements feature #1235) 2023-11-23 moko * src/: classes/math.C, include/pa_string.h, main/pa_string.C: '+' and '-' strings are no longer can be treated as number 0, exception thrown (fixes bug #1234) 2023-11-18 moko * src/include/pa_types.h: minor * src/include/pa_dir.h: MAXPATH in UTF-16 chars, not bytes * tests/: 389.html, results/389.processed: error messages for some OS differs a bit, reducing failing tests for them 2023-11-17 moko * tests/: 423.html, results/423.processed: test for optional @auto[] inheritance added (related to feature #1233) * src/: include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_vstateless_class.C: optional @auto[] inheritance implemented if defined with two args (path, class name) (implements feature #1233) * src/: classes/double.C, classes/int.C, classes/math.C, include/pa_random.h, include/pa_types.h, main/pa_common.C, types/pa_vdouble.h, types/pa_vint.h: clip2int,clip2uint added to sync double->int overflow behavour under different architectures (fixes bug #1232) * tests/: 422.html, results/422.processed: int clipping added 2023-11-16 moko * tests/: 422.html, results/422.processed: test for int and uint overflow in ^n.format[d/u/x] * src/classes/math.C: bugfix: crc32 should not be negative (under Apple M1 when negative double converts to uint the result is 0) and crc32 should be 32 bits * src/main/pa_common.C: avoid (uint) conversion as on Apple M1 it's 0 * src/classes/file.C: bugfix: crc32 should not be negative (under Apple M1 when negative double converts to uint the result is 0) and crc32 should be 32 bits 2023-10-07 moko * src/: main/execute.C, types/pa_vdate.h: volatile added to sync behavour with other OP_NUM_*, related to bug #1230 2023-10-06 moko * tests/: 338.html, results/338.processed: test for bug #1230 added * src/: main/execute.C, types/pa_vdate.h: force double operands to be converted to double to avoid 80 bit operations in x87 mode (fixes bug #1230) 2023-10-05 moko * tests/420.html: add feature FEATURE_GET_ELEMENT4CALL disabled compatibility * tests/337.html: 2work without FEATURE_GET_ELEMENT4CALL * tests/: 421.html, results/421.processed: test to cover all classes and objects nonexistent method and field exceptions (related to feature #1080 and #1227) * tests/results/: 182.processed, 324.processed: undefined method -> method not found exception (related to feature #1080) * src/types/: pa_vbool.h, pa_vconsole.h, pa_vdouble.h, pa_vint.h, pa_vregex.C, pa_vstateless_object.h: + VSimple_stateless_object, "element can not be fetched from" for them, "field not found" for all other types (related to bug #1227) 2023-10-03 moko * src/types/pa_vstateless_class.h: "Source: , Comment: method not found" exception now thrown for static calls instead of "undefined method" without class name (related to feature #1080) 2023-10-02 moko * src/types/: pa_vdouble.h, pa_vhash.h, pa_vint.h, pa_vobject.C, pa_vstateless_object.h, pa_vstring.h, pa_vtable.C: "Source: , Comment: method not found" exception now thrown for all dynamic objects instead of "undefined method" without class name (implements feature #1080) 2023-10-01 moko * src/classes/json.C: we don't have a dynamic json object. 2023-09-28 moko * tests/: 420.html, results/261.processed, results/420.processed: tests updated after bug #1228 fix reverted * src/types/pa_vstring.h: revering fix for bug #1228, as empty or whitespace string is hash compatible, so we don't want $s.key to return a junction * tests/: 261.html, 420.html, results/261.processed, results/420.processed: test for bug #1227 added, test updated after bug #1228 fixed * src/types/: pa_vdouble.h, pa_vint.h: $int.field and $double.field now throws exception as $non-empty-string.field (fixes bug #1227) * src/types/pa_vstring.h: allow $string.method access (fixes bug #1228) 2023-09-26 moko * AUTHORS, aclocal.m4, configure, src/classes/bool.C, src/classes/classes.C, src/classes/classes.awk, src/classes/classes.h, src/classes/curl.C, src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/form.C, src/classes/hash.C, src/classes/hashfile.C, src/classes/image.C, src/classes/inet.C, src/classes/int.C, src/classes/json.C, src/classes/mail.C, src/classes/math.C, src/classes/memcached.C, src/classes/memory.C, src/classes/op.C, src/classes/reflection.C, src/classes/regex.C, src/classes/response.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h, src/include/pa_array.h, src/include/pa_base64.h, src/include/pa_cache_managers.h, src/include/pa_charset.h, src/include/pa_charsets.h, src/include/pa_common.h, src/include/pa_config_fixed.h, src/include/pa_config_includes.h, src/include/pa_dictionary.h, src/include/pa_dir.h, src/include/pa_exception.h, src/include/pa_exec.h, src/include/pa_globals.h, src/include/pa_hash.h, src/include/pa_http.h, src/include/pa_memory.h, src/include/pa_opcode.h, src/include/pa_operation.h, src/include/pa_os.h, src/include/pa_pool.h, src/include/pa_random.h, src/include/pa_request.h, src/include/pa_request_charsets.h, src/include/pa_request_info.h, src/include/pa_sapi.h, src/include/pa_socks.h, src/include/pa_sql_connection.h, src/include/pa_sql_driver_manager.h, src/include/pa_stack.h, src/include/pa_string.h, src/include/pa_stylesheet_connection.h, src/include/pa_stylesheet_manager.h, src/include/pa_symbols.h, src/include/pa_table.h, src/include/pa_threads.h, src/include/pa_types.h, src/include/pa_uue.h, src/include/pa_xml_exception.h, src/include/pa_xml_io.h, src/lib/gd/gif.C, src/lib/gd/gif.h, src/lib/gd/gifio.C, src/lib/ltdl/configure, src/lib/md5/pa_md5.h, src/lib/md5/pa_md5c.c, src/lib/memcached/pa_memcached.C, src/lib/memcached/pa_memcached.h, src/lib/punycode/pa_idna.c, src/lib/punycode/pa_idna.h, src/lib/sdbm/pa_file_io.C, src/lib/sdbm/pa_strings.C, src/lib/smtp/comms.C, src/lib/smtp/smtp.C, src/lib/smtp/smtp.h, src/main/compile.C, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.C, src/main/compile_tools.h, src/main/execute.C, src/main/pa_base64.C, src/main/pa_cache_managers.C, src/main/pa_charset.C, src/main/pa_charsets.C, src/main/pa_common.C, src/main/pa_dictionary.C, src/main/pa_dir.C, src/main/pa_exception.C, src/main/pa_exec.C, src/main/pa_globals.C, src/main/pa_http.C, src/main/pa_memory.C, src/main/pa_os.C, src/main/pa_pool.C, src/main/pa_random.C, src/main/pa_request.C, src/main/pa_socks.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_stylesheet_connection.C, src/main/pa_stylesheet_manager.C, src/main/pa_symbols.C, src/main/pa_table.C, src/main/pa_threads.C, src/main/pa_uue.C, src/main/pa_xml_exception.C, src/main/pa_xml_io.C, src/main/untaint.C, src/main/helpers/simple_folding.pl, src/sql/pa_sql_driver.h, src/targets/apache/mod_parser3.c, src/targets/apache/mod_parser3_core.C, src/targets/apache/pa_httpd.h, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, src/types/pa_junction.h, src/types/pa_method.h, src/types/pa_property.h, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vbool.h, src/types/pa_vcaller_wrapper.h, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vconsole.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vdate.C, src/types/pa_vdate.h, src/types/pa_vdouble.h, src/types/pa_venv.C, src/types/pa_venv.h, src/types/pa_vfile.C, src/types/pa_vfile.h, src/types/pa_vform.C, src/types/pa_vform.h, src/types/pa_vhash.C, src/types/pa_vhash.h, src/types/pa_vhashfile.C, src/types/pa_vhashfile.h, src/types/pa_vimage.C, src/types/pa_vimage.h, src/types/pa_vint.h, src/types/pa_vjunction.C, src/types/pa_vjunction.h, src/types/pa_vmail.C, src/types/pa_vmail.h, src/types/pa_vmath.C, src/types/pa_vmath.h, src/types/pa_vmemcached.C, src/types/pa_vmemcached.h, src/types/pa_vmemory.h, src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vregex.C, src/types/pa_vregex.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vstatus.C, src/types/pa_vstatus.h, src/types/pa_vstring.C, src/types/pa_vstring.h, src/types/pa_vtable.C, src/types/pa_vtable.h, src/types/pa_vvoid.C, src/types/pa_vvoid.h, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wcontext.C, src/types/pa_wcontext.h, src/types/pa_wwrapper.h: copyright, authors actualized 2023-08-20 moko * tests/: 141.html, results/141.processed: test for ^math:uuid7[] commited (related to feature #1219) 2023-08-16 moko * src/main/pa_random.C: replaced clock precision with monotonicity counter, good for Windows version with low clock frequency (related to feature #1229) 2023-08-15 moko * src/: main/pa_random.C, types/pa_vstatus.C: win32 compatibility fixes related to feature #1229 * src/: classes/math.C, include/pa_random.h, main/pa_random.C, types/pa_vstatus.C: ^math:uuid7 added, code provided by Sumo (implements feature #1229) 2023-08-02 moko * tests/: results/417.processed, 417.html: test for empty string match after last char added (related to bug #1224) * src/main/pa_string.C: avoid prestart++ after last char on zero length match (related to bug #1224) 2022-11-22 moko * tests/: 419.html, results/419.processed: test for L_URI and path removeal from filename added (related to bug #1204) * src/main/pa_request.C: bugfix: pa_filename was lost in 1.394 commit (related to bug #1204), L_HTTP_HEADER is incorrect for attribute value, L_URI should be used 2022-09-21 moko * src/targets/cgi/parser3.C: more clear error messages * src/targets/cgi/parser3.C: only SAPI_Info_CGI can read POST, SAPI_Info will return 0 in read_post and post_size != content_length will be thrown 2022-08-23 moko * src/types/pa_vmail.C: .tables addes as .raw contains only last header value 2022-08-22 moko * tests/: 418.html, results/418.processed: test for ^hash_a.intersection[hash_b; $.order[self|arg] ] added (related to #1225) * src/classes/hash.C: keep old behavoir by default * src/classes/hash.C: ^hash_a.intersection[hash_b; $.order[self|arg] ] added (implements #1215) 2022-03-21 moko * src/main/pa_charset.C: bugfix: +static xml_encoding_handlers as xmlInitCharEncodingHandlers is called in libxml static initializers before gc_substitute_memory_management_functions in pa_globals and thus gc may not see reference to our xmlCharEncodingHandler and free it. 2022-01-26 moko * src/targets/cgi/parser3.C: argv[0] -> parser3_filespec 2021-12-28 moko * tests/: 417.html, results/417.processed: test for empty string match added (related to bug #1224) * src/main/pa_string.C: empty string match now works (fixes bug #1224) 2021-12-24 moko * tests/: 415_dir/29.p, results/415.processed: yet another test 2021-12-23 moko * src/: classes/table.C, main/pa_request.C: warnings war * src/: include/pa_common.h, include/pa_http.h, main/pa_common.C, main/pa_http.C, targets/cgi/parser3.C: MSVC SOCKET warnings war 2021-12-21 moko * tests/: 416.html, results/416.processed: test for ^break[] in ^hash/table.select[] (related to feature #1222) * src/classes/: hash.C, table.C: ^break[] support for ^hash/table.select[] (implements feature #1222) 2021-11-30 moko * src/targets/cgi/parser3.C: default sock_ready interval changed to 0.5 sec 2021-11-10 moko * tests/results/415.processed: more syntax errors tests added * tests/415_dir/: 20.p, 21.p, 22.p, 23.p, 24.p, 25.p, 26.p, 27.p, 28.p: minor syntax error tests * src/main/pa_exception.C: pa_strdup added for compatibility * src/classes/curl.C: hint to call ^curl:options[ $.library[correct.libcurl.so.name] ] added if default load fails. 2021-11-09 moko * src/main/compile.y: error message can be on stack * src/main/pa_xml_io.C: strcat replaced with pa_strcat * src/main/pa_charset.C: memcpy is more correct and efficient in this case then strncpy * src/: classes/image.C, types/pa_vrequest.C: pa_strdup used instead of strcpy where possible * src/: classes/op.C, main/pa_exception.C: "%s" format now can be used to avoid MAX_STRING limit in Exception comment * tests/results/415.processed: compiler exceptions are no longer limited to MAX_STRING * src/main/: compile.y, compile_tools.h: Parse_control uses const char * instead of fixed buffer * tests/: 415.html, 415_dir/01.p, 415_dir/02.p, 415_dir/03.p, 415_dir/04.p, 415_dir/05.p, 415_dir/06.p, 415_dir/07.p, 415_dir/08.p, 415_dir/09.p, 415_dir/10.p, 415_dir/11.p, 415_dir/12.p, 415_dir/13.p, 415_dir/14.p, 415_dir/15.p, results/415.processed: tests for parser.compile exceptions added 2021-11-08 moko * src/: classes/math.C, include/pa_common.h, main/compile.y, main/pa_common.C, main/pa_dir.C, main/pa_exec.C, main/pa_http.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vdate.C: pa_strncpy added ans used to avoid strncpy drawbacks 2021-11-06 moko * src/classes/inet.C: ^inet:hostname[] added by sumo@ patch (implements feature #1219) * tests/: 414.html, results/414.processed: test for ^hash.rename[from;to] added (related to feature #1144) 2021-11-05 moko * src/classes/hash.C: ^hash.rename[ $.from[to] ... ] support added (related to feature #1144) 2021-11-04 moko * src/: classes/hash.C, include/pa_hash.h: ^hash.rename[from;to] added (implements feature #1144) 2021-10-19 moko * tests/: 413.html, results/413.processed: test for hash no longer is accepted as file parameter (related to bug #1218) * src/: classes/curl.C, classes/file.C, classes/image.C, classes/math.C, classes/xdoc.C, types/pa_value.C, types/pa_value.h, types/pa_vfile.h, types/pa_vmail.C: hash no longer is accepted as file parameter (fixes bug #1218) 2021-07-19 moko * src/targets/cgi/parser3.C: waitpid in file::exec returned "No child processes" when SIGCHLD was SIG_IGN (fixes bug #1215) 2021-04-16 moko * src/types/pa_vmail.C: message can be null when e-mail is broken, processing it leads to assertions. 2021-03-25 moko * tests/: 412.html, results/412.processed: test to demonstrate bug #1213 2021-02-12 moko * tests/: 360.html, results/360.processed, results/363.processed: parser method call in expression mode no longer differs from call in string mode (related to feature #1211) 2021-02-11 moko * src/types/pa_vmail.C: mail parsing with Windows line endings fixed (bug #1212) * src/types/pa_vmethod_frame.h: no more difference inside @test[] when called $v[^test[]] vs $v(^test[]), numbers are converted to strings in both calls (implements feature #1211) 2021-01-28 moko * buildall, etc/auto.p.in: to remove last patch in debian package * configure, configure.ac, src/include/pa_version.h: 3.4.6 -> 3.4.7b 2021-01-21 moko * src/main/pa_http.C: no alarm() in file::load when web server mode is MULTITHREADED 2021-01-20 moko * src/targets/apache/mod_parser3.c: it is more correct to recommend 'a2enmod mpm_prefork' * src/targets/apache/mod_parser3.c: prefork name is now 'libapache2-mpm-itk' * src/targets/apache/mod_parser3_core.C: last regular malloc removed * src/targets/isapi/Makefile.am: -pa_threads.C * configure, configure.ac, src/include/pa_version.h: 3.4.6rc -> 3.4.6 * etc/auto.p.in: post_max_size 10Mb -> 64Mb. It's 2021 year now. :) * etc/auto.p.in: @config[result] added to simplify $cfg change in /httpd.p * etc/auto.p.in: httpd fine-tune: + @OPTIONS partial, + ^use[/httpd.p] + optional ^preprocess[] (related to feature #1203) 2021-01-19 moko * buildall: --disable-parallel-mark added to avoid "number of processors" threads creation for heap marking as it conflicts with RLimitNProc in apache (on Linux setrlimit RLIMIT_NPROC limits threads) 2021-01-16 moko * src/: classes/memory.C, include/pa_memory.h, lib/gc/include/gc.h, main/pa_globals.C, main/pa_memory.C, targets/apache/mod_parser3_core.C, targets/isapi/parser3isapi.C, types/pa_vhashfile.C: ^memory:auto-compact(N) added (implements feature #1209) 2021-01-15 moko * configure, configure.ac, src/include/pa_version.h: 3.4.6b -> 3.4.6rc * src/classes/json.C: get_delim added for delimiter caching (10% faster on large json) 2021-01-14 moko * operators.ru.txt, operators.txt: updated with 3.4.6 changes * tests/results/224.processed: test result modified after today(shift) implemented * tests/: 407.html, results/407.processed: test for ^hash.select option $.default(bool) added (related to feature #1172) * src/classes/hash.C: ^hash.select option $.default(bool) added (related to feature #1172) * tests/: 141.html, results/141.processed: test modified for feature #1185. * src/: classes/math.C, include/pa_random.h, main/pa_random.C: ^math:uuid options $.lower(bool) $.solid(bool), ^math:uid64 options $.lower(bool) (implements feature #1185) 2021-01-11 moko * src/classes/date.C: ^date::today(N) by gz@ (implements feature #1192) * tests/: 411.html, results/411.processed: test for ^date::today(N) added (related to feature #1192) 2021-01-05 moko * tests/: 270.html, results/270.processed: test modified to work under Windows * tests/: 390.html, 395.html, results/395.processed: tests updated 4 windows * tests/: 410.html, results/410.processed: test for $CLASS-GETTER-PROTECTED(false) added 2021-01-04 moko * tests/: 409.html, results/409.processed, results/auto.p: test for $MAIN:LOCALS(true) added 2021-01-03 moko * src/: main/pa_http.C, main/pa_request.C, types/pa_vclass.C, types/pa_vclass.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: @conf[] +CLASS-GETTER-PROTECTED, +LOCALS. $main -> $MAIN in exception texts (implements feature #1207) 2021-01-02 moko * etc/auto.p.in: minor * src/main/pa_request.C: sending headers only after opening file to allow error reporting if file was not opened (foreign group, etc). 2020-12-31 moko * src/: include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C: ^httpd-main[] -> ^httpd:main[] * src/: classes/reflection.C, include/pa_request.h, main/execute.C, main/pa_request.C: get_class_ref added and used * etc/auto.p.in: @CLASS httpd added * etc/auto.p.in: @auto[] is now first 2020-12-30 moko * tests/: 408.html, results/408.processed: test for bug #1166 (windows only) added * src/main/pa_common.C: create_dir_for_file should not create dir for trailing / (fixes bug #1166) * tests/: 341.html, results/341.processed: tests for ^nameless_table.hash[] added (related to feature #1138) * src/classes/table.C: ^nameless_table.hash[0;1] now supported (implements feature #1138), extra fields in named tables no longer ignored (implements feature #1138) * tests/results/390.processed: updated after exception text change 2020-12-29 moko * tests/: 407.html, results/407.processed: +$._default check * src/classes/hash.C: keep $_default in ^hash.reverse[] * tests/: 407.html, results/407.processed: test for ^hash.select[] and ^hash.reverse[] added (releated to feature #1172) * src/classes/hash.C: ^hash.select[key;value](bool-condition)[options hash] + ^hash.reverse[] added (implements feature #1172) * src/types/pa_vtable.h: warning war * src/include/pa_config_fixed.h: win32 fix 2020-12-27 moko * tests/: 406.html, results/406.processed: test results updated * src/: classes/table.C, main/pa_request.C, types/pa_vmail.C, types/pa_vmemcached.C: fine tuning in ^table.rename[], minor spelling 2020-12-26 moko * tests/: 406.html, results/406.processed: tests for ^table.rename[] added (related to feature #1148) * src/: classes/table.C, include/pa_table.h, main/pa_table.C: ^table.rename[column name from;column name to], ^table.rename[ $.[column name from][column name to] ... ] added (implements feature #1148) 2020-12-25 moko * src/: include/pa_request_info.h, targets/cgi/parser3.C: request_info now on stack to avoid yet another THREAD_LOCAL memory deallocation issue (now with cookies), explained in #1203 * src/types/pa_vcookie.C: fields should be inited 2020-12-24 moko * src/include/pa_stylesheet_connection.h: looks like xsltFreeStylesheet leads to memory double-free. If so, it's for sure libxml bug, but we have GC anyway, so we just remove this call and see... * thread #1, name = 'parser.parser3.cgi', stop reason = signal SIGABRT * frame #0: 0x0000000801ab50fa libc.so.7`__sys_thr_kill + 10 frame #2: 0x0000000801ab5039 libc.so.7`abort at abort.c:65:8 frame #3: 0x00000000004da663 parser.parser3.cgi`GC_freehblk(hbp=) at allchblk.c:878:9 frame #4: 0x00000000004cb8c4 parser.parser3.cgi`GC_free(p=0x0000000808b34000) at malloc.c:617:9 frame #5: 0x0000000000577f0c parser.parser3.cgi`xmlHashFree(table=0x0000000806991a80, f=) at hash.c:356:2 frame #6: 0x000000000051a7c2 parser.parser3.cgi`xsltFreeTemplateHashes + 50 frame #7: 0x000000000050cfac parser.parser3.cgi`xsltFreeStylesheet + 124 frame #8: 0x000000000050d35c parser.parser3.cgi`xsltFreeStylesheetList + 44 frame #9: 0x000000000050d1fa parser.parser3.cgi`xsltFreeStylesheet + 714 frame #10: 0x00000000004436e5 parser.parser3.cgi`Stylesheet_manager::maybe_expire_cache() [inlined] Stylesheet_connection::disconnect(this=0x0000000804676c80) at pa_stylesheet_connection.h:62:3 2020-12-23 moko * src/classes/image.C: ^image::measure[; $.video() ] option added * tests/: 395.html, 395_dir/4.mp4, results/395.processed: test ^image::measure[; $.video(true) ] added * src/main/pa_exec.C: not cleared automatically in multithreaded httpd mode for unknown reasons 2020-12-22 moko * src/targets/cgi/parser3.C: added by PAF in rev 201 to "write to error_log uri of currently processed document", but never used and conflicts with how libgc stops threads on FreeBSD (#define SIG_SUSPEND SIGUSR1), thus removed. 2020-12-21 moko * src/main/pa_request.C: +comment 2020-12-20 moko * src/: include/pa_common.h, include/pa_memory.h, main/pa_common.C: it is more safe to have versions of pa_strdup with one and two arguments, as helper_length=0 not always mean that strlen() should be called, but means zero. * src/targets/isapi/parser3isapi.C: minor * src/main/pa_http.C: +valid_http_method * src/: include/pa_http.h, main/pa_http.C, targets/cgi/pa_sapi_info.h: SERVER_PORT now available 2020-12-17 moko * tests/: 405.html, results/405.processed: test for split by regex added (related to feature #1160) * src/classes/string.C: split by regex implemented (feature #1160) * src/classes/string.C: minor * tests/: 404.html, results/404.processed: test for whitespace string is now OK for table argument (related to feature #1169) * src/: classes/image.C, classes/string.C, classes/table.C, types/pa_vmethod_frame.C: whitespace string is now OK for table argument (as with hash) (implements feature #1169) * src/classes/op.C: Exception.add_comment used to avoid MAX_LENGTH limit for comment (fixes bug #1102) * src/targets/cgi/parser3.C: +HAVE_TLS check * src/main/pa_http.C: no HAVE_TLS -> no multithreads mode * src/include/pa_config_includes.h: HAVE_TLS used * configure.ac: +TLS check * src/main/pa_http.C: content logging added * src/targets/cgi/: pa_sapi_info.h, parser3.C: clear_response_headers added 2020-12-16 moko * buildall: as we now use threads, libatomic_ops still required for some OS. * src/main/pa_request.C: whitespace * src/: include/pa_request.h, main/pa_request.C: Request::Exception_trace::table extracted and used * src/main/pa_request.C: moving output_result call outside of try as network exceptions should not be handled by parser code * src/: include/pa_http.h, main/pa_http.C: HTTPD_DEBUG added for logging network exchange * src/targets/cgi/: pa_sapi_info.h, parser3.C: do not send error via network if it was network write error. * src/targets/cgi/parser3.C: log -> pa_log * src/targets/cgi/parser3.C: pa_get_thread_id() used for logging * src/main/pa_threads.C: getpid() if no gettid() found * src/: include/pa_http.h, main/pa_http.C, targets/cgi/parser3.C: we need to ignore "void" connections from browsers (browsers open connections in advance and they will be empty if user does not request more pages) 2020-12-15 moko * src/targets/cgi/parser3.C: avoid previous uri in logs * src/targets/cgi/: pa_sapi_info.h, parser3.C: global ::request and RequestController not needed in httpd mode * src/: classes/bool.C, classes/classes.C, classes/classes.awk, classes/classes.h, classes/curl.C, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/inet.C, classes/int.C, classes/json.C, classes/mail.C, classes/math.C, classes/memcached.C, classes/memory.C, classes/op.C, classes/reflection.C, classes/regex.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_base64.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_http.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_pool.h, include/pa_random.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_symbols.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, lib/punycode/pa_idna.c, lib/punycode/pa_idna.h, lib/sdbm/pa_file_io.C, lib/sdbm/pa_strings.C, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_base64.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_http.C, main/pa_memory.C, main/pa_os.C, main/pa_pool.C, main/pa_random.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_connection.C, main/pa_stylesheet_manager.C, main/pa_symbols.C, main/pa_table.C, main/pa_threads.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, sql/pa_sql_driver.h, targets/apache/mod_parser3.c, targets/apache/mod_parser3_core.C, targets/apache/pa_httpd.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_property.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vcaller_wrapper.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.C, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.C, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.C, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemcached.C, types/pa_vmemcached.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vregex.C, types/pa_vregex.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.C, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: Copyright year updated * src/main/pa_request.C: old compilers support * tests/: 362.html, results/362.processed: test updated after changes after upgrade to libxml2-2.9.9 were made (related to bug #1108) * src/: classes/xdoc.C, types/pa_vxdoc.h: xsltStylesheet_auto_ptr removed, as xsltFreeStylesheet has side effects on original doc. compiled stylesheet no longer cached as with libxml2-2.9.9 it was not updated after xdoc modification (part 3 of test 362). (related to bug #1108) * src/targets/isapi/parser3isapi.C: +pa_strcat * src/: classes/memory.C, include/pa_memory.h, targets/apache/mod_parser3_core.C, targets/isapi/parser3isapi.C: PA_GC_GCOLLECT used * src/include/pa_memory.h: +PA_GC_COLLECT * src/targets/cgi/parser3.C: msvs support fixes * src/lib/gc/include/gc.h: more cleanup * src/: include/pa_threads.h, main/pa_threads.C: win32 fixes * src/: include/pa_http.h, main/pa_http.C, main/pa_request.C, targets/cgi/parser3.C: $main:HTTPD.mode implemented * src/include/pa_config_includes.h: +HAVE_PTHREAD_H * configure.ac: pthread.h added to checked headers * src/classes/table.C: string stream is back :) * src/classes/memory.C: GC_generate_random_backtrace no longer exists * src/main/pa_globals.C: GC_dont_gc replaced * src/lib/gc/include/gc.h: major cleanup, only used functions are left to simplify adding new functions. depricated GC_dont_gc replaced with GC_disable and GC_enable calls. * src/lib/cord/: cordxtra.c, include/cord.h: cleanup: CORD_from_file* not used and thus removed * src/lib/gc/include/gc_allocator.h: minor cleanup 2020-12-14 moko * src/classes/: curl.C, memory.C, table.C: every TLS should be referenced elsewhere, or GC will collect it. * src/: include/pa_xml_io.h, main/pa_stylesheet_connection.C, main/pa_xml_io.C: bugfix: TLS variables should be referenced elsewhere, or GC will collect them (and we'll get GPF in multithreaded enviroment). May be it can be also fixed by some GC call, not sure. But this fix costs nothing (but hours of debugging to find the issue :). 2020-12-11 moko * configure.ac: gettid() check added * src/main/pa_threads.C: HAVE_GETTID used * src/include/pa_config_auto.h.in: +HAVE_GETTID * src/: include/pa_threads.h, main/pa_threads.C: now unified version for isapi/cgi/apache * buildall: threads are now required. * src/: targets/apache/ApacheModuleParser3Core.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, main/main.vcproj: pa_threads.C moved to main * src/targets/: apache/pa_threads.C, cgi/pa_threads.C, isapi/pa_threads.C: pa_threads.C moved to main * src/: main/Makefile.am, targets/cgi/Makefile.am, targets/apache/Makefile.am: pa_threads.C moved to main * src/classes/xdoc.C: Stylesheet_connection_ptr changed a bit * src/: include/pa_stylesheet_connection.h, main/pa_stylesheet_manager.C: Stylesheet_connection_ptr simplfied and weird GPF in multithreaded httpd is gone * src/include/: pa_stylesheet_connection.h, pa_sql_driver_manager.h: whitespace * src/main/pa_sql_driver_manager.C: timeout 60 sec -> 10 sec * src/: include/pa_sql_connection.h, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C: whitespace, warning war * src/: include/pa_threads.h, targets/apache/pa_threads.C, targets/cgi/pa_threads.C, targets/isapi/pa_threads.C: parser_multithreaded never used * src/main/pa_http.C: no ALARM in MULTITHREADED httpd server mode 2020-12-10 moko * src/: include/pa_config_includes.h, include/pa_http.h, main/pa_http.C, targets/cgi/parser3.C: initial support for MULTITHREADED and PARALLEL httpd server modes * src/main/pa_globals.C: GC_java_finalization is depricated 2020-12-09 moko * etc/auto.p.in: + @httpd-main * src/: include/pa_common.h, main/pa_request.C, targets/cgi/pa_sapi_info.h: Range Requests (rfc7233) now really work * src/: include/pa_common.h, main/pa_common.C, main/pa_request.C: slow file_read_binary no longer used, send_range added 2020-12-08 moko * src/main/pa_request.C: >4Gb support * src/targets/cgi/parser3.C: msvc warning war * src/: include/pa_config_includes.h, main/pa_http.C, main/pa_request.C: msvc warnings war * src/classes/image.C: warning war * src/classes/table.C: MSVC warning war * src/targets/cgi/parser3.C: msvc warnings war * src/targets/apache/mod_parser3_core.C: SYSTEM_CONFIG_FILE support added 2020-12-07 moko * configure.ac: SYSTEM_LOG_FILE no longer required as cheat used to avoid logging beside system-wide auto.p * src/targets/cgi/parser3.C: SYSTEM_CONFIG_FILE used * configure, configure.ac, src/include/pa_config_auto.h.in: configure options added: --with-system-cfg=FILE to specify system-wide auto.p --with-system-log=FILE to specify system-wide parser3.log * Makefile.am: bin no longer exists * configure, configure.ac: auto.p moved to etc to simplify debian package * buildall: auto.p and parser3.charsets moved to their default location after install * etc/: Makefile.am, auto.p.in: auto.p moved to etc directory * aclocal.m4, configure: automake 1.15 -> 1.16.1 * src/targets/cgi/parser3.C: locate_config call returned to original place as it requires pa_thread_request() under Windows * src/targets/cgi/parser3.C: renaming 2020-12-06 moko * src/: main/pa_globals.C, targets/cgi/parser3.C: thread request check added 2020-12-04 moko * src/: classes/image.C, include/pa_common.h, main/pa_common.C, main/pa_request.C: unified uint64_t lseek implemented to support >4Gb files under x86, including Windows 2020-12-02 moko * src/main/pa_common.C: minor bugfix: $.limit() should be checked with max_file_size * src/: include/pa_common.h, main/pa_common.C, main/pa_request.C: support for processing files sized >4Gb on 32 bit planforms * tests/399.html: file moved * src/: include/pa_string.h, main/pa_string.C: long long -> int64_t * src/targets/cgi/pa_sapi_info.h: warning war * src/: main/pa_http.C, targets/isapi/parser3isapi.C: windows warning war 2020-12-01 moko * src/classes/image.C: mp4 extended size (>4Gb) support added * src/classes/image.C: for "size not found" exception to be shown if size not found until eof * src/classes/image.C: long -> off_t (which is 64 bits even on 32 bit linux) * src/classes/image.C: ^image::measure[] now supports mp4 (feature #1188) 2020-11-30 moko * src/classes/image.C: definitions moved closer to code * tests/: 395.bmp, 395.html, 396.html, 396.tiff, 395_dir/1.bmp, 395_dir/2.tiff, 395_dir/3_VP8.webp, 395_dir/3_VP8L.webp, 395_dir/3_VP8X.webp, results/395.processed, results/396.processed: tests for ^image::measure[] .webp support added, all image files moved into one directory (related to feature #1188) * src/classes/image.C: ^image::measure[] now supports webp (feature #1188) 2020-11-29 moko * src/main/pa_request.C: CONF_OPTION added to unify @conf options processing, unnessesary defines removed 2020-11-24 moko * tests/results/: 099.processed, 100.processed, 205.processed, 309.processed, 310.processed: Content-Disposition: inline returned * tests/: 099.html, 237.html, 403.html, outputs/403.processed, results/auto.p: test for $response:body[ $.file[] $.name[] ] added (related to bug #1204) * src/main/pa_request.C: $response:body[ $file[.ext] $.name[] ] supported to avoid Content-Disposition: inline; filename=".ext" but still set Content-Type for ext (related to bug #1204) 2020-11-22 moko * src/: include/pa_common.h, main/pa_common.C, main/pa_request.C, types/pa_vfile.C: pa_filename added to avoid useless rsplit * src/main/pa_request.C: content_disposition_inline returned. 2020-11-17 moko * src/main/pa_request.C: empty main method name support * src/: main/pa_common.C, targets/cgi/parser3.C: httpd config_handler added, stdout flush added. 2020-11-16 moko * src/targets/cgi/parser3.C: filespec_4log added, pa_strcat used. * tests/results/: 099.processed, 205.processed, 237.processed, 309.processed, 310.processed: Content-Disposition: inline is not required and should not contain filename="" * src/: include/pa_common.h, main/pa_common.C, main/pa_exception.C, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: pa_strcat implemented and used 2020-11-14 moko * src/targets/cgi/parser3.C: spelling * src/targets/cgi/parser3.C: renaming * src/targets/cgi/parser3.C: args_skip removed, locate_config relocated * src/targets/cgi/parser3.C: execution_canceled was for sigpipe before request processing, which is weired 2020-11-13 moko * src/main/pa_http.C: pa_recv added with timeout support, thus read copied in httpd. 2020-11-12 moko * src/main/pa_http.C: ALARM code unified to be used in httpd * src/: include/pa_request.h, main/pa_request.C, targets/cgi/pa_sapi_info.h: pa_httpd_timeout added * src/main/pa_http.C: URI validation added * src/targets/cgi/parser3.C: filespec_to_process now variable, can't be empty but can be null. httpd-main is now main method name for httpd mode 2020-11-11 moko * src/main/pa_request.C: path_translated can be null in httpd mode * src/: classes/curl.C, classes/file.C, classes/hashfile.C, classes/image.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, include/pa_request.h, main/execute.C, main/pa_request.C: r.absolute -> r.full_disk_path * src/targets/cgi/parser3.C: if filename to process is not specified, auto.p should be present. 2020-11-03 moko * src/: classes/op.C, include/pa_request.h: unused argument removed * src/main/pa_request.C: content_disposition_inline is the default, not required. 2020-10-29 moko * src/: classes/op.C, include/pa_request.h, main/pa_request.C: ^use[file; $.main(true) ] implemented for auto.p processing and path_translated changing to correct relative files path calculation in httpd mode * src/: include/pa_request.h, main/pa_request.C: fail_on_read_problem removed, as it allways true, as if should be. * src/: include/pa_request.h, main/pa_request.C, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: clearing config_filespec when config was not found, thus flag not required and removed. 2020-10-28 moko * tests/: 402.html, results/402.processed: error reporting test * src/main/execute.C: better error reporting when $result[^hash::create[]] in @main. * src/main/: execute.C, pa_request.C: frame.result() should be used + minor optimization * src/: include/pa_request.h, main/execute.C, main/pa_request.C, main/pa_xml_io.C: execute_*_method simplified and unified 2020-10-27 moko * tests/: 306.html, results/306.processed: a bit more testing. :) * src/: main/execute.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vdate.C, types/pa_venv.C, types/pa_vform.C, types/pa_vhash.h, types/pa_vimage.C, types/pa_vmemcached.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vrequest.C, types/pa_vresponse.C, types/pa_vtable.C, types/pa_vxnode.C: optimization: PUT_ELEMENT_REPLACED_ELEMENT no longer used in object-prototype mode * src/: include/pa_sapi.h, targets/apache/mod_parser3_core.C, targets/cgi/pa_sapi_info.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_venv.C, types/pa_venv.h, types/pa_vform.C, types/pa_vform.h: + $env:name[value] and $form:name[value] features 2020-10-18 moko * src/targets/cgi/Makefile.am: + pa_sapi_info.h 2020-10-15 moko * src/main/pa_http.C: url no longer needed as ALTER_EXCEPTION_SOURCE is used * src/: classes/curl.C, include/pa_common.h, main/pa_common.C, main/pa_http.C: check_file_size filespec is now optional * src/: classes/curl.C, include/pa_exception.h, main/pa_exception.C, main/pa_http.C: ALTER_EXCEPTION_SOURCE and ALTER_EXCEPTION_COMMENT added for better error reporting * tests/: 379-curl.html, 379.html, results/223-curl.processed, results/346-curl.processed, results/379-curl.processed, results/379.processed: test results updated as load now provides better error reporting + curl responses updated 2020-10-14 moko * src/: classes/date.C, include/pa_string.h, main/pa_http.C, main/pa_string.C, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C: pa_atoi / pa_atoui / pa_atoul usage checked. 10 is now default base, no hex autodetect by default * src/: include/pa_http.h, main/pa_http.C, targets/cgi/parser3.C: connection socket closing in destructor + accept exception handling * src/targets/cgi/parser3.C: warning war * src/: include/pa_http.h, include/pa_sapi.h, main/pa_http.C, main/pa_request.C, targets/apache/mod_parser3_core.C, targets/cgi/pa_sapi_info.h, targets/cgi/parser3.C: global try exception handling unified 2020-10-13 moko * src/targets/isapi/parser3isapi.C: reverted to atoi to avoid hex autodetection * src/targets/apache/mod_parser3_core.C: reverted to atoi * src/: main/pa_http.C, targets/cgi/pa_sapi_info.h: warning war * src/main/pa_http.C: warning war 2020-10-12 moko * src/: main/pa_request.C, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: excaption in unhandled exception code optimization * src/targets/cgi/parser3.C: request_info now global variable * src/main/pa_http.C: http_read_response moved to HTTP_response class * src/: include/pa_http.h, main/pa_http.C, targets/cgi/pa_sapi_info.h: read_post implemented * src/: include/pa_http.h, main/pa_http.C, targets/cgi/parser3.C: [host:]port syntax support in httpd mode * src/: include/pa_http.h, targets/cgi/pa_sapi_info.h, targets/cgi/parser3.C: populate_env added * src/include/pa_hash.h: to make get(char *) compiling in HashStringString 2020-10-10 moko * src/: classes/curl.C, include/pa_http.h, main/pa_http.C, targets/cgi/pa_sapi_info.h: ResponseHeaders -> HTTP_Headers * src/: include/pa_http.h, include/pa_request_info.h, main/pa_http.C, main/pa_string.C, targets/apache/mod_parser3_core.C, targets/cgi/pa_sapi_info.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vrequest.C: initial httpd mode implementation 2020-10-04 moko * src/targets/cgi/parser3.C: options together 2020-09-30 moko * src/main/pa_http.C: renamed 2020-08-14 moko * configure, configure.ac, parser3.sln, src/lib/Makefile.am, src/targets/cgi/Makefile.am: no httpd as separate library 2020-08-13 moko * src/targets/cgi/parser3.C: SAPI::die used in exception in unhandled exception handler to report 500 instead of 200 it was before. * src/targets/apache/mod_parser3_core.C: minor cleanup * src/: include/pa_sapi.h, main/untaint.C, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: SAPI::abort was used only once, thus replaced with SAPI::die and removed * src/targets/: apache/mod_parser3_core.C, isapi/parser3isapi.C, cgi/parser3.C: whitespace * src/targets/cgi/parser3.C: locate_config() extracted, whitespace. 2020-08-12 moko * src/targets/cgi/parser3.C: duplicate info in signal logging removed, whitespace was: SIGPIPE received while executing code. uri=/_tmp.html, method=GET, cl=0 [uri=/_tmp.html, method=GET, cl=0] * parser3.sln: + httpd.vcproj 2020-08-11 moko * src/targets/cgi/Makefile.am: +libhttpd * configure.ac, src/lib/Makefile.am: +libhttpd 2020-07-13 moko * tests/: 401.html, results/401.processed: test for hash key does not keep language, but tainted in foreach. 2020-07-01 moko * tests/: 235.html, results/235.processed: test result updated as messages before attachments implemented (feature #1176) 2020-06-27 moko * tests/: 400.html, results/400.processed: test updated to check ^return{code} * src/classes/op.C: bugfix: ^return{code} or ^return(expre+ssion) fixed 2020-06-26 moko * tests/: 400.html, results/400.processed: test for OPTIMIZE_RESULT added (related to https://www.parser.ru/forum/?id=85319) * src/types/pa_vmethod_frame.h: bugfix: OPTIMIZE_RESULT failed, when $result assignment was last statement in the method (https://www.parser.ru/forum/?id=85319) 2020-05-23 moko * src/: classes/mail.C, types/pa_vmail.C, types/pa_vmail.h: whitespace, unused level removed 2020-05-19 moko * src/types/pa_vmail.C: whitespace * src/types/pa_vmail.C: files should be processed last (related to feature #1176) 2020-05-12 moko * src/include/pa_memory.h: no new/delete checks for for FreeBSD1X.X due to https://bugs.llvm.org/show_bug.cgi?id=40161 bug * configure.ac: FreeBSD1X.X check added to avoid https://bugs.llvm.org/show_bug.cgi?id=40161 bug. 2020-02-26 moko * src/main/pa_common.C: entry_exists -> entry_ifdir to fix Windows compilation issue (related to bug #1201) * src/main/pa_common.C: entry_readable -> entry_exists, undocumented access(fname, R_OK) call removed (fixes bug #1201) -f and -d now works under Windows in UTF-8 with Russian filenames. * src/types/pa_vmail.C: g_mime_stream_pipe_new used by gmime author advice (related to feature #1199) 2020-02-25 moko * buildall: --silent removed * configure.ac: gmime-3.0 support * buildall: --with-system-mailreceive option added to build with system libgmime * src/types/pa_vmail.C: avoiding https://github.com/jstedfast/gmime/issues/83 "feature" (related to feature #1199) 2020-02-18 moko * src/classes/op.C: windows x64 debug mode compile fix * src/main/pa_globals.C: no longer required due to -MD -> -MT change (releated to feature #1200) * src/: classes/classes.vcproj, lib/cord/cord.vcproj, lib/gd/gd.vcproj, lib/json/json.vcproj, lib/ltdl/ltdl.vcproj, lib/md5/md5.vcproj, lib/memcached/memcached.vcproj, lib/pcre/pcre_internal.vcproj, lib/punycode/punycode.vcproj, lib/sdbm/sdbm.vcproj, lib/smtp/smtp.vcproj, main/main.vcproj, targets/apache/ApacheModuleParser3.vcproj, targets/apache/ApacheModuleParser3Core.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: -MD -> -MT to remove msvcp71.dll/etc dependency (related to feature #1200) 2020-02-12 moko * src/types/pa_vmail.C: minimize diff * src/types/pa_vmail.C: libgmime 3.X support (implements feature #1199) 2020-01-18 moko * tests/: 388-sql.html, results/388-sql.processed: +postprocess 2019-12-28 moko * src/targets/cgi/parser3.C: avoid empty ? 2019-12-27 moko * src/targets/cgi/parser3.C: PATH_INFO check in reinventing DOCUMENT_ROOT (related to feature #1164) * src/targets/cgi/parser3.C: IIS5 support removed to simplify fcgiwrap setup (implements feature #1164) * src/targets/cgi/parser3.C: real_parser_handler logic simplified, but no issues found (related to feature #1164) * src/targets/cgi/parser3.C: actualized 2019-12-26 moko * src/targets/apache/ApacheModuleParser3.vcproj: apache stop/start removed * src/targets/isapi/parser3isapi.vcproj: inetinfo stop/start removed * src/: lib/gc/include/gc.h, main/pa_globals.C: As we log allocation errors, we don't want default gc warnings (without timestamp and URI). * src/: classes/memory.C, main/pa_globals.C, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: GC_dont_gc=1 moved to pa_globals_init * src/main/pa_globals.C: setup_hex_value() removed, static array initialization used (optimization) * src/: main/pa_globals.C, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: pa_socks_init/pa_socks_done moved inside pa_globals_init (optimization) 2019-12-09 moko * src/include/pa_config_fixed.h: warning war 2019-12-08 moko * src/main/main.vcproj: compile.y - ExcludedFromBuild, as we process grammar under Unix. 2019-12-07 moko * tests/389.html: For Windows XP. :) * tests/388-sql.html: Windows compatibility added 2019-12-06 moko * src/targets/cgi/parser3.C: warning war * src/main/pa_string.C: + COMPILE_ASSERT(sizeof(String::Languages) == sizeof(CORD)) to avoid aligning bugs in future * src/: include/pa_config_fixed.h, main/pa_globals.C: simplified to XML_STATIC * src/include/pa_request.h: StackItem() not required * src/include/pa_stack.h: warning war * src/include/pa_config_includes.h: GCC warning silenced * src/include/pa_memory.h: warning war: the program should also define 'void operator delete [](void*, std::size_t)' [-Wsized-deallocation] * src/types/: pa_vregex.h, pa_vtable.h: warning war * src/classes/string.C: not reqired cast removed * src/classes/string.C: not reqired cast removed 2019-12-05 moko * src/lib/sdbm/pa_file_io.C: warning war * src/include/pa_string.h: bugfix for Windows x64: enum Language -> enum Language : size_t - required for VS2015+ to make sizeof(Languages::opt) == sizeof(CORD), will be 16 byte under x64 without it (related to feature #1198) 2019-12-04 moko * src/main/pa_base64.C: unsigned char -> uchar * src/main/: main.vcproj, pa_globals.C: libpcre now linked same way as other libs * src/include/pa_version.h: +amd64 2019-12-03 moko * src/: classes/classes.vcproj, types/types.vcproj: sync debug with release * src/include/pa_config_includes.h: warning war * src/classes/image.C: warning war * src/main/pa_globals.C: x64 libs support * src/include/pa_config_includes.h: warning war * src/types/pa_method.h: warning war 2019-11-28 moko * src/classes/math.C: vs2003 compatibility + warning war * buildall: libxslt-1.1.29 -> libxslt-1.1.34, libxml2-2.9.4 -> libxml2-2.9.9 (related to feature #1136) * src/classes/xdoc.C: xmlHashScanner declaration changed, using typecast for more compatibility (related to feature #1136) * buildall: --direct-download option added, gc-7.6.2 -> gc-8.0.4 + libatomic no longer required, pcre-8.40 -> pcre-8.43 (related to feature #1136) 2019-11-26 moko * src/main/: compile_tools.C, compile_tools.h: invalid assert removed (it was failing in $$var case), condition added 2019-11-25 moko * tests/: 397.html, 399.html, results/141.processed, results/399.processed: base64 options tested * src/: classes/math.C, main/pa_http.C: base64 options used * src/main/pa_base64.C: base64 encode rewritten, base64 options implemented (feature #986) * src/main/pa_cache_managers.C: whitespace * tests/: 397.html, 399.html, results/399.processed: tests for ^base64 encode options added (related to feature #986) * src/: classes/file.C, include/pa_base64.h, main/pa_base64.C: pa_base64_encode(file) removed - more memory, but faster and less code (related fo feature #986) 2019-11-24 moko * tests/: 155.html, results/155.processed: limit and offset in ^table::load[] now supported, thus test added * src/: classes/file.C, classes/table.C, include/pa_common.h, main/pa_common.C: optimization: offset and limit options parsing moved inside file_load. 2019-11-23 moko * src/: classes/file.C, classes/op.C, include/pa_common.h, main/pa_common.C, main/pa_request.C, types/pa_vform.C: optimization: file_read replaced with simplified file_read_binary * src/: classes/op.C, main/pa_common.C, main/pa_request.C, types/pa_vform.C: whitespace * src/: include/pa_common.h, main/pa_common.C: never used params removed 2019-11-21 moko * tests/: 193.html, results/193.processed, results/389.processed: test results updated as now base64 does not discard tail without padding (related to feature #986) 2019-11-20 moko * src/: classes/file.C, classes/string.C, include/pa_base64.h, main/pa_base64.C: optimization: void pa_base64_decode -> size_t pa_base64_decode (related to feature #986) * tests/398.html: tests for base64 decode added (related to feature #986) * src/main/pa_base64.C: base64_decode rewritten - padding option support, padding inside base 64 supported (related to feature #096) 2019-11-19 moko * src/include/pa_memory.h: CHECK_DELETE_USAGE tested to work under FreeBSD 12 2019-11-16 moko * src/main/pa_base64.C: base64_decode converted to C++, url-safe support added, step support removed (related to #986) 2019-11-15 moko * src/classes/math.C: using log since log2 is not present on FreeBSD < 8.4 (related to feature #1177) * src/: include/pa_base64.h, main/pa_base64.C: whitespace, pa_base64_size extracted and used for files as well (related to feature 986) 2019-11-14 moko * tests/: 397.html, results/397.processed: + content check * tests/: 141.html, results/141.processed: make test resuls more readable * tests/: 397.html, results/193.processed, results/397.processed: test results updated after \x00 character was disabled in math:convert string mode (related to feature #1177) * src/classes/: math.C, string.C: \\x00 character disabled while converting to string (as in base64, related to feature #1177) * src/classes/file.C: more correct arguments separation * src/: classes/file.C, classes/math.C, classes/string.C, include/pa_base64.h, include/pa_common.h, main/pa_base64.C, main/pa_http.C, types/pa_vfile.C, types/pa_vmail.C: base64 options added, but not yet implemented (related to feature #986) * src/classes/math.C: whitespace 2019-11-13 moko * tests/: 397.html, results/397.processed: +tainting test (related to feature #1177) * src/classes/math.C: as we now produce not only digits, result should be tainted (related to feature #1177) * src/main/pa_base64.C: whitespace * src/: include/Makefile.am, main/Makefile.am, main/main.vcproj, include/pa_base64.h, include/pa_common.h, main/pa_base64.C, main/pa_common.C: pa_base64.h and pa_base64.C added, base64 implementation moved from pa_common.h and pa_common.C 2019-11-12 moko * tests/: 275.html, results/275.processed: out of range test fixed, as ^math:convert now supports arbitrary precision 2019-11-11 moko * tests/results/389.processed: uctualized error message * tests/: 389.html, 397.html, results/397.processed: tests for ^math:convert added (related to feature #1177) * src/classes/math.C: ^math:convert now supports arbitrary precision, alphabet support added (implements feature #1177) 2019-11-06 moko * tests/: 181.html, results/181.processed: entities usage added, more entites load tests (related to bug #842 discussion) 2019-11-05 moko * src/main/pa_xml_io.C: bugfix: no more extra http://localhost/ call from xmlFileOpen if http://localhost/ was not found (related to bug #842) * src/main/pa_xml_io.C: rename * src/main/pa_xml_io.C: +MemoryStream constructor * src/main/pa_xml_io.C: whitespace 2019-10-31 moko * src/classes/xdoc.C: XML_PARSE_OPTIONS (XML_PARSE_DTDLOAD | XML_PARSE_NOENT) added to fix entities load, (related to feature #1181) 2019-10-25 moko * tests/: 388-sql.html, results/388-sql.processed: more multiple queries tests 2019-10-24 moko * tests/: 388-sql.html, results/388-sql.processed: support for pgsql driver test * tests/: 388-sql.html, results/388-sql.processed: multi_statements=1 now tested, mysql test now supported (connection must be specified in [parser3] section in .my.cnf) related to issues #1195 and #1194 2019-09-11 moko * src/classes/int.C: whitespace * tests/: 388-sql.html, results/388-sql.processed: +duplicate key exception test * tests/results/388-sql.processed: sql queries now shown (related to feature #1196) * src/sql/pa_sql_driver.h: to keep new SQL drivers more compatible with old parser versions. * src/: classes/file.C, classes/hash.C, classes/string.C, classes/table.C, classes/void.C, include/pa_sql_connection.h, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: Show query instead of connect string in query_event_handlers exceptions (implements feature #1196) 2019-09-06 moko * tests/388-sql.html: mysql compat * src/: classes/hash.C, classes/string.C, classes/table.C, classes/void.C, include/pa_common.h, main/pa_common.C: cleanup: sql_ variables declaration moved to pa_common.h 2019-01-15 moko * src/classes/curl.C: ^curl:info[] - OrderedHashString used, items logically sorted 2018-12-27 moko * src/include/pa_config_includes.h: warning war: -Wdeprecated-register added for C++ 17 2018-10-15 moko * configure.ac: FreeBSD 11.2 can be build with ./configure --with-gc=/usr/local/lib/ --with-pcre=/usr/local/ --with-xml=/usr/local/ 2018-09-24 moko * tests/: 396.html, 396.tiff, results/396.processed: test for ^image::measure[] now supports tiff added (related to feature #1188) * src/classes/image.C: ^image::measure[] now supports tiff (implements feature #1188) 2018-09-20 moko * tests/: 395.bmp, 395.html, results/395.processed: test for bmp files measure added (related to ticket #1188) * src/classes/image.C: measure of bmp files implemented (related to ticket #1188) 2018-09-18 moko * tests/: 394-curl.html, results/394-curl.processed, results/auto.p: test for bug #1187 (max_file_size check for head requests) added 2018-08-24 moko * src/classes/curl.C: CURLOPT_NOBODY value used to check if response content-length check is required (fixes bug #1187) 2018-05-11 moko * tests/: 157.html, results/157.processed: test for ^file:copy[..; $.append(bool) ] option added (related to feature #919) * src/classes/file.C: ^file:copy[..; $.append(bool) ] option added from misha@ patch (implements feature #919) 2018-03-22 moko * src/main/pa_request.C: $response:download[ $.file[file.namef] ] worked rather slow (about 1mb/sec) with 10kb buffer, replaced it with 128kb buffer. Now works at least 12 times faster. :) May be Windows-only problem. * src/lib/cord/cord.vcproj: Profile * complete cleanup (VS 2003 build fix) 2018-02-03 moko * src/main/execute.C: removes irrelevant lines from exception stack trace when exceptions occurs in assigment (fixes bug #1165) * tests/: 393.html, results/393.processed: test for behavour after "Property can not be created, already exists field with that name" exception removed (related to feature #1183) * src/types/pa_vclass.C: "Property can not be created, already exists field with that name" exception removed (implements feature #1183) 2018-01-19 moko * src/classes/string.C: whitespace * src/classes/string.C: whitespace * tests/: 392.html, results/392.processed: test for ^regex::create[$regex] added (related to feature #1135) * src/: classes/regex.C, types/pa_vregex.C, types/pa_vregex.h: ^regex::create[$regex] added (implements feature #1135) * src/types/: pa_vclass.C, pa_vclass.h: CLASS_GETTER_UNPROTECTED commented define added (related to feature #1157) 2018-01-17 moko * buildall: gc 7.6.0 -> 7.6.2 (related to feature #1136) 2018-01-15 moko * tests/: 390.html, results/390.processed: real path replaced by stub * tests/: 391.html, results/391.processed: test for feature #1181 (XML_PARSE_HUGE exception) added 2018-01-11 moko * src/classes/xdoc.C: xmlReadMemory/xmlReadFile now used with XML_PARSE_HUGE option passed by default (implements feature #1181) * src/classes/string.C: whitespace 2017-12-10 moko * tests/: 389.html, 390.html, results/389.processed, results/390.processed: image code coverage tests added (related to feature #1125) 2017-12-08 moko * tests/: 346-curl.html, 388-sql.html, 389.html, results/346-curl.processed, results/388-sql.processed, results/389.processed: more code coverage tests * tests/: 264.html, results/264.processed: code coverage for ^file::exec[] 2017-12-07 moko * tests/: 174.html, 388-sql.html, 389.html, results/388-sql.processed, results/389.processed, results/174.processed: more coverage tests * src/classes/math.C: exception text actualized 2017-12-06 moko * tests/388-sql.html: $SQL can be here * tests/results/auto.p: $SQL not required here * tests/: 388-sql.html, 389.html, Makefile, results/388-sql.processed, results/389.processed, results/auto.p: code coverage tests for sql (using sqlite) and int/double/bool added (related to feature #1125) * src/: classes/classes.vcproj, lib/cord/cord.vcproj, lib/json/json.vcproj, lib/md5/md5.vcproj, lib/memcached/memcached.vcproj, lib/punycode/punycode.vcproj, lib/sdbm/sdbm.vcproj, lib/smtp/smtp.vcproj, main/main.vcproj, targets/apache/ApacheModuleParser3Core.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: gc\include no longer required * src/lib/: cord/cord.vcproj, gd/gd.vcproj: gc\include no longer required * src/: classes/Makefile.am, classes/table.C, include/pa_config_includes.h, include/pa_string.h, lib/cord/Makefile.am, lib/cord/cordbscs.c, lib/cord/cordxtra.c, lib/gd/Makefile.am, lib/json/Makefile.am, lib/sdbm/Makefile.am, lib/smtp/Makefile.am, main/Makefile.am, main/untaint.C, targets/apache/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: to be sure that our version of gc.h/cord.h is used, we now include it directly 2017-12-04 moko * src/lib/: gd/gd.vcproj, md5/md5.vcproj, memcached/memcached.vcproj, punycode/punycode.vcproj, sdbm/sdbm.vcproj, smtp/smtp.vcproj: includes unified, gc added where required * src/: classes/memory.C, include/pa_config_includes.h: GC_DEBUG now can be used to trace memory allocations * src/: classes/table.C, include/pa_config_includes.h, include/pa_memory.h, lib/cord/cordbscs.c, lib/cord/cordxtra.c, main/pa_globals.C: PA_DEBUG_DISABLE_GC works again, pa_gc_* method removes, libcord also can work without libgc * src/classes/json.C: pa_gc_malloc_atomic should not be used 2017-11-29 moko * src/classes/curl.C: no exception if some of ^curl:info[] elements are not present (related to feature #1173) * tests/346-curl.html: test updated to test curl content-length bug (related to feature #1173) * tests/results/346-curl.processed: more test for content-length curl bug (related to feature #1173) * tests/results/346-curl.processed: test results updated after #1173 implemented 2017-11-28 moko * src/classes/curl.C: another libcurl Content-length bug walkaround (related to feature #1173) 2017-11-27 moko * src/: classes/curl.C, lib/curl/curl.h: ^curl:options $.http_version[version string] added (implements feature #1173), CURLOPT_POSTFIELDSIZE is set to 0 now only for old versions, where $post(true) bug existed. 2017-11-18 moko * src/include/pa_memory.h: warning war (related to feature #1170) * src/include/pa_pool.h: RedHat 7.3 compatibility fixed (related to feature #1170) 2017-11-17 moko * src/include/pa_memory.h: CHECK_DELETE_USAGE define added as std::basic_stringstream used in ^table.csv-string[] is compatible with delete usage check only under Debian 9 (related to feature #1170) 2017-11-16 moko * src/: classes/curl.C, classes/hash.C, classes/json.C, classes/table.C, classes/xdoc.C, include/pa_config_includes.h, include/pa_hash.h, include/pa_memory.h, include/pa_pool.h, main/pa_charset.C, main/pa_memory.C, main/pa_xml_io.C, sql/pa_sql_driver.h, types/pa_value.h, types/pa_vmemcached.C, types/pa_vxdoc.h: regular new/delete no longer used in our code, stubs defend from accidental use (implements feature #1170) 2017-06-24 moko * configure.ac: minor fix: thanks to alx@ 2017-05-29 moko * src/types/pa_vmail.C: mail headers are now correctly truncated - MAX_CHARS_IN_HEADER_LINE value fixed, mail_header_utf8_substring added to avoid cutting of UTF-8 chars (fixed bug #123) * src/main/untaint.C: as in case of =?UTF-8?Q?= space is ignored, =?UTF-8?Q?= should start in case of leading space (related to bug #123) * buildall: echo -n -> printf for OS X. :) 2017-05-25 moko * tests/: 288.html, results/288.processed: test updated afted setting $o.prop without setter exception removed (related to feature #1157) * src/types/pa_vclass.C: no more "this property has no setter method" when setting $o.prop without setter (implements feature #1157) * buildall: echo \c -> echo -n for FreeBSD * configure, configure.ac, src/include/pa_config_auto.h.in, src/types/pa_vdouble.h: isfinite now checked in configure * compile, config.guess, config.sub, depcomp, install-sh, missing: upgraded to automake 1.15 2017-05-23 moko * src/types/pa_vdouble.h: finite returned where isfinite not defined 2017-05-22 moko * buildall: gc-7.6.0 USE_LIBC_PRIVATES allready defined warning war * buildall: extern CFLAGS setting support * src/types/pa_vdouble.h: warning war: finine() -> isfinite() 4OSX * buildall: http -> https * buildall: gc-7.2f -> gc-7.6.0 2017-05-20 moko * buildall: https, pcre, xml, xslt updated to current versions (related to feature #1136) 2017-05-19 moko * tests/097.html: after parser.ru moved to https 2017-05-17 moko * tests/results/: 175.processed, 372.processed: tests resuls updated after lintian spelling typos fixed (related to bug #1156) * src/: classes/file.C, classes/hash.C, classes/reflection.C, classes/string.C, classes/table.C, main/pa_charset.C, main/pa_common.C, main/pa_http.C, types/pa_vimage.h, types/pa_vmail.C, types/pa_vxdoc.h: fixed spelling typos from lintian reported by Sergey B Kirpichev (fixes bug #1156) * tests/results/096.processed: +XMP * tests/: 096.html, 096_dir/188.jpg: ^image::measure[] $.exif(true) $.xmp(true) options tested (test for feature #1154) * src/classes/image.C: ^image:measure[] options $.exif(false) $.xmp(false) $.xmp-charset[UTF-8] implemened. exif no longer fetched by default! (implements feature #1154) 2017-05-16 moko * tests/: 256.html, results/256.processed: ^json:string[$image] now allowed (related to feature #1154) * src/: classes/image.C, types/pa_vimage.C, types/pa_vimage.h: initial XMP implementation - without options and transcode (related to feature #1154) 2017-05-12 moko * src/: classes/image.C, types/pa_vimage.C, types/pa_vimage.h: image: exif moved to ffields, skipped in ^image.html[] where iterators now used (preparation for feature #1154) 2017-05-05 moko * tests/: 387.html, 387_dir/A.p, 387_dir/B.p, results/387.processed: test for circular class inheritance check added (related to bug #1150) * src/types/pa_vstateless_class.C: circular class inheritance check added (fixes endless add_derived bug #1150) 2017-05-04 moko * tests/: 386.html, results/386.processed: test for $table.value(number) added (related to feature #1152) * src/types/pa_vtable.C: table put_element: column value must be string - > column value must be string compatible to allow $t.value(1) (implements feature #1152) 2017-05-03 moko * src/main/pa_request.C: $use[$method] is not possible, reverting (related to feature #1151) * tests/: 386.html, 386.p, results/386.processed: $use[$method] is not possible, removing test (related to feature #1151) * src/: main/pa_request.C, types/pa_vstateless_class.h: get_element_method added and used to allow $use[$method] and $autouse[$method] (implements feature 1151) * tests/: 386.html, 386.p, results/386.processed: test for @use in variable added (related to feature #1151) * tests/results/226.processed: actualized after ^try-catch used * tests/: 226.html, 385.html, results/385.processed: test for @autouse in variable added * configure.ac, src/include/pa_version.h: 3.4.5 -> 3.4.6b 2017-02-27 moko * configure.ac, src/include/pa_version.h: 3.4.5rc -> 3.4.5 2017-02-20 moko * operators.ru.txt, operators.txt: actualization + beauty 2017-02-16 moko * tests/: 384.html, results/384.processed: test for ^reflection:mixin[; $.name[] ] option added (related to feature #1089) * tests/: 384.html, results/384.processed: test for ^reflection:mixin[] added (related to feature #1089) * src/types/pa_value.h: warning war: virtual ~Value() added 2017-02-15 moko * src/include/pa_hash.h: compilation without HASH_CODE_CACHING fixed * tests/: 320.html, results/320.processed: $.reverse(true/false) test added (related to feature #1069) * src/: classes/reflection.C, types/pa_vstateless_class.h: compilation without HASH_ORDER fixed * src/: classes/reflection.C, include/pa_hash.h: $.reverse(true/false) added to ^reflection:methods[] (related to feature #1069) 2017-02-14 moko * tests/: 152.html, results/152.processed: test for $._default hash added (related to bug #1131) * tests/: 277.html, results/277.processed: test for hash with only $._default is now defined (related to bug #1131) * src/types/pa_vhash.h: hash with only $._default is now defined (fixed bug #1131) 2017-02-13 moko * tests/cat-windows.sh: cat-windows added (cygwin required) * tests/: 171.html, 264.html, 286.html, 370.html, results/320.processed, results/375.processed, results/auto.p: cat-windows.sh support added * tests/375.html: Windows support * tests/270.html: documented * tests/: 270.html, run_parser.cmd: bugfix: PATH_INFO has slashes (not backslashes) even under Windows (broke test 270) 2017-02-12 moko * tests/: descript.ion, todo.txt: cleanup 2017-02-09 moko * tests/: 253.html, 255.html, 275.html, 347-curl.html, run_tests.cmd: Windows compatibility * tests/make_tests.cmd: removed as test can't be passed - TZ is set incorrectly (GMT) if parser is called from cygwin 2017-02-08 moko * operators.ru.txt, operators.txt: actualization 15% completed * operators.ru.txt, operators.txt: cp1251 -> utf-8 * NEWS, README: minor update * src/include/pa_config_includes.h: warning war continues * src/: include/pa_config_includes.h, include/pa_memory.h, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vdouble.h: warning war: gcc 6.x issues fixed * src/: classes/bool.C, classes/classes.C, classes/classes.awk, classes/classes.h, classes/curl.C, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/inet.C, classes/int.C, classes/json.C, classes/mail.C, classes/math.C, classes/memcached.C, classes/memory.C, classes/op.C, classes/reflection.C, classes/regex.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_http.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_pool.h, include/pa_random.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_symbols.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, lib/punycode/pa_idna.c, lib/punycode/pa_idna.h, lib/sdbm/pa_file_io.C, lib/sdbm/pa_strings.C, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_http.C, main/pa_memory.C, main/pa_os.C, main/pa_pool.C, main/pa_random.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_connection.C, main/pa_stylesheet_manager.C, main/pa_symbols.C, main/pa_table.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, sql/pa_sql_driver.h, targets/apache/mod_parser3.c, targets/apache/mod_parser3_core.C, targets/apache/pa_httpd.h, targets/apache/pa_threads.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_property.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vcaller_wrapper.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.C, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.C, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.C, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemcached.C, types/pa_vmemcached.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vregex.C, types/pa_vregex.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.C, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: Copyright year: 2015->2017 2017-02-07 moko * configure.ac, src/include/pa_version.h: 3.4.5b -> 3.4.5rc 2017-02-06 moko * src/main/pa_common.C: minor fixes, whitespace * src/: classes/curl.C, classes/file.C, classes/image.C, include/pa_common.h, include/pa_dir.h, main/pa_common.C, main/pa_dir.C, main/pa_exec.C: wchar filenames API under Windows now used (implements feature #1081) * src/: types/pa_vcookie.C, main/pa_charset.C: cleanup 2017-02-01 moko * src/include/pa_request.h: cleanup 2017-01-30 moko * src/main/pa_request.C: file_lock_wait_limit -> lock_wait_timeout 2017-01-29 moko * tests/: 383.html, results/383.processed: test for ^reflection:stack[] added (related to feature #1052) * src/classes/reflection.C: else added * src/: include/pa_os.h, main/pa_os.C, main/pa_request.C: $.max_file_lock_wait added (implements feature #1128) 2017-01-28 moko * tests/: 379-curl.html, results/379-curl.processed: curl empty body and other cases tests added (related to featue #1014) * src/classes/curl.C: bug if response is empty fixed (related to feature #1014) 2017-01-27 moko * src/: classes/json.C, classes/reflection.C, include/pa_request.h, main/execute.C, types/pa_vmethod_frame.h: ^reflection:stack[] added (implements feature #1052) 2017-01-25 moko * tests/: 382.html, results/382.processed: @GET_DEFAULT returning method test added 2017-01-23 moko * src/classes/reflection.C: optimization: options->get replaced by hash iterator * tests/: 381.html, results/381.processed: now -> fixed date * src/main/pa_request.C: warning war * src/targets/cgi/parser3.vcproj: Stack size increased from 2Mb to 5Mb (fixes bug #1058) * src/classes/curl.C: warning war * tests/: 381.html, results/381.processed: tests for ^json:string $.one-line(true) option added (related to feature #1124) * src/: classes/json.C, types/pa_value.h: $json-string $.one-line(true|false) options is now supported (implements feature #1124) * tests/: 380.html, results/380.processed: test for modified $.max_file_size added (related to bug #1014) * tests/: 379.html, results/auto.p: tests for rewritten http file load added (related to bug #1014) * src/: classes/curl.C, include/pa_common.h, include/pa_http.h, main/pa_common.C, main/pa_http.C: check_file_size added and used in curl / file load from disk and http, http file load rewritten (related to bug #1014) 2017-01-18 moko * tests/: 378.html, results/378.processed: tests for ^result[] added (related to feature #66) * src/: classes/op.C, include/pa_request.h: ^return[] can't be Method::CO_WITHOUT_FRAME as frame still added in expression (related to feature #66) 2017-01-17 moko * tests/: 377.html, results/377.processed: test for different combinations of breaks in body and delimiter (related to bug #1077) * tests/: 376.html, results/376.processed: many ^break[] tests added (related to bug #1077) * src/types/pa_vmethod_frame.C: "break is not allowed in expression passed to native method" exception added to avoid bugs due to WRITE_EXPR_RESULT skipped and native methods execution continues after ^break[] (related to bug #1077) 2017-01-14 moko * tests/: 330.html, results/330.processed: test results updated after ^break[] bugs where fixed (related to bug #1077) * tests/: 329.html, results/329.processed: test results updated after ^break[] bugs where fixed (related to bug #1077) * tests/results/320.processed: ^return[] added 2017-01-13 moko * src/: classes/hash.C, classes/hashfile.C, classes/op.C, classes/table.C, include/pa_request.h, main/execute.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vmethod_frame.C: Request::SKIP_INTERRUPTED, Request::SKIP_RETURN added and implemented, Request::SKIP_* now checked after each possible process/execute call (fixes bug #1077) 2016-12-29 moko * src/main/pa_common.C: warning war * src/: classes/math.C, include/pa_random.h, include/pa_request.h, include/pa_types.h, main/pa_request.C, main/pa_string.C: pa_file_size_limit added, ^math:random fixed for upper limit and limits more then 0x7FFFFFFF, limits now declared in pa_types.h (related to feature #1014) * src/: classes/curl.C, classes/file.C, include/pa_common.h, main/pa_common.C, main/pa_dir.C, main/pa_exec.C: stat -> pa_stat (related to feature #1014) 2016-12-28 moko * src/: classes/file.C, main/pa_request.C, main/pa_string.C: VS2003 warning war 2016-12-26 moko * tests/: 341.html, results/341.processed: test for ^table.hash[id;;$.type[string]] added (related to feature #1057) * src/classes/table.C: ^table.hash[id;;$.type[string]] support fix (related to feature #1057) * src/types/pa_vdate.C: warning war continues... * src/: classes/date.C, classes/image.C, classes/table.C, include/pa_config_includes.h, types/pa_vfile.C: warning war * src/lib/gd/gifio.C: warning war / cleanup * src/lib/json/pa_json.C: warning war * src/classes/hash.C: warning war * src/types/pa_vfile.C: warning war * src/: classes/hash.C, include/pa_common.h, types/pa_vcookie.C: -Wall warning war continues * configure.ac: --with-build-warnings actualized 2016-12-25 moko * src/main/pa_exec.C: -wAll warning war * src/: types/pa_vform.C, types/pa_vrequest.C, main/pa_common.C: -wAll warning war * src/: include/pa_common.h, include/pa_sapi.h, types/pa_junction.h, types/pa_method.h, types/pa_value.h, types/pa_vdate.C, types/pa_vstateless_class.h, types/pa_vxdoc.h: -wAll warning war 2016-12-23 moko * src/lib/ltdl/Makefile.am: extra dist added * tests/results/344.processed: test result updated after $file.text prefetched in ^hash::create[$file] (related to feature #1075) * src/types/: pa_vfile.C, pa_vfile.h: $file.text prefetched in ^hash::create[$file] (related to feature #1075) 2016-12-22 moko * src/: classes/file.C, include/pa_common.h, main/pa_common.C, main/pa_request.C, main/pa_stylesheet_connection.C, types/pa_vfile.C: file_stat now return 64-bit size (implements #1014 under 32-bit unix versions) 2016-12-21 moko * tests/: 375.html, results/375.processed: test for exec returning stated file added (related to feature #1119) * src/classes/file.C: load should not return file with null body (fixes bug #1119) 2016-12-14 moko * tests/: 374.html, results/374.processed: test for $method.name added (related to feature #1117) plus method returning junction test 2016-12-13 moko * src/: include/pa_symbols.h, main/pa_symbols.C, types/pa_vjunction.C, types/pa_vjunction.h: $method.name added (implements feature #1117) * src/: types/pa_vform.C, include/pa_request_info.h: now only GET, HEAD and TRACE can't have body (implements feature #1116) 2016-12-09 moko * tests/: 373.html, results/373.processed: tests for ^reflection:tainting added (related to feature #1098) * src/classes/reflection.C: ^reflection:tainting arguments order change (related to feature #1098) 2016-12-06 moko * src/: classes/reflection.C, include/pa_string.h, main/pa_string.C: ^reflection:tainting[$string] added (implements feature #1098) 2016-12-05 moko * src/types/pa_vdouble.h: negative zero (-0) now converted to 0 (fixes bug #1114) 2016-12-04 moko * tests/: 206.html, results/206.processed: negative zero (0/-1) check added 2016-12-03 moko * tests/: 346-curl.html, results/346-curl.processed: test modified to test value.as_hash() usage * src/classes/curl.C: value.as_hash() used for correct hash processing * src/classes/reflection.C: exceptions texts fixes 2016-12-02 moko * tests/: 372.html, results/372.processed: tests for ^reflection:create[ $.class[name] $.constructor[name] $.arguments[ $.1[param1] $.2[param2] ... ] ] added (related to feature #1094) * src/types/pa_vmethod_frame.h: comment added: params should be declared outside of *_FRAME_ACTION as MethodParams destructor will be called in ~VNativeMethodFrame * src/classes/reflection.C: ^reflection:create[ $.arguments[ ... ] ] minor fix * src/: classes/reflection.C, types/pa_value.C, types/pa_value.h, types/pa_vmethod_frame.C: ^reflection:create[ $.class[name] $.constructor[name] $.arguments[ $.1[param1] $.2[param2] ... ] ] now supported (implements feature #1094) value::as_hash added (and should be used everywhere) * src/classes/reflection.C: cleanup 2016-12-01 moko * tests/: 356.html, results/356.processed: test for method junctions class name added to the resulting hash added (related to feature #1068) * src/classes/reflection.C: for method junctions class name added to the resulting hash (related to feature #1068) 2016-11-30 moko * src/types/: pa_vhashfile.C, pa_vhashfile.h: file_name included in exception (related to bug #1113) * src/types/pa_vhashfile.C: whitespace * src/main/pa_os.C: errno now returned as it should (fixes bug #1113) * tests/results/: 175.processed, 192.processed, 224.processed, 229.processed, 239.processed, 244.processed, 246.processed, 314.processed, 352.processed: tests results updated after method call exceptions improved as method now keeps its name * src/: classes/reflection.C, main/execute.C, types/pa_value.C, types/pa_vmethod_frame.h: method call exceptions improved as method now keeps its name * tests/: 224.html, 239.html, results/224.processed, results/239.processed: tests and tests results updated after Request::construct exception changed * src/: classes/reflection.C, main/execute.C: Request::construct exception optimized * tests/: 371.html, results/371.processed: test for WWrapper.get_element call in $.name.key[value] code added (related to feature #1091) * src/types/pa_wwrapper.h: WWrapper.get_element returned, as used in $.name.key[value] code (related to feature #1091) 2016-11-29 moko * src/classes/op.C: VS warning war * src/types/: pa_vmethod_frame.h, pa_wcontext.h: VS warning war: C4239: nonstandard extension used : 'return' : conversion from 'Value' to 'Value &' (related to feature #1020) * src/: main/execute.C, types/pa_vmethod_frame.h, types/pa_wcontext.h: VS warning war: C4239: nonstandard extension used : 'return' : conversion from 'Value' to 'Value &' (related to feature #1020) * src/main/execute.C: VS warning war * src/targets/cgi/parser3.C: VS compatibility fix * src/include/pa_request.h: VS warning war * tests/: 370.html, results/370.processed: test for ^file::exec[ ... $.stdin[$binary_file] ] added (related to bug #1044) * src/: classes/file.C, classes/mail.C, include/pa_exec.h, include/pa_string.h, main/pa_exec.C: pa_exec now supports $.stdin[$binary_file] (fixes bug #1044) 2016-11-28 moko * src/main/pa_exec.C: whitespace * src/main/pa_request.C: whitespace * tests/: 369.html, results/369.processed: test for $response:status usage added (related to feature #1099) * src/targets/cgi/parser3.C: HTTP response code used as exit status if < 100 (implements feature #1099) * src/targets/cgi/parser3.C: whitespace * src/targets/cgi/parser3.C: whitespace * tests/: 368.html, results/368.processed: test updated after ^reflection:filename[$method] added (related to feature #1053) * src/: classes/op.C, classes/reflection.C, include/pa_request.h, main/compile.y, main/execute.C, main/pa_request.C, types/pa_vclass.h: filename -> filespec, ^reflection:filename[$method] added (related to feature #1053) 2016-11-27 moko * tests/: 368.html, results/368.processed: test for reflection:filename[$class or object] added (related to feature #1053) * src/: classes/reflection.C, main/compile.y, types/pa_vclass.h, types/pa_vstateless_class.h: ^reflection:filename[$class or object] added (implements feature #1053) 2016-11-26 moko * src/: include/pa_request_info.h, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C: remove_absolute_uri -> strip_absolute_uri 2016-11-25 moko * src/: include/pa_request_info.h, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C: request_info.remove_absolute_uri added to remove possible http://site.name/ from $request:uri (implements feature #1112) 2016-11-24 moko * tests/: 367-curl.html, results/367-curl.processed: test for previous request headers clearing after redirect added (related to bug #1109) * src/: classes/curl.C, include/pa_array.h, include/pa_http.h: response headers from previous requests are now cleared, only last request headers are collected (fixes bug #1109) * tests/results/: 266.processed, 321.processed, 356.processed: tests results updated as method name now added to the resulting hash for new syntax only (Imp1 compatimility fixed, related to feature #1068) * src/classes/reflection.C: method name now added to the resulting hash for new syntax only (Imp1 compatimility fixed, related to feature #1068) * tests/results/366.processed: test for native and parser implementation of ^use[] logic (related to feature #1074) * tests/: 366.html, 366_dir/test-duplicate.p, 366_dir/test.p: test for native and parser implementation of ^use[] logic (related to feature #1074) 2016-11-23 moko * src/: classes/op.C, include/pa_request.h, main/compile.y, main/pa_request.C: @USE file now implemented as ^use[file; $.origin[origin_file] ] (implements feature #1074) 2016-11-21 moko * tests/: 365.html, results/365.processed: test for $caller bugs in 3.4.4 and $caller.method now tested (related to feature #1110) * tests/: 364.html, results/364.processed: $caller usage in different contexts now tested (related to feature #1110) * src/types/types.vcproj: +pa_vcaller_wrapper.h * src/types/Makefile.am: pa_vcaller_wrapper.h added * src/: include/pa_symbols.h, main/pa_symbols.C, types/pa_method.h, types/pa_vcaller_wrapper.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: redesign: VCallerWrapper added and used (implements feature #1110) 2016-11-20 moko * src/types/pa_vdouble.h: whitespace 2016-11-11 moko * tests/: 363.html, results/363.processed: more tests for feature #1091 (how parser methods work in expression context) * src/: include/pa_request.h, types/pa_vmethod_frame.h: in expressions strings are now written as strings, not values by write_as_string (related to feature #1091) * src/classes/op.C: to make more correct behavour in expression context 2016-11-07 moko * tests/: 362.html, results/362.processed: test for xsltParseStylesheetDoc caching as xsl modification after it added (related to bug #1108) * src/: classes/xdoc.C, types/pa_vxdoc.h: xsltParseStylesheetDoc result now cached as xdoc is modified after it (fixes bug #1108) 2016-11-06 moko * src/types/pa_vxdoc.h: whitespace 2016-11-05 moko * src/types/pa_vmethod_frame.h: cleanup 2016-11-03 moko * tests/results/244.processed: more correct exception after method frames separation * src/types/pa_vmethod_frame.h: minor optimizaion * src/types/pa_method.h: optimization: params_count added * src/: classes/json.C, classes/op.C, classes/reflection.C, include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_value.C, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C: Optimization: VMethodFrame now divided into VNativeMethodFrame, VParserMethodFrame, VLocalParserMethodFrame; METHOD_FRAME_ACTION, EXPRESSION_FRAME_ACTION, CONSTRUCTOR_FRAME_ACTION defines added and used (related to feature #1104) 2016-11-02 moko * src/: classes/bool.C, classes/curl.C, classes/date.C, classes/double.C, classes/file.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/inet.C, classes/int.C, classes/json.C, classes/mail.C, classes/math.C, classes/memcached.C, classes/op.C, classes/reflection.C, classes/regex.C, classes/string.C, classes/table.C, classes/xdoc.C, classes/xnode.C, include/pa_request.h, main/execute.C: cleanup: r.write_pass_lang, r.write_no_lang -> r.write (implements feature #1091) * src/main/execute.C: cleanup (related to feature #1104) * src/: include/pa_request.h, main/execute.C, types/pa_vmethod_frame.h, types/pa_wcontext.h: VExpressionFrame added, in_expression removed (implements feature #1104) 2016-10-31 moko * src/types/pa_value.C: whitespace 2016-10-28 moko * tests/results/244.processed: updated after error reporting fixed in pa_wcontext.C * src/types/pa_wcontext.C: error reporting fixed * src/types/pa_wcontext.h: whitespace * src/classes/image.C: not fully readed entries are no longer processed (fixes bug #1106) 2016-10-26 moko * src/classes/image.C: whitespace * src/: include/pa_request.h, include/pa_string.h, main/untaint.C, types/pa_vmail.C, types/pa_vmethod_frame.h, types/pa_wcontext.h, types/pa_wwrapper.h: optimization: L_PASS_APPENDED removed as no longer required (related to feature #1091) * tests/results/: 264.processed, 350.processed: test results update reverted (whitespace optimization) after write_no_lang removed :) (related to feature #1091) * src/: classes/file.C, classes/hash.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, include/pa_request.h, main/pa_xml_io.C, types/pa_vmail.C: Temp_lang removed, write_no_lang now almost equal write_pass_lang (related to feature #1091) * tests/results/: 264.processed, 350.processed: test results updated (whitespace optimization) after write_assign_lang removed (related to feature #1091) * tests/: 361.html, results/361.processed: test for non-string ^untaint added (related to feature #1091) * src/: classes/curl.C, classes/date.C, classes/file.C, classes/hash.C, classes/op.C, classes/string.C, include/pa_request.h, main/execute.C: optimization: write_assign_lang removed as not required (first part of feature #1091 implementation) 2016-10-12 moko * tests/: 360.html, results/360.processed: more test code (related to feature #1104) * src/: classes/op.C, classes/reflection.C, include/pa_opcode.h, include/pa_request.h, main/compile.y, main/execute.C: opcode OP_PREPARE_TO_EXPRESSION removed as not required, optimized WContext is next task (implements feature #1104) * src/types/pa_method.h: more detailed comment for CO_WITHOUT_FRAME / CO_WITHOUT_WCONTEXT * tests/: 360.html, results/360.processed: test for in expression state (related to feature #1104) 2016-10-11 moko * src/main/execute.C: compilation without OPTIMIZE_CALL fixed * src/classes/op.C: default value removed from initializer * src/types/pa_vmemcached.C: FreeBSD 11 warning war * src/types/pa_vmethod_frame.h: FreeBSD 11 warning war 2016-10-10 moko * tests/results/auto.p: test updated adter $RECOURSION_LIMIT, $LOOP_LIMIT -> $LIMITS[ $.max_recoursion, $.max_loop ] (related to feature #42) * src/main/pa_request.C: $RECOURSION_LIMIT, $LOOP_LIMIT -> $LIMITS[ $.max_recoursion, $.max_loop ] (related to feature #42) 2016-10-08 moko * src/classes/double.C: whitespace 2016-10-07 moko * src/types/pa_vmethod_frame.h: reorder 2016-10-06 moko * src/classes/date.C: typo * src/types/pa_vmethod_frame.h: whitespace + cleanup * src/: classes/hash.C, classes/hashfile.C, classes/json.C, classes/op.C, classes/reflection.C, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: params.get now returns Value&, not Value* * src/types/pa_vmethod_frame.C: params.get should return Value&. * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: get_as removed; first as_* code rewrite 2016-10-05 moko * src/include/pa_request.h: whitespace * tests/: 359.html, results/359.processed: test for VCodeFrame and intercept_string added (related to feature #1097) * src/: classes/image.C, classes/op.C, classes/table.C, include/pa_request.h, main/execute.C, types/pa_vmethod_frame.C: optimization: intercept_string removed (implements feature #1097) * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: whitespace * src/types/: pa_vcode_frame.h, pa_wwrapper.h: get_element removed from VCodeFrame and WWrapper as not required 2016-10-04 moko * src/: classes/curl.C, classes/date.C, classes/double.C, classes/file.C, classes/hash.C, classes/image.C, classes/inet.C, classes/int.C, classes/json.C, classes/op.C, classes/reflection.C, classes/string.C, classes/table.C, include/pa_request.h, main/execute.C, types/pa_vmethod_frame.C: proces_to_value -> process after StringOrValue removed (related to feature #1020) * src/classes/form.C: whitespace * src/main/execute.C: VALUE__GET_BASE_CLASS added to opcode_names * tests/: 357.html, 358.html, results/357.processed, results/358.processed, results/auto.p: test for @conf $RECOURSION_LIMIT and $LOOP_LIMIT added (related to feature #42) 2016-10-03 moko * src/: classes/op.C, include/pa_request.h, main/pa_request.C, types/pa_vtable.C: @conf $RECOURSION_LIMIT and $LOOP_LIMIT now supported (implements feature #42) * src/types/pa_vregex.h: no reason for VRegex to be is_evaluated_expr * src/classes/curl.C: CURL_OPT(CURL_INT, SSLVERSION) added (implements feature #1095) 2016-10-01 moko * src/classes/reflection.C: $.overwrite in ^reflection:mixin is now false by default (related to feature #1089) 2016-09-30 moko * src/types/pa_wcontext.h: cleanup 2016-09-29 moko * src/main/execute.C: whitespace * src/include/pa_request.h: whitespace * src/: classes/hash.C, classes/hashfile.C, classes/json.C, classes/op.C, classes/table.C, include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_wcontext.h: optimization: StringOrValue removed as it just slows down and adds complexity (implements feature #1020) 2016-09-28 moko * tests/: 356.html, results/266.processed, results/321.processed, results/356.processed: tests updated after name was added to method_info hash, test for ^reflection:method_info[junction] added (related to feature #1068) * src/classes/reflection.C: ^reflection:method_info[junction] now supported, method name added to the resulting hash (implements feature #1068) * tests/: 276.html, results/276.processed: more tests for ^reflection:delete[] * src/classes/reflection.C: fixed bug then ^reflection:delete didn't work on class and could damage native objects (like file) 2016-09-26 moko * tests/: 345.html, 346-curl.html, 347-curl.html, 348.html, results/345.processed, results/346-curl.processed, results/347-curl.processed, results/348.processed: numbers added to simplify diff analysis * tests/: 352.html, results/352.processed: test result updated as method name used * src/classes/reflection.C: method name used * src/types/: pa_method.h, pa_vstateless_class.C: method now keeps its name * src/types/pa_method.h: whitespace * src/classes/reflection.C: both method and field with one name can exist. * src/classes/reflection.C: ^reflection:mixin added (implements feature #1089) * tests/: 355.html, results/355.processed: property appears in derived class if added in base test added * src/types/pa_vstateless_class.h: get_method declaration + whitespace * tests/: 354.html, results/354.processed: nice test from method and property with one name in class added 2016-09-23 moko * src/classes/reflection.C: ^reflection:method usage documented 2016-09-22 moko * src/: classes/classes.vcproj, types/types.vcproj: we need RTTI as we use 'dynamic_cast' on polymorphic type 'Value'. Without it compile warning and GPF occures on VS2003 (related to feature #1087) * tests/: 350.html, results/350.processed: test added for $.encloser[] support in ^table::create (related to feature #11) * src/classes/table.C: another minor fix (related to feature #11) 2016-09-21 moko * src/include/pa_config_fixed.h: vs2015 compilation fixes * src/: classes/curl.C, classes/file.C, classes/hash.C, classes/json.C, classes/string.C, classes/table.C, classes/xdoc.C, include/pa_charsets.h, main/pa_charsets.C, main/pa_common.C, main/pa_http.C, main/pa_request.C, main/pa_sql_driver_manager.C, types/pa_vfile.C, types/pa_vmail.C, types/pa_vrequest.C, types/pa_vresponse.C: charsets -> pa_charsets, vs2015 warning war * src/classes/table.C: vs2015 warning war * src/types/pa_vdate.C: vs2015 warning war * src/main/: pa_common.C, pa_globals.C: vs2015 compilation fixes * src/targets/cgi/parser3.vcproj: wsock32 -> ws2_32.lib (winsock 1 -> winsock 2) for vs2015 compatibility (getaddrinfo functions) * src/main/pa_common.C: vs2015 compilation fixes * src/: include/pa_common.h, lib/smtp/smtp.C, main/pa_common.C: vs2015 compilation fixes * src/main/pa_charset.C: vs2015 warning war * src/: classes/file.C, types/pa_wwrapper.h: vs2015 warning war * src/main/pa_charset.C: vs2015 warning war * src/types/: pa_wcontext.h, pa_vmethod_frame.h: vs2015 warning war * src/types/pa_vdate.C: vs2015 compilation fix * src/: include/pa_memory.h, main/pa_memory.C: VS2015 warning war * src/: lib/json/pa_json.C, classes/mail.C, classes/string.C: VS2015 compilation fixes * src/classes/table.C: minor fix (related to feature #11) * tests/results/282.processed: no longer skipping extra enclosers (related to feature #11) * src/classes/table.C: minor fix + no longer skipping extra enclosers (related to feature #11) * src/classes/table.C: minor optimization (related to feature #11) * src/classes/table.C: minor fix and optimization (related to feature #11) 2016-09-20 moko * tests/: 353.html, results/353.processed: test for PC.cclass->is_vars_local() check in one_big_piece in ^process[] added (related to bug #1090) * src/main/compile.y: PC.cclass->is_vars_local() check added for one_big_piece (fixes bug #1090) * tests/: 229.html, results/229.processed: code coverage tests * src/classes/op.C: bugfix: no more GPF if ^process[$context] (no body) was called * src/classes/op.C: whitespace * tests/: 323.html, results/323.processed: test for code junction should not be returned by ^reflection:class, ^reflection:base * src/classes/reflection.C: bugfix: code junction should not be returned by ^reflection:class, ^reflection:base * tests/: 323.html, 352.html, results/352.processed: no more exception for ^reflection:method[class;no-such-method] (related to feature #1087) * src/classes/reflection.C: ^reflection:method[class;no-such-method] : exception -> void (related to feature #1087) * src/include/pa_request.h: request::write_value added to allow write value without convertion (related to issue #1091) 2016-09-19 moko * src/main/pa_random.C: windows build fix * src/types/pa_vhash.h: warning war 2016-09-14 moko * tests/: 352.html, 552.html, results/352.processed, results/552.processed: test for ^reflection:method[] extension added (related to feature #1087) * tests/: 552.html, results/552.processed: test for ^reflection:method[] extension added (related to feature #1087) * src/classes/reflection.C: compatibility issue fixed, VClass dynamic_cast check added (related to feature #1087) * tests/: 351.html, results/351.processed: test for @auto[] inheritance bug diring ^process[] added (related to bug #1088) * src/: classes/op.C, main/pa_request.C, types/pa_vstateless_class.C: set_method now checks for @auto[] to disable it inheritance during ^process (fixes bug #1088) * src/classes/reflection.C: ^reflection:method[$class:method;$self] added (implements feature #1087) 2016-09-13 moko * tests/: 349.html, results/auto.p: test for objects prototyping added and $OBJECT-PROTOTYPE(false) is used for old tests (related to feature #1086) * src/: main/pa_request.C, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.C: objects now are not class instances, but have class as prototype, can be overridden by $OBJECT-PROTOTYPE(false) in @conf (implements feature #1086) 2016-09-08 moko * src/: classes/file.C, classes/mail.C, classes/string.C, classes/table.C, main/pa_http.C, main/pa_string.C, include/pa_string.h: cleanup: string::split limit argument removed as no longer required, pos_after no longer reference (related to feature #11) * src/classes/table.C, tests/results/348.processed: now exception is rised when invalid option is passed to ^table::create[] * tests/: 282.cfg, 282.html, results/282.processed: more code coverage tests * tests/: 348.html, results/348.processed: code coverage tests added * tests/: 348.html, results/348.processed: generic ^table::create[] tests * tests/: 035.html, results/035.processed, results/272.processed: tests updated after $.encloser[] support for ^table::create implementation (related to feature #11) * src/classes/table.C: $.encloser[] support for ^table::create finally added (implements feature #11) 2016-09-07 moko * src/include/pa_string.h: added StringSplitHelper as friend (related to feature #11) * src/include/pa_string.h: body and langs now protected, not private to allow inheritance (related to feature #11) * src/classes/table.C: lsplit optimized before cloning for ^table::create with $.encloser[] (related to feature #11) * src/classes/table.C: optimizaion: TableControlChars.separators added and used (related to feature #11) * src/classes/table.C: spelling: TableSeparators -> TableControlChars column -> separator separators -> control_chars 2016-09-06 moko * src/main/pa_string.C: whitespace * src/main/pa_string.C: whitespace 2016-09-01 moko * tests/: 347-curl.html, results/347-curl.processed: to make tests results OS-independent * src/: include/pa_http.h, main/pa_http.C: typo bugfix for clang compiler (related to feature #1042) 2016-08-15 moko * src/include/pa_string.h: whitespace * src/classes/table.C: whitespace 2016-08-05 moko * tests/: 344.html, results/344.processed: test for ^hash::create[$file] added (related to feature #1075) * src/types/: pa_vfile.h, pa_vmail.C: ^hash::create[$file] now supported (implements feature #1075) 2016-08-04 moko * tests/: 341.html, results/341.processed: more code coverage tests * tests/: 346-curl.html, results/346-curl.processed: more code coverage tests for curl * tests/: 346-curl.html, results/346-curl.processed: more code coverage tests for curl * tests/: 223-curl.html, 223.html, results/223-curl.processed, results/223.processed: code coverage tests: $.form[ $.table[] ] test added * tests/: 223-curl.html, results/223-curl.processed: more code coverage tests for curl 2016-08-03 moko * src/classes/curl.C: dlink(curl_library) now called not once, but until it will be loaded, allowing to find existing library. * tests/: 346-curl.html, 347-curl.html, results/346-curl.processed, results/347-curl.processed: more code coverage tests for curl * tests/: 339-curl.html, 339.html, 346-curl.html, Makefile, results/339-curl.processed, results/346-curl.processed: curl functionality tests 2016-08-02 moko * tests/: 339.html, results/339.processed: test for tables in ^file:load[] and ^curl:load[] (commented) added (related to feature #1042) * tests/: 345.html, results/345.processed: code coverage tests for file class * tests/: 344.html, results/344.processed: code coverage tests * tests/: 344.html, results/344.processed: mdate removed from output * src/classes/file.C: minor bugfix: is_text should be taked from fcontent.is_text_mode() if not set (related to feature #1061) * tests/: 344.html, results/344.processed: more tests * tests/: 343.html, 344.html, results/343.processed, results/344.processed: tests for ^file::create[ $.from-charset and $.to-charset ] (related to feature #1061) * src/: classes/file.C, types/pa_vfile.C, types/pa_vfile.h: aset_text_mode argument optimized * src/: classes/file.C, types/pa_vfile.C, types/pa_vfile.h: checkBOM now used in detect_binary_content (related to feature #1061) * src/main/pa_request.C: load_charset no longer required to_upper * src/types/pa_vfile.C: bugfix: ^file::create[$text_file;...] now preserves original file mode (if no $.mode specified) * src/: classes/file.C, types/pa_vfile.C, types/pa_vfile.h: ^file::create now supports $.from-charset[] and $.to-charset options (implements feature #1061), automatic transcode is done if text file is created from binary file and charset is detected. 2016-07-30 moko * src/classes/table.C: ^t.hash[..;] now supported (related to feature #1057) * tests/: 341.html, results/341.processed: test for ^t.hash[..;] added (related to feature #1057) * tests/: 286.html, results/286.processed: code tests coverage 2016-07-29 moko * src/classes/table.C: table size should be checked inside menu and foreach (related to feature #858) * src/: classes/curl.C, classes/file.C, classes/string.C, classes/xdoc.C, include/pa_charsets.h, main/pa_charsets.C, main/pa_common.C, main/pa_http.C, main/pa_sql_driver_manager.C, types/pa_vmail.C, types/pa_vrequest.C, types/pa_vresponse.C: charsets.get now does str_upper inside (related to feature #1061) * tests/: 342.html, results/342.processed: more code coverage tests * tests/: 342.html, outputs/342.processed: table menu code coverage + foreach test added (related to feature #858) * tests/: 341.html, results/341.processed: tests for ^table.hash[]{code} added + code coverage tests (related to feature #1057) * src/: include/pa_common.h, classes/table.C: ^table.hash[]{code as value} support (implements feature #1057) * src/classes/table.C: whitespace 2016-07-28 moko * src/: classes/curl.C, types/pa_vfile.C: curl now saves filename from URL, if not specified query string removed from url-based filenames in ^curl:load[] and ^file::load[] (related to feature #1042) 2016-07-27 moko * tests/: 340.html, results/340.processed: test for transcode_text_result=false added (related to issue #1042) 2016-07-26 moko * src/types/pa_vfile.C: file name should not be empty (if file path is folder and ends with /) (related to feature #1042) * src/main/pa_http.C: whitespace optimizaion * src/: classes/curl.C, include/pa_common.h, include/pa_http.h, main/pa_common.C, main/pa_http.C: ^curl:load[] now support multiple headers, ^file::load supports headers transcoding (implements feature #1042) 2016-07-25 moko * src/include/pa_common.h: PA_DEFAULT added 2016-07-22 moko * tests/: 338.html, results/338.processed: test for $date.field(value) added (related to feature #1066) * src/: classes/date.C, types/pa_vdate.C, types/pa_vdate.h: $date.field(value) now supported for y/m/d/h/m/s (implements feature #1066) 2016-07-21 moko * src/: classes/file.C, classes/image.C, include/pa_common.h, main/pa_common.C: pa_common.h: File_read_action: fname, as_text arguments removed; image.C - absolute path shown in exception (implements feature #1071) * tests/: 235.html, results/235.processed: test and test result updated after static boundary in mail and Errors-To: mail header removed (related to feature #1047) * src/: classes/math.C, include/pa_random.h, main/pa_http.C, main/pa_random.C, types/pa_vmail.C: get_uuid_boundary() added and used, static boundary in mail removed, Errors-To: mail header removed (implements feature #1047) 2016-07-20 moko * src/: classes/reflection.C, types/pa_vstateless_class.h: equest.classes(): Value -> VStateless_class, part 3 (related to issue #1051) * src/: classes/reflection.C, include/pa_request.h, main/execute.C: request.classes(): Value -> VStateless_class, part 2 (related to issue #1051) * tests/results/: 224.processed, 323.processed: classes without methods should not be methoded (related to issue #1051) * src/: classes/reflection.C, include/pa_request.h, main/compile.y, main/compile_tools.h, main/pa_request.C: request.classes(): Value -> VStateless_class, part 1 (related to issue #1051) * tests/: 337.html, results/337.processed: test for ^reflection:fields_reference[] and VHashReference class added (related to feature #1072) * src/: classes/hash.C, classes/json.C, classes/reflection.C, types/pa_value.h, types/pa_vhash.h, types/pa_vobject.h: VHashBase and VHashReference added, allowing ^reflection:fields_reference[] implementation (closes feature #1072) 2016-07-19 moko * tests/: 323.html, results/323.processed: we want to see "methoded" * tests/: 336.html, results/336.processed: test for $BASE:property and ^BASE:method (OP_VALUE__GET_BASE_CLASS) added (related to bug #1059) * src/: include/pa_opcode.h, main/compile.y, main/execute.C, types/pa_vstateless_class.h, types/pa_wcontext.h: no more somebody_entered_some_class, $BASE:property works again, ^BASE:method[] bugs fixed (fixes bug #1059) 2016-07-14 moko * tests/: 335.html, results/335.processed: test for feature #1055 added * src/classes/hash.C: bugfix: $._default was not copied if empty feature: ^hash.contains[_default] added (implements feature #1055) 2016-07-13 moko * src/classes/reflection.C: bugfix: ^reflection:def[class;name] should not call @autouse (http://www.parser.ru/forum/?id=83480) 2016-07-05 moko * src/classes/hash.C: Optimization: HashStringValue::Iterator used in ^hash.foreach (related to feature #1073) 2016-07-04 moko * tests/: 134.html, 281.html, results/134.processed, results/281.processed: tests updated after hash blocking removed (related to feature #1073) * src/: classes/hash.C, include/pa_hash.h, types/pa_vhash.h: hash no longer blocks on change during foreach (implements feature #1073) 2016-06-17 moko * tests/: 330.html, results/330.processed: try exception source test added (related to bug in #1062) * tests/: 334.html, results/334.processed: Exception stack trace test added (related to bug in $1062) * src/classes/op.C: Exception trace now correctly restored and errors reported (related to bug #1062) 2016-05-25 moko * src/main/compile.y: minor cleanup + beauty 2016-05-24 moko * tests/: 333.html, results/333.processed: more exceptions testing * tests/: 332.html, results/332.processed: test for FIELDS_SYMBOL, _DEFAULT_SYMBOL, CALLER_SYMBOL, SELF_SYMBOL added (related to features #1056, #1026) * src/: classes/json.C, include/pa_symbols.h, main/pa_symbols.C, types/pa_vhash.C, types/pa_vhash.h, types/pa_vtable.C, types/pa_vtable.h: FIELDS_SYMBOL, _DEFAULT_SYMBOL added and used (implements feature #1056) * src/: include/pa_symbols.h, main/compile.y, main/compile_tools.C, main/execute.C, main/pa_symbols.C, types/pa_vjunction.C, types/pa_vstateless_class.C, types/pa_vstateless_class.h: CLASS_SYMBOL, CLASS_NAME_SYMBOL added and used (related to feature #1026) * src/: classes/reflection.C, include/pa_symbols.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/pa_symbols.C, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: Symbols now have *_SYMBOL naming convention. STATIC_SYMBOL, DYNAMIC_SYMBOL, LOCALS_SYMBOL, PARTIAL_SYMBOL, REM_SYMBOL where added (related to feature #1026) * src/: include/pa_symbols.h, main/compile.y, main/compile_tools.C, main/pa_globals.C, main/pa_symbols.C, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vstateless_class.C: SYMBOLS_CACHING define implemented (related to feature #1026) * src/main/main.vcproj: + ps_symbols * src/: include/Makefile.am, include/pa_string.h, include/pa_symbols.h, main/Makefile.am, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/pa_symbols.C, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vstateless_class.C: initial implementation for symbols cache (related to feature #1026) * src/: include/pa_common.h, main/pa_http.C: minor cleanup * src/main/pa_globals.C: minor cleanup 2016-05-19 moko * src/types/pa_vhash.h: minor optimization: ^hash.fields[] removed (related to feature #1046) * tests/: 331.html, results/331.processed: test for BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE removal added (related to feature #1051) * src/main/compile.y: BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE error removed (implements feature #1054) 2016-05-18 moko * src/types/pa_vtable.C, tests/results/324.processed: no more "column not found" exception for ^table.no-such-method[] (related to feature #1046) * tests/: 261.html, results/261.processed: test added and updated after feature #1046 implementation * src/: classes/string.C, types/pa_value.C, types/pa_vstring.h, types/pa_vvoid.h: $string.anything works for whitespace strings, ^string.contains added for hash compatibility, $string.method no longer returns stting method (implements feature #1046) 2016-05-12 moko * src/classes/curl.C: content-type response header no longer ignored (fixes issue #1045) * tests/: 330.html, results/330.processed: test for incomplete finally execution when break occures added (related to issue #1077) * src/classes/op.C: bugfix: Request::skip reset is called before executing catch and finally code (fixes issue #1062) 2016-05-11 moko * tests/: 329.html, results/329.processed: test for invalid ^break[] behavour added (bug #1077) * src/classes/op.C: try_catch code cleanup (related to bug #1062) 2016-04-24 moko * src/types/pa_vstateless_class.h: warning war 2016-04-17 moko * tests/: 328.html, results/328.processed: test for ^break(condition) and ^continue(condition) (related to feature #1063) * src/classes/op.C: ^break(condition) and ^continue(condition) implemented (feature #1063) 2016-04-12 moko * tests/results/280.processed: ordered hash now used for class methods and properties (test results updated for feature #1069) * src/classes/: xdoc.C, xnode.C: xnode_class initialization moved to xdoc.C as under FreeBSD it was inited after and inheritance failed (related to issue #1051) * tests/: 320.html, results/320.processed: xdoc and xnode methods are printed to check inheritance (related to feature #1051) 2016-04-09 moko * tests/results/320.processed: ordered hash now used for class methods and properties (test results updated for feature #1069) * src/types/pa_vstateless_class.h: ordered hash now used for class methods and properties (implements feature #1069) * src/types/: pa_vconsole.h, pa_vcookie.C, pa_venv.C, pa_vrequest.C, pa_vstatus.C: minor optimization: #ifndef OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL returned (related to feature #1051) 2016-04-07 moko * src/main/execute.C: returned Value in .CLASS case for VJunction (related to feature #1051) * src/types/: pa_vjunction.C, pa_vmethod_frame.C, pa_vmethod_frame.h, pa_vstateless_class.C, pa_vstateless_class.h: string constants deduplication (related to feature #1051) * tests/results/224.processed: test result updated (related to feature #1051) * src/: main/execute.C, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_venv.C, types/pa_venv.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vstatus.C, types/pa_vstatus.h: classes hash now contains only VStateless_class derived objects, .CLASS is also allways VStateless_class derived object (related to feature #1051). 2016-04-06 moko * tests/results/323.processed: test result updated after feature #1051 implementation * src/: classes/classes.h, classes/op.C, classes/response.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, main/pa_request.C, types/pa_vclass.h, types/pa_vform.C, types/pa_vmail.C, types/pa_vmath.C, types/pa_vmemory.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.h: base -> methoded_donor for static classes, type() moved from VStateless_class to VClass and Methoded (implements feature #1051) 2016-04-04 moko * src/: classes/classes.C, include/pa_request.h, main/pa_request.C: beauty: put_class added (related to feature #1051) 2016-04-01 moko * tests/results/: 175.processed, 192.processed, 224.processed, 229.processed, 244.processed, 246.processed, 316.processed: test results updated as class.type() removed from error messages, only type() left (related to feature #1051) * src/: classes/classes.C, classes/classes.h, classes/mail.C, classes/op.C, classes/reflection.C, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_request.C, types/pa_value.C, types/pa_vclass.C, types/pa_vclass.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_wcontext.C: name() removed from VStateless_class, type() is used instead (related to feature #1051) * src/classes/mail.C: old logic restored. * src/: classes/bool.C, classes/classes.C, classes/classes.awk, classes/classes.h, classes/curl.C, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/inet.C, classes/int.C, classes/json.C, classes/mail.C, classes/math.C, classes/memcached.C, classes/memory.C, classes/reflection.C, classes/regex.C, classes/response.C, classes/string.C, classes/table.C, classes/xdoc.C, classes/xnode.C, types/pa_vform.C, types/pa_vmail.C, types/pa_vmath.C, types/pa_vmemory.h: optimizaion: *_base_class removed (related to feature #1051) 2016-03-30 moko * tests/: 327.html, results/224.processed, results/327.processed: test for TZ specification in ^date::create[], TZ is kept during ^date::create[$dt] (related to feature #1048) * src/: classes/date.C, types/pa_vdate.h: TZ can be specified in ^date::create[], TZ is kept during ^date::create[$dt] (implements feature #1048) 2016-03-29 moko * tests/: 315.html, results/315.processed: test for timezone format +HHmm added (related to feature #1065) * src/classes/date.C: timezone format +HHmm now supported (implements feature #1065) 2016-03-28 moko * tests/: 202.html, results/131.processed, results/202.processed, results/224.processed, results/256.processed, results/315.processed: test results updated after %.2d now default for hours offset in iso-string (was %2d), test for ^date.iso-string options $.colon(true) $.z(true) $.ms(false) added (related to feature #1065) 2016-03-27 moko * src/types/pa_vdate.C: '+' sign for zero offset (related to feature #1065) * src/: classes/date.C, types/pa_vdate.C, types/pa_vdate.h: ^date.iso-string options $.colon(true) $.z(true) $.ms(false) added (implements feature #1065) 2016-03-24 moko * tests/: 202.html, results/202.processed: test $date.week added (related to bug #1067) * src/types/: pa_vdate.C, pa_vdate.h: fix for $date.week changed date (fix for bug #1067) 2016-03-10 moko * configure.ac, src/include/pa_version.h: 3.4.4 -> 3.4.5b 2015-12-07 moko * tests/: 326.html, results/326.processed: test for .CLASS & .CLASS_NAME optimization added (related to feature #844) 2015-11-17 moko * tests/: 323.html, results/323.processed: order added * tests/: 325.html, results/325.processed: double range test added (related to bug #1049) 2015-11-16 moko * src/: classes/string.C, types/pa_vdouble.h: finite(double) check added to disallow NaN and Infinity (fixes bug #1049) 2015-11-11 moko * tests/324.html: parser 3.4.3 execution support added (related to feature #1017) * tests/: 324.html, results/324.processed: test for GET_ELEMENT4CALL feature added (feature #1017) 2015-10-29 moko * operators.ru.txt, operators.txt: updated for 3.4.4 * configure.ac, src/include/pa_version.h: 3.4.4rc -> 3.4.4 * src/main/pa_exec.C: get_exit_status implemented for Windows (related to bug #1043) 2015-10-28 moko * src/main/pa_exec.C: Windows bugfix: $.stdin[] no longer cause hangup during ^file::exec (fixes bug #1043) 2015-10-27 moko * src/main/pa_memory.C: pa_fail_alloc added for GC_abort in Windows 2015-10-26 moko * tests/322.html, src/classes/reflection.C: arguments reorder (related to issue #1041) * src/: classes/classes.awk, main/helpers/simple_folding.pl: Copyright year updated * src/: classes/bool.C, classes/classes.C, classes/classes.h, classes/curl.C, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/inet.C, classes/int.C, classes/json.C, classes/mail.C, classes/math.C, classes/memcached.C, classes/memory.C, classes/op.C, classes/reflection.C, classes/regex.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_http.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_pool.h, include/pa_random.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, lib/sdbm/pa_file_io.C, lib/sdbm/pa_strings.C, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_http.C, main/pa_memory.C, main/pa_os.C, main/pa_pool.C, main/pa_random.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_connection.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, sql/pa_sql_driver.h, targets/apache/mod_parser3.c, targets/apache/mod_parser3_core.C, targets/apache/pa_httpd.h, targets/apache/pa_threads.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_property.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.C, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.C, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.C, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemcached.C, types/pa_vmemcached.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vregex.C, types/pa_vregex.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.C, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: Copyright year updated * src/targets/cgi/parser3.C: year updated * src/classes/reflection.C: VS2003 compatibility fixed (related to issue #1041) * tests/: 323.html, results/323.processed: test for base classes added * tests/: 261.html, results/261.processed: updated after better error reporting done for $string.key exception * src/types/pa_vstring.h: better error report for $string.key exception * src/types/: pa_vobject.C, pa_vobject.h: VObject::get_element copied as VObject::get_element4call to remove extra virtual call * tests/: 322.html, results/322.processed: test for ^reflection:is[] added (related to feature #1041) * src/classes/reflection.C: ^reflection:is empty value is void (related to feature #1041) * src/classes/reflection.C: ^reflection:is[class_name|code|method;[context;]element_name] added (implements feature #1041) 2015-10-24 moko * configure.ac, src/include/pa_version.h: 3.4.4b -> 3.4.4rc 2015-10-22 moko * tests/: 321.html, results/321.processed: test for ^reflection:method_info[] file detection added * tests/: 320.html, results/320.processed: test for ^reflection:class_by_name[class_name] added (related to feature #993) * src/classes/reflection.C: ^reflection:class_by_name[class_name] added (implements feature #993) * src/main/execute.C: GET_ELEMENT4CALL added to get_method_filename (related to feature #1017) * tests/: 319.html, results/319.processed: ^throw[] stacktrace test added (related to issue #1039) * src/main/pa_request.C: ^throw origin fixed (related to feature #1039) * src/types/pa_vcookie.C: bugfix: expires_sec should not be called for VDate * tests/results/182.processed: updated after feature #1038 implemented * tests/: 318.html, 182_dir/a6.p, results/318.processed: test for compile-time exception origin added (test for feature #1039) * src/: include/pa_request.h, main/compile.C, main/compile.y, main/pa_request.C: exception unification: compile-time exceptions now have origin, @USE origins also tracked (implements feature #1039) 2015-10-20 moko * src/main/pa_request.C: cleanup 2015-10-15 moko * src/types/pa_vtable.C: defines fixed (related to feature #1017) * src/: classes/hash.C, include/pa_opcode.h, types/pa_vhash.h, types/pa_vtable.C: new feature: no more $table.method and $hash.method, aliases for _at, _count, _key (related to feature #1017) 2015-10-14 moko * tests/: 317.html, results/317.processed: test for ^string.unescape[] added (related to feature #120) * buildall: reverted libxml 2.9.2 -> 2.9.1 due to "ID already defined" bug (described in issue #1036) * tests/: 247.html, results/247.processed: test for checkBOM added (test for bug #1037) * src/: include/pa_charsets.h, main/pa_charsets.C, main/pa_common.C, main/pa_http.C: checkBOM detects charset if it's not enforced, skips BOM signature if it complies charset (fixes bug #1037) 2015-10-13 moko * src/targets/cgi/parser3.vcproj: disabling buggy incremental linking * src/classes/inet.C: vs2003 compilation fix * src/classes/math.C: warning war * src/lib/punycode/pa_punycode.c: warning war 2015-10-12 moko * src/lib/punycode/pa_punycode.c: warning war * parser3.sln: moved parser3 first, to make it default startup project * buildall: parser "mirror" now used for external libs sources (implements feature #1036) * buildall: most external libs are updated to their current versions (related to feature #1036) * src/classes/image.C: more tags added * src/: include/pa_memory.h, types/pa_vdate.C: warning war 2015-10-11 moko * src/classes/curl.C: minor optimization (related to feature #1035) 2015-10-09 moko * src/classes/curl.C: pa_strdup added for strings from curl (related to feature #1035) * src/main/pa_string.C: mini fix: RedHat 7.2 does not have ULLONG_MAX definition * src/classes/curl.C: ^curl:info[name]/^curl:info[] added (implements feature #1035) * src/main/pa_charset.C: String::Body(String::C) used * src/main/pa_charset.C: exceptions unified * src/: include/pa_charset.h, main/pa_charset.C: declarations unified * src/: classes/file.C, classes/image.C, classes/mail.C, classes/op.C, classes/xdoc.C, classes/xnode.C, include/pa_string.h, main/pa_request.C, main/pa_string.C, types/pa_vimage.C, types/pa_vmath.C, types/pa_vstatus.C, types/pa_vxdoc.C: explicit String::Body(char) calls removed; String::Body(String::C) constructor added (related to bug #957) * src/classes/file.C: minor optimization * src/include/pa_hash.h: hash.get(char*) added, to minimize Cord(char*) autocreation (related to bug #957) * src/: classes/string.C, main/untaint.C: minor optimizations * src/: classes/json.C, classes/reflection.C, include/pa_string.h: String(char*, Lang, length) removed, String(C(), Lang) used instead (related to bug #957) 2015-10-08 moko * src/: classes/file.C, include/pa_string.h, lib/cord/cordbscs.c, lib/cord/include/cord.h, main/pa_http.C, main/pa_string.C, main/untaint.C: Now char * is converted to CORD only using AS_CORD() to check for empty cord bug (fixes bug #957) * src/include/pa_hash.h: fixed compilation without HASH_CODE_CACHING * src/classes/string.C: ^string:unescape[js|uri;escaped;$.charset[...]] added (implements feature #120) * src/main/pa_common.C: reduce js flags checks count (related to feature #120) 2015-10-07 moko * tests/: 275.html, results/275.processed: test modified after unsigned long long int support implemented (feature #1034) * src/: classes/math.C, include/pa_string.h, main/pa_string.C: pa_atoul added for unsigned long long int support 2015-10-06 moko * src/types/pa_vdate.C: INT_MAX used 2015-10-03 moko * tests/: 302.html, results/302.processed: test for bug #1023 (\u2028, \u2029 escaping) added * src/main/untaint.C: \u2028, \u2029 are now escaped in json:string[] (fixes bug #1023) 2015-09-29 moko * tests/305.html: try-catch added for OS without ipv6 support * src/lib/json/pa_json.C: more unique prefixes for Solaris compilation * src/: include/pa_opcode.h, include/pa_request.h, main/compile.y, main/execute.C, types/pa_value.h, types/pa_vhash.h, types/pa_vtable.C, types/pa_vtable.h: get_element4call implemented to distinguish ^hash.method from $hash.field (implements feature #1017) * src/lib/punycode/pa_punycode.c: warning war * src/include/pa_config_includes.h: warning war * src/include/pa_config_includes.h: pragma warning actualized a bit * src/include/pa_config_includes.h: warning war * src/include/pa_hash.h: clang compilation fix 2015-09-27 moko * src/main/compile.tab.C: Bison 3 is now default * src/main/: compile.C, compile.y: Bison 3 compatibility fixed 2015-09-25 moko * src/: classes/hash.C, include/pa_hash.h: parser now compiles and works with undefined HASH_ORDER (related to feature #196) 2015-09-24 moko * tests/: 027.html, results/027.processed: test modified to test ^hash.sort (feature #196) * src/: classes/hash.C, include/pa_hash.h: ^hash.sort[key;value]{string-key-maker}|(numeric-key-maker)[[asc|desc]] added (implements feature #196) * tests/: 316.html, results/316.processed: Added test for bug #1025 (exception handling in non-cached ^cache), plus for "it does not have logical value" and "$exception.handled value must be either boolean or string 'cache'" exceptions. * src/classes/op.C: ^cache: exceptions now handled in non-cached code (fixes bug #1025) 2015-09-23 moko * src/classes/table.C: warning war * src/: classes/math.C, types/pa_vcookie.C: warning war * src/classes/file.C: warning war * src/: include/pa_table.h, main/pa_table.C: warning war * src/: main/pa_request.C, classes/date.C: warning war * src/: types/pa_vdate.C, classes/op.C: warning war * tests/: 122.html, results/122.processed: win sync: to remove differences with OS that doesn't keep timezone change history * src/types/pa_vdate.C: tzset() should be called in Windows after TZ change (related to feature #36) * tests/: 075.html, results/075.processed: win sync: to remove differences with OS that doesn't keep timezone change history * tests/: 315.html, results/315.processed: win sync: to remove differences with OS that doesn't keep timezone change history * tests/: 256.html, results/256.processed: win sync: to remove differences with OS that doesn't keep timezone change history * tests/: 124.html, results/124.processed: win results sync: to avoid hitting time change hole. * src/types/pa_vdate.C: static returned. :) 2015-09-22 moko * src/types/pa_vdate.C: FreeBSD 10 GPF fix (related to feature #36) * tests/results/131.processed: more tests for feature #1032 * src/classes/date.C: minor fix related to feature #1032 * operators.ru.txt, operators.txt: ISO date creation documented (related to feature #1032) * operators.ru.txt, operators.txt: iso-string documented (related to feature #1032) * tests/: 315.html, results/315.processed: more tests added (related to feature #1032) * tests/: 131.html, results/131.processed: date range checks updated (related to feature #36) * tests/: 315.html, results/057.processed, results/315.processed: test added for ISO date support (related to issue #315) * src/classes/date.C: more readable exceptions in date creation (related to ticket #1032) 2015-09-18 moko * tests/: 202.html, results/202.processed: ^date.iso-string[] check added (related to issue #1032) * tests/results/256.processed, src/classes/json.C: iso-string documented (related to issue #1032) * tests/: 256.html, results/256.processed: ISO date check added (related to issue #1032) * tests/: 057.html, results/057.processed, results/224.processed: tests results updated after ISO date support implemented (related to feature #1032) * src/: classes/date.C, classes/image.C, types/pa_value.h, types/pa_vdate.C, types/pa_vdate.h: ISO 8601 dates support added, ^date::create[string] constructor formalized, ^date.iso-string[] added (implements feature #1032) 2015-09-05 moko * operators.ru.txt, operators.txt: actualized * operators.ru.txt, operators.txt: date changes documented (related to ticket #36) 2015-09-04 moko * src/types/pa_vdate.C: warning war * src/: classes/op.C, types/pa_vhashfile.C: warning war 2015-09-03 moko * tests/results/096.processed: test result updated for 0..9999 year date range support (related to feature #36) * tests/: 314.html, results/314.processed: test for ^string:base64[], ^string:idna[], ^string:js-escape[] (related to bug #1031) * src/classes/string.C: Static calls fixed for ^string:base64[], ^string:idna[], ^string:js-escape[] (closes bug #1031) * Makefile.am, acsite.m4, configure.ac, configure.in: Warning war: configure.in -> configure.ac * configure, configure.in, src/include/pa_config_auto.h.in: more correct timezone check for FreeBSD Warning war: configure.in -> configure.ac * configure, configure.in, src/classes/Makefile.am, src/include/pa_config_auto.h.in, src/lib/cord/Makefile.am, src/lib/gd/Makefile.am, src/lib/json/Makefile.am, src/lib/memcached/Makefile.am, src/lib/pcre/Makefile.am, src/lib/sdbm/Makefile.am, src/lib/smtp/Makefile.am, src/main/Makefile.am, src/targets/apache/Makefile.am, src/targets/cgi/Makefile.am, src/types/Makefile.am: INCLUDES -> AM_CPPFLAGS (warning war) PA_DATE64 (0..9999 year date range) check added * src/types/pa_vdate.C: FreeBSD fixes + more robust code * tests/results/: 124.processed, 224.processed: test resuls updated for new date implementation (related to feature #36) * src/: classes/date.C, classes/image.C, include/pa_common.h, main/pa_common.C, types/pa_value.C, types/pa_vdate.C, types/pa_vdate.h: new double date implementation with internal support for extended 0..9999 year range, default timezone support (related to feature #36) 2015-08-28 moko * src/types/pa_vmail.C: fixed $mail:received.date calculations (fixes bug #1030) 2015-08-21 moko * src/classes/inet.C: snprintf size "bug" commented * src/main/pa_common.C: snprintf comments updated 2015-08-16 moko * src/types/: pa_vdate.C, pa_vdate.h: logic moved to pa_vdate.C 2015-08-11 moko * src/: classes/json.C, types/pa_value.C, types/pa_value.h, types/pa_vclass.C, types/pa_vobject.C: hash_json_string argument can be null (fixes bug #1029) 2015-08-06 moko * src/types/: Makefile.am, pa_vdate.C, pa_vdate.h, types.vcproj: pa_vdate.C added 2015-08-05 moko * tests/: 313.html, results/313.processed: test for ^table.count[columns] and ^table.flip[] with nameless tables (feature #1003) * src/: classes/table.C, include/pa_table.h, main/pa_table.C: max_cell added, now ^table.count[columns] and ^table.flip[] works correctly for nameless tables (implements feature #1003) 2015-08-03 moko * tests/312.html: test for ^table.append[$hash] and ^table.insert[$hash] added (related to feature #1028) * src/classes/table.C: ^table.append[$hash] and ^table.insert[$hash] now supported (implements feature #1028) * tests/: 312.html, results/312.processed: test row copy in ^table.hash[; $.type[table] ] added (related to feature #1016) * src/classes/table.C: row copy now created in ^table.hash[; $.type[table] ] (related to feature #1016) 2015-07-29 moko * tests/: 312.html, results/312.processed: test for ^table.delete[] added (related to feature #1016) * src/: classes/table.C, include/pa_table.h, main/pa_table.C: ^table.delete[] added to delete current row (related to feature 1016) 2015-07-28 moko * tests/: 312.html, results/312.processed: test for $table.column[value] and ^table.insert{row} (related to feature #1016) * src/: classes/table.C, include/pa_table.h, main/pa_table.C, types/pa_vtable.C, types/pa_vtable.h: $table.column[value] and ^table.insert{row} are now implemented (feature #1016) * src/include/pa_array.h: Optimization: bool reverse removed from append(), insert() added, memmove arguments order in remove() fixed (related to feature #1016) 2015-07-23 moko * src/classes/json.C: tainted json and empty json exception added (implements feature #1015) * tests/: 311.html, results/311.processed: empty json and tainted json exception test added (related to issue #1015) 2015-07-22 moko * tests/: 311.html, results/311.processed: test for UTF-8 processing added * tests/: 311.html, results/311.processed: test for json_exception_with_source added (related to issue #394) * src/classes/json.C: json_exception_with_source added (implements feature #394) 2015-06-29 moko * src/: classes/file.C, include/pa_dir.h, main/pa_dir.C: directories are now correctly determined if _d_type == DT_UNKNOWN (closes bug #1027) 2015-06-10 moko * src/types/pa_vxnode.h: extern "C" not requred and causes build error if libxml has LIBXML_ICU_ENABLED. 2015-06-04 moko * tests/099.html: ups, reverting * tests/: 099.html, 309.html, 310.html, results/309.processed, results/310.processed: tests for $response:body[ $.file[] ] and $response:last-modified added * src/main/pa_request.C: last-modified check fixed 2015-06-03 moko * tests/: 204.html, 205.html, 293.html, results/204.processed, results/205.processed, results/293.processed: $response:headers logging added (tests for feature #1007) * src/: include/pa_common.h, include/pa_request.h, main/pa_request.C, types/pa_vmail.C, types/pa_vresponse.C: $response:headers are now in uppercase (closes feature #1007) 2015-06-02 moko * src/: include/pa_memory.h, classes/math.C: some of -pedantic build errors reverted for clang compatibility 2015-06-01 moko * src/include/pa_memory.h: -pedantic build errors fixed * src/classes/math.C: -pedantic build error fixed * src/classes/table.C: USE_STRINGSTREAM moved to the correct place 2015-05-31 moko * src/classes/table.C: USE_STRINGSTREAM optimized * src/: classes/file.C, classes/math.C, include/pa_opcode.h, include/pa_string.h, lib/json/pa_json.h, main/compile_tools.h, main/pa_charset.C, main/pa_globals.C, main/pa_string.C, types/pa_vmail.C, types/pa_vmethod_frame.C, types/pa_vregex.C, types/pa_vxnode.h: warning war (-pedantic flag) 2015-05-28 moko * tests/: 308.html, results/308.processed: test for ^table::create[$t;], etc work added (related to bug #975) * src/classes/table.C: check_option_param removed, ^table::create[$t;], etc now works (fixes bug #975) 2015-05-27 moko * src/main/pa_request.C: Invalid response filename in gcc 4.9.2 (Debian jessie) fixed (closes issue #1024) * tests/Makefile: sort added as in Debian jessie list become unsorted 2015-05-18 moko * tests/: 201.html, results/201.processed: test for ^string.trim[what] feature #1022 * src/classes/string.C: ^string.trim[what] now supported, implements feature #1022 2015-05-17 moko * tests/results/185.processed: test result updated as feature #1021 implemented (left/right accept negative parameter) * src/classes/string.C: left/right now accept negative parameter (implements feature #1021) 2015-05-08 moko * src/classes/math.C: isalnum -> pa_isalnum * src/main/execute.C: optimization in getter-junction processing (related to issue #997) 2015-05-07 moko * tests/: 307.html, results/307.processed: test for issue #997 added * src/main/execute.C: process_getter result now checked if junction returned (closes issue #997) * tests/: 305.html, results/305.processed: sort added to ignore different order * src/types/pa_vxnode.C: & now untainted in $node.nodeValue assignment (closes issue #994) * tests/: 306.html, results/306.processed: test for issue #994 added * tests/: 303.html, results/303.processed: two more errors tested 2015-05-06 moko * tests/: 305.html, results/305.processed: test for name2ip & ip2name added (related to feature #992) * tests/: 303.html, 304.html, results/303.processed, results/304.processed: tests for idna conversion added (related to issue #849) 2015-05-02 moko * src/classes/inet.C: ^inet:ip2name[] and ^inet:name2ip[] implemented 2015-04-30 moko * src/main/pa_http.C: idna_host added, related to issue #849 * src/main/pa_http.C: set_addr corrected, pa_idna_encode call added (related to issue #849) 2015-04-24 moko * src/types/pa_vjunction.C: warning war * src/lib/punycode/: pa_idna.h, pa_punycode.h: code style unification * src/lib/punycode/pa_idna.c: warning war 2015-04-22 moko * src/main/main.vcproj: punycode include path added * src/lib/punycode/pa_idna.c: windows compile error fixed * src/lib/punycode/pa_idna.c: warning war * parser3.sln, src/lib/punycode/punycode.vcproj: punycode windows project file added * src/lib/punycode/pa_convert_utf.c: debug compilation fix * src/include/pa_memory.h: warning war * src/: classes/string.C, include/pa_common.h, main/pa_common.C: ^string:idna[xn--...], ^string.idna[] - idna conversion support implemented (related to feature #849) * configure.in, src/main/Makefile.am, src/targets/apache/Makefile.am, src/targets/cgi/Makefile.am: libpunycode added in Unix 2015-04-21 moko * configure.in: large files support 2015-04-15 moko * src/lib/punycode/: Makefile.am, pa_convert_utf.c, pa_convert_utf.h, pa_idna.c, pa_idna.h, pa_punycode.c, pa_punycode.h: initial version for punycode/idna support library (ticket #849) 2015-04-08 moko * src/: classes/curl.C, classes/date.C, classes/file.C, classes/image.C, classes/mail.C, classes/reflection.C, classes/string.C, classes/xnode.C, include/pa_request.h, include/pa_string.h, include/pa_stylesheet_connection.h, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_common.C, main/pa_request.C, main/pa_string.C, main/pa_xml_io.C, main/untaint.C, types/pa_vclass.C, types/pa_vcookie.C, types/pa_vfile.C, types/pa_vform.C, types/pa_vmethod_frame.h, types/pa_vstateless_class.h, types/pa_wwrapper.h, main/compile.tab.C: removed most of the clang compiler warnings (closes issue #1018) * src/include/pa_string.h: String::Body comparation operators with char * added (related to issue #958) 2015-04-07 moko * src/main/compile.tab.C: YYMALLOC/YYFREE defined to pa_malloc/pa_free to remove system malloc/free usage (related to issue #1018) * src/: classes/table.C, classes/xdoc.C, doc/memory.dox, include/pa_hash.h, include/pa_memory.h, lib/gd/gif.C, lib/gd/gif.h, lib/smtp/smtp.C, main/compile.y, main/pa_charset.C, main/pa_http.C, main/pa_request.C, main/pa_string.C, main/pa_xml_io.C, targets/apache/mod_parser3_core.C, types/pa_vconsole.h, types/pa_vdouble.h, types/pa_vfile.C, types/pa_vform.C, types/pa_vint.h: new(UseGC) replaced with new, malloc/strdup/free replaced with pa_ version and checks for accidental use of non-pa_ version added (related to issue #1018) 2015-04-03 moko * buildall: pcre-8.33 -> pcre-8.36 * src/: main/compile.y, classes/form.C, classes/mail.C, classes/op.C, classes/string.C, main/compile.tab.C, main/compile_tools.C, main/pa_http.C, main/pa_request.C, main/pa_sql_driver_manager.C, types/pa_vfile.C, types/pa_vhashfile.C: C++11 compilation errors fixed (related to ticket #958) * src/: classes/file.C, include/pa_common.h, include/pa_sapi.h, main/pa_common.C, main/pa_http.C, main/pa_request.C, targets/apache/mod_parser3_core.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_venv.C, types/pa_vform.C, types/pa_vform.h, types/pa_vrequest.C, types/pa_vrequest.h: $request:headers, $request:method added (implements feature #1007) 2015-03-17 misha * tests/302.html: - test for ^json:string[...;$._default[method-name]] * src/: classes/json.C, types/pa_value.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.C: - if option $._default[method-name] is specified in ^json:string[], a method with specified name will be called for classes/objects serialization ( new feature: #982 ) 2015-03-16 misha * src/: include/pa_opcode.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_venv.C, types/pa_venv.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhashfile.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vregex.C, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: - $var.CLASS & $var.CLASS_NAME now have special opcodes. This can be switched off by commenting #define OPTIMIZE_BYTECODE_GET_ELEMENT__SPECIAL on pa_opcode.h ( new feature: #844 ) 2015-03-15 misha * tests/075.html: - test for $response:header[] * src/types/pa_vresponse.C: - $response:header[] deletes header that was set earlie ( new feature: #1001 ) 2015-03-12 misha * tests/246.html: - more tests for ^hash._at[] * src/: classes/hash.C, include/pa_hash.h: - ^._at[...] now accepts second param [key|value|hash] ( new feature: #1012 ) 2015-03-09 moko * src/types/pa_vmail.C: exception for everything but $mail:received, closes issue #1011 2015-02-20 moko * tests/: 275.html, results/275.processed: hex detection in pa_atoui fix test (closes issue #1010) * src/main/pa_string.C: hex detection in pa_atoui fixed (closes issue #1010) 2015-02-17 moko * src/types/pa_vmail.C: closes issue #1009 - mail content should be tainted. 2015-02-03 misha * tests/301.html: - test for ^json:string($double) causes exception. bugfix: #1008 * src/classes/json.C: - ^json:string($double) causes exception. bugfix: #1008 * tests/014.html: - updated for work with ^hash.delete[] 2015-01-12 misha * src/: classes/form.C, include/pa_common.h, include/pa_request_info.h, main/pa_common.C, types/pa_vform.C, types/pa_vform.h: - supports body with PUT method as well ( new feature: #1006 ) * src/classes/file.C: - warnings war 2015-01-11 misha * tests/300.html: - test for ^hash.delete[] is added * src/classes/hash.C: - ^hash.delete[] clear all hash ( new feature: #989 ) - tiny optimization in intersects 2015-01-06 moko * src/types/pa_vmail.C: file names transcode added, to and cc added with transcode, attachments detection fixed * src/main/pa_request.C: filling mail received after cgi/auto.p load to allow charset switch (related to issue #996) 2014-12-31 moko * src/types/pa_vmail.C: from and subject now transcoded if not UTF-8 source charset (fixes issue 996) * src/main/pa_exception.C: fixed string from stack bug (closes issue #1000) 2014-12-11 misha * src/types/pa_vhashfile.C: - check if key is not empty before access ( bug fix: #1005 ) 2014-11-13 misha * src/main/compile.y: - PC.append does not reset to false while creating a new class. bugfix: #990 * tests/299.html: - test for creation class after working with partial class (create+append) * src/types/pa_vobject.C: - @GET[def] always returns true. bugfix: #995 * tests/232.html: - test for @get[def] added 2014-10-12 moko * src/lib/pcre/pcre_internal.vcproj: correct path * src/: classes/classes.vcproj, lib/cord/cord.vcproj, lib/ltdl/ltdl.vcproj, lib/md5/md5.vcproj, lib/pcre/pcre_internal.vcproj, main/main.vcproj, targets/apache/ApacheModuleParser3.vcproj, targets/apache/ApacheModuleParser3Core.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: project GUID inserted in *.vcproj for correct conversion in newer VS versions * parser3.sln, src/lib/pcre/pcre_internal.vcproj: pcre_internal.vcproj added 2014-08-28 moko * src/lib/pcre/: Makefile.am, pa_pcre_chartables.c, pa_pcre_internal.h, pa_pcre_valid_utf8.c: _pcre_default_tables and pcre_valid_utf are copied to parser3 code (fixes issue #991) 2014-06-30 misha * tests/298.html: - tests for ^reflection:def[class;className] added * src/classes/reflection.C: - ^reflection:def[class;className] added ( new feature: #918 ) 2014-06-29 misha * src/classes/table.C: - ^table::create[unsupported data] - exception comment changed to "body must be table or code" ( bug fix: #951 ) * tests/: 261.html, results/261.processed: - tests for ^json:string[...;$.void[null|string]] added * src/: classes/json.C, types/pa_value.h, types/pa_vvoid.h: - new option $.void[string|null] added to ^json:string[...] ( new feature: #952 ) 2014-06-28 moko * src/classes/curl.C: $.charset now processed before other curl options (closes issue #980) 2014-05-23 misha * src/classes/json.C: - bug fix: #987 2014-05-04 misha * tests/: 253.html, 253_json.txt: - test for ^json:parse[$.int(false)] is added * src/classes/json.C: - To ^json:parse[] added option $.int(bool, default true). The option is similar to $.double(bool) but for integers. 2014-05-01 moko * src/classes/file.C: "PARSER_VERSION" -> PARSER_VERSION ( bugfix: #12 ) 2014-04-16 moko * src/main/pa_http.C: response-charset option should finally work now (fix for issue #867) * src/main/pa_http.C: response-charset option should work now (fix for issue #867) 2014-03-07 moko * buildall: libgc moved * buildall: libgc moved 2013-12-29 moko * src/classes/string.C: ^string:js-unescape result now tainted, closes issue #966 * tests/: 186.html, results/186.processed: ^string:js-unescape result now tainted, issue #966 2013-12-03 moko * src/: classes/memcached.C, types/pa_vmemcached.C, types/pa_vmemcached.h: memcached open $.skip-connect(true|false) option was added for http://www.parser.ru/forum/?id=79343 * src/classes/file.C: bugfix for http://www.parser.ru/forum/?id=79337 2013-11-05 moko * configure.in, src/include/pa_version.h: 3.4.3 -> 3.4.4b * src/main/pa_globals.C: spelling fixed 2013-10-29 moko * src/lib/json/json.vcproj: json.c -> pa_json.C * src/lib/json/pa_json.C: C++ compatibility addes, related to issue #892 * src/: classes/json.C, lib/json/Makefile.am, lib/json/json.c, lib/json/json.h, lib/json/pa_json.C: json.c -> pa_json.C (for exceptions to be thrown thougth json library), related to issue #892 * src/main/pa_charset.C: avoid compilation bug in Debian 6.0.8 x32, related to issue #896 2013-10-24 moko * configure.in, src/include/pa_version.h: 3.4.3rc -> 3.4.3 2013-10-23 moko * README: actualization 2013-10-22 moko * src/targets/apache/mod_parser3.c: Adopted apache 2.4 compatibility patch from Sergey Kirpichev * tests/: 297.html, results/297.processed: non-working getter fix test for issue #948 * src/: include/pa_request.h, main/pa_request.C: Now getter is not called when saving value of $match variable in ^string.match[] to increase compatibility (related to issue #948). * src/: include/pa_request.h, targets/cgi/parser3.C: minor header usage optimization 2013-10-21 moko * tests/: 182.html, results/182.processed: local path removed for compatibility * tests/: 244.html, 253.html, 254.html, 275.html, 281.html, results/244.processed, results/253.processed, results/254.processed, results/275.processed, results/281.processed: try_catch -> try-catch * tests/: 288.html, 294.html, 296.html, results/288.processed, results/294.processed, results/296.processed: try_catch -> try-catch 2013-10-20 moko * tests/: 296.html, results/296.processed: test for xsl exception for issue #938 added. * src/: include/pa_xml_exception.h, main/pa_stylesheet_connection.C: forgotten to be replaced XmlException is now replaced (once again closes issue #938) 2013-10-18 moko * buildall: disable clock_gettime detection to avoid librt linking (which in turn depends on libpthread), related to issue #943 2013-10-18 misha * src/: classes/classes.vcproj, lib/gd/gd.vcproj, lib/smtp/smtp.vcproj, main/main.vcproj, targets/apache/ApacheModuleParser3Core.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: - new locations for libxml2 includes where added to vcproj files 2013-10-18 moko * src/classes/: hashfile.C, op.C: hopefully last part of issue #948 fix * tests/: 295.html, results/295.processed: test for issue #948 updated * src/classes/table.C: hopefully last lost part for issue #948 fix. :) * tests/: 295.html, results/295.processed: test for issue #948 added * src/: classes/hash.C, classes/string.C, classes/table.C, include/pa_request.h, types/pa_method.h: for getters and setters to be executed request.put_element should be called, not context.put_element (fixes issue #948) 2013-10-17 moko * src/classes/xdoc.C: libxml 2.9.1 compatibility with define LIBXML2_NEW_BUFFER check (closes issue #943) * buildall: libxml 2.9.1 build is broken --without-reader. 2013-10-16 moko * configure.in, src/include/pa_version.h: 3.4.3b -> 3.4.3rc * tests/: 294.html, results/294.processed: test for issue #938 * src/: classes/xdoc.C, classes/xnode.C, include/pa_xml_exception.h, main/pa_xml_exception.C: XmlException now calls fixUTF8 if source charset is UTF-8 (closes issue #938) * buildall: pcre-8.30 -> pcre-8.33 libxml2-2.8.0 -> libxml2-2.9.1 libxslt-1.1.26 -> libxslt-1.1.28 * src/: include/pa_charset.h, lib/pcre/pa_pcre_internal.h, main/pa_charset.C: fixUTF8 method added to replace invalid UTF-8 to '?', related to issue #938 2013-10-15 moko * src/: include/pa_common.h, main/pa_charset.C, main/pa_common.C, main/untaint.C: json chars 0x01-0x1F now are escaped as \u00XX, minor optimizations (closes issue #896) * tests/results/: 292.processed, 293.processed: results updated to comply with issue #896 * tests/: 292.html, 293.html, results/292.processed, results/293.processed: tests for json escaping 2013-10-14 moko * src/: include/pa_common.h, main/pa_common.C: minor rearrangements and cleanup, code moved from .h to .C, no changes in code 2013-10-12 moko * tests/results/119.processed: updated test result commited * tests/: 291.html, results/291.processed: test for issue #894 added * src/types/pa_wcontext.h: base methods call support function get_somebody_entered_some_class should not be true forever, as wcontext can have many get_elements calls (fixes issue #894) 2013-10-11 moko * tests/: 290.html, results/290.processed: test for junction GPF issue #942 added * src/types/pa_vmethod_frame.h: GPF if method junctions is passed to native method fixed (closes issue #942) * tests/: 158.html, results/158.processed: test for csv-string[] added * src/classes/table.C: minor fixes for table.csv-string[] (closes feature #907) * src/classes/table.C: ^table.csv-string[] from misha@ (implements feature #907) 2013-10-09 moko * src/: main/pa_request.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vstateless_class.C: GET_default, SET_default now works properly not only in objects, but in classes as well (closes issue #903) * tests/: 289.html, results/289.processed: GET/SET_default now works in classes, not only objects, test case added, related to issue #903 * tests/: 288.html, results/288.processed: test for endless recursion bug added (related to issue #903) 2013-10-05 moko * src/: classes/hash.C, classes/hashfile.C, classes/op.C, classes/table.C, main/execute.C, types/pa_method.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmemcached.C, types/pa_vmemcached.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: optimization: put_element no longer has "bool areplace" argument, related to issue #903 2013-10-03 moko * tests/results/182.processed: result for $.replace(false) test commited * src/classes/date.C: ^date::create(number) processed correctly (fixes issue #901) * src/classes/image.C: as_no_junction removed, as param can be expression (closes issue #931) * tests/233.html: test for issue #931 added 2013-10-02 moko * tests/: 182.html, 182_dir/a5.p: test for $.replace(true) modified, test for $.replace(false) added * src/main/compile_tools.h: forgotten class replace returned. :) 2013-09-30 moko * tests/: 141.html, results/141.processed: md5 tainting test added * src/: classes/op.C, include/pa_request.h, main/compile.y, main/compile_tools.h, main/pa_request.C: allow_class_replace implemented; $.replace option added to ^process and ^use 2013-08-27 moko * src/classes/: file.C, json.C, math.C, string.C, xdoc.C: cstr_to_string_body_untaint should be called with charsets for possible uri language and connection for possible sql language. related to issue #857 * buildall: and -> or fixed 2013-08-26 moko * buildall: prepare_ functions logic changed to support gc-7.2d.tar.gz extracting to gc-7.2 directory 2013-08-23 moko * src/include/pa_config_fixed.h: gc and xml libs are now linked statically 2013-08-22 moko * src/classes/string.C: String::Empty used (related to issue #912) append_know_length removed (related to old GPF bug) 2013-08-21 moko * src/classes/math.C: untaint(L_AS_IS) added for md5 and sha1 * src/classes/math.C: ^math:digest[...;$file] support added (related to ticket #857 * tests/: 141.html, results/141.processed: ^math:digest[...;$file] implemented * src/types/pa_vhashfile.h: warning war * src/: classes/json.C, classes/op.C, include/pa_hash.h, include/pa_request.h, main/pa_request.C, types/pa_value.h: anti_endless_json_string_recoursion removed from request; json_string_recoursion added to json_options; $.indent[indent value] now supported and passed within recoursion closes feature #937 * tests/: 287.html, results/287.processed: test for feature #937 2013-07-31 moko * src/lib/json/: json.c, pa_json.C: STATE__X -> STATE_XX for cygwin compilation having #define _S * src/main/pa_globals.C: cleanup 2013-07-30 moko * src/: classes/table.C, include/pa_common.h, main/pa_charset.C, main/pa_common.C: vs2003 warning war * src/lib/json/: json.c, pa_json.C: vs2003 warning war * src/lib/json/: json.c, pa_json.C: vs2003 compilation fix * src/lib/md5/pa_sha2.c: warning war 2013-07-29 moko * src/lib/json/: json.c, json.h, pa_json.C, pa_json.h: some libjson patches from github * src/: classes/bool.C, classes/double.C, classes/int.C, classes/memcached.C, include/pa_config_includes.h, types/pa_vfile.C, types/pa_vfile.h: warning war * src/lib/json/json.vcproj: C++ -> C * src/lib/json/: json.c, pa_json.C: C++ warning revert * src/lib/json/: json.c, pa_json.C: windows compatibility * src/lib/json/: json.c, pa_json.C: windows compatibility * src/lib/json/: json.c, pa_json.C: warning war * src/lib/json/: json.c, pa_json.C: win32 compilation issues fixes * src/include/pa_config_fixed.h: uint16_t added * configure.in: uint16_t check added * src/: classes/json.C, lib/json/JSON_parser.C, lib/json/JSON_parser.h, lib/json/Makefile.am, lib/json/json.c, lib/json/json.h, lib/json/json.vcproj, lib/json/pa_json.C, lib/json/pa_json.h: JSON_parser with non-free licence is replaced with similar GPL licenced libjson (fixes issue #892) 2013-07-25 moko * parser3.sln: dependencies added * parser3.sln, src/targets/apache/ApacheModuleParser3.vcproj, src/targets/apache/ApacheModuleParser3Core.vcproj: win32 apache module support * src/targets/apache/mod_parser3_core.C: win32 cleanup * src/targets/apache/mod_parser3.c: win32 apache 2.2 module 2013-07-23 moko * src/: include/pa_memory.h, main/pa_memory.C: non-working PA_DEBUG_GC_MEMORY removed * src/: main/pa_globals.C, targets/cgi/parser3.C: PA_DEBUG_DISABLE_GC compilation fix * src/: classes/op.C, classes/table.C, include/pa_request.h, main/pa_request.C: outdated RESOURCES_DEBUG removed * src/: main/pa_os.C, targets/cgi/parser3.C: headers cleanup, garbage cleanup * src/main/pa_common.C: warning war * src/: include/pa_http.h, main/pa_http.C: headers cleanup * src/: include/pa_common.h, main/pa_common.C: WIN32 -> _MSC_VER, minor cleanup * src/: include/pa_dir.h, main/pa_dir.C: loaddir under cygwin now uses cygwin, not WIN32 implementation * src/main/pa_exec.C: WIN32 -> _MSC_VER, under cygwin unix exec is able to exec shell scripts * src/classes/math.C: ifdef WIN32 cleanup * src/types/pa_vmemcached.C: LT_MODULE_EXT used * src/classes/curl.C: LT_MODULE_EXT used * src/include/pa_config_fixed.h: LT_MODULE_EXT defined 2013-07-22 moko * src/include/: pa_config_fixed.h, pa_config_includes.h: win32 includes fix * src/: main/pa_common.C, targets/cgi/parser3.C: includes cleanup * configure.in, src/include/pa_config_includes.h, src/lib/smtp/comms.C, src/lib/smtp/smtp.C, src/lib/smtp/smtp.h, src/main/pa_exec.C: includes cleanup * src/targets/cgi/parser3.C: 2012->2013 * src/include/pa_version.h: 3.4.2 -> 3.4.3b * configure.in, src/include/pa_config_includes.h, src/include/pa_http.h, src/lib/json/JSON_parser.h, src/main/pa_random.C, src/main/pa_socks.C, src/types/pa_vstatus.C: cygwin support cleanup * configure.in: dirent.h check added * src/: include/pa_config_includes.h, include/pa_dir.h, main/pa_dir.C: includes cleanup, dirent.h check added filePath not copied 2013-07-21 moko * src/lib/cord/cord.vcproj: unused cordprnt.c removed * src/targets/cgi/: Makefile.am, getopt.c, getopt.h, parser3.vcproj: unused getopt.h / getopt.c removed * operators.ru.txt, operators.txt, src/classes/file.C, tests/022.html, tests/results/022.processed: ^file:list[path][$.filter[regexp] $.stat(true)] usage commented * configure.in, src/classes/file.C, src/include/pa_dir.h, src/main/pa_dir.C: ^file:list[] now has dir column and when $.stat(true) it has size/*date columns modified patch from misha@ that closes issue #914. * src/: include/pa_config_includes.h, main/pa_globals.C: PA_RELEASE_ASSERTS removed * src/lib/md5/pa_md5c.c: minor cleanup * src/lib/json/: JSON_parser.C, JSON_parser.h: headers cleanup, localeconv()->decimal_point usage remoed (related to issue #934) * src/lib/cord/: Makefile.am, cordprnt.c, include/cord.h: unused cordprnt.c removed * src/lib/sdbm/: sdbm.c, sdbm_pair.c, pa-include/pa_apr.h, pa-include/pa_errno.h, pa-include/pa_file_io.h, pa-include/pa_strings.h: includes cleanup * src/lib/md5/pa_md5c.c: headers cleanup 2013-07-20 moko * src/lib/cord/: cordbscs.c, cordprnt.c, cordxtra.c: includes cleanup 2013-07-19 moko * src/classes/math.C: extern "C" added for crypt 2013-07-18 moko * src/classes/math.C: fix redhat7.2 build 2013-07-17 moko * configure.in, src/include/pa_config_includes.h, src/include/pa_config_fixed.h: headers actualized (inttypes.h added for uint8/32/64_t) * src/lib/md5/: pa_md5.h, pa_md5c.c, pa_sha2.c, pa_sha2.h: pa_config_includes.h used for uint32/64_t 2013-07-16 moko * src/: include/pa_string.h, main/pa_string.C, types/pa_vform.C, types/pa_vform.h, types/pa_vobject.C, types/pa_vobject.h: warning war * src/main/compile.tab.C: compile.y was updated * src/main/compile.y: warning war * src/: include/pa_exception.h, main/pa_exception.C, main/pa_xml_exception.C: warning war * src/: include/pa_common.h, main/pa_common.C: warning war * configure.in: beauty :) * tests/: 141.html, results/141.processed: sha256/512 added 2013-07-13 moko * src/lib/md5/md5.vcproj: sha2 added * src/: lib/md5/pa_sha2.c, lib/md5/pa_sha2.h, lib/md5/Makefile.am, classes/math.C: sha2 support (sha256/sha512 digest) 2013-07-08 moko * src/classes/image.C: directory read or other read problem message fixed (related to issue #933) 2013-07-07 moko * AUTHORS: + misha + moko. :) 2013-07-06 moko * src/: classes/curl.C, include/pa_globals.h, include/pa_sql_driver_manager.h, lib/memcached/pa_memcached.C, main/pa_globals.C, main/pa_sql_driver_manager.C: pa_dlinit added for lt_dlinit to be called once and lt_dlexit called at right place (related to issue #925) 2013-07-04 moko * src/types/: pa_vfile.C, pa_vfile.h, pa_vstring.C: VString::as_vfile now uses vfile.set_binary_string to avoid content-type to be set, as it brokes badly designed logic in response output. This hopefully finishes issue #928. * tests/results/: 256.processed, 286.processed: file now displayed as name, size, mode, content-type * src/main/pa_common.C: read error now reported cottectly (fixes issue #933 2013-06-28 moko * tests/: 286.html, results/286.processed: test extended * tests/: 286.html, results/286.processed: Test for issue #928 added. it tests default content-type change. * src/types/pa_vfile.C: closes issue #928 - default content-type now updated 2013-06-25 moko * src/: classes/file.C, types/pa_vfile.C, types/pa_vfile.h: default content-type for text/binary files without name added; ^file::create[$f;...] options now works properly and $f properties are default (fixes issue #928) 2013-05-16 misha * src/include/pa_opcode.h: - define for OBJECT_POOL optimisation is added * src/main/pa_table.C: - a tiny memory optimisation while creating table if specified limit is bigger than source rows count * src/classes/table.C: - ^table.foreach[k;v]{code}[separator] is added ( new feature: #858 ) 2013-04-29 moko * src/classes/curl.C: CURL_IPRESOLVE_V4 now set by default, $.ipresolve(0|1|2) added (closes issue #891) * src/lib/curl/curl.h: CURL_IPRESOLVE added 2013-04-24 moko * src/: classes/memcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, types/pa_vmemcached.C, types/pa_vmemcached.h: ^memcache.release[] added, calls memcached_quit (refs #893) 2013-04-22 moko * src/: include/pa_string.h, main/pa_common.C: no more double slashes in file path (fixes bug #872) * src/: classes/curl.C, lib/curl/curl.h: minor fixes related to CURLOPT_ENCODING renamed into CURLOPT_ACCEPT_ENCODING (issue #739) * tests/results/266.processed: $.max_params added (feature #915) * src/: include/pa_common.h, main/pa_http.C: response-charset option added to file::load (closes issue #867) 2013-04-20 misha * src/classes/curl.C: - forgotten CURL_ACCEPT_ENCODING option is commited 2013-03-15 misha * src/classes/: hash.C, table.C: - Optimisation: do not create multiple empty strings while ::sql. uae String::Empty instead 2013-03-14 misha * src/classes/reflection.C: - for user classes ^reflection:method_info[] returns $.max_params and $.extra_param with $.call_type if they available ( new feature: #915 ) * src/classes/file.C: - ^file:delete[] now supports an option $.exception(false) that suppress any exception while deleting file ( new feature: #916 ) * src/classes/curl.C: - parsing cookies after curl:load now should work :) 2013-03-12 misha * src/types/pa_vfile.C: - if specified file_name is empty string set default name for the file 2013-03-11 misha * src/classes/curl.C: - after $f[^curl:load[...]] the cookies are also available in $f.cookies * src/: include/pa_http.h, main/pa_http.C: - parsing cookies is moved to a separate method 2013-03-10 moko * src/include/pa_config_fixed.h: typedef unsigned int uint32_t added * src/lib/memcached/pa_memcached.h: typedef unsigned int uint32_t removed (declared by autoconf) * configure.in: AC_TYPE_SSIZE_T, AC_TYPE_UINT32_T added for uint32_t define 2013-03-10 misha * src/classes/file.C: ^file:delete and ^file:move now support option $.keep-empty-dirs(true) ( new feature: #884 ) * src/: include/pa_common.h, main/pa_common.C: - option for keeping empty dirs is added 2013-03-10 moko * src/classes/: bool.C, double.C, int.C: default can be present, but default check removed from ^int/double/bool.int/double/bool for string.int/double/bool compatibility (related to issue #913) * src/classes/string.C: ^string.int/dobule/bool no longer internally throws exception if default is present (closes issue #913) 2013-03-09 misha * src/types/: pa_vhash.h, pa_vregex.h, pa_vtable.h: - tiny optimisations ( #845 ) * src/types/pa_venv.C: - added $env:fields ( new feature: #906 ) 2013-03-08 moko * src/main/pa_http.C: GPF on ^cookies:save fixed, $file.cookies now creates correct table (fixes issue #910) * src/classes/op.C: r.connection() -> r.connection(false) to allow use outside of 'connect' operator (fixes issue #911) * tests/results/: 096.processed, 122.processed: test results updated as doubles now printed with 15 significant digits, not 5 (fixes issue #882) * src/types/pa_vdouble.h: %.15g now used to format doubles instead of broken has_frac() ? "%g": "%.0f" logic (fixes issue #882) 2013-02-21 moko * src/classes/table.C: _locate_name_value does not check arguments count, so we check it in advance (fixes issue #905) 2012-10-23 moko * buildall: old shell for and echo compatibility (for six) 2012-10-19 moko * buildall: --strip added --disable-safe-mode listed in usage 2012-10-17 misha * src/classes/op.C: - apply-taint should not throw "outside connect" exception with sql lang now 2012-10-17 moko * src/main/pa_request.C: bugfix: safe mode should be inited for each request (for apache module) 2012-09-26 moko * src/doc/doxygen.cfg: png -> svg 2012-09-25 moko * tests/: 141.html, results/141.processed: md5 hmac added, long key test added * src/classes/math.C: HMAC for MD5 added, bugfix for tempdigest double use when key is long 2012-09-16 moko * src/classes/math.C: Format -> Method Encode -> Format * tests/: 141.html, results/141.processed: math:digest hmac test added 2012-09-14 moko * src/classes/math.C: SHA1ReadDigest added and used in ^sha1. ^digest[sha1|md5;data; $.encode[base64|hex] $.hmac[key]] basic implementation added 2012-09-12 moko * src/doc/: doxygen.cfg, footer.htm, index.dox, string.dox, targets.dox: doxygen.cfg and footer.htm updated for doxygen 1.7.3 targets.dox and string.dox slightly actualized 2012-08-31 moko * ChangeLog: now generated with patched cvs2cl.pl 2012-07-29 moko * tests/285.html, src/main/execute.C, tests/results/285.processed: result should be pushed after VMethodFrame destructor is called, as it deletes junctions from stack params (fixes issue #868) 2012-07-23 moko * INSTALL, README: buildall script usage documented, other outdated info updated. * buildall-with-xml, buildall-without-xml: replaced by buildall 2012-07-21 moko * buildall: glib does not compile when threads are disabled... * src/types/pa_vmail.C: g_assertion fixes for empty input * src/types/pa_vmail.C: yet another fix (strange GPF on object unref, can't unref nested objects) * src/types/pa_vmail.C: another check added 2012-07-19 moko * buildall: usage added * buildall: new buildall script that unites buildall-with-xml, buildall-without-xml, --with-apache and --with-mailreceive * configure.in: support for static gmime and dynamic glib linking. fixes for FreeBSD 2012-07-17 moko * configure.in: --with-mailreceive replaced --with-static-mailreceive and --with-shared-mailreceive pathlink removed 2012-07-16 moko * src/types/pa_vmail.C: updated to work gmime 2.6, headers now capitalized, content now decoded and text content converted to $request:charset. all properties are accessed by functions, this ready for dynamic load. 2012-06-28 moko * src/targets/apache/Makefile.am: fix for apache cflags for Linux 32 bit 2012-06-27 moko * buildall-with-xml, buildall-without-xml: fetch requires -p for passive ftp * src/lib/ltdl/ltdl.vcproj: release build fixed * configure.in: 3.4.2 RC -> 3.4.2 2012-06-22 moko * src/types/pa_vfile.C: returned empty mode to stated files (issue #815) * tests/: 284.html, results/284.processed: output options test (feature #265) 2012-06-22 misha * tests/215.html: - little changes 2012-06-21 moko * src/: classes/json.C, classes/xdoc.C, types/pa_vxdoc.C, types/pa_vxdoc.h: output_options returned and used (bugfix for feature #265) * buildall-with-xml, buildall-without-xml: --with-match-limit=10000 breaks long .*, default 10M restored. (issue #216) * tests/: 283.html, results/283.processed: test for issue #815 added * src/types/: pa_vfile.C, pa_vstring.C: bugfix: ^#0D not altered again, cstrm not required. * src/lib/ltdl/: argz.c, ltdl.c, libltdl/lt__glibc.h: fixes for Win32 and broken FreeBSD (issue #45) * src/lib/ltdl/ltdl.vcproj: preopen.c and config.h removed * src/main/pa_string.C: warnings war * src/: classes/mail.C, include/pa_dir.h, include/pa_http.h, lib/json/JSON_parser.h, lib/smtp/smtp.h, main/pa_random.C, main/pa_socks.C, targets/apache/pa_threads.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_vstatus.C: compilation under cygwin fixed 2012-06-19 moko * src/lib/ltdl/: config_fixed.h, ltdl.vcproj: compilation under Windows fixed * parser3.sln: removed antique pcre_ctype * src/include/pa_config_fixed.h: required for INT_MAX / UINT_MAX * src/include/pa_config_fixed.h: undefined reference to __imp__pcre_* fix for Windows * src/: include/pa_charset.h, lib/pcre/Makefile.am, lib/pcre/pa_pcre_internal.h, lib/pcre/pcre_internal.h: pcre_internal.h -> pa_pcre_internal.h for Windows compatibility (win32/pcre has own copy of pcre_internal.h _pcre_default_tables define fixed 2012-06-18 moko * src/classes/memcached.C: flush -> clear * src/classes/memcached.C: memcached does not support quotes even in server name * src/: classes/memcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, types/pa_vmemcached.C: version() called on open to check servers existance. $.key(true) syntax now supported 2012-06-17 moko * src/include/: pa_config_fixed.h, pa_config_includes.h: old stuff cleanup * src/classes/table.C, tests/282.cfg, tests/282.html, tests/results/282.processed: encloser at the EOF bug fixed, incorrectly enclosed data now processed more logicaly (fixes #339) 2012-06-15 moko * buildall-without-xml: sync with buildall-with-xml * buildall-with-xml: download auto-detected between fetch and curl * configure.in: --with-gc and --with-pcre now also processed correctly * aclocal.m4, configure, src/include/pa_config_auto.h.in: now aclocal -I src/lib/ltdl/m4/ && autoheader && automake && autoconf should be run on rol1 using automake / aclocal (GNU automake) 1.11.1 autoconf (GNU Autoconf) 2.68 * configure.in: new PARSER_VERSION logic * src/include/pa_version.h: new pa_version.h logic * src/: classes/curl.C, classes/file.C, classes/image.C, classes/xdoc.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vrequest.C, types/pa_vstring.C: feols_normalized -> fis_text_content set_binary added * src/targets/cgi/parser3.C: gcc compilation warnings fixed 2012-06-15 misha * src/: classes/curl.C, classes/file.C, classes/image.C, classes/xdoc.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vrequest.C, types/pa_vstring.C: - ^file::create[text;content] EOLs in content now is normalized. ( new feature: #815 ) 2012-06-15 moko * configure.in: --disable-version-update added to disable version update with host information (for debian package) whitespace optimized * configure.in: version changed to 3.4.2 RC no-pic added for libtool * src/include/pa_version.h: Nice pa_version.h default. Please keep it. 2012-06-14 moko * src/classes/hash.C, src/types/pa_vhash.h, tests/281.html, tests/results/281.processed: "hash flocked" error removed for safe operations like ^h._count[] ( new feature: #335 ) * src/targets/apache/Makefile.am: libmod_parser3 -> mod_parser3 * buildall-with-xml, buildall-without-xml: --with-static -> --with * configure.in: --with-static/shared xml replaced with --with-xml, xml compilation check added * configure.in: --with-static/shared-gc, --with-static-pcre are replaced with --with-gc and --with-pcre test for pcre linking added 2012-06-13 moko * configure.in: apxs2 check optimized * src/targets/cgi/Makefile.am: preserve-dup-deps requires .a, not .la, includes optimized * buildall-with-xml: --with-pic looks better for -fPIC * configure.in: switched to convenience library in static linking * src/targets/apache/Makefile.am: switched to convenience library usage to avoid libtool warnings * src/lib/: cord/Makefile.am, gd/Makefile.am, json/Makefile.am, md5/Makefile.am, memcached/Makefile.am, sdbm/Makefile.am, smtp/Makefile.am: switched to convenience library usage * src/sql/Makefile.am: pa_sql_driver.h should be in includes * src/targets/apache/Makefile.am: updated for libtool usage * buildall-without-xml: --with-included-ltdl added * buildall-without-xml: sync with buildall-with-xml * buildall-with-xml: --with-included-ltdl added $cflags added for -fPIC for x64 $download added for wget success check added * buildall-without-xml: --with-dynamic-stdcpp removed * configure.in: disable-static returned * src/targets/cgi/Makefile.am: Automake 1.9 does not support LIBTOOLFLAGS 2012-06-12 moko * configure.in, src/targets/cgi/Makefile.am: disable-static not compatible with LIBTOOLFLAGS for unknown reasons * buildall-with-xml: --with-dynamic-stdcpp removed * configure.in: static/dynamic -lstdc++ linking option removed apxs2 check added * src/targets/cgi/Makefile.am: static/dynamic -lstdc++ linking option removed 2012-06-10 moko * src/targets/cgi/Makefile.am: --preserve-dup-deps libtool option added * src/targets/cgi/pp3.cmd: old PAF stuff * Makefile.am: ACLOCAL_AMFLAGS = -I src/lib/ltdl/m4 added and some beauty * depcomp: from libtool 2.4.2 * configure.in: ltdl directory removed, it has correct Makefile.in 2012-06-09 moko * Makefile.am, aclocal.m4, config.guess, config.sub, configure, install-sh, ltmain.sh, missing, src/include/pa_config_auto.h.in: autogenerated files updated after libtool update * src/lib/ltdl/: COPYING.LIB, Makefile.am, README, acinclude.m4, aclocal.m4, argz.c, argz_.h, config-h.in, config.h, config_auto.h.in, config_fixed.h, configure, configure.ac, configure.in, lt__alloc.c, lt__dirent.c, lt__strl.c, lt_dlloader.c, lt_error.c, ltdl.c, ltdl.h, slist.c, config/compile, config/config.guess, config/config.sub, config/depcomp, config/install-sh, config/ltmain.sh, config/missing, libltdl/lt__alloc.h, libltdl/lt__dirent.h, libltdl/lt__glibc.h, libltdl/lt__private.h, libltdl/lt__strl.h, libltdl/lt_dlloader.h, libltdl/lt_error.h, libltdl/lt_system.h, libltdl/slist.h, loaders/dld_link.c, loaders/dlopen.c, loaders/dyld.c, loaders/load_add_on.c, loaders/loadlibrary.c, loaders/preopen.c, loaders/shl_load.c, m4/argz.m4, m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4: libtool updated to version 2.4.2 * configure.in: preparation for new libtool * configure.in: Some beauty added :) * src/targets/apache/Makefile.am: := -> = * src/lib/pcre/: Makefile.am, config.h: config.h removed once again. :) * src/include/pa_config_includes.h, configure.in: limits.h added, previously was taken from pcre_internal.h. :) * src/lib/pcre/Makefile.am: config.h returned * src/lib/pcre/config.h: still need this. :) * src/lib/pcre/pcre_internal.h: extracts from real pcre_internal.h * configure.in: --with-charsets removed; --with-mysql-client & co removed * buildall-with-xml, buildall-without-xml: pcre_internal.h extracts now in parser tree, no need to copy * src/lib/pcre/: Makefile.am, config.h, ibm-1250.ucm, ibm-1251.ucm, ibm-1254.ucm, ibm-1257.ucm, pcre_parser_ctype.c, pcre_parser_ctype.vcproj, ruspart_win2koi.pl, win-koi.tab: debian/patches/101_pcre.patch - local copy of pcre_internal.h extracts now used old trash removed * etc/parser3.charsets/Makefile.am: charsets now in share (debian/patches/104_automake.patch) + all charsets are copied * buildall-with-xml, buildall-without-xml: curl option removed + extra arguments now supported 2012-06-08 misha * src/classes/table.C: - one params.as_hash usage was rolled back: the 2nd option in ^table.hash[] could be hash or table so .as_hash will throw an exception when table option is specified * src/: classes/curl.C, classes/file.C, classes/hash.C, classes/image.C, classes/mail.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, include/pa_exception.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: - MethodParams::as_hash is optimized and improved (whitespaces are allowed as empty options) - MethodParams::as_table is added - above methods are used for parsing methods' options ( new feature: #9 ) * src/types/: pa_vclass.C, pa_vclass.h: - method get_hash is added to vclass. now class fields can be accessible as a hash: $h[^hash::create[$asd:CLASS]] * src/types/: pa_vhash.h, pa_vhashfile.h: - vhash and vhashfile now have get_fields method so their fields can be accessed with ^reflection:fields[...] & ^reflection:field[...] 2012-06-06 misha * tests/280.html: - tests for ^reflection:method[obj-or-class;method], ^reflection:field[obj-or-class;field] and ^reflection:fields[obj-or-class] are added 2012-06-05 misha * src/classes/reflection.C: - ^reflection:method[class or object;method name] and ^reflection:field[class or object;field name] are added * src/types/pa_vstateless_class.C: - Method::get_vjunction method is used * src/types/pa_method.h: - Method::as_vjunction method is added 2012-06-05 moko * src/targets/Makefile.am: cgi now build with apache module * src/classes/memcached.C: flish ttl fixed 2012-06-04 moko * src/classes/json.C, src/classes/op.C, tests/279.html, tests/results/279.processed: ^json:parse[] now supports $.taint option (new feature #833) 2012-06-04 misha * src/: include/pa_common.h, main/pa_common.C, types/pa_vcookie.C: - search_stop method was moved from pa_vcookie.C to pa_common.C 2012-06-03 misha * src/main/pa_http.C: - ^file:load[...;http://...] - all received cookies are parced and stored into $.cookies ( new feature: #31 ) 2012-05-30 misha * tests/: 182_dir/a3.p, 182_dir/a4.p, 182.html: - test for adding incomplete class into a scope while @USE is found * src/main/compile.y: - add incomplete class into a scope while @USE and @CLASS instructions are found ( bugfix: #838 ) 2012-05-30 moko * src/types/pa_vclass.C, tests/278.html, tests/results/278.processed: removed "property has no getter method" exception when GET_DEFAULT present (fixes #269) * src/classes/json.C, tests/277.html: ^json:string[], $.default -> $._default 2012-05-29 moko * src/types/pa_vvoid.h: $STRICT-VARS(true) implemented to check uninitialized values usage (new feature: #154) 2012-05-28 moko * tests/277.html, src/classes/json.C, src/classes/reflection.C, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vbool.h, src/types/pa_vdate.h, src/types/pa_vdouble.h, src/types/pa_vfile.C, src/types/pa_vfile.h, src/types/pa_vint.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vstring.h, src/types/pa_vtable.C, tests/results/277.processed, src/types/pa_vtable.h, src/types/pa_vvoid.h, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h: ^json:string[$o; $.default[$method]] implemented for VObject (new feature #803) * src/classes/json.C, src/lib/json/JSON_parser.h, tests/277.html, tests/results/277.processed: json numbers are now treated as double ( new feature: #834 ) * src/: classes/math.C, include/pa_string.h, main/pa_charset.C, main/pa_string.C, types/pa_vdouble.h, types/pa_vint.h: pa_atoui added for out of range checks, zero division in vint/vdouble check added ( fixes #832 ) * tests/: 275.html, results/275.processed: tests for pa_atoui added ( fixes #832 ) 2012-05-28 misha * buildall-with-xml: - --without-lzma option is added to libxml2 configure * tests/256.html: - test for ^json:string[-file-;$.file[stat]] is added - tests for unsupported values for options $.file, $.table and $.date are added * src/: classes/json.C, types/pa_value.h: - ^json:string[...] now accepts "stat" $.file[] option's value in addition to existed "text" and "base64" ( new feature: #835 ) * tests/276.html: - test for ^reflection:delete[$object-or-class;field-name] * src/classes/reflection.C: - ^reflection:delete[$object-or-class;field-name] is added ( new feature: #268 ) 2012-05-27 misha * buildall-with-xml: - libxml2 2.7.8 => 2.8.0 2012-05-24 misha * src/include/pa_common.h: - method lastposafter was removed * src/classes/file.C: - use strrpbrk & rskipchars instead of lastposafter - ^file:dirname[] & Co proper handle windows file paths ( bug fix: #783 ) - ^file:dirname[] & ^file:basename[] now work as *nix commands * src/main/pa_request.C: - use strrpbrk instead of lastposafter * src/: include/pa_string.h, main/pa_string.C: - strrpbrk & rskipchars were added * tests/270.html: - more tests for ^file:find[] * tests/065.html: - more tests for ^file:dirname[] & Co * src/include/pa_version.h: - must be "win32" here. it is auto-generated on *nix 2012-05-24 moko * src/classes/math.C: ^math:convert[] now supports uint32 and throws overflow exception ( new feature: #830 ) * tests/: 275.html, results/275.processed: test for ^math:convert[] uint32 support and overflow added ( new feature: #830 ) 2012-05-23 moko * src/: classes/table.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vregex.C, types/pa_vregex.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: bool "return string as-is" removed from as_expr_result. ( new feature: #831 ) * tests/results/244.processed: test changed after bug #782 fix commited * tests/results/229.processed: test results for bug #782 commited * tests/: 254.html, results/254.processed: uid now just compared, not printed. :) 2012-05-20 moko * src/classes/reflection.C: ^reflection:uid[$object] added ( new feature: #341 ) * tests/: 254.html, results/254.processed: test for ^reflection:uid[] added * tests/: 254.html, results/254.processed: test for ^reflection:uid[$obj] added 2012-05-17 misha * src/main/untaint.C: - do not replace ' char by _26 while exploding filespec-tainting ( new feature: #829 ) 2012-05-12 moko * src/types/pa_vvoid.h: is_string now also checked, but get_* - not. 2012-05-08 moko * src/types/pa_vmethod_frame.h: bug #782 fixed * tests/229.html: test for bug #782 * tests/results/259.processed, src/main/pa_request.C, src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h, src/types/pa_vstring.h, src/types/pa_vvoid.C, src/types/pa_vvoid.h: feature #154 - first empty param now string; defined locals are empty strings; $STRICT-VARS(true) added 2012-04-27 moko * src/targets/apache/Makefile.am: ../../lib/memcached/libmemcached.a added 2012-04-27 misha * buildall-with-xml, buildall-without-xml: - prce 8.12 => pcre 8.30 ( #827 ) 2012-04-25 moko * src/: classes/json.C, classes/memcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, types/pa_vmemcached.C, types/pa_vmemcached.h: memcached_add implemented. * src/classes/curl.C: stderr -> f_stderr for Windows compatibility 2012-04-23 moko * src/: classes/memcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, types/pa_vmemcached.C, types/pa_vmemcached.h: open allows options hash for new memcached(options) function * src/classes/curl.C: check_safe_mode added, stderr now rewritten, not appended 2012-04-21 moko * src/classes/curl.C: '' added. :) * src/classes/classes.vcproj: new curl.h location * src/classes/curl.C: verbose output redirection from stderr to file curl option added 2012-04-20 moko * src/: classes/curl.C, lib/curl/curl.h: lib/curl/curl.h now contains what we need from curl, #ifdef HAVE_CURL removed * configure, configure.in, src/classes/Makefile.am, src/include/pa_config_auto.h.in, src/include/pa_version.h, src/lib/Makefile.am, src/lib/curl/Makefile.am, src/lib/curl/curl.h: curl.h header now in src/lib/curl, not configure option 2012-04-19 moko * src/: classes/double.C, classes/inet.C, classes/int.C, classes/string.C, lib/gc/include/gc_allocator.h, types/pa_vform.C: PVS-Studio detected errors fixes, unused options from sql_result_string removed. (closes issue #468) * src/types/pa_vmemcached.C: empty string fix * src/types/: pa_value.C, pa_value.h, pa_vmemcached.C, pa_vstring.C, pa_vstring.h: serialization helpers moved to pa_vmemcached.C 2012-04-18 moko * src/targets/apache/mod_parser3.c: "Parser3 module requires apache2-mpm-prefork" error displayed in threaded mpm. * src/targets/apache/: mod_parser3.c, mod_parser3_core.C: pa_setup_module_cells delayed to avoid GPF on init with php5-xsl installed (issue #354) 2012-04-16 moko * src/types/pa_vmemcached.C: call to memcached_result_create and memcached_result_free removed 2012-04-14 moko * src/lib/memcached/pa_memcached.h: uint32_t for Windows defined * src/types/pa_vmemcached.C: check_key added and used 2012-04-13 moko * src/: include/pa_string.h, types/pa_value.C, types/pa_value.h, types/pa_vmemcached.C, types/pa_vstring.C, types/pa_vstring.h: Serialization_data now added and used, VString now serialized with languages into memcached. 2012-03-28 moko * src/: types/pa_vmemcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h: result lengths added 2012-03-27 moko * src/types/pa_vmemcached.C: strdup added 2012-03-24 moko * src/: classes/memcached.C, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, types/pa_vmemcached.C, types/pa_vmemcached.h: memcached: mget, flush, fttl added 2012-03-20 moko * configure, configure.in: Makefiles.in updated for memcached * src/targets/cgi/Makefile.am: cleanup * src/: types/Makefile.am, types/pa_vmemcached.C, types/pa_vmemcached.h, targets/cgi/Makefile.am: memcached initial * src/: classes/Makefile.am, classes/memcached.C, lib/memcached/Makefile.am, lib/memcached/constants.h, lib/memcached/pa_memcached.C, lib/memcached/pa_memcached.h, lib/memcached/types.h, lib/Makefile.am: memcached initial 2012-03-16 moko * src/main/execute.C: ident now works under Linux + ident displays filenames (closes issue #818) * src/types/: Makefile.am, pa_vmethod_frame_global.h, pa_vmethod_frame_local.h: cleanup: pa_vmethod_frame_global.h pa_vmethod_frame_local.h removed * src/: classes/bool.C, classes/classes.C, classes/classes.awk, classes/classes.h, classes/curl.C, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/inet.C, classes/int.C, classes/json.C, classes/mail.C, classes/math.C, classes/memory.C, classes/op.C, classes/reflection.C, classes/regex.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_http.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_pool.h, include/pa_random.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/pcre/pcre_parser_ctype.c, lib/sdbm/pa_file_io.C, lib/sdbm/pa_strings.C, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_http.C, main/pa_memory.C, main/pa_os.C, main/pa_pool.C, main/pa_random.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_connection.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, main/helpers/simple_folding.pl, sql/pa_sql_driver.h, targets/apache/mod_parser3.c, targets/apache/mod_parser3_core.C, targets/apache/pa_httpd.h, targets/apache/pa_threads.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_property.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.C, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.C, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vmethod_frame_global.h, types/pa_vmethod_frame_local.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vregex.C, types/pa_vregex.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.C, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: ident now works under Linux + ident displays filenames (closes issue #818) Copyright updated 2012-03-13 moko * src/main/pa_string.C: compilation fix for feature #741 2012-03-09 misha * tests/193.html: - tests for ^string:base64[encoded] are updated * src/main/pa_common.C: - ^string:base64[encoded;$.strict(true)] now detects invalid base64 chars in the middle of encoded stricg ( new feature: #55 ) * src/include/pa_exception.h: - new exception type for base64 decoding is added 2012-03-06 misha * tests/274.html: - tests for ^date::today[] and ^date.sql-string[datetime|date|time] are added * src/classes/date.C: - constructor ^date::today[] is added ( new feature: #811 ) - ^date.sql-string[] now can accept one param -- strings "datetime", "date" or "time" - comments tidying up * src/types/pa_vdate.h: - get_sql_string now can print datetime, date and time 2012-03-03 misha * tests/193.html: - tests for ^string:base64[encoded;$.strict(true)] are added * tests/results/auto.p: - try-catch operator is added * src/: classes/file.C, classes/string.C, include/pa_common.h, main/pa_common.C: - $.strict(true|false) option is added to base64 decode methods ( new feature: #55 ) * src/main/pa_common.C: - base64 decode memory usage was decreased ( new feature: #819 ) 2012-02-28 moko * src/classes/hash.C: ident test 2012-02-27 misha * src/classes/file.C: - PARSER_VaRSION => PARSER_VeRSION 2012-01-08 misha * tests/273.html: - tests for ^string.replace[from;to] are added * src/: classes/string.C, include/pa_dictionary.h, main/pa_dictionary.C, main/pa_string.C: - ^string.replace[from;to] is added ( new feature: #741 ) - ^string.replace[one subst here] is slightly optimized 2011-12-07 misha * src/classes/table.C: - $t[^table::create{$empty}] now creates named table with one empty column ( bugfix: #63 ) 2011-11-30 misha * src/classes/json.C: - it's possible to set user's method for parsing arrays: ^json:parse[...;$.array[$hook]] ( new feature: #763 ) * tests/272.html: - test for ^json:parse[...;$.array[$hook]] 2011-11-23 misha * src/: classes/curl.C, classes/file.C, classes/image.C, classes/table.C, classes/xdoc.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C: - constructor ^file::create[mode;filename;content[;options]] now accepts binary mode and file-content - new constructor's format: ^file::create[string-or-file-content[;$.name[filename] $.mode[text|binary] $.content-type[...] $.charset[...]]] ( new feature: #65 ) * src/: include/pa_request.h, main/pa_request.C: - new method mime_type_of(const String*) is added * src/include/pa_exception.h: - new exception constant FILE_NAME_MUST_BE_SPECIFIED is added * src/classes/table.C: - bug with negative offset transformed into a feature. it means pointing to a row from the end of the table ( new feature: #810 ) 2011-11-19 misha * src/classes/table.C: - signed/unsigned warnings _select ( new feature: #810 ) * src/types/pa_vxdoc.C: - checkout if $.encoding and $.charset options were specified together is simplified 2011-11-12 misha * src/main/pa_request.C: - forgotten fix for escaping filename in HTTP content-disposition header (a part of bug #361 ) * src/classes/json.C: - ^json:string[$.class_name[jmethod]] now checks for ancestors' classes as well ( new feature: #456 ) * src/classes/op.C: - exceptions for ^break[] and ^continue[] "without cycle" now have types "parser.break" and "parser.continue" instead of "parser.runtime" ( new feature: #799 ) 2011-11-11 misha * tests/results/: 099.processed, 100.processed, 205.processed, 237.processed: - since bug #361 was fixed the content of filename in HTTP headers is quoted * tests/results/270.processed: - result for test 270 * tests/: 065.html, results/065.processed: - more tests for ^file:basename[] & Co were added * tests/270_dir/: 270.txt, subdir/270.txt: - stuff for 270.html * tests/270.html: - tests for ^file:find[] are added * src/types/pa_vxdoc.C: - now it's possible to specify encoding using option $.charset. option $.engoding is still supported but these options can not be specified together * src/classes/xdoc.C: - charset.isUTF8 is used instead of comparation charset name with string "UTF-8" ( bugfix: #759 ) 2011-10-11 misha * src/: classes/xdoc.C, types/pa_vxdoc.C, types/pa_vxdoc.h: - new option was added: ^xdoc.file[$.name[ ]] (new feature: #622) 2011-09-30 misha * src/types/pa_vrequest.C: - saving empty $request:post-body causes exception "saving stat-ed file" ( bugfix: #395 ) 2011-05-30 misha * src/classes/string.C: - fixed bug which was added with params.as_hash into string:sql 2011-05-29 misha * src/types/pa_value.C: - filename in content-disposition header must be quoted ( bugfix: #361 ) 2011-05-27 misha * src/classes/: image.C, xdoc.C: - $.mode must be set for newly created file * src/classes/: hash.C, mail.C: - little tunning with get_hash usage * src/include/pa_exception.h: - one more string for exception was added 2011-05-25 misha * tests/269.html: - tests for checking input params in some dom methods * src/classes/: xdoc.C, xnode.C: - validation of some input params was added. it isn't possible not wo create xdoc with invalid tagName. ( bugfix: #160 ) * src/include/: pa_exception.h, pa_xml_exception.h: - exception's string "data must be string" was mover from pa_exception.h to pa_xml_exception.h * src/classes/: xnode.C, xnode.h: - methods as_xmlqname, as_xmlncname, as_xmlname and as_xmlnsuri were added * src/main/pa_xml_exception.C: - XmlException accepts more options * src/include/pa_xml_exception.h: - XmlException accepts more options - XML-related exception's strings were added * src/: classes/xdoc.C, types/pa_vxdoc.h: - code cleanup (unused output_options were removed) 2011-05-19 misha * src/classes/: file.C, hash.C, string.C, table.C, void.C: - params.as_hash is used more while parsing methods hash-options 2011-05-18 misha * operators.ru.txt, operators.txt: - info about json-serialization of xdoc was added * tests/256.html: - tests for json-serialization xdoc were added * src/types/pa_vxdoc.C: - ups. I've forgot about "method" :) * src/: types/pa_value.h, types/pa_vxdoc.C, types/pa_vxdoc.h, classes/json.C, classes/xdoc.C: - now json:string can serialize xdoc-objects. options (the same as ^xdoc.string[]) could be specified in $.xdoc[] ( new feature: #265 ) 2011-05-15 misha * tests/268.html: - tests for ^table.count[with options] were added * src/classes/table.C: - method ^table.count[] now can accept options ( new feature: #93 ): ^table.count[column] returns number of columns for named table; ^table.count[cells] returns number of cells in the current row; ^table.count[] & ^table.count[rows] return number of rows in a table. * tests/267.html: - test for checking switch/case in boolean mode was added * src/classes/op.C: - if switch's or case's value is bool, they are compared as bool values, not as double values: new feature: #351 2011-05-06 misha * tests/242.html: - EOL before EOF was added * tests/169.html: - tests for splitting empty string and void were added * src/main/pa_string.C: - fix of fix (^empty_string.split[...] returned table with one empty cell) 2011-04-03 misha * src/include/pa_version.h, configure.in: - version in head was changed to 3.4.2b 2011-03-30 misha * src/types/pa_vregex.C: - \w & Co now contain unicode properties as well ( new feature #294 ) 2011-03-29 misha * buildall-with-xml, buildall-without-xml: - PCRE stack usage is limited to approx. 6 MB. previous limits were too big for real life. bugfix: #216 2011-03-04 moko * etc/parser3.charsets/cp866.cfg: Conforms to http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/PC/CP866.TXT * etc/parser3.charsets/cp866.cfg: cp866 initial version from vlalek@ 2011-02-22 misha * src/include/pa_charset.h, operators.ru.txt, operators.txt: - some methods mustn't be under #ifdef XML or parser can't be compiled without xml support 2011-02-21 misha * src/targets/apache/: Makefile.am: - mention ApacheModuleParser3.vcproj was removed * src/types/pa_vjunction.C: - EOL before EOF was added (warning removed) 2011-02-20 misha * tests/: 266.html, 266.p: - tests for checking $.inherited and $.overridden in ^reflection:method_info[...] were added * src/classes/reflection.C: - beautifying result of ^reflection:method_info[] ($.overridden/inherited) 2011-02-18 misha * src/main/: pa_charset.C, pa_http.C, untaint.C: - use pa_isalpha and pa_isalnum instead of isalpha and isalnum - bug with redundand quoting lowercased latin chars while building email body was fixed * src/include/pa_common.h: - pa_isalpha and ps_isalnum methods were added (they check for latin chars only) 2011-02-16 misha * src/main/pa_charset.C: - bugfix: in some cases the calculating string size for transcoding gave too small value (should ever look for availability char in dest charset inspite of the char size) 2011-02-04 moko * tests/223.html: header values now not url-encoded (issue #195) 2011-02-01 misha * buildall-with-xml, buildall-without-xml: - 8.10 => 8.12 2011-01-31 misha * src/main/pa_request.C: - throw exception if param file_name in use_file is empty 2011-01-08 moko * src/classes/curl.C: compilations errors fixed 2010-12-29 moko * tests/: 265.html, results/265.processed: test for issue #200 added * src/main/pa_string.C: empty regex result check added (fixes issue #200) * src/main/pa_http.C: pa_http_safe_header_name corrected a bit * tests/results/223.processed: header values now not url-encoded (issue #195) * src/: classes/curl.C, include/pa_http.h, main/pa_http.C, main/untaint.C: L_HTTP_HEADER now used in http headers values, pa_http_safe_header_name added for headers names (fixes bug #195) 2010-12-18 misha * src/: types/types.vcproj, classes/classes.vcproj: - arp-include => pa-include 2010-11-28 moko * src/lib/sdbm/sdbm.vcproj: apr -> pa (.vcproj) * src/lib/sdbm/: pa_strings.C, sdbm.c, pa-include/pa_strings.h: apr -> pa * configure.in: apr -> pa * src/types/: pa_vhashfile.C, pa_vhashfile.h: apr -> pa * src/: lib/sdbm/pa-include/Makefile.am, lib/sdbm/Makefile.am, classes/Makefile.am, types/Makefile.am: apr -> pa * src/lib/sdbm/: Makefile.am, apr_file_io.C, apr_strings.C, pa_file_io.C, pa_strings.C, sdbm.c, sdbm_hash.c, sdbm_lock.c, sdbm_pair.c, sdbm_pair.h, sdbm_private.h, sdbm_tune.h, pa-include/pa_apr.h, pa-include/pa_errno.h, pa-include/pa_file_info.h, pa-include/pa_file_io.h, pa-include/pa_sdbm.h, pa-include/pa_strings.h: apr -> pa (apache2 module apr name conflict resolved) 2010-11-27 misha * buildall-with-xml, buildall-without-xml: - typo fixed: libz2 -> libbz2 2010-11-26 misha * src/: types/pa_vregex.C, classes/hash.C, classes/table.C: - warnings removed 2010-11-25 moko * operators.ru.txt, operators.txt: $.indent(true) * operators.ru.txt, operators.txt: another bugfix. :) * operators.ru.txt, operators.txt: bugfix. :) * buildall-with-xml: libxml2-2.7.8 + with-apache 2010-11-24 moko * configure: apxs support * configure.in: apxs support -Bstatic gc removed for OS X * src/targets/: Makefile.am, apache/Makefile.am: apxs support * src/main/: pa_globals.C, pa_xml_io.C: the rest converted to THREAD_LOCAL usage * src/: classes/curl.C, include/pa_config_includes.h, main/pa_globals.C: THREAD_LOCAL defined and used 2010-11-23 moko * src/: classes/op.C, main/pa_os.C: microseconds, not milliseconds should be passed to pa_sleep, and only fractional part (bugfix: #188) * src/targets/apache/mod_parser3.c: 1.3 compatibility * src/targets/apache/: mod_parser3.c, mod_parser3_core.C: GC_dont_gc=1, as in cgi version * src/targets/apache/mod_parser3.c: warning war * src/targets/apache/: mod_parser3.c, mod_parser3_core.C, pa_httpd.h: version removed, some trash removed * src/targets/apache/mod_parser3.c: version removed (we don't want to show it), warning war * src/targets/apache/: mod_parser3.c, mod_parser3_core.C, pa_httpd.h: parser_status_allowed removed + merge config functions removed (override is the default) + beauty * src/: include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: option to hide $status used in apache module removed 2010-11-18 moko * operators.ru.txt, operators.txt: $.table[compact] added for ^json:string[] 2010-11-16 moko * src/targets/apache/mod_parser3.c: some cleanup done * src/main/untaint.C: bugfix: first, second String::Body argument is hashcode; second, info.fragment_begin is original, not resulting length * src/classes/file.C: new feature: $.stdin now untainted * tests/results/264.processed: new feature: $.stdin[] now untainted * tests/cat.sh: new feature: stdin arg to test $.stdin[value] * src/classes/op.C: ^apply-taint[] method added * tests/: 264.html, results/264.processed: ^apply-taint[] test added; $.stdin untaint test added 2010-11-15 moko * src/targets/apache/mod_parser3.c: outdated MODULE_MAGIC_NUMBER removed * src/targets/apache/: mod_parser3.c, mod_parser3_core.C, pa_httpd.h: 2x2 calculated under apache2. :) 2010-11-13 moko * src/targets/apache/mod_parser3.c: initial changes to build module with apache 2.x includes * src/targets/apache/: Makefile.am, mod_parser3.c, mod_parser3_core.C, pa_httpd.h, pa_threads.C: initial commit for united apache 1.3 / apache 2.x DSO module 2010-11-09 moko * src/types/pa_method.h: check added to dissallow @method[name;*] syntax * tests/: 263.html, results/263.processed: test from method[*args] added * src/types/: pa_method.h, pa_vmethod_frame.h: closes #26: variable number of params can now be passed to a method declared with *arg 2010-11-06 moko * src/classes/table.C: formating fixed. :) * src/classes/table.C: closes #4: ^table.select now supports $.limit(), $.offset, $.reverse() options * tests/: 262.html, results/262.processed: test for ^table:select with options added (feature #4) * src/include/pa_array.h: remove function added * src/types/: pa_vhash.C, pa_vhash.h: avoiding temporal String object in get_element/put_element, using static one. 2010-11-04 moko * src/types/pa_vregex.C: closes #6: exeption now thrown if invalid options is passed * tests/: 256.html, results/256.processed: $.table[compact] feature now tested; k and p in handler now tested. * src/types/: pa_value.h, pa_vtable.C, pa_vtable.h: fixes #153, $.table[compact] feature added * src/classes/json.C: key is now passed to handler in value_json_string; ^json:string result now process tainting inside and returns clean string, related to issue #153 * src/main/untaint.C: bugfix: charset can be null (in ^string:save[] as example), thus check is added 2010-10-31 moko * src/classes/string.C: error message changed (fixes issue #149) 2010-10-29 moko * src/main/pa_http.C: ":port" is now added to "Host:" header if port is not default (fixes issue #155); exception on invalid port added. * src/main/untaint.C: '*' is now not urlencoded to allow header "Accept: */*" to be passed 2010-10-28 moko * src/classes/curl.C: bugfix: detect_charset() was throwing exception on unknown charset even if response_charset was specified 2010-10-27 moko * src/classes/string.C: ^string.append removed for void compatibility 2010-10-26 moko * src/classes/json.C: libjson supports array at top level, we too (GPF fixed) 2010-10-25 moko * tests/: 253.html, results/253.processed: libjson supports array at top level, parser now supports it as well. * tests/261.html, tests/results/261.processed, src/types/pa_vstring.h: empty string is now void compatible (allows $empty.key) 2010-10-22 misha * src/types/pa_vcookie.C: - fix for session cookie (was introduced while adding additional expires checkout) * tests/030.html: - test for session cookie was added 2010-10-21 moko * src/: classes/string.C, classes/void.C, main/execute.C, types/pa_vvoid.C, types/pa_vvoid.h: void now inherited from string (feature #111) * tests/: 261.html, results/261.processed: checks void from string inheritance (feature #111) * src/classes/: bool.C, classes.h, curl.C, date.C, double.C, file.C, hash.C, hashfile.C, image.C, inet.C, int.C, json.C, reflection.C, regex.C, string.C, table.C, void.C: used_directly() now true by default 2010-10-17 moko * src/: include/pa_string.h, main/pa_http.C, main/untaint.C: files upload now uses binary blocks instead of L_FILE_POST tainting. (bugfix: #128) * tests/: 223.html, results/223.processed: binary file upload test added, GPF (issue #128) also checked in this test 2010-10-13 misha * tests/260.html: - test for math:convert * src/classes/math.C: - error in math:convert was fixed * operators.ru.txt, operators.txt: - info about ^math:convert[number](from-base;to-base) was added * src/classes/math.C: - method ^math:convert[number](from-base;to-base) for converting number represention from one base to another was added ( new feature: #23 ) 2010-10-13 moko * src/main/compile.tab.C: [] now is empty string, not void * src/main/compile.y: [] now is empty string, not void * src/types/pa_vvoid.h: void now passed as parameter * tests/: 259.html, results/259.processed: to test difference between void and empty string (see ticket #111) * tests/results/152.processed: $sEmpty[] is now empty string, not void * tests/256.html: $s[$void] is no longer empty string * tests/254.html: empty string is no longer void 2010-10-12 misha * src/types/pa_vcookie.C: - check if $.expires value can be converted to date during cookies set up ( bugfix: #104 ) * tests/041.html: - more tests for ^table.locate were added * src/classes/table.C: - ^table.locate[field;value;options] didn't work ( bugfix: #129 ) - exception comment for incorrect options ^table.locate[field;value;options] was fixed 2010-10-10 moko * src/: classes/reflection.C, main/execute.C: constructor returning another object feature returned * tests/results/258.processed: test result updated as constructor returning another object feature returned * tests/: 258.html, results/258.processed: test for constructor returning another object 2010-10-08 misha * tests/257.html: - whitespaces after @METACOMMANDS and their options shouldn't cause exceptions any longer 2010-10-06 moko * src/classes/: hash.C, table.C: length from sql server is now ignored, as sql string can contain 0x00 inside (bugfix: #119) 2010-10-02 misha * operators.ru.txt, operators.txt: - the X mark was removed from ^cache[file]. it is usable to delete cache file. 2010-10-02 moko * tests/: 253.html, results/253.processed: hook_key added for key checking * src/classes/json.C: null key bug fixed 2010-09-29 misha * tests/: 256.html, 256.txt: - tests for ^json:string[] were added 2010-09-25 moko * src/classes/json.C: small fixed * tests/results/: 253.processed, 255.processed: just updated * tests/: 253.html, 253_json.txt, 255.html, results/253.processed, results/255.processed: charset transcode test added for json:parse 2010-09-24 moko * src/types/pa_value.h: warning war :) * src/: classes/json.C, include/pa_request.h, types/pa_value.h, types/pa_vfile.C, types/pa_vtable.C: $.indent implemented for ^json:string 2010-09-22 moko * src/main/pa_charset.C: parser charset tables declare only white-space before 0x20, thus adding the missing chars * etc/parser3.charsets/: koi8-r.cfg, koi8-u.cfg: updated to conform to http://unicode.org/Public/MAPPINGS/VENDORS/ 2010-09-21 misha * src/main/compile.y: - some semicolons were added (VS2010 don't want to compile grammar if they are absent) * tests/: make_tests.cmd, run_tests.cmd: - path tools is changed * src/classes/classes.vcproj: - pathes to ls and gawk are changed * src/main/main.vcproj: - path to bison is changed 2010-09-21 moko * etc/parser3.charsets/: windows-1250.cfg, windows-1251.cfg, windows-1254.cfg, windows-1257.cfg, x-mac-cyrillic.cfg: updated to conform to http://unicode.org/Public/MAPPINGS/VENDORS/ 2010-09-20 misha * src/types/pa_vtable.C: - add EOLs while json-serializing table * src/classes/json.C: - add EOL while json-serializing hash * src/lib/json/JSON_parser.C: - 'ES' replaced by 'ESC' because some compilers don't like 'ES'. 2010-09-17 misha * operators.ru.txt, operators.txt: - info about json class was added * src/classes/json.C: - ^json:string[object] * src/: include/pa_request.h, main/pa_request.C: - stuff for preventing infinite recursion while executing json:string was added * src/include/pa_string.h: - method append_quoted was added * src/types/: pa_value.C, pa_value.h, pa_vbool.h, pa_vdate.h, pa_vdouble.h, pa_vfile.C, pa_vfile.h, pa_vint.h, pa_vstring.h, pa_vtable.C, pa_vtable.h, pa_vvoid.h: - method get_json_string was added to Value & Co * src/classes/date.C: - methods get_gmt_string and get_sql_string were used * src/types/pa_vdate.h: - methods get_gmt_string and get_sql_string were added 2010-09-10 moko * src/targets/cgi/parser3.C: vsnprintf now not called twice in die_or_abort (backport from 3.4.1) * src/targets/cgi/parser3.C: vsnprintf now not called twice in die_or_abort (bugfix: #106) 2010-09-09 moko * src/classes/json.C: warning war. :) 2010-09-08 misha * src/lib/json/Makefile.am: - additional include directories were added (for pa_memory.h and gc.h) * src/lib/json/json.vcproj: - JSON_parser.c => JSON_parser.C - compile as C++ instead default - additional include directory was added (for gc.h) * src/types/pa_vform.C: - little code reformating * src/classes/file.C: - $.content-type option now can be specified in ^file::create ( new feature: #102 ) 2010-09-08 moko * src/lib/json/: JSON_parser.C, JSON_parser.h: json lib now uses pa_malloc/pa_free 2010-09-07 moko * tests/results/254.processed: VStateless_class:put_element exception was fixed * src/types/: pa_value.h, pa_vstateless_class.h: now VStateless_class:put_element barks self.type, not this.type (bugfix: #105) 2010-09-06 moko * src/classes/reflection.C: bugfix: new String() is required for exception handling * tests/: 254.html, results/254.processed: test modified 2010-09-05 moko * tests/: 254.html, results/254.processed: ^reflection:copy test added * src/: classes/reflection.C, include/pa_request.h: ^reflection:copy implemented (new feature: #100) 2010-09-03 moko * src/lib/json/JSON_parser.C: c++ compatiblity * tests/: 253.html, 253_json.txt, results/253.processed: $.distinct option testing added 2010-09-02 moko * src/classes/json.C: $.distinct[first|last|all] added 2010-09-01 moko * tests/results/253.processed: json test result * tests/: 253.html, 253_json.txt: json test added * src/classes/json.C: json.C update to actual version + hash key creation bugfix 2010-08-31 misha * src/lib/json/JSON_parser.C, src/lib/json/JSON_parser.h, src/lib/json/Makefile.am, src/lib/json/json.vcproj, src/lib/Makefile.am, src/classes/Makefile.am, src/classes/classes.vcproj, src/classes/json.C, parser3.sln: - json library was added 2010-08-30 moko * src/: include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_vobject.C: cosmetic optimization in request:execute_method usage * src/: include/pa_charset.h, main/pa_charset.C: small optimization, just to decrease number of lines. :) 2010-08-27 misha * src/classes/op.C: - taint[json] was added * tests/: 250.html, 251.html, 252.html: - tests for taint[json] were added * src/main/pa_exec.C: - warning fix was rolled back. * src/: main/pa_charset.C, main/untaint.C, include/pa_charset.h, include/pa_string.h: - taint[json] was added - escaping was slightly modified 2010-08-25 misha * src/classes/file.C: - typo in file:sql exception was fixed * src/main/pa_exec.C: - warning about declared and not used variable forced_allow was removed 2010-08-14 misha * src/classes/hash.C: - two warnings about signed/unsigned mismatch were removed 2010-08-11 moko * tests/: 249.html, results/249.processed: default setter and anti-recursive default getter test added * src/: classes/reflection.C, include/pa_request.h, main/execute.C, types/pa_value.h, types/pa_vclass.C, types/pa_vobject.C, types/pa_vobject.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: default setter support + anti-recursive default getter support ( new feature: #13 ) * src/include/pa_hash.h: optimization: threshold member removed from hash, reducing sizeof(hash) 2010-08-10 misha * tests/196.html: - junction-method was added to the test * tests/248.html: - ups. typo :) * tests/248.html: - test for checking .match with 4 params * tests/: 247.html, 247_utf8.txt, 247_utf8_bom.txt, 247_windows1251.txt: - test for "transcode file from utf-8 to $request:charset during loading if the BOM code is detected" * src/main/: pa_common.C, pa_http.C: - transcode file from utf-8 to $request:charset during loading if the BOM code is detected ( new feature: #98 ) 2010-08-05 misha * src/classes/image.C: - ^image.replace now can accept only 2 params. in this case the whole image is affected ( new feature: #95 ) 2010-08-04 misha * tests/246.html: - test tor ^hash._at[] was added * src/classes/hash.C: - ^hash._at[first|last|[-]N] ( new feature: #53 ) * src/include/pa_hash.h: - methods for accessing the first and the last values of ordered hash were added (first_value and last_value) * src/classes/file.C: - now ^file::base64 accepts up to 4 params (similar to others file's methods): ^file::base64[mode;user-file-name;encoded;options] ( new feature: #68 ) * src/types/pa_vmethod_frame.h: - helper method as_hash was added 2010-08-01 moko * src/classes/op.C: to correctly process $result[] in code, called from ^process * tests/245.html: $result in ^process[] test added * src/: classes/op.C, classes/reflection.C, include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C: optimization: VMethodFrame(junction, caller) replaced with VMethodFrame(method, caller, self) op_call(VMethodFrame &frame, bool constructing) removed, construct(class,method) added * tests/results/: 192.processed, 244.processed: request::construct added * tests/: 244.html, 245.html, results/244.processed, results/245.processed: object creation exceptions and ^process tests added 2010-07-28 misha * tests/make_tests.cmd: - win32 EOLs * tests/: run_parser.cmd, run_tests.cmd: - cmd files for executing tests on Win32 were added (The system timezone should be GMT+3) 2010-07-26 misha * tests/: 212.html, results/212.processed: - sizes were removed mecause they could be different on different OSs * tests/065.html: - make it "win32 friendly" 2010-07-25 misha * src/main/compile.y: - all EOLs between methods are removed during compilation ( new feature: #47 ) * tests/results/149.processed: - prepare tests to trim trailing methods' EOLs * tests/149.html: - prepare tests to trim trailing methods' EOLs * tests/: results/006.processed, results/014.processed, 006.html, 014.html, 022.html: - prepare tests to trim trailing methods' EOLs * tests/: 059.html, 071.html, 149.html, results/059.processed, results/071.processed, results/022.processed: - prepare tests to trim trailing methods' EOLs * tests/: results/073.processed, results/109.processed, results/142.processed, results/144.processed, results/149.processed, 073.html, 096.html, 109.html, 142.html, 144.html: - prepare tests to trim trailing methods' EOLs * tests/: 096.html, 107.html, 109.html, 142.html, 144.html, 149.html, 152.html, results/096.processed, results/107.processed, results/109.processed, results/142.processed, results/144.processed: - prepare tests to trim trailing methods' EOLs 2010-07-24 moko * tests/results/: 156.processed, 224.processed: fix for #54 changed the hash order in this test * tests/014.html: to check hash order, hash no is longer sorted before print * src/include/pa_hash.h: hash copy constructor now keeps order (bugfix: #54) 2010-07-23 moko * tests/results/224.processed: @auto[] is no longer inherited * src/types/pa_vstateless_class.C, tests/227.html, tests/results/227.processed: @auto[] is no longer inherited (bugfix: #57) 2010-07-22 misha * src/classes/table.C: - don't skip comment lines during table::load if encloser or separator is set as '#' ( new feature: #30 ) * src/targets/cgi/parser3.C: - don't run as cgi if env:PARSER_VERSION was set for preventing infinite loot ( bugfix: #12 ) * src/classes/file.C: - set PARSER_VARSION env before external script executing 2010-07-13 misha * tests/058.html: - test for suppressing @border was added - test for user attribute was added * tests/results/186.processed: unescaping from \uXXXX * tests/186.html: unescaping from \uXXXX * tests/: 239.html, results/239.processed: method call type * src/types/: pa_vjunction.C, pa_vjunction.h: - bugfix: #90 : $junction_method.CLASS_NAME (+CLASS) 2010-07-07 misha * buildall-with-xml, buildall-without-xml: - moving to pcre 8.10 on *nix 2010-07-05 misha * src/: classes/curl.C, classes/file.C, classes/hash.C, classes/image.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, main/pa_common.C, main/pa_http.C: - exception comment strings "options must be hash", "options must be hash, not code" and "called with invalid option" were replaced by constatns - exception comment string "invalid option passed" was replaced by "called with invalid option" (now in different methods are the same exception comment string) * src/include/pa_exception.h: - more exception strings were defined * src/: main/compile.y, main/compile_tools.C, main/compile_tools.h, types/pa_vstateless_class.h: - now we can define possible method's call type ( new feature: #5 ) 1. @OPTIONS\nstatic|dynamic (no option == any) -- for all classe's methods 2. @static:method[params] (only static keyword could be used here) -- for specified methods * src/main/pa_common.C: - junction points should not be deleted on win32 during dirs cleanup ( bugfix: #83 ) - optimisation in dirs cleanup 2010-07-03 misha * tests/: 158.html, 160.html, 161.html, 162.html, 163.html, results/158.processed, results/160.processed, results/161.processed, results/162.processed, results/163.processed: - prepare tests to trim trailing methods' EOLs * tests/results/169.processed: - prepare tests to trim trailing methods' EOLs * tests/results/: 168.processed, 169.processed: - prepare tests to trim trailing methods' EOLs * tests/: results/170.processed, results/167.processed, results/168.processed, results/169.processed, 167.html, 168.html, 169.html: - prepare tests to trim trailing methods' EOLs * tests/: results/170.processed, results/171.processed, results/172.processed, results/173.processed, results/174.processed, results/175.processed, 170.html, 171.html, 172.html, 173.html, 174.html, 175.html: - prepare tests to trim trailing methods' EOLs * tests/: results/176.processed, results/180.processed, results/184.processed, results/185.processed, results/191.processed, results/192.processed, results/196.processed, results/197.processed, results/198.processed, 176.html, 180.html, 184.html, 185.html, 191.html, 192.html, 196.html, 197.html, 198.html: - prepare tests to trim trailing methods' EOLs * tests/: 199.html, 208.html, 209.html, 213.html, 214.html, results/199.processed, results/208.processed, results/209.processed, results/213.processed, results/214.processed: - prepare tests to trim trailing methods' EOLs 2010-06-29 misha * tests/: 220.html, 218.html, results/218.processed, results/215.processed, results/217.processed, 215.html, 217.html: - prepare tests to trim trailing methods' EOLs * tests/: results/224.processed, 224.html, 223.html, results/223.processed, results/220.processed: - prepare tests to trim trailing methods' EOLs * tests/results/: 226.processed, 230.processed: - prepare tests to trim trailing methods' EOLs * tests/: 229.html, results/229.processed: - prepare tests to trim trailing methods' EOLs * tests/: 232.html, 235.html, results/232.processed, results/235.processed, 226.html, 227.html, 228.html, 230.html, results/226.processed, results/227.processed, results/228.processed, results/230.processed: - prepare tests to trim trailing methods' EOLs 2010-06-16 moko * tests/: 229.html, results/229.processed: elseif now supported in ^if * src/classes/op.C: new feature: #56 elseif now supported in ^if 2010-06-03 misha * src/main/pa_common.C: - bugfix #74 -- memmove should be used instead of memcopy for overlaped regions 2010-05-25 misha * src/main/pa_common.C: - wanring about unused vars was removed * src/: include/pa_request.h, main/execute.C, main/pa_request.C: - get_method_filename was moved to execute.C 2010-05-23 misha * src/main/pa_request.C: - more accurate detection of method's file 2010-05-22 misha * src/classes/reflection.C: - bugfix: core during detection of .file if filespec isn't detected successfully 2010-05-20 misha * src/main/pa_request.C: - fix in get_method_filename * src/include/pa_request.h: - new feature: #24 -- searching included file in @USE/^use is changed. if its filespec doesn't start from '/' it will be searched in caller file directory * src/classes/reflection.C: - ^reflection:method_info returns file where the method is defined * src/: include/pa_request.h, main/compile.y, main/pa_request.C, classes/op.C: - new feature: #24 -- searching included file in @USE/^use is changed. if its filespec doesn't start from '/' it will be searched in caller file directory * src/: classes/file.C, include/pa_common.h: - method lastposafter is moved to pa_common.h 2010-05-18 misha * src/: main/pa_common.C, include/pa_common.h, classes/string.C, types/pa_vcookie.C: new feature: #71 ^string:js-unescape and cookie parser decode \uXXXX as well as %uXXXX 2010-05-17 misha * src/classes/curl.C: beauty: - unused param is removed in method _curl_version_action - some spaces were removed or replaced by tabs * src/classes/table.C: - bugfix: #72 core with empty value during ^table.hash[...;name_of_the_last_column][$.type[string]] 2010-05-16 misha * src/classes/curl.C: new: #61 more curl options were added (contributed by Sumo) 2010-04-29 pretender * src/main/pa_string.C: fixes #63 Split result from empty string now empty string. * src/types/pa_vtable.C: bugfix: #35 All empty table cells are now string type. 2010-04-28 pretender * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/execute.C: bugfix: #59 OPTIMIZE_BYTECODE_GET_CLASS macrodefinition removed 2010-04-19 pretender * src/main/execute.C: fixes #60 Stacktrace now contains info for OP_CONSTRUCT_OBJECT and OP_GET_CLASS * src/: include/pa_common.h, main/pa_common.C, main/pa_exec.C: fixes #64 Now file.missing exception generates in unsafe mode to. * src/classes/file.C: fixes #48 Now not throw "not save environment variable" exception in grpunlim version. 2010-04-05 misha * src/classes/string.C: - new feature: 4th param was added to match. if specified its value is returned in case of nothing was found 2010-04-01 misha * src/main/pa_request.C: - bugfix: on *nix URIs like /a/b/// caused multiple execution of /a/b/auto.p 2010-03-19 misha * src/main/execute.C: - core in $table1.$table2 was fixed * src/targets/cgi/parser3.C: - core in sigpipe was fixed 2010-01-27 misha * src/main/pa_common.C: - bugfix: there are no excaption.type if trying to open file by path /existing-file/non-exixting-file 2010-01-26 misha * src/types/: pa_vrequest.C, pa_vrequest.h: - $request:post-body was added (returns file) 2009-12-22 misha * src/classes/curl.C: - method 'option' was renamed to 'options' - now parser doesn't have class curl if it was built without it 2009-12-15 misha * configure.in: - little cheat with curl include dir was added 2009-12-05 misha * src/classes/curl.C: - some fixes 2009-12-04 misha * src/include/pa_config_fixed.h, src/classes/classes.vcproj, src/classes/curl.C, src/classes/file.C, src/classes/Makefile.am, buildall-with-xml, buildall-without-xml, configure.in: - curl class was added * src/include/pa_hash.h: - hash-iterator was added * buildall-with-xml, buildall-without-xml: - option --passive-ftp was added to pcre 2009-11-27 misha * src/classes/image.C: - don't add @border attribute to output of ^image.html[] if it was specified by user with empty value * src/types/pa_vxdoc.C: - bugfix: core if xdoc doesn't have the root element and we are trying to access .documentElement 2009-11-11 misha * src/classes/table.C: - in ^table.flip[] look at number of columns instead of number of items in first row for named tables 2009-11-10 misha * operators.ru.txt, operators.txt: - info about hash-options in ^file::create was added * tests/237.html: - test for ^file::create[...;$.charset[...]] was added 2009-11-09 misha * buildall-with-xml: - moving to libxml 2.7.6 * tests/236.html: - tests for comparations cords with functions were added * src/include/pa_string.h: - optimisation: cacheing of cstr was added * src/main/pa_http.C: - little optimisation * src/: classes/table.C, lib/gc/include/gc_allocator.h: - bugfix: GPF mallocs + stringstream (table.save) * src/classes/file.C: - file::create now accepts 4th param: options with $.charset * src/lib/cord/: cordxtra.c, include/private/cord_pos.h: - fixed bug in cord (comparation cords with functions was buggy) 2009-11-06 misha * src/main/pa_string.C: - bugfix: calculation string.length sometimes was buggy * src/classes/string.C: - bugfix: Temp_value_element wasn't destroyed if exception occured during match/replace * src/: main/pa_charset.C, include/pa_charset.h: - method lengthUTF8Char was added * src/classes/op.C: - clean tainting lang was added for user's usage * src/lib/cord/: cordbscs.c, cordxtra.c: - some rare GPF were fixed: checkouts are required after GC_MALLOC * src/types/pa_vregex.C: - check UTF8 only during 1st iteration * operators.ru.txt, operators.txt: - actually, there is no ^untaint[xml] in file::create 2009-10-15 misha * tests/: 235.html, 235_attach.txt: - tests for preparing email were added * tests/234.html: - more tests for checking ^taint[uri] escaping were added * src/: include/pa_string.h, main/pa_charset.C, main/pa_http.C, main/pa_request.C, main/untaint.C, types/pa_vmail.C: - little hacking: for dealing with transcoding+^taint[uri] transcode_and_untaint was replaced by untaint_and_transcode 2009-10-13 misha * tests/: 121.html, results/121.processed: - test transcoding + url-escaping now * tests/results/auto.p: - more helpers' methods were added * src/main/pa_globals.C: - die instead of abort 2009-10-06 misha * src/main/pa_common.C: - don't allocate memory during capitalization if input string is already capitalized * src/targets/isapi/parser3isapi.C: - pass pre-capitalized headers * src/targets/cgi/parser3.C: - pass pre-capitalized headers - don't use format function because it calls malloc * src/include/pa_common.h: - more capitalized headers were added * src/main/pa_common.C: - in safe mode clear executable bits during file writing 2009-10-05 misha * src/main/pa_charset.C: - use iterators in pa_charset.C itself 2009-10-03 misha * src/: types/pa_vimage.h, classes/image.C: - ^img.font[], ^img.text[] & ^img.length[] can work in utf-8 now * src/: include/pa_charset.h, main/pa_charset.C: - class UTF8_string_iterator was added * src/classes/image.C: - respect utf-8 when calculate alphabet length * src/classes/mail.C: - check from before get message.cstr 2009-10-02 misha * tests/233.html: - test for image.font, image.length, image.text with text in utf-8 were added * src/main/pa_common.C: - use pa_malloc_atomic instead of new * buildall-with-xml, buildall-without-xml: - comment about gc version for freebsd 4 was added 2009-10-01 misha * src/main/pa_exec.C: - bugfix: allocate a bit more (for terminator) - read_pipe were slightly optimized 2009-09-28 misha * src/main/: pa_common.C, pa_uue.C: - some magic numbers were removed * src/types/pa_vmail.C: - forgot about space after ':' * src/types/pa_vmail.C: - escape filenames while preparing mail body - small simplifications * src/: include/pa_uue.h, main/pa_uue.C: - pa_uuencode now has inout params like pa_base64 * src/: types/pa_vmail.C, types/pa_vmail.h, classes/mail.C: - new option $.debug-print(1) was added to mail:send - changes for using uue_encode which uses less memory * src/main/pa_common.C: - pa_base64_encode uses less memory now * src/: include/pa_uue.h, main/pa_uue.C: - pa_uuencode reduces less memory now 2009-09-26 misha * src/types/pa_vmail.C: - default encoding now is base64 * buildall-with-xml: - moving to libxml 2.7.5 and libxslt 1.1.26 2009-09-25 misha * src/types/pa_vmail.C: - capitalization of headers was added to sending mail as well * buildall-with-xml: - catalog package was removed from libxml * src/main/pa_xml_io.C: - fix in removing file:// protocol for win32 absolute path * src/include/pa_common.h: - one more capitalized header was added 2009-09-22 misha * INSTALL: - comment about building just httpd binary while building apache module was added 2009-09-21 misha * buildall-with-xml: - moving to the latest versions of xml libs: libxml 2.7.4 and libxslt 1.1.25 2009-09-19 misha * tests/231.html: - test for encoding cookie in win-1251 2009-09-18 misha * tests/: 224.html, 224.p: - tests for ^reflection:fields[class or object] were added * operators.ru.txt, operators.txt: - info about method ^reflection:fields[class or object] was added * src/classes/reflection.C: - method ^reflection:fields[class or object] was added * src/types/: pa_value.h, pa_vclass.C, pa_vclass.h, pa_vobject.h: - methods get_fields were added * tests/232.html: - tests for @GET[name] * src/classes/table.C: - some changes in handling hash-options for creare, join and locate * src/types/: pa_vobject.C, pa_vobject.h: - @GET[] now could be defined with option: the type of requested value 2009-09-17 misha * tests/212.html: - tests for .pattern and .options were added * src/types/: pa_vregex.C, pa_vregex.h: - $regex.pattern and $regex.options were added 2009-09-11 misha * tests/: 223.html, 223_utf8.txt, 223_win1251.txt: - test was rewrited. it checks not just one case of sending cookies during file::load[http], but also sending headers and fields (including files) 2009-09-10 misha * src/main/untaint.C: - workaround in file-spec lang for old Macs was removed => now parser can open files with Russian 'r' in filename * src/main/untaint.C: - bugfix: client charset whould be analized while escaping cookies but now source charset * src/main/pa_http.C: - bugfix: the values of http headers didn't ^tainted[uri] so it was possible to make request with incorrect http header * src/main/pa_http.C: - capitalization of http headers during file::load[http was slightly changes - bugfix: all headers which parser sends during file::load[http should be transcoded and only then escaped * src/main/untaint.C: - a bit more comments were added * src/classes/: file.C, string.C: - types where changes (minus 2 warnings) * src/include/pa_common.h: - 2 capitalized strings for making http headers during file::load[http were added 2009-09-08 misha * operators.ru.txt, operators.txt: - changes in file.save and string.save were added * tests/: 230.html, 230.txt: - tests for checking options in file.save and string.save were added * src/main/pa_request.C: - http headers names, which are passed to SAPI::add_header_attribute are lowercased now (it'll be capitalized in that method) * src/: types/pa_vfile.C, types/pa_vfile.h, classes/file.C, classes/string.C: - file_write accepts Request_charsets and asked charset and cound transcode content before writing - string.save and file.save have option $.charset now * src/: include/pa_common.h, main/pa_common.C, classes/table.C, classes/xdoc.C: - file_write accepts Request_charsets and asked charset and cound transcode content before writing * src/include/pa_exception.h: - new exception comment string was defined 2009-09-07 misha * src/main/compile.y: - grammar $name\ name stops now for regex sub-pattern\s 2009-09-04 misha * src/main/pa_http.C: - capitalization of http headers during file::load[http was implemented 2009-09-03 misha * src/: main/pa_common.C, main/pa_http.C, main/pa_request.C, include/pa_common.h, include/pa_sapi.h, types/pa_vcookie.C, types/pa_vmail.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: - back to storing response http headers in lowercase - capitalize them during output 2009-08-31 misha * src/classes/table.C: - allow call with any brackets (it could be useful in methods with explict result declaration) * src/classes/table.C: - bugfix: ^table.sort{...} doesn't work correctly if $request:charset==koi8-r 2009-08-30 misha * src/: include/pa_common.h, main/pa_request.C: - http headers were changed: content-type => Content-type and so on * src/classes/file.C, src/include/pa_common.h, src/include/pa_request.h, src/main/pa_http.C, src/main/pa_request.C, src/types/pa_vcookie.C, src/types/pa_vmail.C, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, tests/results/001.processed, tests/results/002.processed, tests/results/003.processed, tests/results/004.processed, tests/results/005.processed, tests/results/006.processed, tests/results/007.processed, tests/results/008.processed, tests/results/009.processed, tests/results/010.processed, tests/results/011.processed, tests/results/012.processed, tests/results/013.processed, tests/results/014.processed, tests/results/015.processed, tests/results/016.processed, tests/results/017.processed, tests/results/018.processed, tests/results/019.processed, tests/results/020.processed, tests/results/021.processed, tests/results/022.processed, tests/results/023.processed, tests/results/024.processed, tests/results/025.processed, tests/results/026.processed, tests/results/027.processed, tests/results/028.processed, tests/results/029.processed, tests/results/030.processed, tests/results/031.processed, tests/results/032.processed, tests/results/033.processed, tests/results/034.processed, tests/results/035.processed, tests/results/036.processed, tests/results/037.processed, tests/results/038.processed, tests/results/039.processed, tests/results/040.processed, tests/results/041.processed, tests/results/042.processed, tests/results/043.processed, tests/results/044.processed, tests/results/045.processed, tests/results/046.processed, tests/results/047.processed, tests/results/048.processed, tests/results/049.processed, tests/results/050.processed, tests/results/051.processed, tests/results/052.processed, tests/results/053.processed, tests/results/054.processed, tests/results/055.processed, tests/results/056.processed, tests/results/057.processed, tests/results/058.processed, tests/results/059.processed, tests/results/060.processed, tests/results/061.processed, tests/results/062.processed, tests/results/063.processed, tests/results/064.processed, tests/results/065.processed, tests/results/066.processed, tests/results/067.processed, tests/results/068.processed, tests/results/069.processed, tests/results/070.processed, tests/results/071.processed, tests/results/072.processed, tests/results/073.processed, tests/results/074.processed, tests/results/075.processed, tests/results/076.processed, tests/results/077.processed, tests/results/078.processed, tests/results/079.processed, tests/results/080.processed, tests/results/081.processed, tests/results/082.processed, tests/results/083.processed, tests/results/084.processed, tests/results/085.processed, tests/results/086.processed, tests/results/087.processed, tests/results/088.processed, tests/results/089.processed, tests/results/090.processed, tests/results/091.processed, tests/results/092.processed, tests/results/093.processed, tests/results/094.processed, tests/results/095.processed, tests/results/096.processed, tests/results/097.processed, tests/results/098.processed, tests/results/099.processed, tests/results/100.processed, tests/results/101.processed, tests/results/102.processed, tests/results/103.processed, tests/results/104.processed, tests/results/105.processed, tests/results/106.processed, tests/results/107.processed, tests/results/108.processed, tests/results/109.processed, tests/results/110.processed, tests/results/111.processed, tests/results/112.processed, tests/results/113.processed, tests/results/114.processed, tests/results/115.processed, tests/results/116.processed, tests/results/117.processed, tests/results/118.processed, tests/results/119.processed, tests/results/120.processed, tests/results/121.processed, tests/results/122.processed, tests/results/123.processed, tests/results/124.processed, tests/results/125.processed, tests/results/126.processed, tests/results/127.processed, tests/results/128.processed, tests/results/129.processed, tests/results/130.processed, tests/results/131.processed, tests/results/132.processed, tests/results/133.processed, tests/results/134.processed, tests/results/135.processed, tests/results/136.processed, tests/results/138.processed, tests/results/139.processed, tests/results/140.processed, tests/results/141.processed, tests/results/142.processed, tests/results/143.processed, tests/results/144.processed, tests/results/145.processed, tests/results/146.processed, tests/results/147.processed, tests/results/148.processed, tests/results/149.processed, tests/results/150.processed, tests/results/151.processed, tests/results/152.processed, tests/results/153.processed, tests/results/154.processed, tests/results/155.processed, tests/results/156.processed, tests/results/157.processed, tests/results/158.processed, tests/results/159.processed, tests/results/160.processed, tests/results/161.processed, tests/results/162.processed, tests/results/163.processed, tests/results/164.processed, tests/results/165.processed, tests/results/166.processed, tests/results/167.processed, tests/results/168.processed, tests/results/169.processed, tests/results/170.processed, tests/results/171.processed, tests/results/172.processed, tests/results/173.processed, tests/results/174.processed, tests/results/175.processed, tests/results/176.processed, tests/results/177.processed, tests/results/178.processed, tests/results/179.processed, tests/results/180.processed, tests/results/181.processed, tests/results/182.processed, tests/results/183.processed, tests/results/184.processed, tests/results/185.processed, tests/results/186.processed, tests/results/187.processed, tests/results/188.processed, tests/results/189.processed, tests/results/190.processed, tests/results/191.processed, tests/results/192.processed, tests/results/193.processed, tests/results/194.processed, tests/results/195.processed, tests/results/196.processed, tests/results/197.processed, tests/results/198.processed, tests/results/199.processed, tests/results/200.processed, tests/results/201.processed, tests/results/202.processed, tests/results/203.processed, tests/results/204.processed, tests/results/205.processed, tests/results/206.processed, tests/results/207.processed, tests/results/208.processed, tests/results/209.processed, tests/results/210.processed, tests/results/211.processed, tests/results/212.processed, tests/results/213.processed, tests/results/214.processed, tests/results/215.processed, tests/results/216.processed, tests/results/217.processed, tests/results/218.processed, tests/results/219.processed, tests/results/220.processed, tests/results/221.processed, tests/results/222.processed, tests/results/223.processed, tests/results/224.processed, tests/results/225.processed, tests/results/226.processed, tests/results/227.processed, tests/results/228.processed, tests/results/229.processed: - http headers were changed: content-type => Content-type and so on 2009-08-27 misha * src/: main/pa_random.C, include/pa_random.h, targets/cgi/parser3.C: - year was updated :) 2009-08-26 misha * tests/: 224.html, 224.p: - test for creating of parser object using constructor without params - little bugfix in test * src/main/compile_tools.h: - bugfix: should't call autouse while checking existed class while processing partial option * src/classes/reflection.C: - bugfix: core when creating object with reflection and constructor doesn't have params 2009-08-24 misha * tests/229.html: - tests for checking the number of parameters were added * src/types/: pa_value.C, pa_vmethod_frame.h: - bugfix: the actual number of method's parameters wasn't checked correctly (the bug was introduced in 3.4.0) 2009-08-22 misha * src/main/pa_http.C: - ^file::load[http://...;$.body[]] : $.body transcoded, but tainted pieces are escaped only when content-type==url-encoding * tests/228.html: - test for checking ^file::load[http://...;$.body[]] * src/types/: pa_vform.C, pa_vform.h: - bugfix: attempt to detect post charset was too early (charsets is empty at this moment) 2009-08-21 misha * src/: include/pa_string.h, main/pa_http.C, main/pa_request.C, main/untaint.C: - some fixes with transcode+untaint 2009-08-15 misha * src/main/pa_exec.C: - number of argv in file::exec/cgi on unix was increaced to 100 (was 50) * tests/227.html: - test for checking overriding properties in static classes was added * tests/: 226.html, 226.p: - test for @autoload[] was added * src/: include/pa_request.h, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_request.C, classes/reflection.C: - autouse was implemented 2009-08-14 misha * src/classes/reflection.C: - outdated checkout was removed * src/classes/reflection.C: - optimization - method ^dynamical was added. * src/: types/pa_value.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.h, main/execute.C: - optimization * src/types/pa_vclass.C: - exception if base on sytem class 2009-08-12 misha * src/types/: pa_vclass.C, pa_vclass.h, pa_vstateless_class.C, pa_vstateless_class.h: - little optimisation 2009-08-11 misha * tests/224.html: - method_params => method_info - checking for $.inherited * src/classes/reflection.C, operators.ru.txt, operators.txt: - method method_params was renamed to method_info and now it returns class name, if method was defined in ancestor * tests/225.html: - tests for cheching properties in hierarhical classes were added * src/: types/pa_property.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, main/compile.y, main/execute.C, classes/classes.C: - problems with properties in new classes implementation were fixed 2009-08-10 misha * src/main/execute.C: - now constructor shouldn't be defined in class. it could be defined in parent. 2009-08-09 misha * src/classes/reflection.C: - ^reflection:methods doesn't return base's methods 2009-08-08 misha * src/: classes/classes.h, classes/date.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/mail.C, classes/op.C, classes/reflection.C, classes/regex.C, classes/string.C, classes/table.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_hash.h, main/execute.C, main/pa_http.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_method.h, types/pa_property.h, types/pa_value.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_venv.C, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vproperty.C, types/pa_vproperty.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h, types/types.vcproj: - new classes implementation * buildall-with-xml, buildall-without-xml: - gc has a bug if USE_MUNMAP is used. so it is disabled as a workaround. 2009-08-05 misha * src/: main/pa_common.C, include/pa_common.h: - not needed parameter was removed * src/main/pa_http.C: - bugfix: error was during detecting content-type of file which was loaded by http 2009-08-01 misha * src/main/execute.C, src/main/compile.y, src/include/pa_opcode.h, src/types/pa_wcontext.h, src/types/pa_wwrapper.h, INSTALL: - OPTIMIZE_BYTECODE_CONSTRUCT_OBJECT and OPTIMIZE_CONSTRUCT_OBJECT can't be disabled with defines any longer 2009-07-29 misha * src/classes/reflection.C, tests/results/224.processed: - for native methods with any call type now returned empty call_type value * src/: classes/hash.C, classes/hashfile.C, classes/op.C, classes/table.C, include/pa_hash.h, include/pa_request.h, main/pa_request.C: - break in cycles was optimized * INSTALL: - more defines were described 2009-07-28 misha * operators.ru.txt, operators.txt: - some changes in information about reflection class * tests/: 224.html, 224.p: - tests for reflection class * src/classes/reflection.C: - some bugs were fixed, method classes was added, refactoring 2009-07-26 misha * src/classes/classes.vcproj: - reflection class wass added to project * operators.ru.txt, operators.txt: - information about reflection class was added * src/classes/reflection.C: - class was redesigned 2009-07-24 misha * src/classes/: Makefile.am, reflection.C: - class reflection was added * src/types/pa_vstateless_class.h: - method for reflection method's in classes was added 2009-07-22 misha * src/main/compile_tools.h: - bugfix: $object.$var was over-optimized. it failed if $object1.$object2.field 2009-07-16 misha * src/: lib/cord/cordbscs.c, lib/cord/cordprnt.c, lib/cord/cordxtra.c, lib/cord/include/cord.h, include/pa_string.h, main/pa_string.C: - optimization: CORD_str, CORD_to_const_char_star, CORD_to_char_star and CORD_substr have one more arg: length of cord 2009-07-15 misha * src/main/pa_http.C: - bugfix: $.cookies' values should be force tainted in ^file::load[http://...;$.cookies[]] * src/classes/: op.C, regex.C, string.C: - new string with exception was used * src/include/pa_exception.h: - new string with exception was added * tests/223.html: - test for checking cookie-encoding during ^file::load[http was added * tests/: 221.html, 222.html: - tests for checking type of $table.fields.field were added * src/types/pa_vtable.C: - not used var decl was removed * src/include/pa_string.h: - use cached string length in Body::mid. it improves speed of match with brackets in pattern * src/lib/cord/include/cord.h: - make CORD_substr_checked available outside 2009-07-14 misha * src/types/pa_vtable.C: - $table.fields.a return string even if column is empty (sometime returned void) - $table.fields was added for nameless tables * src/targets/cgi/getopt.c: - one warning resolved * src/main/pa_string.C: - potentian bug fixed * src/classes/op.C: - small optimization in taint/untaint 2009-07-13 misha * tests/156.html: - test for $cookie[...$.httponly(false)...] was added * src/types/pa_value.C: - bugfix: $cookie[...$.httponly(false)...] souldn't add the attribut to output 2009-07-11 misha * src/targets/: cgi/parser3.vcproj, isapi/parser3isapi.vcproj: - stack size was increaced to 2MB (default=1MB) 2009-07-08 misha * src/main/pa_string.C: - link to UTF-8 description was added * src/include/pa_hash.h: - hash keeps element's order in more places (ex: ._keys[]) * tests/220.html: - test for checking order of elements in hash in foreach was added * tests/172.html: - small changes in printing hash * tests/129.html: - small changes in printing hash * src/: include/pa_common.h, include/pa_hash.h, include/pa_request.h, types/pa_value.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: - hash now keeps order of elements * tests/014.html: - small changes in printing hash 2009-07-07 misha * src/classes/op.C: - new taint language "parser-code" was added * tests/219.html: - test for auto untaint parser code in process was added * src/classes/op.C: - tainted pieces in body of process are auto-untainted now: ^ -> ^^, $ -> ^$ etc. * src/: include/pa_string.h, main/untaint.C: - new language L_PARSER_CODE for auto-untaint in process was added * src/: classes/file.C, classes/hash.C, classes/image.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, include/pa_string.h, main/pa_charset.C, main/pa_http.C, main/pa_request.C, main/pa_xml_io.C, main/untaint.C, types/pa_value.h, types/pa_vhash.h, types/pa_vmail.C, types/pa_vobject.h, types/pa_vstring.h: - some code cleanup 2009-07-06 misha * src/classes/: file.C, hash.C, image.C, mail.C, op.C, string.C, table.C, void.C, xdoc.C: - cstr(params) and cstrm(params) were deleted. taint_cstr[m] and untaint_cstr[m] should be used * src/types/: pa_vcookie.C, pa_vhash.h, pa_vhashfile.C, pa_vimage.C, pa_vmail.C, pa_vobject.h, pa_vregex.C, pa_vrequest.C, pa_vstring.h, pa_vvoid.h: - cstr(params) and cstrm(params) were deleted. taint_cstr[m] and untaint_cstr[m] should be used * src/main/: pa_charset.C, pa_common.C, pa_exec.C, pa_http.C, pa_request.C, pa_sql_driver_manager.C, pa_xml_io.C: - cstr(params) and cstrm(params) were deleted. taint_cstr[m] and untaint_cstr[m] should be used * src/include/pa_string.h: - cstr(params) and cstrm(params) were deleted. taint_cstr[m] and untaint_cstr[m] should be used * tests/218.html: - test for checking automatic file-spec-taint was added * src/: types/pa_vhashfile.C, types/pa_vimage.C, types/pa_vmail.C, types/pa_vregex.C, types/pa_vrequest.C, types/pa_vstring.C, classes/file.C, classes/hash.C, classes/image.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C: - optimizations and simplification of string.cstr(...) * src/: include/pa_string.h, main/untaint.C, main/pa_common.C, main/pa_exec.C, main/pa_request.C, main/pa_sql_driver_manager.C: - optimizations and simplification of string.cstr(...) 2009-07-04 misha * tests/217.html: - test for recursion detection was added * src/: types/types.vcproj, main/main.vcproj, classes/classes.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj: - RuntimeTypeInfo was removed from .vcproj * src/types/pa_wwrapper.h: - dynamic_cast was removed * tests/: 195.html, 195_utf8.txt, 195_windows1251.txt: - tests for uploading files and case-insensitive http-method were added * tests/: 216.html, 216_dir/1, 216_dir/2.txt: - test for checking tainted pattern in ^file:list[] was added 2009-07-03 misha * src/: classes/classes.vcproj, main/main.vcproj, types/types.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj: - enable runtime info (needed for dynamic_cast) - little options changes * src/main/pa_http.C: - file::load[http works now with uploading files _and_ changing $.charset 2009-06-29 misha * src/types/pa_vregex.C: - ^untaint[regex][] for all tainted data while creating pattern 2009-06-25 misha * src/classes/image.C, operators.ru.txt, operators.txt: - options' names for ^image.font were changed to $.space, $.width and $spacing - default space width now == gif's width 2009-06-24 misha * tests/215.html: - tests for $file.mode were added * operators.ru.txt, operators.txt: - added info about $file.mode and changes in ^image.font[ * src/: types/pa_vimage.h, classes/image.C: ^image.font - third param now could be omited - third param now could be hash (with all widths options: $.space-width, $.letter-width) - it's possible to specify tracking ($.letter-space) * src/classes/file.C: - file objects now could have mode field (text|binary) * src/types/: pa_vfile.C, pa_vfile.h: - method set_method was added 2009-06-23 misha * src/: include/pa_string.h, main/pa_string.C, classes/string.C: - trim can work with utf-8 chars now 2009-06-20 misha * src/: classes/hash.C, main/pa_string.C: - string length cacheing was implemented * src/classes/table.C: - string length cacheing was implemented * src/include/pa_string.h: - string length cacheing was implemented 2009-06-17 misha * src/main/execute.C: - value param was removed from WContext::WContext * src/types/: pa_vcode_frame.h, pa_vmethod_frame.C, pa_wcontext.h, pa_wwrapper.h: - value param was removed from WContext::WContext - field wcontext was removed from VCodeFrame (using fparent instead) * tests/214.html: - test with hash copying 2009-06-16 misha * tests/: 062.html, results/062.processed: - evaluation hardcoded strings doesn't work in expression anymore * src/main/execute.C: - less calls for get_constructing() - little refactoring * src/: types/pa_wcontext.h, types/pa_wwrapper.h, include/pa_request.h: - less calls for get_constructing() * src/classes/: hash.C, hashfile.C: - fixed bug which was introduced with OPTIMIZE_SINGLE_STRING optimization 2009-06-14 misha * src/: classes/date.C, classes/file.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/regex.C, classes/table.C, classes/xdoc.C, classes/xnode.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.h, types/pa_vstateless_class.h, main/execute.C: - create object for storing object's fields only for parser objects 2009-06-13 misha * buildall-with-xml, buildall-without-xml: - new option was added for building GC (it slightly reduces memory usage) * src/types/: pa_wcontext.h, pa_wwrapper.h: - optimization of single string write * src/main/execute.C: - bytecode optimization of ^class:constructor - optimization of single string write * src/: include/pa_opcode.h, main/compile.y, main/compile_tools.h: - bytecode optimization of ^class:constructor 2009-06-09 misha * src/targets/cgi/parser3.C: - type size_t was changed to int in main (better compatibility) 2009-06-08 misha * src/main/compile.y: - I've forgot to commit it :( 2009-06-07 misha * src/include/pa_opcode.h: - more optimizations for WITH_SELF, WITH_READ and WITH_ROOT * src/main/: compile.y, compile_tools.C, compile_tools.h, execute.C: - more optimizations for WITH_SELF, WITH_READ and WITH_ROOT - little refactoring 2009-06-06 misha * tests/213.html: - tests for 3rd match string-param were added * src/classes/string.C: - 3rd match param could be string now * src/main/: compile.y, compile_tools.h: - much more bytecode's sequences optimized to WITH_SELF__VALUE__GET_ELEMENT and GET_OBJECT_ELEMENT 2009-06-05 misha * src/main/pa_http.C: - bugfix: content-length was not calculated if $.body was specified 2009-06-04 misha * src/classes/op.C: - optimizing write_assign_lang in connect * src/classes/op.C: - optimizing write_assign_lang in taint/untaint * src/main/execute.C: - little refactoring - optimizing write_assign_lang in taint/untaint * src/include/pa_opcode.h: - little refactoring * src/: include/pa_opcode.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: - optimizations for $self.field, ^self.method, $self.field[...] and $self.field(...) were added 2009-06-03 misha * src/types/pa_venv.C: - pa_strdup was replaced by strdup 2009-06-02 misha * src/: main/compile.y, main/compile_tools.h, main/execute.C, include/pa_opcode.h: - refactoring in last optimizations ($a[...], $a(...), $.a[...], $.a(...)). a bit less optimizations now but code is much easy and it is ready for further improvements. 2009-05-27 misha * src/: types/pa_junction.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vmethod_frame.h, main/execute.C: - changed in destructing junctions * src/main/: pa_charset.C, pa_string.C: - more safe creation on String:Body 2009-05-26 misha * src/: main/pa_common.C, main/pa_http.C, include/pa_common.h: - one method detect_charset was deleted - bug was fixed in this method (error while detecting charset in content_type withot last ';') * src/types/: pa_vform.C, pa_vform.h: - detect post charset only once 2009-05-25 misha * src/classes/file.C: - bugfix: file::exec didn't work after optimizing of helper_length 2009-05-24 misha * src/main/compile_tools.h: - $a[$b.c] and $a[$b.$c] optimisations were added - little refactoring * src/main/execute.C: - core while printing in debug log non-printable values was fixed - $a[$b.c] and $a[$b.$c] optimisations were added * src/include/pa_opcode.h: - new opcodes for $a[$b.c] and $a[$b.$c] were added 2009-05-23 misha * src/: lib/cord/cordbscs.c, lib/cord/cordxtra.c, lib/cord/include/cord.h, include/pa_string.h, main/untaint.C: - CORD_cat optimization * src/: include/pa_opcode.h, main/compile_tools.h, main/execute.C: - call constr optimisation under separate define now * src/main/: compile_tools.h, execute.C: - bugfix: $a[] $b[$a] -- in $b should be string, not void * src/main/compile.y: - little fix for rem-cut optimisation * src/: include/pa_opcode.h, main/compile_tools.C, main/compile_tools.h, main/execute.C: - optimisations for $a[^b[...]], $.a[^b[...]], $a(^b[...]) and $.a(^b[...]) * INSTALL: - description of some #defined were added * src/types/: pa_vfile.C, pa_vfile.h: - fill .'text' field only before 1st access (memory usage is reduced if don't access to .text field) * src/include/pa_array.h: - array grows step now not static (it reduces numbers of reallocs) 2009-05-20 misha * src/include/pa_opcode.h: - bytecode optimization for $a(1), $.b(2), $c[d] and $.e[f] was added * src/main/: compile.y, compile_tools.C, compile_tools.h, execute.C: - bytecode optimization for $a(1), $.b(2), $c[d] and $.e[f] was added * src/main/execute.C: - debug printing moved in defines * src/main/: compile.y, compile_tools.C, compile_tools.h: - bugfix and little refactoring for OP_GET_OBJECT_ELEMENT + OP_GET_OBJECT_VAR_ELEMENT optimisation 2009-05-19 misha * src/main/: compile.y, compile_tools.C, compile_tools.h, execute.C: - $a.$b & ^a.$b bytecode optimisation * src/include/pa_opcode.h: - new opcodes were added (for $a.$b & ^a.$b optimisation) * src/main/compile.y: - compiler now generate new opcodes: OP_GET_ELEMENT_FIELD and OP_GET_ELEMENT_FIELD__WRITE for $a.b and ^a.b - compiler now cut off ^rem{ with all content ; any number of params } * src/main/execute.C: - code for handle new opcodes OP_GET_ELEMENT_FIELD and OP_GET_ELEMENT_FIELD__WRITE was added * src/main/: compile_tools.C, compile_tools.h: - new parameter was added for LA2V and LA2S * src/include/pa_opcode.h: - new defines which can be used for disable some bytecode optimisation and new opcodes were added 2009-05-17 misha * src/lib/cord/cordxtra.c: - bugfix. * tests/212.html: - .size[] and .study_size[] were added to tests * operators.ru.txt, operators.txt: - info about regex class was added * tests/212.html: - tests for regex class were added 2009-05-16 misha * buildall-with-xml, buildall-without-xml: - moving from gc6.8 to gc7.1 * tests/022.html: - test for ^file:list[path;] (empty second param) was added * src/classes/file.C: - bugfix: ^file:list[path;] [empty second param) should work 2009-05-15 misha * src/classes/table.C: - automatically disable stringstream usage on freebsd4 * src/lib/cord/cordxtra.c: - var decl should be at the beginning of scope * tests/211.html: - test with different types of access to hash was added * tests/210.html: - test which checks for loosing tainting in hash's keys was added * tests/208.html: - some parser work added. or stime == 0 %-) * src/lib/cord/cordbscs.c: - little hack was added to cord * src/lib/cord/cordxtra.c: - cacheing of cord chars was added * src/include/pa_version.h, configure.in: - moko have made a lot of optimisations for increacing version number more dramatically :) * src/classes/date.C: - little refactoring: use constructor which accepts formated string * src/: include/pa_string.h, main/pa_string.C: - String constructor which can print formatted string was added 2009-05-14 misha * src/include/pa_string.h: - type was fixed * src/: classes/hashfile.C, classes/op.C, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_hash.h, include/pa_request.h, include/pa_sql_driver_manager.h, include/pa_string.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_xml_io.h, main/pa_charset.C, main/pa_charsets.C, main/pa_string.C, main/pa_stylesheet_connection.C, types/pa_value.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vstateless_class.C, types/pa_vstateless_class.h: - hash_code caching was implemented (seaches should be faster now) * src/: classes/file.C, classes/hash.C, classes/image.C, classes/string.C, classes/table.C, include/pa_string.h, main/pa_charset.C, main/pa_http.C, main/pa_request.C, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_venv.C, types/pa_vform.C, types/pa_vhashfile.C, types/pa_vregex.C, types/pa_vrequest.C: - String constructors don't have that stupid true/false param which means 'tainted'. they accept lang instead. * src/types/pa_vmethod_frame.h: - bugfix: taint/untaint didn't work with OPTIMIZE_RESULT * src/types/: pa_method.h, pa_vstateless_class.C: - less warnings wher OPTIMIZE_RESULT and OPTIMIZE_CALL not defined 2009-05-13 misha * src/: types/pa_method.h, types/pa_vcookie.C, types/pa_vdouble.h, types/pa_venv.C, types/pa_vhashfile.C, types/pa_vint.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vregex.C, types/pa_vregex.h, types/pa_vrequest.C, types/pa_vstateless_class.C, main/execute.C, main/pa_charset.C, main/pa_common.C, main/pa_request.C, main/pa_string.C, include/pa_string.h, classes/date.C, classes/file.C, classes/hash.C, classes/image.C, classes/string.C, classes/table.C, classes/xdoc.C: - result optimisation - helper_length parameter removed from string constructors 2009-05-11 misha * tests/209.html: - tests for ^hash::create[hash] were added * tests/208.html: - tests for $status:rusage, $status:memory, ^memory:compact[] were added * tests/207.html: -tests for abs, sign, trunc, frac, exp, log, log10 were added * tests/206.html: - test for try with finally was added 2009-05-10 misha * tests/205.html: - test for ^file::create[...] was added * tests/204.html: - test for ^response:clear[] was added * tests/038.html: - tests for trigonometric functions were added * tests/014.html: - tests for ^hash.containts and ^hash.delete were added - more tests for .add, .sub, .union, .intersects and .intersections * tests/065.html: - test for ^file:dirname was added * tests/030.html: - test for $cookie:fields was added * tests/203.html: - test for ^h._keys[column name] was added * tests/201.html: - tests for .trim were added * tests/202.html: - tests for last-day, date:calendar[type](YYYY;MM;DD) were added * tests/200.html: - tests for .sort(), .sort{}, .flip[] and .offset[type](N) were added * tests/185.html: - more tests for .left(N), .right(N), .min(N;M) and .pos[c](N) were added * tests/141.html: - test for math:sha1 was added * tests/063.html: - tests for .mod(N), .inc[] & .dec[] were added 2009-05-09 misha * src/main/compile.y: - rollback 2009-05-05 misha * src/main/pa_exec.C: - little optimisation: somewhere length() was replaced by is_empty() * src/: include/pa_string.h, main/pa_charset.C: - little optimisation: somewhere length() was replaced by is_empty() * src/classes/table.C: - little optimisation: somewhere length() was replaced by is_empty() * src/: classes/file.C, classes/hash.C, classes/hashfile.C, classes/op.C, classes/table.C, main/pa_exception.C: - little optimisation: somewhere length() was replaced by is_empty() 2009-05-04 misha * src/: types/pa_method.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, main/execute.C, include/pa_request.h, classes/hash.C, classes/op.C, classes/table.C: - more optimisations were added: some operators don't switch write context anylonger 2009-05-01 misha * src/main/compile.y: - slightly more opcode optimisations for WITH_WRITE + VALUE + GET_ELEMENT -> OP_VALUE__GET_ELEMENT * src/main/execute.C: - simplifying process for getters 2009-04-30 misha * tests/: 198.html, 199.html: - new line fixes (should be 0x0A) * tests/results/199.processed: - test for checking $result into ^rem was added * tests/199.html: - test for checking $result into ^rem was added * tests/: 022.html, 096.html: - sort after :list was asses (on some OS it returns list in different order) * src/: include/pa_array.h, include/pa_request.h, include/pa_stack.h, main/execute.C, types/pa_vmethod_frame.h: - changes in stack impl - get_element() optimisation: 3rd param removed - bugfix: problems with reading empty input param - defines SAVE_CONTEXT and RESTORE_CONTEXT were added and used * tests/results/198.processed: - test for reading empty local var was added * tests/198.html: - test for reading empty local var was added 2009-04-29 misha * src/main/compile.y: - bugfix: couldn't compile because OP_VALUE__GET_ELEMENT should be unde #ifdef * src/: include/pa_array.h, include/pa_opcode.h, include/pa_request.h, main/compile.y, main/execute.C, main/pa_request.C, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: - we can work without opcode OP_STORE_PARAM, so it was removed 2009-04-28 misha * src/: include/pa_opcode.h, main/compile.y, main/execute.C: - op-codes optimisation: 1. VALUE+GET_CLASS=>VALUE_GET_CLASS 2. WITH_READ+VALUE+GET_ELEMENT=>VALUE__GET_ELEMENT (not all yet) 3. WITH_READ+VALUE+GET_ELEMENT__WRITE=>VALUE__GET_ELEMENT__WRITE 4. WITH_READ+VALUE+GET_ELEMENT_OR_OPERATOR=>VALUE__GET_ELEMENT_OR_OPERATOR * src/main/compile_tools.h: - new stuff for op-codes optimisation * src/: main/pa_string.C, classes/string.C: - !length() => is_empty() 2009-04-27 misha * src/types/pa_vregex.h: - back explicit vars initialisation 2009-04-24 misha * src/classes/string.C: - ups. typo fixed * src/main/execute.C: - more replacements '*new VBool' to 'VBool::get' - checks for ^break[], ^continue[] and parser.interrupted were optimised * src/classes/string.C: - number of params.count() calls was slightly reduced 2009-04-23 misha * src/: classes/image.C, include/pa_string.h, main/pa_charset.C: - make it x64 friendly * src/: classes/image.C, include/pa_string.h, main/pa_charset.C: - parser is x64 friendly now 2009-04-22 misha * src/types/pa_vhashfile.C: - coder friendly exception about exceeding record size was added * src/classes/file.C: - use vregex object instead of direct calls methods from pcre lib * src/: classes/file.C, include/pa_string.h, main/pa_string.C, classes/string.C: - use vregex object instead of direct calls methods from pcre lib * src/: include/pa_common.h, main/pa_common.C: - method print_pcre_exec_error_text was moved to class vregex * src/classes/: Makefile.am, classes.vcproj, regex.C: - class regex was added * src/types/: Makefile.am, pa_vregex.C, pa_vregex.h, types.vcproj: - class vregex was added 2009-04-21 misha * buildall-with-xml, buildall-without-xml: - pcre 7.8 -> pcre 7.9 * src/: types/pa_junction.h, types/pa_value.C, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_wcontext.C, types/pa_wcontext.h, main/execute.C, classes/op.C: - junction-optimisation (destructors) * src/include/pa_array.h: - free under if now 2009-04-19 misha * src/main/untaint.C: - ^taint[js] now escapes \x0D as well 2009-04-18 misha * src/include/pa_version.h: :q : CV: ---------------------------------------------------------------------- * src/types/: pa_vjunction.h, pa_vstateless_class.C: - little refactoring * src/: include/pa_array.h, include/pa_hash.h, types/pa_vmethod_frame.h: - destructors under #ifdef now * src/include/pa_memory.h: - define for using destructors was added * src/: types/pa_method.h, types/pa_vstateless_class.C, main/execute.C: - some junctions will be cached now * src/include/pa_hash.h: - hash destructor frees pairs now * src/include/pa_array.h: - inline was added to destructor * src/types/pa_method.h: - comment was changed 2009-04-17 misha * src/: include/pa_array.h, include/pa_hash.h, types/pa_vmethod_frame.h: - destructors were added * src/types/: pa_method.h, pa_vmethod_frame.h: - write_to_result renamed to always_use_result * src/main/: compile.y, compile_tools.h: - rollback changes in compiler: full backward compatibility is better * src/types/pa_vmethod_frame.h: - set flag write_to_result if find result in var's hash * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: - optimisation in method_frame * src/include/pa_array.h: - optimisation in array (allocate elements only when needed) * src/types/pa_vresponse.C: - check for $response:headers field before looking at custom fields * src/types/pa_vmethod_frame.h: - if flag write_to_result was set, not needed to check existance var with name 'result' in var's hash * src/main/compile.y: - compiler was changed: now it detects writings to $result and set flag writo_to_result in method * src/classes/string.C: - little optimisation: no needed to write number with lang * src/main/pa_charset.C: - methods readChar and skipChar which is used for read utf8-strings were renamed - is_escaped was renamed to isEscaped (to the same name convention) * src/: types/pa_method.h, main/compile_tools.h: - flag write_to_result added. compiler get this info from code. 2009-04-16 misha * src/types/: pa_wcontext.h, pa_vmethod_frame.h: - create new String only before 1st write * src/include/pa_string.h: - not needed template removed * src/: types/pa_vbool.h, types/pa_vfile.h, types/pa_vimage.C, types/pa_vjunction.C, types/pa_vproperty.C, types/pa_vstateless_class.C, types/pa_vxdoc.C, types/pa_vxnode.C, main/pa_request.C, classes/bool.C, classes/double.C, classes/hash.C, classes/int.C, classes/string.C, classes/table.C, classes/void.C, classes/xnode.C: - bool optimisation (use only 2 bool objects) 2009-04-15 misha * src/lib/cord/cordxtra.c: - more optimisation * src/: include/pa_string.h, main/untaint.C: - String::append optimisation * src/include/pa_hash.h: - get_by_hash_code added (it works faster then get and can sometime be used) * src/main/pa_string.C: - String::length optimisation * src/main/pa_charset.C: - rollback changeing readChar to skipChar. these methods read different strings * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: - fresult_initial_void removed + some optimisation - if $result defined we don't write to context anymore * src/main/pa_charset.C: - readChar => skipChar (in this place we need just skip char) * src/: types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vrequest.C, types/pa_vtable.C, main/execute.C, classes/table.C: - VVoid::get() => new VVoid (one void-instance) * src/types/pa_vvoid.h: - added get() method for retreave one instance 2009-04-11 misha * tests/196.html: - tests for $cookie:CLASS_NAME & Co were added * tests/197.html: - test for parser://test in xml was added * src/classes/string.C: - small optimisation * src/types/: pa_venv.C, pa_venv.h, pa_vconsole.h: - small optimisation 2009-04-10 misha * buildall-with-xml, buildall-without-xml: - moving from pcre-7.7 to pcre-7.8 * src/types/pa_vclass.C: - normalizing todo-comments: '@todo' now * src/types/: pa_vcookie.C, pa_vcookie.h: - $cookie:CLASS_NAME was added * src/types/: pa_vrequest.C, pa_vrequest.h: - $request:CLASS and $request:CLASS_NAME were added * src/types/pa_vconsole.h: - $console:CLASS and $console:CLASS_NAME were added * src/types/: pa_venv.C, pa_venv.h: - $env:CLASS and $env:CLASS_NAME were added * src/types/: pa_vmail.C, pa_vdate.h: - normalizing todo-comments: '@todo' now * src/targets/cgi/parser3.C: - size_t -> int for calming down compirer * src/main/pa_string.C: - little code cleanup * src/main/pa_common.C: - describe one more UTF-8 related error during PCRE compile/execute * src/classes/: image.C, inet.C, string.C, xdoc.C, xnode.C: - normalizing todo-comments: '@todo' now * src/types/: pa_vmath.C, pa_vmath.h: - $math:E was added * src/main/pa_charset.C: - type changed for making compiler happy 2009-03-10 misha * src/targets/cgi/parser3.C: make g++ happy with the type of argc in main() 2009-02-01 misha * src/main/pa_http.C: - bugfix: double CRLF before the end of boundary 2009-01-25 misha * tests/: 194.html, 194_dir/194.p: - test for @GET[] was added * src/classes/file.C: - more changes for parsing different number of params for file::load * tests/193.html: - tests for exception while base64-decode binary to string was added * tests/192.html: - tests for file::load with different number of options * src/classes/math.C: - ups. forgot '+1' * src/: classes/table.C, classes/file.C, include/pa_common.h, include/pa_http.h, main/pa_xml_io.C, main/pa_common.C, main/pa_http.C: - ^file::load[...;http://...;] now can post files (new option $.encode[multipart-form/data] should be specified) - $.method[] option for file::load now is not case-sensitive * src/: include/pa_string.h, main/untaint.C: - for file post the new taint language L_FILE_POST was added * src/: include/pa_random.h, main/Makefile.am, main/pa_random.C, main/main.vcproj, classes/math.C, include/Makefile.am: - some stuff was moved to separate files 2009-01-23 misha * src/classes/math.C: - little optimisation in ^math:sha1[] - spaces to tabs were converted 2009-01-12 misha * src/main/pa_http.C: - value of $.method[] option force uppercased now * src/: targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vform.C, types/pa_vmail.C: - some constants changed their names * src/main/pa_common.C: - changes in formating * src/: classes/file.C, main/pa_http.C: - some constants changed their names * src/include/pa_http.h: - some spaces were converted to tabs * src/include/pa_common.h: - some constants changed their names * src/classes/file.C: - fixed 4-th paramether for file::load - little code rewriting * src/types/pa_vfile.C: - little code rewriting * src/: main/pa_common.C, main/pa_http.C, main/untaint.C, types/pa_value.h: - some formating changes * src/include/pa_common.h: - some formating spaces transformed to tabs * src/classes/string.C: - exception while base64-decode binary to a string 2009-01-11 misha * configure.in: - version changed to 3.3.1b 2008-09-05 misha * src/lib/pcre/Makefile.am: file Makefile.am was added on branch release_3_3_0 on 2008-09-05 10:59:35 +0000 2008-09-04 misha * tests/: 130.html, 131.html: - these exceptions not typeless anymore * src/classes/op.C: - exception with 'invalid taint language' not typeless anylonger * src/classes/image.C: - some exceptions while operations with image not typeless anymore * src/: types/pa_vhashfile.C, main/pa_common.C, classes/file.C, main/pa_exec.C, main/pa_http.C: - some exceptions while operations with files not typeless anymore * src/: classes/date.C, types/pa_value.C, types/pa_vcookie.C, types/pa_vdate.h: - exceptions while checking date range not typeless anymore * src/include/pa_exception.h: - exception type string for invalid date range was added 2008-09-03 misha * src/: classes/file.C, main/pa_string.C: - exception while pce operations not typeless anymore * src/include/pa_exception.h: - exception type for pce operations was added * tests/: 191.html, 191_a.p, 191_b.p: - tests for calling .CLASS and .CLASS_NAME insite classes * src/classes/table.C: - don't save table header whiile ^table.save[append;filename] if file exists 2008-09-02 misha * src/main/compile.y, src/main/compile_tools.h, src/types/pa_vstateless_class.h, src/main/compile.tab.C, tests/182_dir/a1.p, tests/182_dir/a2.p: - append option was renamed to partial and it login changed: we must mark class as partial for allow their modifications in future. 2008-08-29 misha * tests/results/022.processed: - testing taint[regex] in mask for file:list * tests/022.html: - testing taint[regex] in mask for file:list * tests/022_dir/b[b].txt: - file for testing taint[regex] in mask for file:list was added * src/classes/file.C: - bugfix: ^taint[regex][] didn't works in file:list 2008-08-26 misha * src/types/pa_vobject.C: - we must get .CLASS and .CLASS_NAME from last derived object * src/classes/image.C: - many strings "image.format" replaced by IMAGE_FORMAT constant string - handle GPS info while parse exif - understand some more exif tags * src/include/pa_exception.h: - string "image.format" was added 2008-08-21 misha * src/: main/pa_string.C, classes/file.C: - use method for print pcre_exec text error * src/main/pa_common.C: - method for print pcre_exec text error was added * src/include/pa_common.h: - method declaration for print pcre_exec text error was added 2008-08-19 misha * src/main/execute.C: - bugfix: opcodes must be in separate namespace while debug execution as well * tests/: 015.html, results/015.processed: - test for escaping some parser chars was added 2008-08-18 misha * tests/: 190.html, 190.p, results/190.processed: - test for $caller.self.field + default getter in one class was added * tests/: 189.html, results/189.processed: - test for ^date::create[date object] * tests/: 188.html, results/188.processed: - tests for match with UTF-8 strings * src/main/pa_string.C: - option 'U' (ungreedy) was added to ^string.match[] * ChangeLog: - parser 3.3.0 beta13 2008-08-15 misha * src/lib/pcre/: LICENCE, Makefile.am, README, Tech.Notes, get.c, internal.h, pcre.3, pcre.3.html, pcre.3.txt, pcre.c, pcre.h, pcre.vcproj, study.c, maketables.c, pcre_dftables.vcproj, dftables.c: - old PCRE files removed * src/lib/pcre/config.h: - configuration for PCRE library * src/targets/: cgi/parser3.vcproj, isapi/parser3isapi.vcproj: - use PCRE library from win32\pcre instead of parser3\src\lib\pcre * src/: classes/file.C, main/pa_string.C: - moved to new PCRE library and set flag UTF8 if $request:charset is UTF-8 * src/: include/pa_charset.h, main/pa_charset.C, main/pa_globals.C, include/pa_config_fixed.h: - moved to new PCRE library * src/: main/main.vcproj, types/types.vcproj, classes/classes.vcproj, lib/Makefile.am: - use PCRE library from win32\pcre instead of parser3\src\lib\pcre * src/: include/pa_opcode.h, include/pa_operation.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/compile.tab.C: - opcodes were moved to separate namespace 2008-08-14 misha * src/types/pa_vstateless_class.C: - newline at the end missed * src/main/untaint.C: - char '-' also prefixed by '\' while regex tainting 2008-08-11 misha * tests/: 187.html, 187.p, results/187.processed: - tests for $caller.self, $caller.self.field and $caller.self.field[value] were added * src/types/pa_vmethod_frame.h: - still need to check 'self' runtime as well (for $caller.self) 2008-07-25 misha * tests/: 021.html, 032.html, 033.html, 047.html, 055.html, 059.html, 061.html, 064.html, 067.html, 068.html, 085.html, 086.html, 098.html, 109.html, 121.html: - set correct charsets in tests with international characters 2008-07-23 misha * src/main/pa_http.C: - escape $cookies as %uXXXX while file::load[...;http:// * src/: main/pa_string.C, main/pa_globals.C, classes/file.C: - pcre now everywhere in separate namespace * src/types/pa_vmethod_frame.h: - looking for caller before looking for vars * src/main/: compile.y, compile.tab.C: - characters '@' and '#' now can be escaped by '^' 2008-07-22 misha * src/classes/string.C, tests/186.html: - names changes: escape=>js-escape, unescape=>js-unescape 2008-07-21 misha * tests/results/186.processed: - test for string escape/unescape * tests/186.html: - test for string escape/unescape * src/classes/string.C: - string has escape and unescape methods now * src/: include/pa_string.h, main/pa_string.C: - escape method was added * src/: include/pa_charset.h, main/pa_charset.C: - more escape method-layers added (with different params) 2008-07-18 misha * tests/results/185.processed: - test for ^str.pos[substr](offset) was added * tests/185.html: - test for ^str.pos[sub](offset) added * src/classes/string.C, src/classes/void.C, operators.ru.txt, operators.txt: - ^string.pos[substr](offset) -- 2nd param accepted now * src/main/pa_string.C: - .pos works fine with offset for utf-8 strings 2008-07-17 misha * src/: include/pa_string.h, main/pa_string.C, classes/string.C: - helper length added for mid for small optimisation 2008-07-16 misha * tests/: 185.html, results/185.processed: - tests for length/left/right/mid/pos with utf-8 strings * src/classes/string.C: - left/right/mid/length/pos works fine for utf-8 strings * src/main/untaint.C: - comments removed * src/: include/pa_string.h, main/pa_string.C, include/pa_charset.h, main/pa_charset.C: - methods for working with pos/mid for strings in utf-8 were added 2008-07-15 misha * tests/: 184.html, results/184.processed: - test for case body as expression: $var(^switch(1){^case(1)(true)..}) * src/classes/op.C: - case body can be expression now: $var(^switch(1){^case(1)(true)..}) * tests/: results/183.processed, 183.html: - added test for testing new cookie encoding (%uXXXX) * src/main/untaint.C: - cookies outputs as %uXXXX now. while decoding for backward compatibility they decoded from %XX in request:charset too * src/: types/pa_vcookie.C, types/pa_vcookie.h, main/pa_request.C: - cookie class now decode cookies before first access after last request:charset changing (as form class). * src/main/pa_charset.C: - added method escape for escaping cookies as %uXXXX - before transcode calculate required space for dest string. it reduce mem usage for transcode * src/include/pa_charset.h: - added method escape for escaping cookies as %uXXXX * src/include/pa_string.h: - taint lang (internal) L_HTTP_COOKIE was added. will used for escaping cookies as %uXXXX * src/include/pa_common.h: - escape method has new option for skip converting '+' to a space char * src/main/: pa_common.C, pa_http.C: - skip BOM code before transcode - escape method has new option for skip converting '+' to a space char 2008-07-08 misha * src/classes/op.C: - bugfix in switch - case "stops" on 1st match (no UE if more then 1 case matches anylonger) - optimization: doing searching.as_string() || searching.as_double() only once 2008-07-04 misha * src/types/pa_vdate.h: - is_evaluated_expr returning true added so now ^date::create[date object] works * src/classes/string.C: - left and right added as aliases for start and end in ^string.trim[] 2008-07-03 misha * src/classes/file.C: - allow $.limit for file::sql as well * src/classes/file.C: - allow $.offset option for file::sql - force send limit=1 to query for use sql specifics authomatically * src/classes/: hash.C, string.C, table.C: - don't throw exception if $.limit value if empty. autoconvert it as everywere 2008-07-02 misha * configure.in: - time to change version number to 3.3.0 %-) * src/include/pa_version.h: - time to change version number to 3.3.0 %-) 2008-06-26 misha * src/classes/: file.C, hash.C, string.C, table.C, void.C: - $.limit(0) fixes * src/sql/pa_sql_driver.h: - new drivers API and new version (10.0) - $.limit(0) fixes * src/sql/pa_sql_driver.h: - SQL_NO_LIMIT added (preparations to new API) * src/: include/pa_sql_driver_manager.h, include/pa_sql_connection.h, main/pa_sql_driver_manager.C, classes/op.C: - document_root added * src/main/compile.tab.C: - error message was changed 2008-06-25 misha * src/main/compile.y: - error message was changed 2008-06-24 misha * tests/176_dir/: a.p, d.p: - @OPTION => @OPTIONS * tests/: 182.html, 182_dir/a1.p, 182_dir/a2.p, 182_dir/a3.p: - tests for @OPTIONS\nappend * tests/: 176.html, results/176.processed: - @OPTION => @OPTIONS * src/main/: compile.y, compile.tab.C: - stuff for @OPTIONS\nappend * src/main/compile_tools.h: - new methods for @OPTIONS\nappend * src/types/pa_vmethod_frame.h: - ALL_VARS_LOCAL_NAME moved fo compile.y 2008-06-17 misha * src/main/: compile.y, compile.tab.C: - bugfix in 'def' compilation: ^if(default){true. it's incorrect. must be exception} 2008-06-16 misha * tests/: 181.ent, 181.html, results/181.processed: - test for checking external reference loading with 'http://localhost' prefix while creating xdoc * tests/180.html: - use ^inet:ntoa[] and ^inet:aton[] instead of ^math:long2ip[] and ^math:ip2long[] * src/types/: pa_vobject.C, pa_vobject.h: - get_scalar_value method added which use scalar stateless class method when user object used in scalar context - use get_scalar_value when user object requested in scalar context * src/main/pa_common.C: - size must be int but not size_t or we can't compare with 0 sprintf result * src/: types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, main/execute.C, main/pa_request.C: - go back to one VMethodFrame with internal switch between local/global vars * src/types/pa_vclass.C: - register scalar if method @GET[] was specified * src/types/: pa_vstateless_class.C, pa_vstateless_class.h, pa_vstateless_object.h: - stateless class and object now has private scalar field and getter/setter for working with it * src/classes/math.C: - methods math:long2ip & math:ip2long were moved to inet static class * src/classes/: classes.vcproj, inet.C, Makefile.am: - inet static class added (^inet:aton[IP], ^inet:ntoa(number)) * tests/: 180.html, results/180.processed: - tests for ^math:long2ip(long) and ^math:ip2long[IP] * src/classes/math.C: - ^math:ip2long[IP] added 2008-06-11 misha * src/main/pa_xml_io.C: - use file_read_text again because of we need cut BOM code and remove DOS newline chars. but don't transcode it anyway. * src/: include/pa_common.h, include/pa_http.h, main/pa_common.C, main/pa_http.C: - option for disable transcoding while file_read and file_read_text added 2008-06-10 misha * tests/: 179.html, 179.p, results/179.processed: - test for many classes in 1 file * src/main/: compile.C, compile_tools.h: - compile return list of classes now. * src/main/: compile.y, compile.tab.C: - compile return list of classes now. internals. * src/main/pa_request.C: - compile return list of classes now. try call @conf and @auto for each returned class * src/include/pa_request.h: - compile return list of classes now * src/types/pa_vstateless_class.h: - typedef ArrayClass added (for return list of classes when compile buf) 2008-06-07 misha * src/main/pa_request.C: - constructing VRequest object with 3rd param -- form * src/types/: pa_vrequest.C, pa_vrequest.h: - constructor acceps 3rd param: form. needed for get post_charset * src/types/: pa_vform.C, pa_vform.h: - VForm::get_post_charset() added * src/: include/pa_common.h, main/pa_common.C, main/pa_http.C, types/pa_vform.C, types/pa_vform.h: - some polish 2008-06-06 misha * src/types/: pa_vform.C, pa_vform.h: - if POST -- try detec charset and decode chars from it but not from response:charset * src/main/pa_http.C: - detect_charset moved out of here * src/: include/pa_common.h, main/pa_common.C: - more helpers methods moved here - unescape_chars accepn one charset now * src/main/pa_http.C: - new constants used - don't allow $.content-type in ^file::load[;http://;$.method[POST]] - add charset info while ^file::load[;http://;$.method[POST]] - option $.omit-post-charset(true) added to ^file::load[;http://] for disabling charset during post * src/types/pa_vform.C: - new constants used * src/include/pa_common.h: - some constants were added * src/: classes/form.C, types/pa_vform.C: - use StrStartFromNC instead of StrEqNc * src/main/pa_common.C: - new method for caseless search c-substring in c-string - use isxdigit instead of is_hex_digit * src/include/pa_common.h: - new method for caseless search c-substring in c-string 2008-06-05 misha * tests/results/178.processed: - test for testing default getter * tests/178.html: - test for testing default getter * tests/178_dir/: 178a.p, 178b.p, 178c.p, 178d.p, 178e.p: - classes for test for testing default getter * src/main/execute.C: - default getter soul * src/types/: pa_vobject.C, pa_vobject.h: - get default getter if requested objects' field not found * src/types/pa_vclass.C: - register default getter if defined - get default getter if requested field not found * src/types/pa_vstateless_object.h: - method get_default_getter was added * src/types/: pa_vstateless_class.C, pa_vstateless_class.h: - pointer to default getter and methods for get/set it were added * src/types/: pa_junction.h, pa_vjunction.h: - junction has auto_name field (for default getter) 2008-06-04 misha * src/main/pa_xml_io.C: - load external xml in binary mode (no transcoding, no cutting BOM code, no fixing line breaks) and get it to libxml "as is" 2008-06-03 misha * src/main/pa_common.C: - use store_Char instead of transcodeCharFromUTF8 * src/: include/pa_charset.h, main/pa_charset.C: - method store_Char added, transcodeCharFromUTF8 -- removed 2008-06-02 misha * tests/: results/177.processed, 177.html: - test for checking .[acm]date after local ^file::load[] was added * tests/: results/176.processed, 176.html: - test for checking @OPTION\locals + @method[vars][locals] added * tests/results/auto.p: - CLASS_PATH specified for checking use 2008-05-30 misha * src/main/: compile.y, compile.tab.C: - changes in compiler: @OPTION\nlocals + @method[vars][;locals;] were added * src/main/execute.C: - code of OP_CALL and OP_CALL__WRITE was moved to separate method op_code - switch from VMethodFrame to VMethodFrameGlobal + VMethodFrameLocal * src/include/pa_request.h: - code of OP_CALL and OP_CALL__WRITE was moved to separate method op_code * src/main/pa_request.C: - use VMethodFrameGlobal instead of VMethodFrame now * src/types/pa_vstateless_class.h: - stateless class have bool flag all_vars_local as well * src/types/: pa_vmethod_frame.h, pa_vmethod_frame_global.h, pa_vmethod_frame_local.h, Makefile.am: - who children for VMethodFrame were added: one (global) works as VMethodFrame before and second (local) write all vars in self vars scope * src/types/pa_method.h: - method has bool flag all_vars_local now 2008-05-29 misha * tests/: 129.html, results/129.processed: - more tests for ^table.hash[] * src/classes/hash.C: - ^hash::sql has a new option: $.type[hash|string|table] as ^table.hash[] one. * src/classes/op.C: - ^try has 3rd param now: finally code which executed anyway after try or catch section 2008-05-27 misha * src/classes/table.C: - bugfix: ^table.hash[key][$.type[table]] must not fail if $.distinct(1) wasn't specified 2008-05-26 misha * src/classes/op.C: - allow ^throw[my type] 2008-05-22 misha * configure.in, configure: - version number updated to 3.2.4b * src/classes/: op.C, string.C: - trim format string before eval/format * tests/: results/175.processed, 175.html: - more tests for different format strings in .format[] * src/types/pa_vform.C: - while decoding get values decode %uXXXX as well (not only %XX) * src/main/pa_common.C: - unescape_chars can decode %uXXXX if charset specified - checks for format before print number (^d.format[>...<], ^eval($d)[>...<]) - formating with spaces (instead of tabs) removed * src/include/pa_common.h: - unescape_chars can decode %uXXXX if charset specified * src/: include/pa_charset.h, main/pa_charset.C: - method for get char in requested charset from utf code was added 2008-05-19 misha * tests/: 174.html, results/174.processed: - test for ^hashfile.cleanup[] added * src/classes/hashfile.C: - optimization: don't create any key or value variable if it's name weren't specified (^hf.foreach[;v]{...}) 2008-05-16 misha * src/classes/hash.C: - optimization: don't create any key variable if variable name wasn't specified (^h.foreach[;v]{...}) 2008-05-15 misha * src/classes/op.C: - small changes * src/classes/hashfile.C: - code reformating (as hash.foreach) * src/classes/hash.C: - calculate var_context once before foreach 2008-05-14 misha * src/classes/hashfile.C: - incorrect vars context calculation for ^hashfile.foreach[;]{} fixed * src/classes/: hash.C, table.C: - little optimisation * src/classes/file.C: - bugfix: double absolute path while loading file * tests/: 174.html, results/174.processed: - tests for hashfile were added * buildall-with-xml: - moving to libxslt 1.1.24 2008-04-30 misha * src/classes/file.C: - stat file while loading (local only) so .adate, .mdate and .cdate available without additional ::stat 2008-04-28 misha * src/classes/file.C: - $.name and $.content-type available for stated file 2008-04-14 misha * src/targets/cgi/parser3.C: - new year in copyright %-) * src/include/pa_version.h: - new version number in head 2008-04-10 misha * tests/: 080.html, results/080.processed: - cut '0' from exponential part because of on diff OS it differ (20 or 020 for ex) * tests/: 119.html, results/119.processed: - check for encoding while creating xdoc 2008-04-09 misha * buildall-with-xml: - move to libxml 2.6.32 and libxslt 1.1.23 * src/main/pa_common.C: - comment added * src/classes/date.C: - little refactoring 2008-04-07 misha * src/classes/table.C: - use NO_STRINGSTREAM for switch to old style of ^table.save[]: prepare one big string and sabe it at once. it's safe on freebsd 4.x but use much more memory. * buildall-with-xml, buildall-without-xml: - option --disable-stringstream added (under comment. use it on freebsd 4.x) 2008-02-22 misha * src/main/pa_http.C: - exception if $.body[] and $.forms[] specified together in file::load[;http] - get back transcoding $.body[] in file::load[;http] 2008-02-21 misha * src/classes/date.C: - ^date.gmt-string[] was added * src/types/pa_value.C: - method for output date in RFC 822 format moved to pa_common.h * src/include/pa_common.h: - method for output date in RFC 822 format moved here from pa_value.C * src/types/pa_vmail.C: - fixed core in sending mail with attachment in simple mode ($.file[file here]) introduced in 3.2.2 2008-02-20 misha * src/main/pa_http.C: - transcode $.headers before escaping into specified charset while ^file::load[...;http://...] (L_URI instead of L_HTTP_HEADER) - $.cookies param available in ^file::load[;http://...] now (but we don't parse set-cookies from response yet) (cookies not transcoded as common $cookies) 2008-02-19 misha * src/main/pa_request.C: - rollback: we mustn't force taint $response:field values because in this case $response:locateion[http://...] don't works. 2008-02-15 misha * src/classes/op.C: - little refactoring * src/main/pa_http.C: - taint names of $.headers for load[;http * src/main/pa_request.C: - force taint values of $response:field 2008-02-14 misha * src/main/pa_request.C: - $response:field transcoded to $response:charset before escaping now * src/main/pa_http.C: - some outdated comments removed * src/classes/date.C: - lastdat -> last-day * src/classes/date.C: - ^date:lastday(year;month) and ^date.lastday[] were added - little code refactoring - comments changes * tests/: 159.html, results/159.processed: - test for number of days in February * src/types/pa_value.C: - fixes in code formatting * src/classes/: file.C, op.C, table.C: - fixes in code formatting and comments 2008-02-13 misha * src/main/pa_common.C: - bugfix for february at leap year 2008-01-28 misha * tests/: 160.html, results/160.processed: - more test for cache added * src/classes/op.C: - bugfix: cache body executed twice if contains unhandled exception 2008-01-25 misha * src/lib/sdbm/sdbm.c: - use arp_malloc instead of malloc (fixed bug when hashfile became inavailable after memory:compact) * src/lib/sdbm/apr_strings.C: - +arp_malloc 2008-01-22 misha * src/classes/table.C: - little refactiring and exception texts changes in method ^table.hash[] * src/types/pa_vcookie.C: - link to cookie specification changed 2008-01-21 misha * tests/: 171.html, cat.sh, results/171.processed: - more tests for file::exec/cgi * src/classes/file.C: - bugfix: core while processing headers if executed cgi script don't return content 2008-01-18 misha * buildall-with-xml: - move to libxml2 version 2.6.31 * src/include/pa_version.h, configure.in: - version number updated to '3.2.3b' 2007-12-28 misha * src/: classes/hash.C, include/pa_hash.h: - hash.contain => hash.contains 2007-12-27 misha * gnu.vcproj, parser3.sln, src/classes/classes.vcproj, src/lib/cord/cord.vcproj, src/lib/gd/gd.vcproj, src/lib/ltdl/ltdl.vcproj, src/lib/md5/md5.vcproj, src/lib/pcre/pcre.vcproj, src/lib/pcre/pcre_dftables.vcproj, src/lib/pcre/pcre_parser_ctype.vcproj, src/lib/sdbm/sdbm.vcproj, src/lib/smtp/smtp.vcproj, src/main/main.vcproj, src/targets/cgi/parser3.vcproj, src/targets/isapi/parser3isapi.vcproj, src/types/types.vcproj: - back to VS2003 because of Apache 1.3 module can't work if it was built in VS 2005. with cgi all file so VS2003 project files can be easy converted to the new format. 2007-12-04 misha * src/types/pa_vcode_frame.h: - changes in comment 2007-11-29 misha * src/: types/pa_vcode_frame.h, main/execute.C: - code frame don't intercept strings any longer * tests/: 173.html, results/173.processed: - tests for $d[^date::now[]] $j{$d} $r[$j] -- must create date object in $r but not in main code frame * tests/: 172.html, results/172.processed: - more tests for pass objects from code frames 2007-11-27 misha * tests/: 152.html, results/152.processed: - tests for converting strings 'true'/'false' to bool were added * tests/152.html: - added checks for converting strings 'true'/'false' to bool * src/classes/string.C: - ^srting.bool[] now can convert to bool not only strings with numbers but with values 'true'/'false' as well * src/targets/: cgi/parser3.C, isapi/parser3isapi.C: - buffer size for parser3.log increased * src/main/pa_common.C: - remove_crlf optimize whitespaces now * src/include/pa_common.h: - remove_crlf return cstring size now * src/include/pa_types.h: - constant with buffer size for parser3.log added 2007-11-16 misha * tests/cat.sh: - script for tests for file::exec/cgi * tests/171.html: - tests for file::exec/cgi * tests/results/171.processed: - tests results for file::exec/cgi 2007-11-15 misha * src/main/pa_exec.C: - fixed incorrect exec code for unix * src/classes/file.C: - .body must be set before analyzing cgi headers * src/classes/file.C: - bugfix: we must transcode output fix EOLs only if exec/cgi return anything. 2007-11-14 misha * operators.ru.txt, operators.txt: - info about new text|binary option for file::exec/cgi was added * src/: include/pa_exec.h, main/pa_exec.C, classes/file.C: - ^file:exec[[text|binary];script;...] * src/: include/pa_exception.h, classes/file.C, classes/image.C, classes/string.C, classes/table.C: - more text strings moved to the one place 2007-11-09 misha * src/types/pa_vrequest.C: - $request:argv must be taint * ChangeLog: - $request:argv [patch from Sumo] * operators.ru.txt, operators.txt: - $request:argv * src/: include/pa_request_info.h, types/pa_vrequest.C, types/pa_vrequest.h, targets/cgi/parser3.C: - $request:argv 2007-10-25 misha * buildall-with-xml, buildall-without-xml: - options preparations for ./configure rewrited * src/main/: compile.tab.C, compile.y: - bug if parser.compile error occure in unhandled_exception finally fixed 2007-10-23 misha * tests/: 170.html, results/170.processed: - test for @method[][result] * operators.ru.txt, operators.txt: - added info about node.prefix and node.namespaceURI * src/classes/xnode.C: - xmlHasProp used instead of xmlGetProp * src/types/pa_vxnode.C: - DOM2 fields namespaceURI and prefix were added for node and attribute 2007-10-22 misha * src/types/pa_vmail.C: - content-transfer-encoding: 8bit added * src/main/pa_request.C: - added const content-transfer-encoding * src/include/pa_request.h: - added const content-transfer-encoding - ups. constants must be in lowercase (for search) * src/types/pa_vmail.C: - more constants used - content-transfer-encoding: 8bit added * src/main/pa_uue.C: - content-transfer-encoding moved out of here * src/include/pa_request.h: - more constants * src/types/pa_vmail.C: - constant renamed - $.content-id don't ommit anymore if $.content-disposition was specified - little refactoring * src/: include/pa_request.h, main/pa_request.C: - constant renamed 2007-10-17 misha * operators.ru.txt, operators.txt: - info about table::create[nameless]{data}[>options<] was added * src/main/: compile.tab.C, compile.y: - if error occure while compile method don't put this method in methods table anymore. in other case the parser coredumped if @unhandled_exception method can't be compiled because of parser.compile error. * src/main/execute.C: - little code reformating * src/main/pa_request.C: - little code reformating - comment changed 2007-10-16 misha * tests/: 035.html, results/035.processed: - tests table::create[]{}[options] added * src/classes/table.C: - table::create[]{} now accept 3rd param: options (only $.seperator[] yet) 2007-10-10 misha * src/classes/table.C: - some contstants moved to pa_common.h - some code changes 2007-10-02 misha * src/main/pa_uue.C: - memory usage during uuencode reduced more then three time as much. but base64 encoding method still use less memory anyway. 2007-09-17 misha * operators.ru.txt, operators.txt: - added info about $cookie:fields * src/types/pa_vcookie.C: - $cookie:fields available now * src/classes/hash.C: - some stuff for use with .for_each moved to common * src/include/pa_common.h: - some stuff for use with .for_each moved here * src/types/: pa_venv.C, pa_venv.h: - some strings moved to #define 2007-09-14 misha * buildall-with-xml: - new xml libs again =) 2007-08-28 misha * operators.ru.txt, operators.txt: - texts about ^table.columns[[column name]] and ^string.split[...][v][column name] were added * tests/: 168.html, 169.html, results/168.processed, results/169.processed: - tests for ^table.columns[[column name]] and ^string.split[...][v][column name] were added * src/classes/table.C: - new option ^table.columns[[column name]] was added * src/classes/string.C: - new option ^string.split[...;v;[column name]] * src/include/pa_exception.h: - error text message for ^hash._keys[], ^table.columns[] and ^string.split[] 2007-08-27 misha * src/main/untaint.C: - try to fix coredump on unix if print to body ^taint[sql][something] outside of connect * tests/: 167.html, results/167.processed: - test for ^taint[sql] outside of connect * buildall-with-xml, buildall-without-xml: - strip parser3 was added (commented by default) 2007-08-20 misha * operators.ru.txt, operators.txt: - comment about new method ^node.hasAttributes[] was added * src/classes/: file.C, math.C, op.C, string.C, xdoc.C: - more duplicated exception text strings were removed * src/include/pa_exception.h: - more exception text strings moved here * src/classes/table.C: - some duplicate exceptions' text strings removed * src/classes/: file.C, hashfile.C, image.C, op.C, string.C, xdoc.C, xnode.C: - some duplicate exceptions' text strings removed * src/include/pa_exception.h: - some exception text strings movet to pa_exception * tests/: 149.html, results/149.processed: - test for ^xnode.hasAttributes[] was added - some code changes * src/classes/xnode.C: - DOM2 method ^xnode.hasAttributes[] was added 2007-08-17 misha * tests/: results/006.processed, results/059.processed, 006.html, 059.html: - more tests for match * tests/: 129.html, results/129.processed: - tests for ^table.hash[...][$.type[string|hash|table]] added * src/targets/cgi/parser3.C: - little syntax changes * src/: classes/math.C, targets/isapi/parser3isapi.C: - little syntax changes * src/targets/cgi/parser3.C, operators.ru.txt, operators.txt: - annoying 'SIGPIPE' messages in parser3.log switched off by default. If someone really still need it: use $SIGPIPE(1) 2007-08-08 misha * buildall-with-xml, buildall-without-xml: - remove libs source files by default since now 2007-08-07 misha * buildall-without-xml: - some option syntax changes * buildall-with-xml: - compile libxml2 without http support - some option syntax changes * src/main/pa_xml_io.C: - will use parser file loader for xml needs 2007-08-06 misha * buildall-with-xml: - moved to libxml2-2.6.29 and libxslt-1.1.21 * tests/: 160.html, results/160.processed: - cache test was rewrited 2007-07-06 misha * tests/: 153.html, results/153.processed: - added test for ^math:sha1[string] * src/types/pa_vform.C: - bugfix: uploaded file name wasn't transcoded * src/classes/math.C: - ^math:long2ip(long) and ^math:sha1[string] were added 2007-06-28 misha * etc/parser3.charsets/windows-1251.cfg: - removed duplicated and some incorrect chars 2007-06-19 misha * src/include/pa_hash.h: - methods generic_hash_code & hash_code were moved on top because of gcc 4 had a problems during building. 2007-06-18 misha * tests/results/019.processed: - new image commited 2007-06-09 misha * src/classes/: op.C, table.C: - in while and table.select method as_expression used now * src/types/pa_vmethod_frame.h: - method as_expression was added 2007-06-08 misha * tests/: 166.html, results/166.processed: - test for ^match[...][n] * tests/: 165.html, results/165.processed: - tests for loops * src/lib/cord/include/private/cord_pos.h: - back to origin value because of no speed/memory optimisation but some proglems with long cycles occure 2007-06-06 misha * src/classes/: op.C, table.C: - ^while(true){}, ^while(1){}, ^table.select(true) and ^table.select(1) didn't works because of awaiting junction-param only. fixed. 2007-05-24 misha * src/: include/pa_os.h, main/pa_os.C: - 20 attempt to get lock with 0.5 secs interval * src/classes/op.C: - cache was rewrited. I hope it works with locking system now on unix * src/main/pa_os.C: - locks engines were rewrited: now we don't use system locks which wait till other threads release it but try get lock, if fail wait 1 sec and make 10 attempts. * src/include/pa_os.h: - consts for blocking locks + some comments were added * src/lib/sdbm/apr_file_io.C: - wait till lock released while opening files * src/classes/table.C: - changes in includes. if unclude after our classes on unix it can't be build * src/types/pa_vhashfile.C: - not needed code removed 2007-05-23 misha * src/: classes/file.C, classes/op.C, main/pa_common.C, include/pa_common.h: - cosmetic changes 2007-05-18 misha * src/lib/cord/include/private/cord_pos.h: - rebalance tree not so often. it's give some speed increasing * tests/results/160.processed: - returned time corrected * tests/160.html: - time increased because on unix 1 mean nothing :( * operators.ru.txt, operators.txt: - added info about ^hash.contain[key] * src/classes/hash.C: - added ^hash.contain[key] * src/include/pa_hash.h: - added method for checking key exists in hash 2007-05-07 misha * src/include/pa_string.h: - was compilation error during build on freebsd4 2007-05-03 misha * src/classes/table.C: - option $.type[hash|string|table] was added for ^table.hash[] * src/classes/file.C: - comment removed 2007-04-26 misha * src/types/: pa_vhashfile.C, pa_vhashfile.h: - while ::open the real files doesn't opened in place anymore 2007-04-24 misha * src/classes/math.C: - I thought one more time and remove lg(N) :) * src/include/pa_exception.h: "static" removed 2007-04-23 misha * src/classes/math.C: ^math:lg(N) => ^math:log10(N) * src/classes/math.C: added: - ^math:ln(N) (the same as ^math:log(N)) - ^math:lg(N) * tests/: 097.html, results/097.processed: - charsets converstion during ^file::load[text;http://...] added * tests/: 164.html, results/164.processed: - check for set expires as a date * tests/: 164.html, results/164.processed: - test for hashfile * src/classes/hashfile.C: - little comment changes * src/types/pa_vhashfile.C: - don't open hashfile files until 1st access * src/: classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_request.h, main/execute.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_exec.C, main/pa_http.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_table.C, types/pa_value.C, types/pa_value.h, types/pa_vclass.C, types/pa_vconsole.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vmail.C, types/pa_vmethod_frame.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vtable.C, types/pa_vxdoc.h, types/pa_wcontext.C: - "parser.runtime" strings were removed * src/classes/hashfile.C: - with .clear[] called files_delete() now. * src/types/: pa_vhashfile.C, pa_vhashfile.h: - .clear() removed. * src/include/pa_exception.h: - string constant with "parser.runtime" text was added 2007-04-20 misha * operators.ru.txt, operators.txt: - some comments changing * operators.ru.txt, operators.txt: - added info about .^hashfile.release[], ^hashfile.clenaup[] and new ^string.match[][>N-option<] * configure: =cheching for unsetenv * src/classes/hashfile.C: - ^hashfile.cleanup[], ^hashfile.release[] were added * src/: main/pa_string.C, include/pa_string.h, classes/string.C: - ^string.match[][] understand new option now: return number of matches but not table wit results * src/types/: pa_vhashfile.C, pa_vhashfile.h: - hashfile can auto reopen now * src/classes/op.C: - bug. must be false * configure.in: - checking for unsetenv was added * src/types/pa_vform.C: - some comments 2007-04-18 misha * buildall-with-xml: moving to libxml2-2.6.28 * buildall-with-xml, buildall-without-xml: added commented lines with --disable-safe-mode option * operators.ru.txt, operators.txt: - info about $form:files 2007-04-17 misha * src/types/: pa_vform.C, pa_vform.h: - some code was modified - $form:files was added * tests/: 163.html, results/163.processed: removing auto format * src/types/pa_vdate.h: - start adding unsetenv("TZ"); 2007-04-16 misha * tests/: 163.html, results/163.processed: - test for .int[], floor, round, ceiling and .format[] * src/classes/file.C: - little optimization for getting args in exec/cgi 2007-04-13 misha * src/classes/file.C: - arguments for file::exec/cgi can be specified now as s table with one column 2007-03-27 misha * tests/: 162.html, results/162.processed: - test for ^table.select(^condition[$t]) * tests/results/auto.p: - load windows-1251 charset for some tests * tests/run_parser.sh: PARSER_CONFIG -> CGI_PARSER_CONFIG * tests/: results/161.processed, 161.html, 161_utf8.txt, 161_windows1251.txt: - added test for ^file::load[text;/local/file.txt;$.charset[...]] * tests/: results/013.processed, 013.html: - added test for checking $._default value while hash modifications * tests/: 160.html, results/160.processed: - add test for ^cache[key](secs){code}, ^cache[] and ^cache(0) 2007-03-22 misha * src/include/pa_common.h: - "charset" string defined for ^file::load[text;/local.txt] and ^table::load[/table.txt] * src/main/: pa_common.C, pa_http.C: - $.charset option for ^file::load[text;/local.txt] and ^table::load[/table.txt] was added - not needed transcodes were removed from ^file::load[...;http://...] * src/types/pa_vdate.h: - date.week was fixed - date.weekyear was added * src/classes/date.C: - date.week was fixed * operators.ru.txt, operators.txt: - added info about date.weekyear * tests/: 159.html, results/159.processed: - tests for date.week and date.weekyear added 2007-03-15 misha * src/classes/table.C: - enclose column numbers for nameless tables as well 2007-03-14 misha * src/targets/cgi/parser3.C: - bugxif. failed when request cgi * src/classes/table.C: - table.save optimization: now required much less memory 2007-03-13 misha * tests/results/: 158.processed, 158.processes: - tests for table.save/table.load * tests/: 158.html, results/158.processes: - tests for table.save/table.load * buildall-with-xml: libxml2: --without-ftp --without-docbook * buildall-with-xml: - pattern needed now for building * tests/results/097.processed: - added test results for xdoc::load & xdoc::load[http://...] * tests/097.html: - added test for xdoc::load 2007-03-12 misha * tests/: 107.html, results/107.processed: - added test for xpath '//man' 2007-03-01 misha * tests/: 097.html, results/097.processed: - added test for creating xdoc from file * tests/: results/157.processed, 157.html: - added test for file:move 2007-02-28 misha * src/classes/xdoc.C: - another attempt * src/classes/xdoc.C: - roll back last changes for a while * src/classes/xdoc.C, operators.ru.txt, operators.txt: - ^xdoc::create[$file] added. * src/classes/file.C: - under lock we create non-exist dir anyway * tests/results/099.processed: - ever send content-disposition to client with file * tests/157.html: + test for file:copy 2007-02-26 misha * src/classes/file.C: - some similar strings moved to #define instead of to be copy/pasted many times * src/types/pa_vfile.h: - class name string ("file") moved to #define 2007-02-20 misha * configure.in: - added some strings for sqlite detection 2007-02-19 misha * operators.ru.txt, operators.txt: - some comments changes * buildall-with-xml, buildall-without-xml: - some modifications 2007-02-17 misha * buildall-with-xml, buildall-without-xml: - moving to gc6.8 * src/main/pa_request.C: - damn, i forgot to commit it while I change console behaviour 2007-02-12 misha * src/targets/cgi/parser3.C: - don't print headers if $console:line[data] was used during cgi execution. * src/types/pa_vconsole.h: - console class have bool flag now which marked as 'true' if class was used. * tests/: 152.html, results/152.processed: - more types was added to test 152 * src/types/: pa_vimage.C, pa_vimage.h: - fixed bug added while adding 'bool' (^if($image){} caused exception) 2007-02-09 misha * tests/: 152.html, results/152.processed: - test alightly updated * tests/: 152.html, results/152.processed: - test rewrited * src/types/: pa_vxdoc.C, pa_vxdoc.h, pa_vxnode.C, pa_vxnode.h: - bugfix. I broke xdoc & xnode in expression 2007-02-08 misha * tests/: 152.html, results/152.processed: - add test for checking 'def' for void, string, bool, int & double 2007-02-07 misha * operators.ru.txt, operators.txt: - ^file:base64[filespec] was added * tests/results/153.processed: - result test for ^file:base64[filespec] was updated * tests/153.html: - test for ^file:base64[filespec] was added * src/types/pa_vconsole.h: - little optimization * src/classes/file.C: - ^file:base64[filespec] * src/main/pa_common.C: - definitions for ^file:base64[filespec] * src/include/pa_common.h: - declarations for ^file:base64[filespec] * src/types/pa_vcookie.C: - little optimization 2007-02-06 misha * src/main/: utf8-to-lower.inc, utf8-to-upper.inc: - some chars were temporary commented * src/types/pa_vbool.h: - bugfix * tests/156.html: - added test for bool cookie * src/types/pa_vcookie.h: - not needed string "cookie" removed * tests/: 155.html, results/155.processed: - added test for check $.encloser[] option for table save/load * tests/: 153.html, 154.html, todo.txt: - two more tests added 2007-02-05 misha * tests/results/152.processed: - newline at the end was missed * tests/results/141.processed: - math:md5 must be lowercased * src/targets/cgi/parser3.C: - 2007 in help ;) 2007-02-03 misha * tests/results/: 150.processed, 151.processed, 152.processed: - test for bool added and some content length fixes * tests/152.html: - test for bool added * buildall-with-xml: - moved to libxml2-2.6.27 and libxslt-1.1.20 * operators.ru.txt, operators.txt: - info bool class was added * src/: classes/Makefile.am, classes/bool.C, classes/classes.vcproj, classes/double.C, classes/int.C, classes/string.C, classes/void.C, classes/xnode.C, include/pa_string.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.C, types/pa_vjunction.h, types/pa_vproperty.C, types/pa_vproperty.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.h, types/types.vcproj: - bool class was added * src/main/pa_request.C: - fix 2007-01-18 misha * src/: main/pa_string.C, classes/string.C: - return table during ^string.match[][] even if no matched found. 2006-12-20 misha * src/types/: pa_method.h, pa_vfile.h: - some syntax changes [ http://www.parser.ru/forum/?id=55598 ] 2006-12-19 misha * src/types/pa_vxdoc.C: - $xDoc is "xnode" == true now. more details: http://www.parser.ru/forum/?id=52359 * src/main/pa_request.C: - always set content-disposition for $response:body[hash here]. more details: http://www.parser.ru/forum/?id=52130 2006-12-07 misha * operators.ru.txt, operators.txt: - added info about bool params in cookie set * src/types/pa_vcookie.C: - bool param in cookies available now $cookie:name[ $.value[123] $.secure(true) $.httponly(true) ] * src/types/: pa_value.C, pa_value.h, pa_vbool.h: - is_bool method was added 2006-12-02 misha * src/classes/file.C: - file_block_read used instead of native read * src/main/pa_common.C: - added file_block_read with read error detection - file_block_read used instead of native read * src/include/pa_common.h: - added file_block_read declaration 2006-12-01 misha * operators.ru.txt, operators.txt: - info about $var.CLASS_NAME was added * src/types/: pa_vstateless_class.C, pa_vstateless_class.h: - $var.CLASS_NAME added * operators.ru.txt, operators.txt: - added info about ^file:copy[] * src/classes/file.C: - ^file:copy[from;fo] was added 2006-11-20 misha * src/classes/date.C: - bug fix :) 2006-11-17 misha * src/include/pa_common.h: - array in crc32 calculation was changed to static * src/main/pa_common.C: - little optimization in getMonthDays - small changes in crc32 calculation * src/classes/date.C: - not needed code was removed 2006-11-16 misha * src/types/pa_vmail.C: - fix missed brakes * src/types/pa_vmail.C: - mail:send now set content-type: multipart/related instead of multipart/mixed if file have $.content-id[] 2006-11-15 misha * src/types/pa_vdouble.h: abs -> fabs 2006-11-14 misha * operators.ru.txt, operators.txt: - added info about ^file.md5[] and ^file:md5[file-name] * src/classes/file.C: - ^file.md5[] and ^file:md5[file-name] were added * src/main/pa_common.C: - CRC32_MAX_BUFFER_SIZE was renamed to FILE_BUFFER_SIZE * src/classes/math.C: - hex_string was moved to pa_common.h * src/include/pa_common.h: - hex_string was moved from math.C - CRC32_MAX_BUFFER_SIZE was renamed to FILE_BUFFER_SIZE * src/types/pa_vdouble.h: - incorrect frac detection with negative values was fixed 2006-11-13 misha * operators.ru.txt, operators.txt: - added info about ^math:crc32[string], ^file:crc32[file-name] & ^file.crc32[] * src/classes/math.C: - added ^math:crc32[string] * src/classes/file.C: - some comments were changed - added ^file:crc32[file-name] and ^file.crc32[] * src/: include/pa_common.h, main/pa_common.C: - some functions for crc32 calculation added 2006-11-03 misha * src/include/pa_array.h: - not needed variable removed * tests/: 150.html, 151.html, results/150.processed, results/151.processed: - 2 tests were added * src/include/: pa_array.h, pa_table.h: - table.locate & table.join with $.reverse(1) were fixed * src/main/pa_http.C: - bug fix. now tainted data from $.form and query converted to $.charset during ^file::load[http://...] 2006-11-02 misha * src/include/pa_table.h: ups. forget '=' char * src/include/pa_table.h: - one more fix in .locate[...][$.reverse(1)] 2006-11-01 misha * src/classes/math.C: - bug fix, details: http://www.parser.ru/forum/?id=53360 * src/include/pa_table.h: - bug fix during ^table.locate( condition false for all records )[$.reverse(1)] * src/main/pa_http.C: - second param for this mid method is length but not end_index so this method has error and can't detect charsets in next content-types: Content-type: text/html; charset="windows-1251" Content-type: text/html; charset="windows-1251"; Content-type: text/html; charset=windows-1251; only Content-type: text/html; charset=windows-1251 was fine 2006-10-31 misha * src/classes/file.C: - empty args in file::exec removed now 2006-09-03 paf * src/classes/file.C: proper tainting of ^file::exec/cgi[script;env;COMMAND;LINE;PARAMS] 2006-06-09 paf * src/lib/pcre/pcre-2_08.tar.gz: one can easily find those * src/classes/table.C: formatting * src/classes/table.C: incorporated patch from misha: Sent: Thursday, June 08, 2006 12:38 PM Subject: parser3: patch for ignoring string options for ^table.save[] * src/classes/hash.C: incorporated patch from misha Sent: Wednesday, June 07, 2006 9:52 PM Subject: parser3: patch for $hash._default disappear while * operators.ru.txt, operators.txt: ^mail:send[ $.file1[ $.value[file] $.format[!uue|!base64] << new base64 option. default uue ] ] * src/types/pa_vmail.C: misha: Sent: Wednesday, June 07, 2006 8:51 PM Subject: patch for base64 in ^mail:send[] %-) 2006-04-09 paf * src/main/compile.tab.C: ` change compiled * gnu.vcproj, operators.ru.txt, operators.txt, parser3.sln, src/classes/classes.vcproj, src/classes/file.C, src/classes/hash.C, src/classes/hashfile.C, src/classes/image.C, src/classes/op.C, src/classes/table.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_array.h, src/include/pa_config_fixed.h, src/include/pa_dir.h, src/include/pa_memory.h, src/include/pa_request.h, src/include/pa_stack.h, src/lib/cord/cord.vcproj, src/lib/gd/gd.vcproj, src/lib/ltdl/ltdl.vcproj, src/lib/md5/md5.vcproj, src/lib/pcre/pcre.vcproj, src/lib/pcre/pcre_dftables.vcproj, src/lib/pcre/pcre_parser_ctype.vcproj, src/lib/sdbm/sdbm.vcproj, src/lib/smtp/smtp.h, src/lib/smtp/smtp.vcproj, src/main/compile.y, src/main/execute.C, src/main/main.vcproj, src/main/pa_cache_managers.C, src/main/pa_charset.C, src/main/pa_exec.C, src/main/pa_http.C, src/main/pa_request.C, src/main/pa_socks.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_stylesheet_connection.C, src/main/pa_stylesheet_manager.C, src/targets/cgi/getopt.c, src/targets/cgi/parser3.C, src/targets/cgi/parser3.vcproj, src/targets/isapi/pa_threads.C, src/targets/isapi/parser3isapi.C, src/targets/isapi/parser3isapi.vcproj, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vcookie.C, src/types/pa_vhashfile.C, src/types/pa_vhashfile.h, src/types/pa_vmail.C, src/types/pa_vresponse.C, src/types/pa_vstatus.C, src/types/types.vcproj, tests/descript.ion: + ^break[] ^continue[], in ^for, ^while, ^menu, ^hash/hashfile.foreach * gnu.vcproj, parser3.sln, src/classes/classes.vcproj, src/classes/file.C, src/classes/hash.C, src/classes/image.C, src/classes/op.C, src/classes/table.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_array.h, src/include/pa_config_fixed.h, src/include/pa_dir.h, src/include/pa_memory.h, src/include/pa_request.h, src/include/pa_stack.h, src/lib/cord/cord.vcproj, src/lib/gd/gd.vcproj, src/lib/ltdl/ltdl.vcproj, src/lib/md5/md5.vcproj, src/lib/pcre/pcre.vcproj, src/lib/pcre/pcre_dftables.vcproj, src/lib/pcre/pcre_parser_ctype.vcproj, src/lib/sdbm/sdbm.vcproj, src/lib/smtp/smtp.h, src/lib/smtp/smtp.vcproj, src/main/compile.y, src/main/execute.C, src/main/main.vcproj, src/main/pa_cache_managers.C, src/main/pa_charset.C, src/main/pa_exec.C, src/main/pa_http.C, src/main/pa_request.C, src/main/pa_socks.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_stylesheet_connection.C, src/main/pa_stylesheet_manager.C, src/targets/cgi/getopt.c, src/targets/cgi/parser3.C, src/targets/cgi/parser3.vcproj, src/targets/isapi/pa_threads.C, src/targets/isapi/parser3isapi.C, src/targets/isapi/parser3isapi.vcproj, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vcookie.C, src/types/pa_vmail.C, src/types/pa_vresponse.C, src/types/pa_vstatus.C, src/types/types.vcproj, tests/descript.ion: ! switched to VS2005 (projects and object.for_each(, info)) + $response:field[] setting void means removing + grammar $name` name stops now, for mysql `$field` + started ^break[] ^continue[], in ^for. TODO: to other iterators (while, menu, foreach) + all log messages += [uri=, method=, cl=] * buildall-with-xml: merged . ftp paths update * buildall-with-xml: . ftp paths update 2006-03-04 paf * src/main/: pa_string.C: merged from HEAD ! cache file curruption checks++ [thanks to Igor Zinkovsky for detailed report] * src/main/pa_string.C: ! cache file curruption checks++ [thanks to Igor Zinkovsky for detailed report] 2006-03-01 paf * src/main/untaint.C: merged from HEAD ! mail:send << changed \r or \n to ' ' in 2006-02-18 paf * src/main/untaint.C: merged from HEAD ! mail:send << changed \r or \n to ' ' in * src/main/untaint.C: ! mail:send << changed \r or \n to ' ' in 2006-02-03 paf * src/main/pa_common.C: merged from HEAD ! bugfix: decoding from base64 * src/main/pa_common.C: ! bugfix: decoding from base64 2006-01-20 paf * src/types/pa_vhashfile.C: . merged hashfile.foreach memory economy fix * src/classes/: table.C: merged from HEAD ! bugfix ^table.save[$.encloser-s now handled properly * src/classes/table.C: ! bugfix ^table.save[$.encloser-s now handled properly 2006-01-19 paf * buildall-with-xml, buildall-without-xml: merged from HEAD ! libgc:USE_MUNMAP activates merging of free memory blocks which helps a lot in our case: after transform we want CORD(main.result)->cstr[big malloc]->transcode[big malloc] * src/types/pa_vhashfile.C: . merged hashfile.foreach memory economy fix * buildall-with-xml, buildall-without-xml: ! libgc:USE_MUNMAP activates merging of free memory blocks which helps a lot in our case: after transform we want CORD(main.result)->cstr[big malloc]->transcode[big malloc] 2006-01-17 paf * src/types/pa_vhashfile.C: ! hashfile.foreach: counted pairs before reading them. got rid of reallocs = became quicker and less fragmentated 2005-12-29 paf * INSTALL, Makefile.am, buildall-with-xml, buildall-without-xml, configure, configure.in, src/include/pa_version.h, src/lib/ltdl/Makefile.am, src/lib/ltdl/acconfig.h, src/lib/ltdl/acinclude.m4, src/lib/ltdl/config.guess, src/lib/ltdl/config.sub, src/lib/ltdl/configure.in, src/lib/ltdl/install-sh, src/lib/ltdl/ltmain.sh, src/lib/ltdl/missing: . merged from 3.2.1 * Makefile.am, src/lib/ltdl/Makefile.am: . now site.m4 also packaged when 'make dist', so do configure companion files in src/lib/ltdl * src/lib/ltdl/: Makefile.am, acconfig.h, acinclude.m4, config.guess, config.sub, configure.in, install-sh, ltmain.sh, missing: . now config_auto.h is created with configure [were constant] * INSTALL: . references to documentation and some clarification * buildall-with-xml, buildall-without-xml: . farawell doc indication * Makefile.am: . dist+=buildall* 2005-12-28 paf * configure: . 3.2.1 * INSTALL, buildall-with-xml, buildall-without-xml: + started to simplify build process, see INSTALL 2005-12-26 paf * configure: ver * configure.in, src/include/pa_version.h, src/main/compile.tab.C: version 2005-12-21 paf * src/main/: compile.tab.C, main.vcproj: . win32: grammar is now compiled with bison 1.875b, it reports unexpected token names 2005-12-19 paf * src/: main/compile.tab.C, types/pa_vxnode.h: ! bugfix xnode now holds a link to xmlNode to prevent premature gc(xmlNode) * src/classes/classes.vcproj, src/include/pa_config_fixed.h, src/lib/gd/gd.vcproj, src/lib/smtp/smtp.vcproj, src/main/main.vcproj, src/main/pa_globals.C, src/targets/cgi/parser3.vcproj, src/targets/isapi/parser3isapi.vcproj, src/types/types.vcproj, configure, configure.in, src/include/pa_version.h: . killing gdome [what a relief] * tests/: 097.html, 106.html, 108.html, 110.html, 112.html, 113.html, 114.html, 115.html, 116.html, 117.html, Makefile, run_parser.sh, results/001.processed, results/002.processed, results/003.processed, results/004.processed, results/005.processed, results/006.processed, results/008.processed, results/009.processed, results/010.processed, results/011.processed, results/012.processed, results/013.processed, results/014.processed, results/015.processed, results/016.processed, results/017.processed, results/018.processed, results/020.processed, results/021.processed, results/022.processed, results/023.processed, results/024.processed, results/025.processed, results/026.processed, results/027.processed, results/028.processed, results/029.processed, results/030.processed, results/031.processed, results/032.processed, results/033.processed, results/034.processed, results/035.processed, results/036.processed, results/037.processed, results/038.processed, results/039.processed, results/040.processed, results/041.processed, results/042.processed, results/043.processed, results/044.processed, results/045.processed, results/046.processed, results/047.processed, results/048.processed, results/049.processed, results/050.processed, results/051.processed, results/052.processed, results/053.processed, results/054.processed, results/055.processed, results/056.processed, results/057.processed, results/058.processed, results/059.processed, results/060.processed, results/061.processed, results/062.processed, results/063.processed, results/064.processed, results/065.processed, results/066.processed, results/067.processed, results/068.processed, results/069.processed, results/070.processed, results/071.processed, results/072.processed, results/073.processed, results/074.processed, results/075.processed, results/076.processed, results/077.processed, results/078.processed, results/079.processed, results/080.processed, results/081.processed, results/082.processed, results/083.processed, results/084.processed, results/085.processed, results/086.processed, results/087.processed, results/088.processed, results/089.processed, results/090.processed, results/091.processed, results/092.processed, results/093.processed, results/094.processed, results/095.processed, results/096.processed, results/097.processed, results/099.processed, results/100.processed, results/101.processed, results/102.processed, results/104.processed, results/105.processed, results/106.processed, results/107.processed, results/108.processed, results/109.processed, results/110.processed, results/111.processed, results/112.processed, results/113.processed, results/114.processed, results/115.processed, results/117.processed, results/119.processed, results/120.processed, results/121.processed, results/122.processed, results/123.processed, results/124.processed, results/125.processed, results/126.processed, results/127.processed, results/128.processed, results/129.processed, results/130.processed, results/131.processed, results/132.processed, results/133.processed, results/134.processed, results/135.processed, results/136.processed, results/138.processed, results/139.processed, results/140.processed, results/141.processed, results/142.processed, results/143.processed, results/144.processed, results/145.processed, results/146.processed, results/147.processed, results/148.processed, results/149.processed, results/auto.p: . now works if we turn off default auto.p * configure: . makes * src/types/pa_vxnode.C: . less warnings * src/types/pa_vxnode.C, tests/142.html, tests/144.html, tests/145.html, tests/149.html, tests/descript.ion, tests/outputs/d.cmd, tests/results/142.processed, tests/results/143.processed, tests/results/144.processed, tests/results/145.processed, tests/results/146.processed, tests/results/147.processed, tests/results/148.processed, tests/results/149.processed: . removed .nodeValue from all node types other than 5 (grabbed piece from gdome) * tests/: 137.html, results/137.processed: . not handled this case yet. code does not hang from inserting parent into child, considering thing minor issue -- nodes are removed from source anyway, don't know why shold that be an error after all * src/targets/cgi/parser3.C: . style * src/classes/xnode.C: . "xml.dom" . xnode.select* now works on xdoc too [were barking "not element"] 2005-12-16 paf * tests/: 146.html, 147.html, 148.html: . more tests * src/classes/xnode.C: . also bark on possible errors * src/types/: pa_vxdoc.C, pa_vxnode.C, pa_vxnode.h: + xdoc DOM props * src/: types/pa_value.h, types/pa_vvoid.h, main/compile.tab.C, main/compile.y: merged from HEAD ! fixed overoptimized ^call(false) case. (confused it with ^call[] case) * src/main/: compile.tab.C, compile.y: ! fixed overoptimized ^call(false) case. (confused it with ^call[] case) * tests/: 142.html, 143.html, 144.html, 145.html: . dom [part] * tests/: 006.html, 034.html, 057.html, Makefile, make_tests.cmd, results/001.processed, results/002.processed, results/003.processed, results/004.processed, results/005.processed, results/006.processed, results/008.processed, results/009.processed, results/010.processed, results/011.processed, results/012.processed, results/013.processed, results/014.processed, results/015.processed, results/016.processed, results/017.processed, results/018.processed, results/019.processed, results/020.processed, results/021.processed, results/022.processed, results/023.processed, results/024.processed, results/025.processed, results/026.processed, results/027.processed, results/028.processed, results/029.processed, results/030.processed, results/031.processed, results/032.processed, results/033.processed, results/034.processed, results/035.processed, results/036.processed, results/037.processed, results/038.processed, results/039.processed, results/040.processed, results/041.processed, results/042.processed, results/043.processed, results/044.processed, results/045.processed, results/046.processed, results/047.processed, results/048.processed, results/049.processed, results/050.processed, results/051.processed, results/052.processed, results/053.processed, results/054.processed, results/055.processed, results/056.processed, results/057.processed, results/058.processed, results/059.processed, results/060.processed, results/061.processed, results/062.processed, results/063.processed, results/064.processed, results/065.processed, results/066.processed, results/067.processed, results/068.processed, results/069.processed, results/070.processed, results/071.processed, results/072.processed, results/073.processed, results/074.processed, results/075.processed, results/076.processed, results/077.processed, results/078.processed, results/079.processed, results/080.processed, results/081.processed, results/082.processed, results/083.processed, results/084.processed, results/085.processed, results/086.processed, results/087.processed, results/088.processed, results/089.processed, results/090.processed, results/091.processed, results/092.processed, results/093.processed, results/094.processed, results/095.processed, results/096.processed, results/097.processed, results/099.processed, results/101.processed, results/102.processed, results/104.processed, results/105.processed, results/106.processed, results/107.processed, results/108.processed, results/109.processed, results/110.processed, results/111.processed, results/112.processed, results/113.processed, results/114.processed, results/115.processed, results/116.processed, results/117.processed, results/118.processed, results/119.processed, results/120.processed, results/121.processed, results/122.processed, results/123.processed, results/124.processed, results/125.processed, results/126.processed, results/127.processed, results/128.processed, results/129.processed, results/130.processed, results/131.processed, results/132.processed, results/133.processed, results/134.processed, results/135.processed, results/136.processed, results/137.processed, results/138.processed, results/139.processed, results/140.processed, results/141.processed: . refreshed old tests, made them work without auto.p (in utf8) . things noted: . gif got encoded differently . exif 0000:00:00 decoded now into 0000:00:00 (were some strange year) * INSTALL: . revived linux libgc fix * INSTALL, configure.in, src/lib/Makefile.am: . sweetest part [no glib/gdome in INSTALL and patches] * src/: classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_charset.h, include/pa_config_includes.h, include/pa_globals.h, include/pa_memory.h, include/pa_request.h, include/pa_xml_exception.h, lib/cord/Makefile.am, lib/cord/cord.vcproj, lib/cord/cordbscs.c, lib/cord/cordprnt.c, lib/cord/cordxtra.c, main/compile.tab.C, main/pa_charset.C, main/pa_globals.C, main/pa_memory.C, main/pa_request.C, main/pa_stylesheet_connection.C, main/pa_xml_exception.C, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: . started killing gdome 2005-12-13 paf * src/main/: pa_request.C: merged from HEAD ! when code in @unhandled_exception thrown another exception, print correct origin (earlier code in catch of exception inside of @unhandled_exception grabbed parent_frame(original_exception) origin and printed it, instead of true origin) * src/main/pa_request.C: ! when code in @unhandled_exception thrown another exception, print correct origin (earlier code in catch of exception inside of @unhandled_exception grabbed parent_frame(original_exception) origin and printed it, instead of true origin) 2005-12-09 paf * INSTALL: . updated INSTALL doc to work around linux stack base detection problem, due to change in gc6.4 code * src/main/: pa_string.C: merged from 3.1.5 ! regex tainting were ignored in ^string.matched :( * src/main/pa_string.C: ! regex tainting were ignored in ^string.matched :( * ChangeLog, INSTALL, configure, configure.in, src/classes/date.C, src/include/pa_config_fixed.h, src/include/pa_version.h, src/main/compile.y, src/main/compile_tools.h, src/main/pa_charset.C, src/main/pa_common.C, src/main/pa_globals.C, src/main/pa_string.C, src/targets/cgi/getopt.c, src/targets/isapi/parser3isapi.C, src/types/pa_vmail.C: . merged latest fixes from 3.2.0 2005-12-08 paf * src/types/pa_vmail.C: merged from 3.2.0 ! bcc line longer then 500 chars now handled OK [were wrapped on 500th char according to rfc, but sendmail failed to unwrap it properly] * src/types/pa_vmail.C: ! bcc line longer then 500 chars now handled OK [were wrapped on 500th char according to rfc, but sendmail failed to unwrap it properly] * src/targets/isapi/parser3isapi.C: . less warnings * src/targets/isapi/parser3isapi.C: . undone some strange change since 3.1.5 * src/targets/isapi/parser3isapi.C: . merged from 3.1.5 release link fixes * src/: classes/date.C, include/pa_config_fixed.h, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/pa_charset.C, main/pa_common.C, main/pa_globals.C, main/pa_string.C, targets/cgi/getopt.c: . less warnings * src/include/pa_config_fixed.h: . removed outdated string origins [in current storage scheme there's no place for them. someday we can add third CORD to store origins and special version of parser which stores origins there [separate binary]] 2005-12-07 paf * src/targets/isapi/parser3isapi.C: . now links in release mode * src/include/pa_version.h: makefiles * src/include/pa_version.h: . not beta * configure, configure.in, src/include/pa_version.h: not beta 2005-12-06 paf * src/types/: pa_wcontext.C, pa_wcontext.h: ! after long discussion [some details here http://i2/tasks/edit/?id=4869912143891354460] decided to undo the change ^call[$void] passes void. now it will pass empty string again. * src/main/: compile.tab.C, compile.y: . version readded * src/classes/op.C: . in this version there is no ^switch[$nothing] = ^switch[void] problem 2005-12-01 paf * src/classes/op.C: mreged from HEAD . bugfix ^switch[$void_value] caused ^case[string] to be coerced to double since searching value were not string (it was vvoid) * src/classes/op.C: . bugfix ^switch[$void_value] caused ^case[string] to be coerced to double since searching value were not string (it was vvoid) * INSTALL: . compiled with libxml2 = 2.6.22 libxslt = 1.1.15 glib = 1.2.10 gdome2 = 0.8.1 2005-11-30 paf * src/types/pa_vdate.h: merged from HEAD: ! bugfix: to drop TZ on win32 must putenv("TZ="), on unix works only putenv("TZ") * src/types/pa_vdate.h: ! bugfix: to drop TZ on win32 must putenv("TZ="), on unix works only putenv("TZ") * INSTALL: . xml libs versions updated * src/main/pa_globals.C: //20051130 trying to remove this, author claims that fixed a lot there // 20040920 for now both workarounds needed. wait for new libxml/xsl versions 2005-11-28 paf * src/classes/table.C: merged from HEAD: ! nameless table has columns==0 * src/classes/table.C: ! nameless table has columns==0 * src/main/pa_http.C: merged from HEAD: ! status line check made earlier [was totally wrong] * src/main/pa_http.C: ! status line check made earlier [was totally wrong] 2005-11-25 paf * src/include/pa_array.h: -this reduces speed(table::load) strange. undoing for now... * src/include/pa_version.h: -this reduces speed(table::load), strange. undoing * src/classes/op.C: merged from HEAD + ^while(){}[SEPARATOR] * src/classes/op.C: + ^while(){}[SEPARATOR] * src/include/pa_array.h: + optimistics added: all arrays (table rows) now grow size*=2, like in .NET ArrayList.EnsureCapacity, this speeds things up and saves memory a LOT! (not noticed negative effect on syntetic tests, future will tell...) * src/include/pa_memory.h: . removed GC_DEBUG for debug version, it changed gc_malloc implementation, which obscured profiling * src/classes/table.C: merged from HEAD: + optimized table::load/sql, now row ArrayString-s allocated with columns.count() elements and don't always grow from count=3[realloc,realloc] * src/classes/table.C: + optimized table::load/sql, now row ArrayString-s allocated with columns.count() elements and don't always grow from count=3[realloc,realloc] * src/classes/table.C: merged from HEAD: . ^table.save unused buffer after save * src/classes/table.C: . ^table.save unused buffer after save 2005-11-24 paf * configure.in: . merged glib2-config patch * configure.in: + trying to find glib2-config * src/: classes/file.C, include/pa_common.h, main/execute.C, main/pa_common.C, main/pa_request.C: merged from HEAD: ! changed file/dir_readable to simple file/dir_exist, this would help in situations "class not found because .p file has bad rights" << in that case error would be explicit "access denied to 'this' file" * aclocal.m4, configure, src/include/pa_config_auto.h.in: makefiles * src/: classes/file.C, include/pa_common.h, main/execute.C, main/pa_common.C, main/pa_request.C: ! changed file/dir_readable to simple file/dir_exist, this would help in situations "class not found because .p file has bad rights" << in that case error would be explicit "access denied to 'this' file" * src/: classes/file.C, include/Makefile.am, include/pa_common.h, include/pa_http.h, main/Makefile.am, main/main.vcproj, main/pa_common.C, main/pa_http.C: merged from HEAD: +! ^file::exec/cgi[script;$.charset[changed] $.QUERY_STRING[^untaint[URI]{aaa=$form:text} << now %HH would be encoded in $.charset charset * src/classes/file.C: +! ^file::exec/cgi[script;$.charset[changed] $.QUERY_STRING[^untaint[URI]{aaa=$form:text} << now %HH would be encoded in $.charset charset * src/: include/Makefile.am, include/pa_common.h, include/pa_http.h, main/Makefile.am, main/main.vcproj, main/pa_common.C, main/pa_http.C: . extracted http:// into separate file [preparation for ^file::cgi[script;$.form[$.field1[] 2005-11-22 paf * src/: include/pa_version.h, main/compile.tab.C: makefiles * acinclude.m4, configure.in: . merged underquting fixes * src/include/pa_config_auto.h.in: configure+makes * src/classes/op.C: . overmerged a little * src/main/compile.tab.C: Makefile * src/main/: pa_common.C: . less gcc warnings * src/classes/op.C: merged from HEAD: + $exception.handled[cache] now reports original exception if we have no old cache * src/classes/op.C: + $exception.handled[cache] now reports original exception if we have no old cache * src/: classes/op.C, include/pa_string.h, main/untaint.C: merged from HEAD: + ^taint/untaint[regex] << escapes these: \^$.[]|()?*+{} * src/: classes/op.C, include/pa_string.h, main/untaint.C: + ^taint/untaint[regex] << escapes these: \^$.[]|()?*+{} * src/types/pa_vdate.h: ! date TZ save/restore stored pointer to getenv-ed variable, which does not work both on win32&unix. copied old TZ value now * src/types/pa_vdate.h: merged from 3.1.5: ! date TZ save/restore stored pointer to getenv-ed variable, which does not work both on win32&unix. copied old TZ value now * src/types/pa_vdate.h: ! date TZ save/restore stored pointer to getenv-ed variable, which does not work both on win32&unix. copied old TZ value now * src/types/pa_vresponse.C: merged from HEAD: + $response:headers access to internal hash * src/types/pa_vresponse.C: + $response:headers access to internal hash * src/targets/isapi/parser3isapi.C: merged from HEAD: + GC_large_alloc_warn_suppressed=0 between requests [apache mod_, isapi] this reduces number of "GC Warning: Repeated allocation of very large block" messages to only important onces * src/targets/isapi/parser3isapi.C: + GC_large_alloc_warn_suppressed=0 between requests [apache mod_, isapi] this reduces number of "GC Warning: Repeated allocation of very large block" messages to only important onces * src/classes/string.C: merged from HEAD: + removed limitation on ^string/int/double:sql{}[$.default[({param style})] ] * src/classes/string.C: + removed limitation on ^string/int/double:sql{}[$.default[({param style})] ] * src/main/pa_common.C: merged from HEAD: + removed "use either uri with ?params or $.form option" limitation * src/main/pa_common.C: + removed "use either uri with ?params or $.form option" limitation * src/: classes/file.C, classes/string.C, include/pa_common.h, main/pa_common.C: merged from HEAD: + ^file.base64[] encode + ^file::base64[encoded] decode * src/: classes/file.C, classes/string.C, include/pa_common.h, main/pa_common.C: + ^file.base64[] encode + ^file::base64[encoded] decode * src/classes/: file.C, string.C: + ^string.base64[] encode + ^string:base64[encoded] decode * src/: classes/string.C, include/pa_common.h, main/pa_common.C: + ^string:base64[in] encode + ^string.base64[] decode 2005-11-21 paf * src/classes/file.C: + merged from HEAD: ^file::create[text;file.xml;^untaint[xml]{data}] * src/classes/file.C: + ^file::create[text;file.xml;^untaint[xml]{data}] * src/main/pa_request.C: ! merged: $response:body[file] now differes from :download, it does not return content-disposition at all now [previusely it returned valueless content-disposition] * src/main/pa_request.C: ! $response:body[file] now differes from :download, it does not return content-disposition at all now [previusely it returned valueless content-disposition] * src/main/: compile.tab.C, compile.y: ! overoptimized void literals, reverted to just vvod, recreating empty array with each void_value token. that's absolutely needed, since that array grows * src/: main/compile.tab.C, main/compile.y, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vint.h, types/pa_vmethod_frame.h: + merged: expression literals: true/false. ^format[$.indent(true)] * src/: main/compile.tab.C, main/compile.y, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vint.h, types/pa_vmethod_frame.h: + expression literals: true/false. ^format[$.indent(true)] * src/types/: Makefile.am, pa_venv.C, pa_venv.h, types.vcproj: + merged: $env:PARSER_VERSION reports "3.1.5beta (compiled on i386-pc-win32)" * src/types/: Makefile.am, pa_venv.C, pa_venv.h, types.vcproj: + $env:PARSER_VERSION reports "3.1.5beta (compiled on i386-pc-win32)" 2005-11-18 paf * src/classes/: double.C, int.C: ! ^int/double:sql{select null}[$.default(123)] will now return default value * src/classes/op.C: + merged ^cache[] << returns current cache expiration time * src/classes/op.C: + ^cache[] << returns current cache expiration time * src/classes/table.C: ! merged ^table::create[not'nameless'; failed << Exception.problem_source pointed to local var! * src/classes/table.C: ! ^table::create[not'nameless'; failed << Exception.problem_source pointed to local var! * src/main/pa_common.C: ! merged: file::load[binary;fileOfZeroSize] now loads VFile.ptr!=0, so such files can be saved now * src/main/pa_common.C: ! file::load[binary;fileOfZeroSize] now loads VFile.ptr!=0, so such files can be saved now * src/include/pa_dir.h: ! merged: file:list now sees .xxx files, only . and .. now removed from list [were removed all .*] * src/include/pa_dir.h: ! file:list now sees .xxx files, only . and .. now removed from list [were removed all .*] * src/lib/sdbm/apr_file_io.C: ! merged from 3.1.5: hashfile file open error now checked, were not :( [stole that piece from apache 1.3 sources] * src/lib/sdbm/apr_file_io.C: ! hashfile file open error now checked, were not :( [stole that piece from apache 1.3 sources] * src/main/pa_request.C: ! merged from 3.1.5: ensured proper untainting of @main result if returned by $result or $response:body * src/main/pa_request.C: ! ensured proper untainting of @main result if returned by $result or $response:body * src/main/pa_common.C: ! merged from 3.1.5: fixed file load memory issue: now tries to guess content-length and allocates one big piece if possible [regretfully gc_realloc works as malloc+free, leaving lots of holes behind] * src/: classes/memory.C, main/compile.tab.C, main/pa_common.C: ! fixed file load memory issue: now tries to guess content-length and allocates one big piece if possible [regretfully gc_realloc works as malloc+free, leaving lots of holes behind] 2005-11-16 paf * src/: include/pa_common.h, classes/file.C, classes/table.C, main/compile.tab.C, main/pa_common.C: merged to HEAD: ! table::save with enclosers now doubles them: "->"" ! table::save/load do not remove elements from options hash * src/main/compile.y: ! merged to HEAD: ^if(-f "...") now works [were overoptimized ^if(double_literal), compiler confused OP_VALUE+origin+double with OP_STRINGPOOL+code+OP_writeXX * src/main/: compile.tab.C, compile.y: ! ^if(-f "...") now works [were overoptimized ^if(double_literal), compiler confused OP_VALUE+origin+double with OP_STRINGPOOL+code+OP_writeXX * src/: classes/file.C, classes/table.C, include/pa_common.h, main/pa_common.C: ! table::save with enclosers now doubles them: "->"" ! table::save/load do not remove elements from options hash 2005-11-03 paf * src/main/: Makefile.am, compile.tab.C: removed $< from .y compilation, not all makefiles liked that 2005-08-30 paf * src/classes/op.C: merge . speedup check of [DEFAULT] * src/classes/op.C: . speedup check of [DEFAULT] 2005-08-26 paf * src/: classes/date.C, types/pa_vdate.h: merged + date.week * src/: classes/date.C, types/pa_vdate.h: + date.week * src/classes/table.C: merged ! ^table::create[bad]{xxx} now complains about bad!=nameless * src/classes/table.C: ! ^table::create[bad]{xxx} now complains about bad!=nameless * src/classes/: hash.C, string.C, table.C, void.C: merged ! optional options were allowed to be empty. were checked if(is_string), changed to !defined||is_string to allow void * src/: targets/isapi/parser3isapi.C, classes/hash.C, classes/string.C, classes/table.C, classes/void.C: ! optional options were allowed to be empty. were checked if(is_string), changed to !defined||is_string to allow void * src/types/pa_vmethod_frame.h: merged ! many classes/* used as_junction where they needed as_int/double, so failed with recent "(const) now no junction" optimization * src/classes/: double.C, int.C, math.C, op.C, string.C, table.C: merged ! many classes/* used as_junction where they needed as_int/double, so failed with recent "(const) now no junction" optimization * src/: classes/double.C, classes/int.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, main/compile.tab.C, types/pa_vmethod_frame.h: ! many classes/* used as_junction where they needed as_int/double, so failed with recent "(const) now no junction" optimization 2005-08-24 paf * src/targets/isapi/: parser3isapi.C, parser3isapi.vcproj: ! on windows 2003 DllMain receivese \\?\ prefix to fullspec of .dll, stripped it 2005-08-09 paf * src/types/pa_wcontext.h: ! bugfix in_expression bit field were not cleared * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/memory.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_memory.C, main/pa_os.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_connection.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_property.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.C, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vproperty.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.C, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: 2005 * src/types/: pa_value.h, pa_vdouble.h, pa_vint.h, pa_vmethod_frame.h: merged from HEAD ! simplified (double) speedup consequent checks in vmethod_frame * src/types/pa_wcontext.h: ! bugfix in_expression bit field were not cleared * src/: classes/file.C, main/pa_exec.C: merged +file::cgi/exec now params: 50 max (were 10) * src/: classes/file.C, main/pa_exec.C: + file::cgi/exec now params: 50 max (were 10) * src/types/: pa_value.h, pa_vdouble.h, pa_vint.h, pa_vmethod_frame.h, pa_vvoid.C, pa_vvoid.h, pa_wcontext.C, pa_wcontext.h: + ^call[$void] param inside now is void (were: empty string) ! simplified (double) speedup consequent checks in vmethod_frame * src/types/: pa_vmethod_frame.C, pa_vmethod_frame.h: merged + optimized constants in expressions vstring->vdouble + optimized ^call(vdouble), no junction creation, no calls later 2005-08-08 paf * src/main/: compile.tab.C, compile.y, compile_tools.C, compile_tools.h: merged + optimized constants in expressions vstring->vdouble + optimized ^call(vdouble), no junction creation, no calls later * src/types/pa_vdouble.h: merged . double values without fractional part now default printed as %.0f instead of %g * src/types/pa_vdouble.h: . double values without fractional part now default printed as %.0f instead of %g * src/classes/hashfile.C: . merged ! second hashfile::open would cause an exception * src/classes/hashfile.C: ! second hashfile::open would cause an exception * src/: classes/classes.h, main/execute.C, types/pa_junction.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vjunction.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_object.h, types/pa_vvoid.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: . merged VJunction(new Junction) optimization from 3.1.4 * src/: main/execute.C, types/pa_junction.h, types/pa_vjunction.h, types/pa_vstateless_class.C: + optimized new VJunction(new Junction(params)) to new VJunction(params), thousands of mallocs removed 2005-08-05 paf * src/: include/pa_memory.h, main/compile.tab.C, main/compile.y, types/pa_vdouble.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: + optimized ^call(vdouble), no junction creation, no calls later * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/memory.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_memory.C, main/pa_os.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_connection.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.C, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.C, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: . 2005 ;) * src/: lib/cord/cord.vcproj, lib/gd/gd.vcproj, lib/ltdl/ltdl.vcproj, lib/md5/md5.vcproj, lib/pcre/pcre.vcproj, lib/pcre/pcre_dftables.vcproj, lib/pcre/pcre_parser_ctype.vcproj, lib/sdbm/sdbm.vcproj, lib/smtp/smtp.vcproj, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj: + optimized constants in expressions vstring->vdouble 2005-07-29 paf * src/types/pa_vclass.C: . shaped up error messages a bit * src/types/pa_vclass.C: + property getter can now be overridden * src/: main/execute.C, types/pa_vclass.C, types/pa_vobject.C: ! bug fix: static parent fields were not replaced in case $derived:field[put] + property setter can now be overridden 2005-07-28 paf * configure, configure.in, src/classes/classes.h, src/classes/date.C, src/classes/file.C, src/classes/hash.C, src/classes/hashfile.C, src/classes/image.C, src/classes/op.C, src/classes/table.C, src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h, src/include/pa_hash.h, src/include/pa_version.h, src/main/execute.C, src/types/Makefile.am, src/types/pa_method.h, src/types/pa_value.h, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vconsole.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vhash.h, src/types/pa_vhashfile.h, src/types/pa_vimage.C, src/types/pa_vimage.h, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vproperty.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vvoid.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wwrapper.h: + 3.2.0 beta: merged from dynamic_fields_join * src/: classes/hash.C, classes/hashfile.C, classes/op.C, classes/xnode.C, include/pa_hash.h, main/execute.C, types/pa_method.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_object.h, types/pa_vvoid.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: ! restored put_element('replace' param), and restored its checks in vobject.put_element->static fields | dynamic properties 2005-07-27 paf * src/types/pa_vclass.C: ! changed to GET_ SET_ prefixes. for there is some old code containing @set_name $name * src/types/pa_vobject.h: . fixed warning * configure, configure.in, src/include/pa_version.h, src/types/Makefile.am: 3.2.0beta started * src/: classes/xnode.C, include/pa_hash.h, types/pa_vstateless_class.C: ! new asserts were all false. regretfully reverted them all to checks * src/: classes/classes.h, classes/hash.C, classes/hashfile.C, classes/op.C, main/execute.C, types/pa_method.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_object.h, types/pa_vvoid.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: joined_dynamic_fields: removed unused param from put_method (returned to 3 params) * src/: include/pa_hash.h, types/pa_vclass.C, types/pa_vclass.h: joined_dynamic_fields: dynamic get/set works with overriding props [alpha2] * src/types/pa_vclass.C: joined_dynamic_fields: dynamic get/set works [alfa] * src/: classes/classes.h, classes/hash.C, classes/hashfile.C, classes/op.C, include/pa_hash.h, main/execute.C, types/pa_method.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_object.h, types/pa_vvoid.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: joined_dynamic_fields: just compiled * src/: classes/date.C, classes/file.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/table.C, classes/xdoc.C, classes/xnode.h, main/execute.C, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.h, types/pa_vstateless_class.h: joined_dynamic_fields: started * src/types/pa_vobject.C: . object setters [only started, does not work yet] * src/: include/pa_hash.h, types/pa_vclass.C, types/pa_vobject.C: . object setters [only started, does not work yet] 2005-07-26 paf * src/: include/pa_request.h, main/execute.C: . properties: set works [alpha2]. for classes. todo: for objects * src/: classes/classes.h, include/pa_hash.h, main/execute.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_object.h, types/pa_vvoid.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: . properties: set works [alpha1] 2005-07-25 paf * src/: main/compile.C, types/pa_vclass.C, types/pa_vclass.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: . properties: started, get works [alpha1, other approach] * src/: main/compile.C, types/pa_vclass.C, types/pa_vclass.h: . properties: started, get works [alpha2] * src/types/: pa_vclass.C, pa_vclass.h, pa_vstateless_class.C, pa_vstateless_class.h: . properties: started, get works [alpha] 2005-07-15 paf * src/: classes/classes.h, classes/op.C, main/execute.C, types/pa_junction.h, types/pa_property.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vvoid.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.h, types/pa_wwrapper.h, types/types.vcproj: + started property [getters work but think of changing them too to precaching] 2005-07-08 paf * src/main/pa_request.C: ! bugfix: $response:body[nonfile] caused gpf 2005-06-28 paf * src/: classes/file.C, main/untaint.C: ! string invariant violated in passing empty strings to file::exec/cgi environment 2005-06-06 paf * src/classes/: hash.C, string.C, table.C: ! bugfix ^string:sql ^table:sql ^hash:sql now DO process $.bind option 2005-05-24 paf * src/classes/file.C: ! bugfix ^file::load[mode;name;$.offset $.limit] now work again [support was broken in 3.1.4] * src/: main/pa_string.C, classes/op.C: . steps toward removing ALL_INTERIOR_POINTERS 2005-05-12 paf * configure: 3.1.5beta * src/main/pa_common.C: ! bugfix -- recv()==0 is not an error * src/main/pa_common.C: ! bugfix ^file::load[mode;name;$.offset $.limit] now work again [support was broken in 3.1.4] * src/lib/gd/gif.C: ! fixed image.fill, not it does not depend on line-width [was refusing to fill if line-width >1, thanks to Seras for repro case 2005-04-25 paf * src/types/pa_vdate.h: ! getenv("TZ")==0? TZ environment restored correctly 2005-04-19 paf * src/types/pa_vdate.h: bugfix: initial $date.TZ is 0, that results in VString violating invariant!! * src/types/pa_vdate.h: bugfix: TZ now restored after roll if were getenv("TZ")==null 2005-04-08 paf * src/main/pa_charset.C: bugfix: UTF8->one-byte-per-char-encoding bugfix: when there is no char in charset one byte produces 6 (ÿ <hash now regards _default * src/types/pa_vmethod_frame.h: bugfix: when method junction was created by accessing $name_of_method it acquired bad self=closest methodframe; instead of proper self (current class) * src/types/pa_vhashfile.C: bugfix: reading empty string from hashfile produced bad cord 2004-12-10 paf * src/: lib/smtp/comms.C, main/pa_common.C: DONT_LINGER can cause subsequent failures though defined in .h * src/main/pa_common.C: comment on volatile * src/: include/pa_config_auto.h.in, main/pa_common.C: http: unix: alarm function were not used since the beginning due to stupid error [setsigjmp were not checked in configure.in] * src/main/pa_common.C: http: timeout setsockopt [if possible] on unix too * src/main/pa_common.C: http: exception status of send/recv errors change to most probable http.timeout * src/main/pa_common.C: win32: http connection $.timeout option now works [setsockopt on send/receive] 2004-12-08 paf * src/: classes/mail.C, types/pa_vmail.C: bugfix: mail body now cstr-ed knowing mail charset, and untainting uri lang now knows proper charset 2004-11-24 paf * src/classes/hash.C: hash: adding/cloning adds/clones _default now $hash[ $.a[1] $._default[def] ] #$hash2[^hash::create[$hash]] $hash2[^hash::create[]] ^hash2.add[$hash] $hash2.shit 2004-11-12 paf * src/types/pa_vmail.C: bugfix: mail:send[$.date[]] were ignored [since 3.0.4] 2004-11-09 paf * src/targets/cgi/parser3.C: debug: PA_DEBUG_CGI_ENTRY_EXIT if on, writes basics to c:\parser3.log 2004-10-21 paf * src/classes/xnode.C: bugfix: xnode.getAttribute[NS] now return tainted strings [were returning clean onces] 2004-10-15 paf * src/types/pa_vdouble.h: bugfix: ^for[i](1;1.5){} << did two cycles(i=1; i=2), which was wrong, now does ONE 2004-10-12 paf * etc/parser3.charsets/windows-1251.cfg: euro promille +/- 2004-10-07 paf * src/: include/pa_config_fixed.h, include/pa_config_includes.h, main/pa_globals.C: debugger help: PA_RELEASE_ASSERTS enables release asserts * src/: main/pa_string.C, include/pa_string.h: debugger help: String.dump() to stdout in detailed form [were String.v() in short form] * src/lib/cord/cordbscs.c: debugger help: CORD_dump now dumpts \t\r\n as @#| and truncates long char sequences less 2004-10-06 paf * src/: include/pa_socks.h, main/pa_common.C, main/pa_socks.C: win32 beauty: socket errors properly decoded 2004-10-05 paf * src/: include/pa_request.h, main/pa_request.C: bugfix: request::configure_user/admin done always, even if no file-to-process useful in @unhandled_exception [say, if they would want to mail by SMTP something] * src/main/pa_request.C: bugfix: cookie(and mail:recieved) fills now performed prior to file loading [and @auto executing] thus making $cookie:value available in @auto and in @unhandled_exception when IIS is configured to run interpreter even if no file exist 2004-09-20 paf * src/main/pa_globals.C: libxml has bugs: it calls xmlMallocAtomic somewhere where it should have called xmlMalloc and it calls xmlFree when it should have not called it. inserted two workarounds: xmlMallocAtomic implemented as xmlMalloc, and xmlFree just ignored. put away a testcase, maybe someday libxml author would fix all that. until that day: we have SLOW garbage collecting when many xml objects are alive hint: do ^memory:compact[] before xdoc::create 2004-09-17 paf * src/classes/file.C: bugfix: file::cgi headers were lost [typo error from 3.0.8 version] 2004-09-14 paf * src/types/pa_vhashfile.C: bugfix: hashfile.clear deleted only part bugfix: hashfile.foreach iterated only part if hashfile were modified inside 2004-09-13 paf * src/main/pa_string.C: bugfix: $s[+008] ^eval($s) now parsed OK [were as octal] * src/types/pa_vhashfile.C: beauty: not reproduced $hashfile.key[$novalue] bug [reported by motorin], inserted safety-check * src/types/pa_vhashfile.C: change: empty keys now error in parser [not something obscure from sdbm lib] * src/types/pa_vhashfile.C: bugfix: error numbers now from errno.h = strerror now returnes something and we can properly report that to client * src/lib/sdbm/sdbm_private.h: change: limit on length(key+value) now 8008 bytes, were 1008. perl sdbm compatibility now ruined * src/classes/xdoc.C: change: ^xdoc.string now outputted as-is [tainted as-is] this helps //[space][newline] to remain as-is and not be unnecessary optimized away [ruining javascript] * src/classes/xdoc.C: change: ^xdoc.string now outputted as-is [tainted as-is] * src/classes/mail.C: bugfix: typo error 2004-09-09 paf * src/main/pa_common.C: bugfix: loads headers with both \r\n and \n separators bugfix: loads header with endings \r\n\r\n and \n\n (bloody yandex.server) 2004-09-06 paf * src/main/pa_charset.C: bugfix: two-bytes invalid chars in TranscodeFromUTF8 considered valid. only >2bytes-long now %HH encoded 2004-09-01 paf * src/types/pa_vmail.C: change: multipart/mixed changed to multipart/related outlook express have no problems showing unrelated attachments. todo: someday figure out a way of multipart/mixed multipart/related text/html image/xxx application/octet-stream << true attachments * src/types/pa_vmail.C: new: ^mail:send[$.file[$.content-disposition can be overriden new: empty mail header fields removed from letter * src/: classes/mail.C, include/pa_config_fixed.h, types/pa_value.C, types/pa_value.h, types/pa_vmail.C: new: ^mail:send[ $.file[ $.any[header] 2004-08-30 paf * src/: include/pa_config_fixed.h, main/pa_common.C: beauty: less warnings * src/main/pa_common.C: beauty: do not bother with charset detection when ^file::load[binary 2004-08-27 paf * src/main/pa_common.C: hack: for yandex.server http server 2004-08-18 paf * src/main/pa_request.C: bugfix: Accept-Ranges: bytes when sending possibly-chunked response 2004-08-17 paf * src/classes/file.C: bugfix: $f[^file::load[;http://]] $f.content-type now = that of http response * src/classes/file.C: bugfix: $f[^file::load[;http://]] $f.content-type now = that of http response 2004-07-30 paf * src/: include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: bugfix: win32: system&parser exceptions in release mode reported properly parser exception in exception handler WERE mistakenly reported as system exception, without details [in apache & isapi] +some beauty in exception text * src/: include/pa_exception.h, main/pa_request.C, targets/cgi/parser3.C: bugfix: win32: system&parser exceptions in release mode reported properly parser exception in exception handler WERE mistakenly reported as system exception, without details * src/main/execute.C: beauty: simplified system exception handling 2004-07-29 paf * src/classes/table.C: bugfix: ^table.save[export.csv;$.separator[^;]] now works fine [separator were ignored, and \t used unconditionally] * src/types/Makefile.am: added vhash.c 2004-07-28 paf * src/: classes/date.C, classes/image.C, classes/math.C, lib/ltdl/ltdl.c, lib/pcre/pcre_parser_ctype.c, lib/smtp/comms.C, main/pa_common.C, targets/cgi/parser3.C, types/pa_vform.C, types/pa_vmail.C: bugfix: isspace((unsigned char)c) everywhere. failed on russian letters * src/: main/pa_string.C, types/pa_vmail.C, main/pa_common.C: bugfix: isspace((unsigned char)c) everywhere. failed on russian letters * src/main/pa_exec.C: bugfix: win32: chdir not needed, dir passwed as 'currentDirectory' parameter to CreateProcess 2004-07-27 paf * src/targets/cgi/parser3.vcproj: beauty: win32: globaloptimizations ON, release:mapfile ON todo: copy .mapfile from release somewhere [to help searching for unhandled system exceptions] * src/types/pa_vdate.h: check: for invalid datetime after temporary TZ shift * src/types/pa_vdate.h: bugfix: time checked not only at set_time but also in ctor 2004-07-26 paf * operators.ru.txt, operators.txt, src/include/pa_common.h, src/main/pa_common.C, src/main/pa_request.C, src/types/pa_vfile.h, src/types/pa_vhash.C, src/types/pa_vhash.h, src/types/types.vcproj: new: $response:body/download[ $.file[name on disk] $.name[of file for user] $.mdate[date of last-modified. default from directory] ] * src/classes/file.C: moving file:send somewhere else.. * src/: classes/file.C, include/pa_sapi.h, main/pa_common.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: patched: ^file:send by Victor Fedoseev todo: turn it to $response:download[ $.filename[filename] $.option[] ,, ] * src/classes/file.C: beauty: invalid mode thoroughly reported 2004-07-21 paf * src/types/pa_vmail.C: bugfix: too long header values now splitted to several lines were: header: vaaaaaaaaaaaalue now: header: vaaaaaa aaalue note: ms outlook[!express] shows only first 255 characters of subject 2004-07-15 paf * src/main/pa_os.C: bugfix: locks now compiled in [were mistakenly off] 2004-07-14 paf * src/classes/table.C: bugfix: $.bind values now got untainted according to lang [were: as-is] 2004-07-07 paf * src/classes/op.C: bugfix: cache with 2 params caused assertion, checked that * src/main/pa_exec.C: bufix: on unix AND win32 environment string now untainted according to their languages. were: as-is. EVERYWHERE * src/: classes/file.C, main/pa_exec.C: bufix: on unix AND win32 environment string now untainted according to their languages. were: as-is. EVERYWHERE * src/main/pa_exec.C: bufix: on unix environment string now untainted according to their languages. were: as-is. on win32: ok * parser3.vssscc: ...would not go unnoticed * src/main/pa_charset.C: convinience: transcodeFromUTF8 now never fails. in case on input appears nonutf, those bytes will be printed in %HH form. that can be easily decoded/recovered. this form is quite noticable, and hopefully would not go noticed 2004-07-06 paf * src/main/pa_exec.C: bufix: on unix environment string now untainted according to their languages. were: as-is. on win32: ok 2004-07-01 paf * src/: classes/classes.vcproj, lib/cord/cord.vcproj, lib/gd/gd.vcproj, lib/ltdl/ltdl.vcproj, lib/md5/md5.vcproj, lib/pcre/pcre.vcproj, lib/pcre/pcre_dftables.vcproj, lib/pcre/pcre_parser_ctype.vcproj, lib/smtp/smtp.vcproj, main/main.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: win32: option: global optimization ON * src/main/untaint.C: workaround kinda bug in libxml: life requires to do xdoc::create{invalid chars} standard disables chars less then \x20, except tab, cr, lf. changed tainting so that those become '!' 2004-06-25 paf * src/types/pa_vhashfile.C: bugfix: hashfile deserialize accessed int on odd address [prev bugfix failed due to superwize optimizer, which turned memcpy into same 'ld' asm command] * src/types/pa_vhashfile.C: bugfix: hashfile deserialize accessed int on odd address 2004-06-22 paf * src/sql/pa_sql_driver.h: note: about possible optimization * operators.ru.txt, operators.txt, src/classes/hash.C, src/classes/memory.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/include/pa_config_includes.h: new: ^void:sql{call paf(:a)}[ $.bind[ $.a[2] ] ] output variables work. todo: check in out variables 2004-06-18 paf * src/: classes/file.C, classes/hash.C, classes/string.C, classes/table.C, classes/void.C, include/pa_globals.h, include/pa_sql_connection.h, main/compile.tab.C, sql/pa_sql_driver.h: started: ^void:sql{call paf(:a)}[ $.bind[ $.a[2] ] ] input variables work. todo:output * src/targets/cgi/parser3.C: bugfix: iis specific http://parser3/_bug.html?404;http://hpsv/test/ now $request:uri /_bug.html?404;http://hpsv/test/ -------------------------------------------------------------------------------- $request:query IIS-STATUS=404&IIS-DOCUMENT=http://hpsv/test/ -------------------------------------------------------------------------------- IIS-STATUS="404" IIS-DOCUMENT="http://hpsv/test/" 2004-06-16 paf * src/targets/cgi/parser3.C: new: iis specific http://parser3/_bug.html?404;http://server/_bug.html?f=v now $request:query IIS-STATUS=404&IIS-DOCUMENT=http://server/_bug.html&f=v $form:fields IIS-STATUS="404" IIS-DOCUMENT="http://server/_bug.html" f="v" todo: isapi too 2004-05-26 paf * src/include/pa_version.h: 3.1.3 * operators.ru.txt, operators.txt: beauty: removed outdated level 'table' * etc/parser3.charsets/x-mac-cyrillic.cfg: added: thanks to konst * src/main/pa_string.C: beauty: removed 3 warnings * src/: include/pa_string.h, classes/table.C, main/untaint.C, classes/op.C: beauty: removed outdated level 'table' 2004-05-25 paf * src/lib/sdbm/apr_file_io.C: bugfix: bad seek wrapper implementation. mistery: how anything worked * src/sql/pa_sql_driver.h: beauty: param renamed and comment changed, it is now safe to use url if pointers to it are stored to gc mem * src/: main/pa_exec.C, types/pa_vhashfile.C: bugfix: hashfile unknown errors reported and not cause SIGSEGV now 2004-05-24 paf * src/: include/pa_string.h, lib/cord/cordbscs.c, lib/cord/include/cord.h, lib/cord/cordxtra.c: cancel: more speed, less memory: CORD_chars_block originally intended to ... it was good that CORD_chars_block were not used: it consumes more memory [and, might be slow too] undoing that. [and removed that func so that it would not confuse parser developer in future] * src/: include/pa_string.h, lib/cord/include/cord.h: more speed, less memory: CORD_chars_block originally intended to speedup/reduce mem usage were forgotten, and were used stupid CORD_chars * src/include/pa_config_auto.h.in: bugfix: bigendian check added * src/include/: pa_config_fixed.h, pa_string.h: bugfix: on BIGENDIAN processors space-conserving mech failed, causing SIGSEGV/SIGBUS and SAPI::abort("unknown untaint lang#%d", (1|2|3)); 2004-05-14 paf * src/types/: Makefile.am, pa_vvoid.C, pa_vvoid.h, types.vcproj: bugfix: void now has vfile value, and $response:body[] works OK 2004-05-12 paf * src/types/: pa_vbool.h, pa_vhash.h, pa_vhashfile.h, pa_vtable.h: beauty: ^if(def $bool) now equals ^if($bool) and shaped up other sources to use is_defined() {return as_bool();} along VBool 2004-05-11 paf * src/include/pa_exec.h: bugfix: gpf on file::exec/cgi because of referencing to local objects * src/: classes/mail.C, include/pa_exec.h, main/compile.tab.C, types/pa_vmail.C, types/pa_vmail.h: bugfix: bcc with sendmail now left intact 2004-04-15 paf * src/classes/date.C: merged: beauty: unused var removed * src/classes/date.C: beauty: unused var removed * src/include/: pa_exec.h: bugfix: interface without pointer provoked bug 2004-04-09 paf * src/types/pa_vform.C: merge: bugfix: form:imap were incorrect * src/types/pa_vform.C: bugfix: form:imap were incorrect 2004-04-08 paf * src/classes/date.C: new: ^date::create[y-m-d h-M-s>>.milliseconds<<] now allowed, ignored so far * src/main/pa_xml_io.C: merged: bugfix /etc/xml/catalog * src/main/pa_xml_io.C: bugfix: in safe mode -- disabled attempts to consult default catalog [usually, that file belongs to other user/group] 2004-04-06 paf * src/main/pa_common.C: beauty: gcc warning removed * src/main/: compile.tab.C, compile.y: bugfix: gcc refused to accept that trick, trying other * src/main/: compile.tab.C, compile.y: bugfix: step3 to fix explicit result problem * src/main/: compile.tab.C, compile.y: bugfix: step2 to fix explicit result problem * src/main/: compile.tab.C, compile.y: bugfix: step1 to fix explicit result problem * operators.ru.txt, operators.txt, src/classes/string.C: new: ^string.append[string] * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/execute.C: attempt_check_call_in_explicit_result_mode: failed * src/main/pa_common.C: bugfix: of 1.175 bugfix: http://i.p.a.ddress gethostbyaddr added [on some platforms gethostbyname failed with such 'domains'] now checked properly, were: needless reverse/forward dns lookup * src/main/pa_common.C: bugfix: of 1.175 bugfix: http://i.p.a.ddress gethostbyaddr added [on some platforms gethostbyname failed with such 'domains'] now checked properly, were: needless reverse/forward dns lookup * src/main/: compile.C, compile.tab.C, compile.y: reimplemented: @method[][result] means "no string output here" moved to lexical level [on grammar level it were too difficult] * operators.ru.txt, operators.txt, src/include/pa_string.h, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.h, src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h: new: @method[][result] means "no string output here", implemented part of that idea: compiler throws away string literal generation code. and barks nonwhitespace chars * operators.ru.txt, operators.txt: truth: removed comment about $ORIGIN 2004-04-05 paf * configure.in, src/doc/html2chm.cmd, src/doc/sources2html.cmd, src/include/pa_version.h, src/main/pa_common.C, src/targets/isapi/parser3isapi.C: merged with 3.1.3 * etc/parser3.charsets/x-mac-cyrillic.cfg: added: donated by Konstantin Tomashevitch [mailto:konst@design.ru] * src/doc/html2chm.cmd: beauty: no need in bg here * src/doc/sources2html.cmd: beauty: same window, in bg it interfered with FAR console * configure, configure.in: 3.1.3 * src/targets/isapi/parser3isapi.C: beauty: removed some warnings * src/main/pa_common.C: removed warning * src/include/pa_version.h: 3.1.3 2004-04-02 paf * src/main/pa_string.C: bugfix: $s[009] ^s.int[] now 9, were error * src/targets/cgi/parser3.C: new: CGI_PARSER_LOG env variable allows to specify where to put parser log file 2004-04-01 paf * src/classes/table.C: bugfix: bugfix: table::load last line without tab and enter were ignored * src/: include/pa_cache_managers.h, include/pa_globals.h, include/pa_socks.h, main/pa_cache_managers.C, main/pa_globals.C, main/pa_socks.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.def: bugfix: sql connections now are disconnected 2004-03-30 paf * src/classes/table.C: bugfix: table::load last line without tab and enter were ignored * src/classes/table.C: bufix: if last table lines were commented, gpfed * src/: doc/ClassExample1.dox, doc/ClassExample2.dox, doc/ClassExample3.dox, doc/chmhelper.pl, doc/class.dox, doc/compiler.dox, doc/doxygen.cfg, doc/exception.dox, doc/executor.dox, doc/footer.htm, doc/index.dox, doc/memory.dox, doc/methoded.dox, doc/object.dox, doc/string.dox, doc/targets.dox, doc/value.dox, include/pa_version.h, main/pa_cache_managers.C, main/pa_stylesheet_connection.C, targets/isapi/parser3isapi.vcproj, types/pa_vform.C: merged bugfixes from 3.1.2, changed version to 3.1.3beta 2004-03-29 paf * src/types/pa_vhashfile.C: bugfix: empty key on hashfile.get causes gpf * src/doc/: ClassExample1.dox, ClassExample2.dox, ClassExample3.dox, chmhelper.pl, class.dox, compiler.dox, doxygen.cfg, exception.dox, executor.dox, footer.htm, index.dox, memory.dox, methoded.dox, object.dox, string.dox, targets.dox, value.dox: translated to english 2004-03-25 paf * src/targets/isapi/parser3isapi.vcproj: beauty: one more parser3project dependency removed * src/main/: pa_cache_managers.C, pa_stylesheet_connection.C: bugfix: refused to compile without xml * src/types/pa_vform.C: beauty: removed warning * src/classes/classes.vcproj: merged bugfix: now all compiles in any folder [removed last ;) folder dependency] * src/classes/classes.vcproj: bugfix: now all compiles in any folder [removed last ;) folder dependency] * src/include/pa_version.h: release * src/lib/gd/gif.C: new: ^image.pixel(outof;bounds) now returns -1 * src/classes/table.C: beauty: comment& more meaningful error message * src/classes/hash.C: bugfix: ^hash::sql{one column} now produces $.hash[$.column_value1(true) ... ] [were producing some strang thing] 2004-03-23 paf * src/: classes/image.C, main/pa_common.C: bugfix: ^image.polyline and http status line parsing checked number of columns in table [user reported an assert] * operators.ru.txt, operators.txt: example: on hashfile * src/: classes/op.C, types/pa_value.C, types/pa_wcontext.C: bugfix: junction reattach now actually reattaches a junction to new wcontext [were only assigning it to junction, which caused junction tracking to loose junction, and it's context were not killed, and it tried to process in invalid context, gpf] * src/targets/cgi/parser3.C: debug helper added 2004-03-19 paf * src/types/pa_wcontext.C: beauty: error messages removed duplicate "type(type)" in braces 2004-03-10 paf * operators.ru.txt, operators.txt, src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h: new: refined solution to search-in-namespaces problem: $xdoc.search-namespaces.x[http://pif.design.ru/] $nodes[^xdoc.select[//x:second]] * operators.ru.txt, operators.txt, src/classes/xnode.C: new: xnode.select*[xpath expression][[NAMESPACES HASH]] allows to search for info in namespaces $nodes[^xdoc.select[//x:second][ $.x[http://pif.design.ru/] ]] 2004-03-09 paf * operators.ru.txt, operators.txt, src/main/pa_common.C: new: ^file::load[...][options] $.form[ !$.field1[string] !$.field2[^table::create{one_column_only^#0Avalue1^#0Avalue2}] ] !$.body[string] GET ?here notGET(POST, HEAD, others) in content-type: application/x-www-form-urlencoded todo: upload files ability * src/lib/cord/cordxtra.c: bugfix: CORD_pos were not fixed properly, done 2004-03-05 paf * operators.ru.txt, operators.txt, src/main/pa_common.C: new: file::load[;http:// GET/POST $.form[$.fields started, not tested yet todo:$.field[table] for multiple values * operators.ru.txt, operators.txt: new: http:// options $.user $.password basic authorization * src/main/pa_common.C: beauty: link to rtf added * operators.ru.txt, operators.txt, src/include/pa_common.h, src/main/pa_common.C: new: http:// options $.user $.password basic authorization * src/main/pa_common.C: beauty: removed needless vars * operators.ru.txt, operators.txt: new: pgsql option [like that recently added to oracle driver] ClientCharset=parser-charset << charset in which parser thinks client works * operators.ru.txt, operators.txt: new: odbc option [like that recently added to oracle driver] ClientCharset=parser-charset << charset in which parser thinks client works * src/sql/pa_sql_driver.h: beauty: important warning added * etc/parser3.charsets/koi8-r.cfg: there's special code for grad char! * etc/parser3.charsets/windows-1251.cfg: typo 2004-03-04 paf * src/main/pa_sql_driver_manager.C: speedup: charset lookups cached, sql transcoding now goes faster * operators.ru.txt, operators.txt: new: mysql option [like that recently added to oracle driver] ClientCharset=parser-charset << charset in which parser thinks client works * etc/parser3.charsets/: koi8-r.cfg, windows-1251.cfg: keyboard typo error * etc/parser3.charsets/: koi8-r.cfg, windows-1251.cfg: typograph chars commented 2004-03-03 paf * INSTALL: note: added on libgc on FreeBSD, thanks to Andrey N. Pazychev <135@ugtel.ru> and Goor 2004-03-02 paf * operators.ru.txt, operators.txt: new[update typo]: !^void.left(n) nothing !^void.right(n) nothing !^void.mid(p[;n]) nothing * operators.ru.txt, operators.txt, src/classes/void.C: new: !^void.left(n) nothing !^void.right(n) nothing !^void.pos(p[;n]) nothing * operators.ru.txt, operators.txt, src/classes/file.C, src/include/pa_string.h: new: ^file::sql[[name_to_become_$.name]]{} query result must be one row with columns: first: data second: file name third: content-type * operators.ru.txt, operators.txt, src/classes/file.C: ^file.sql-string[] inside ^connect gets properly escaped string, which can be passed to request now this for mysql only. it's up to parser sql driver to fix zeros properly * INSTALL: note: added on building apache with this option: --enable-shared=max thanks to Victor Fedoseev 2004-03-01 paf * src/targets/isapi/parser3isapi.C: new: apache module & isapi extension memory:compact befor processingrequest * operators.ru.txt, operators.txt, src/classes/hash.C: new: ^hash._keys[>>name<<] to call sole column of result * operators.ru.txt, operators.txt, src/classes/image.C, src/lib/gd/gif.C, src/lib/gd/gif.h: new: ^image.pixel(x;y)[(color)] get/set pixel color * src/: classes/image.C, types/pa_vimage.C, types/pa_vimage.h: beauty: image -- less checks [were ugly impl] * src/classes/string.C: bugfix: ^string.left/right/mid with negative values now considered bad * src/main/pa_common.C: bugfix: INADDR_NONE not everywhere defined * src/: classes/xdoc.C, types/pa_vxdoc.h: bugfix: boolean output options now have unified defaults [after transform indent/omit-xml-declaration/standalone 'default' erroreously meant 'true'] * src/main/pa_common.C: bugfix: http://i.p.a.ddress gethostbyaddr added [on some platforms gethostbyname failed with such 'domains'] * src/include/pa_config_auto.h.in: no select check, no define * src/classes/string.C: feature: ^string.trim both parameters may be empty-strings, meaning kind=both chars=whitespaces * src/lib/smtp/comms.C: bugfix: use SO_LINGER if no SO_DONTLINGER exist * src/classes/string.C: check: trim 'chars' must not be empty, exception if it is * src/classes/string.C: changed: ^string.trim [] << both, whitespaces [start|both|end] << kind, whitespaces [start|both|end;chars] full 2004-02-27 paf * operators.ru.txt, operators.txt, src/classes/string.C, src/main/pa_string.C: new method: ^string.trim[start|both|end[;chars]] default 'chars' -- whitespace chars finished * operators.ru.txt, operators.txt, src/classes/string.C, src/include/pa_string.h, src/main/pa_string.C: new method: ^string.trim[start|both|end[;chars]] default 'chars' -- whitespace chars started, only start works * src/main/compile.C: bugfix: line numbers after ^process{}[$.line(-10]] can be negative, allowed to print they as signed * src/main/untaint.C: speed: there's no \n chars in output [normally], so no need to optimize them they could be retrived from databases, though. but 1. should be replaced 2. if not optimized, no harm done * src/main/pa_exec.C: bugfix: waitpid could be interrupted -- ^file::exec/cgi could return invalid status & zombie child can remain for short period until process exists [very bad in mod_parser3] http://i2/tasks/edit/?id=4629451867179521923 * src/lib/smtp/smtp.h: bugfix: SMTP buffer overflow could allow malicious SMTP server to attack as by returning too long status responses http://i2/tasks/edit/?id=4629448401140924947 2004-02-26 paf * operators.ru.txt, operators.txt: feature: ^process...{CODE}[now has options] which are $.main[to what to rename @main] $.file[file, from which (user says) goes that CODE] $.lineno(line number in that file, where CODE starts. may be negative) * operators.ru.txt, operators.txt, src/classes/op.C, src/include/pa_request.h, src/main/compile.C, src/main/compile_tools.h, src/main/pa_request.C: feature: ^process...{CODE}[now has options] which are $.main[to what to rename @main] $.file[file, from which (user says) goes that CODE] $.lineno(line number in that file, where CODE starts. may be negative) 2004-02-25 paf * etc/parser3.charsets/Makefile.am: bugfix: @sysconfdir@ used [were old @charsetsdir@ recently erased from configure.in] * src/classes/hash.C: feature: ^hash::sql{one colum result} now produces hash of column=>1 * src/lib/smtp/smtp.h: beauty: couple of #ifdef-s to compile even with incomplete errno constants set 2004-02-24 paf * src/lib/smtp/smtp.C: smtp on unix: authors of lib/smtp never read "man select" * src/main/pa_os.C: beauty: <0 better then ==-1 * src/lib/smtp/comms.C: smtp on unix: steps to work on unix * src/lib/smtp/: smtp.C: smtp on unix: steps to work on unix * src/classes/Makefile.am: smtp on unix: steps to work on unix * src/: classes/mail.C, types/pa_vmail.C, types/pa_vmail.h: smtp on unix: steps to work on unix [extracted 'to'] * src/classes/mail.C: smtp on unix: steps to work on unix * src/lib/smtp/smtp.C: smtp on unix: compiled on win32 * src/: lib/smtp/Makefile.am, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, targets/cgi/Makefile.am: started porting smtp to unix [testing on solaris] 2004-02-20 paf * src/classes/xdoc.C: beauty: ugly code removed, thanks to egr for pointing that out * src/classes/xdoc.C: bugfix: * src/classes/xdoc.C: beauty: no submits. parser thought there were nameless empty file and $form:field got value of type 'file' * INSTALL: --without-threads * src/include/pa_sapi.h: 2004 2004-02-11 paf * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/memory.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_memory.h, include/pa_opcode.h, include/pa_operation.h, include/pa_os.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, include/pa_xml_exception.h, include/pa_xml_io.h, lib/gd/gif.C, lib/gd/gif.h, lib/gd/gifio.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/smtp/comms.C, lib/smtp/smtp.C, lib/smtp/smtp.h, main/compile.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_memory.C, main/pa_os.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/pa_xml_exception.C, main/pa_xml_io.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_threads.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: 2004 * src/main/pa_globals.C: beauty: typo caused gc.log warnings with debug version of gc.dll * src/: classes/classes.vcproj, lib/gd/gd.vcproj, lib/pcre/pcre.vcproj, lib/pcre/pcre_dftables.vcproj, lib/pcre/pcre_parser_ctype.vcproj, lib/sdbm/sdbm.vcproj, lib/smtp/smtp.vcproj, main/main.vcproj, main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: migrated to latest libxml[2.6.5] and libgdome[1.1.2] simplified lib build processes * src/: classes/classes.vcproj, lib/gd/gd.vcproj, main/main.vcproj, main/pa_globals.C, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: continued changes to reflect libxml xsl new folders * src/: classes/classes.vcproj, lib/gd/gd.vcproj, lib/smtp/smtp.vcproj, main/main.vcproj, targets/cgi/parser3.vcproj, types/types.vcproj: continued changes to reflect libxml xsl new folders * src/: classes/classes.vcproj, lib/gd/gd.vcproj, lib/smtp/smtp.vcproj, main/main.vcproj, targets/cgi/parser3.vcproj, targets/isapi/parser3isapi.vcproj, types/types.vcproj: started changes to reflect libxml xsl new folders * ChangeLog, parser3.sln, src/classes/classes.vcproj, src/lib/gd/gd.vcproj, src/lib/smtp/smtp.vcproj, src/main/compile.tab.C, src/main/main.vcproj, src/main/pa_globals.C, src/targets/cgi/parser3.vcproj, src/targets/isapi/parser3isapi.vcproj, src/types/types.vcproj: started changes to reflect libxml xsl new folders 2004-02-10 paf * INSTALL: critical: libxslt1.1.2 wanted at least libxml2.6.3 to compile. recommened latest libxml up to date * INSTALL: critical: prior to 1.0.30 had bug: "a segfault on pattern compilation errors", on which spent 4 hours worktime. use versions higher than that. recommended now latest up to date 2004-02-06 paf * src/main/: pa_sql_driver_manager.C, pa_stylesheet_manager.C: beauty: unified destructing style * src/main/untaint.C: beauty: removed old def/ifdef * src/main/untaint.C: beauty: coredump @unknown untaint language now 2004-02-03 paf * src/: classes/image.C, main/pa_exec.C, main/pa_memory.C, targets/isapi/parser3isapi.C, types/pa_value.C, types/pa_vcookie.C: beauty: %u is more simple=proper for size_t then %ld/%lu * src/main/pa_common.C: typo: %l -> %u * src/classes/xdoc.C: bugfix: libxml: FOR UTF-8 TOO russian letters in attributes or documents-results of transform now not xx; * src/classes/xnode.C: memleaks found: not fixed yet. todo * src/main/pa_charset.C: bugfix: forgot to undo some * src/main/pa_charset.C: beauty: uncomment PA_PATCHED_LIBXML_BACKWARD to link with old patched libxml libraries 2004-02-02 paf * src/types/pa_vcookie.C: bugfix: erasing cookie: params now output $cookie:example[ $.value[value] $.path[/there/] ] $cookie:example[ $.value[] $.expires[session] $.path[/there/] $.domain[test.com] ] * src/types/pa_vform.C: bugfix: empty values with enctype=multipart/form-data now produce entries in $form:tables
$k[^form:fields._keys[]] ^eval($k)
$request:body

2004-01-30  paf

	* src/classes/xdoc.C: bugfix: libxml: russian letters in attributes
	  or documents-results of transform now not xx;

	* src/classes/date.C: bugfix: ^date::create[invalid fields now
	  produce exception.

	* src/: classes/date.C, include/pa_string.h, main/pa_string.C:
	  bugfix: ^date::create[invalid fields now produce exception.

	* ChangeLog, src/classes/date.C: bugfix: ^date::create[invalid
	  year] now produces exception. todo: check other fields

2004-01-29  paf

	* src/include/pa_memory.h: typo error

	* src/include/pa_memory.h: bugfix: [potential] strdup copied one
	  more byte then specified, then zeroed it << useless and
	  potentially harmful(could gpf)

2004-01-22  paf

	* src/classes/xdoc.C: bugfix: when stylesheet contains error, gpf

	* src/main/untaint.C: merged: bugfix from 3.1.1 on whitespace
	  optimization

	* src/main/untaint.C: bugfix: whitespace now optimized properly
	  [were bug: ^taint[1 & 2]="1 &2"

	* src/main/pa_globals.C: beauty: bigger buffer for xml-related
	  errors

	* src/main/pa_common.C: merged: bugfix from 3.1.1 on memory
	  overflow

	* src/main/pa_common.C: bugfix: buffer overflow * in libxml&xsl
	  error-reporting code * in parser-error reporting code [when no
	  @unhandled_exception defined]

	  fixed in one place: my *snprintf override

2004-01-13  paf

	* operators.ru.txt, operators.txt: typo erro

2003-12-25  paf

	* src/main/pa_common.C: bugfix: ^file::load[binary;http:// now not
	  garbled  [pieces after zero bytes were removed]

2003-12-22  paf

	* src/include/Makefile.am: bugfix: removed from dist:
	  src/include/pa_config_auto.h which were configured for
	  make-dist-platform and badly updated proper config file in target
	  [when .tar used for updating existing source tree]

	* ChangeLog, operators.ru.txt, operators.txt, src/classes/op.C,
	  src/include/pa_sql_connection.h,
	  src/include/pa_sql_driver_manager.h,
	  src/main/pa_sql_driver_manager.C, src/sql/pa_sql_driver.h:
	  feature: sql introducing ability to transcode charsets

2003-12-19  paf

	* src/main/pa_sql_driver_manager.C: beauty: more straighforward
	  error message

	* src/main/pa_charset.C: bugfix: memory for charsethandler
	  structure for libxml now allocated properly

2003-12-17  paf

	* src/types/pa_vfile.C: beauty: removed outdated cast

	* src/main/pa_common.C: bugfix: empty http response caused gpf

	* src/include/pa_string.h: bugfix: removed too strong a assert

	* src/main/pa_globals.C: bugfix: removed false warning [warning:
	  unreported xmlGenericErrors]

2003-12-15  paf

	* src/classes/xdoc.C: bugfix: taint uri under ^xdoc::create{now
	  works}

2003-12-11  paf

	* operators.ru.txt, operators.txt, src/types/pa_vstatus.C:
	  !$status:pid process id
	      !$status:tid thread id

	* src/: include/pa_cache_managers.h, main/pa_cache_managers.C,
	  main/pa_globals.C, main/pa_request.C, types/pa_vstatus.C:
	  bugfix(solaris): removed dependency on object initialization
	  order [one more place]

	* src/: classes/file.C, classes/mail.C, classes/op.C,
	  classes/xdoc.C, main/pa_request.C, types/pa_vimage.C,
	  types/pa_vmath.C, types/pa_vstatus.C: beauty cancel: gcc does not
	  understand that

	* src/: classes/file.C, classes/mail.C, classes/op.C,
	  classes/xdoc.C, include/pa_cache_managers.h,
	  include/pa_sql_connection.h, include/pa_sql_driver_manager.h,
	  include/pa_stylesheet_manager.h, main/pa_request.C,
	  main/pa_stylesheet_manager.C, types/pa_vimage.C,
	  types/pa_vmath.C, types/pa_vstatus.C: beauty: removed redundant
	  ctor call [relying on implicit String::Body(cstr) call]

	* src/main/: pa_cache_managers.C, pa_sql_driver_manager.C,
	  pa_stylesheet_manager.C: bugfix(solaris): removed dependency on
	  object initialization order [two places]

2003-12-10  paf

	* src/include/pa_sql_connection.h: bugfix: $status:sql.cache back
	  << time now ok

	* operators.ru.txt, operators.txt,
	  src/main/pa_sql_driver_manager.C,
	  src/main/pa_stylesheet_manager.C: $status:stylesheet.cache back
	  operational

	* ChangeLog, operators.ru.txt, operators.txt, src/classes/xdoc.C,
	  src/include/pa_charset.h, src/include/pa_sql_connection.h,
	  src/main/pa_charset.C, src/main/pa_sql_driver_manager.C,
	  src/main/pa_string.C, src/types/pa_vxdoc.h: $status:sql.cache
	  back operational

2003-12-02  paf

	* src/types/pa_vmail.C: bugfix:
	  ^mail:send[$.file[$.value[>>xxxx<<]] now untaints properly [were:
	  as-is forced]

	* src/main/pa_xml_io.C: bugfix: on some platforms one can't throw
	  exceptions out of libxml callbacks: reimplemented error handling
	  of http://localhost, parser://method and safemode check callbacks

	* src/main/pa_string.C: bugfix: SPARC gpf on %4!=0 address int ref
	  [merged from HEAD]

	* src/classes/image.C: nothing: comment removed

	* src/main/pa_string.C: bugfix: sparc gpf on reading %4!=0
	  addresses to int

2003-12-01  paf

	* src/main/pa_xml_io.C: bugfix: typo

	* src/main/pa_globals.C: bugfix: win32: compile prob

	* src/classes/xdoc.C: bugfix: typo

	* src/main/pa_xml_io.C: todo: safe mode check not to throw
	  exception

	* src/main/pa_xml_io.C: bugfix: http://localhost typo error

2003-11-28  paf

	* src/main/pa_xml_io.C: installed safe-mode checker as filter of
	  all xml documents read

	* src/main/pa_xml_io.C: http://localhost/ now checked for safe mode

	* src/: classes/xdoc.C, include/pa_stylesheet_connection.h,
	  include/pa_stylesheet_manager.h, main/pa_stylesheet_manager.C:
	  replaced original open mech of xdoc::create & co to use libxml
	  open, so that this would work for root document todo: safe mode
	  checks to libxml: ideally to some 1 point

	* src/main/pa_xml_io.C: comment

	* operators.ru.txt, operators.txt, src/main/pa_xml_io.C: leading /
	  in http://parser[abscent params]

	* operators.ru.txt, operators.txt, src/include/pa_request.h,
	  src/main/pa_xml_io.C: works.	todo: maybe replace original open
	  mech of xdoc::create & co to use libxml open, so that this would
	  work for root document

	  $xdoc[^xdoc::create{     &test^;  }]

	  ^taint[^xdoc.string[]]

	  @method[param] 

2003-11-27  paf

	* src/main/pa_xml_io.C: libxml: started parser://methodcall/params

	* src/classes/date.C: bugfix: typo error

2003-11-26  paf

	* operators.ru.txt, operators.txt, src/include/Makefile.am,
	  src/include/pa_globals.h, src/main/Makefile.am,
	  src/main/main.vcproj, src/main/pa_globals.C,
	  src/main/pa_request.C, src/include/pa_xml_io.h,
	  src/main/pa_xml_io.C: simplification: xml errors to
	  hash reorganization: xml io moved  to
	  pa_xml_io.C/h

	* src/types/pa_value.h: warnings: --

2003-11-25  paf

	* src/classes/table.C: bugfix: wrong sequence. [sadly no waring
	  whatever)

	* src/classes/table.C: bugfix: a, c?x:y, z in gcc considered(?) as
	  a, (c?x:y, z)

	* src/main/untaint.C: bugfix: consequences of not reading this
	  comment: CORD_pos_chars_left /* Number of characters in cache.
	  <= 0 ==> none    */

	* src/include/pa_array.h: removed needless checks

2003-11-24  paf

	* src/: main/pa_request.C, types/pa_vform.C, types/pa_vform.h:
	  removed limit: now $form:xxx can be accessed anytime, even in
	  @auto/conf [and request/response:charset still can be changed
	  anytime]

	* src/main/pa_common.C: bugfix: ^file::load[binary;http://...]
	  now not transcodes response body

	* operators.ru.txt, operators.txt, src/types/pa_vxnode.C,
	  src/types/pa_vxnode.h: $xdoc[^xdoc::create[test]]
	  $tn[^xdoc.createTextNode[text node value]]
	  $dummy[^xdoc.firstChild.appendChild[$tn]]
	  $xdoc.firstChild.firstChild.nodeValue[different]
	  ^taint[^xdoc.string[]]

	* src/: include/pa_hash.h, types/types.vcproj: linker HPUX nongnu
	  workaround: static Hash::allocates -> static Hash_allocates

2003-11-21  paf

	* Makefile.am, configure, configure.in, src/classes/Makefile.am,
	  src/include/pa_config_auto.h.in, src/targets/cgi/Makefile.am,
	  src/types/Makefile.am: rearrange: gd&smtp moved to src/lib

	* src/classes/classes.vcproj: rearrange: gd&smtp moved to src/lib

	* src/classes/mail.C: bugfix: typo

	* parser3.sln, src/classes/Makefile.am, src/lib/Makefile.am,
	  src/lib/gd/Makefile.am, src/lib/gd/gd.vcproj, src/lib/gd/gif.C,
	  src/lib/gd/gif.h, src/lib/gd/gifio.C, src/lib/gd/mtables.h,
	  src/lib/smtp/Makefile.am, src/lib/smtp/comms.C,
	  src/lib/smtp/smtp.C, src/lib/smtp/smtp.h,
	  src/lib/smtp/smtp.vcproj: rearrange: gd&smtp moved to src/lib

	* src/main/pa_exec.C: bug in safe mode

	* src/include/Makefile.am: pa_xml_exception.h

	* src/targets/isapi/parser3isapi.C: more warnings --

2003-11-20  paf

	* src/: classes/math.C, classes/op.C, classes/string.C,
	  main/pa_charset.C, main/pa_dictionary.C, main/pa_string.C,
	  types/pa_value.C, main/pa_dir.C, main/pa_table.C: more warnings
	  --

	* src/: main/pa_charset.C, main/pa_string.C, types/pa_vxnode.C:
	  more warnings --

	* src/classes/xdoc.C: more warnings --

	* src/classes/: date.C, image.C, xdoc.C: more warnings --

	* src/: main/pa_sql_driver_manager.C, main/untaint.C,
	  types/pa_vcookie.C, types/pa_vmail.C: more warnings --

	* src/: classes/date.C, classes/file.C, classes/hash.C,
	  classes/image.C, classes/mail.C, classes/op.C, classes/string.C,
	  classes/table.C, include/pa_cache_managers.h,
	  include/pa_stylesheet_connection.h, main/pa_request.C,
	  types/pa_vdate.h, types/pa_vhashfile.C, types/pa_vimage.h,
	  types/pa_vmethod_frame.C, types/pa_vmethod_frame.h: more warnings
	  --

	* src/main/: execute.C, pa_request.C: old forgotten todo: when
	  can't report problem (undefined @unhandled_exception) problem
	  source string were not reported

	* src/: classes/classes.C, classes/classes.h, classes/date.C,
	  classes/double.C, classes/file.C, classes/form.C, classes/hash.C,
	  classes/hashfile.C, classes/image.C, classes/int.C,
	  classes/mail.C, classes/math.C, classes/memory.C, classes/op.C,
	  classes/response.C, classes/string.C, classes/table.C,
	  classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h,
	  include/pa_array.h, include/pa_cache_managers.h,
	  include/pa_charset.h, include/pa_charsets.h, include/pa_common.h,
	  include/pa_config_fixed.h, include/pa_dictionary.h,
	  include/pa_dir.h, include/pa_exception.h, include/pa_exec.h,
	  include/pa_globals.h, include/pa_hash.h, include/pa_memory.h,
	  include/pa_opcode.h, include/pa_operation.h, include/pa_os.h,
	  include/pa_request.h, include/pa_request_charsets.h,
	  include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h,
	  include/pa_sql_connection.h, include/pa_sql_driver_manager.h,
	  include/pa_stack.h, include/pa_string.h,
	  include/pa_stylesheet_connection.h,
	  include/pa_stylesheet_manager.h, include/pa_table.h,
	  include/pa_threads.h, include/pa_types.h, include/pa_uue.h,
	  include/pa_xml_exception.h, lib/md5/pa_md5.h, lib/md5/pa_md5c.c,
	  lib/sdbm/apr_file_io.C, lib/sdbm/apr_strings.C, main/compile.C,
	  main/compile_tools.C, main/compile_tools.h, main/execute.C,
	  main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C,
	  main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C,
	  main/pa_exception.C, main/pa_exec.C, main/pa_globals.C,
	  main/pa_memory.C, main/pa_os.C, main/pa_pool.C,
	  main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C,
	  main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C,
	  main/pa_uue.C, main/pa_xml_exception.C, main/untaint.C,
	  sql/pa_sql_driver.h, targets/cgi/pa_threads.C,
	  targets/cgi/parser3.C, targets/isapi/pa_threads.C,
	  targets/isapi/parser3isapi.C, types/pa_junction.h,
	  types/pa_method.h, types/pa_value.C, types/pa_value.h,
	  types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h,
	  types/pa_vcode_frame.h, types/pa_vconsole.h, types/pa_vcookie.C,
	  types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h,
	  types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h,
	  types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h,
	  types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C,
	  types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h,
	  types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C,
	  types/pa_vmath.h, types/pa_vmemory.h, types/pa_vmethod_frame.C,
	  types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h,
	  types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C,
	  types/pa_vresponse.h, types/pa_vstateless_class.C,
	  types/pa_vstateless_class.h, types/pa_vstateless_object.h,
	  types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C,
	  types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h,
	  types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h,
	  types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C,
	  types/pa_wcontext.h, types/pa_wwrapper.h: static const char *
	  const IDENT

	* src/: include/pa_array.h, include/pa_pool.h,
	  include/pa_request.h, include/pa_string.h, include/pa_table.h,
	  main/compile_tools.h, main/pa_common.C, types/pa_vhash.h,
	  types/pa_wcontext.h: more warnings --

	* src/: classes/classes.vcproj, classes/date.C, classes/double.C,
	  classes/file.C, classes/hash.C, classes/hashfile.C,
	  classes/image.C, classes/int.C, classes/mail.C, classes/math.C,
	  classes/memory.C, classes/op.C, classes/string.C,
	  classes/table.C, classes/xdoc.C, classes/xnode.C,
	  include/pa_config_includes.h, include/pa_operation.h,
	  include/pa_sql_connection.h, include/pa_table.h,
	  include/pa_types.h, lib/ltdl/config_fixed.h,
	  lib/ltdl/ltdl.vcproj, lib/md5/md5.vcproj, lib/pcre/maketables.c,
	  lib/pcre/pcre_dftables.vcproj, lib/pcre/pcre_parser_ctype.vcproj,
	  lib/sdbm/apr_file_io.C, main/compile.tab.C, main/execute.C,
	  main/main.vcproj, main/pa_cache_managers.C, main/pa_charset.C,
	  main/pa_common.C, main/pa_dir.C, main/pa_exec.C,
	  main/pa_globals.C, main/pa_os.C, main/pa_request.C,
	  main/pa_string.C, main/pa_table.C, targets/cgi/parser3.vcproj,
	  targets/isapi/parser3isapi.vcproj, types/pa_value.h,
	  types/pa_vconsole.h, types/pa_vdate.h, types/pa_vfile.h,
	  types/pa_vhashfile.C, types/pa_vimage.C, types/pa_vimage.h,
	  types/pa_vmail.C, types/pa_vobject.C,
	  types/pa_vstateless_class.h, types/pa_vtable.C,
	  types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.h,
	  types/pa_vxnode.h, types/types.vcproj: turned on warnings level4
	  on all projects (except libltdl=off & libsdbm=level3) found
	  several unitialized vars

2003-11-19  paf

	* src/classes/op.C: more ansi C++ comp

	* operators.ru.txt, operators.txt, src/classes/op.C,
	  src/include/pa_request.h, src/main/pa_request.C:
	  ^cache[...]{body}{catch block with $exception.handled[cache]
	  meaning "get expired cache, if any. else error"}

	* src/: classes/op.C, include/pa_os.h, include/pa_request.h,
	  main/pa_common.C: cache: ^cache[] fallback todo: kinda ^try:
	  ^cache[...]{body}{catch code with $exception.cache field}

2003-11-12  paf

	* src/classes/xnode.C: replaceChild: 2nd param now named oldChild
	  [copy/paste bug]

2003-11-11  paf

	* src/types/: pa_value.h, pa_vfile.h: more C++ compatible [HP C++
	  failed]

2003-11-10  paf

	* src/types/pa_vconsole.h: flush

	* operators.ru.txt, operators.txt, src/main/pa_request.C,
	  src/types/Makefile.am, src/types/types.vcproj,
	  src/types/pa_vconsole.h: $console:line read/write  [for nntp]

	* operators.ru.txt, operators.txt: mysql: transaction support:
	  ?autocommit=0

	* operators.ru.txt, operators.txt: comment: updated

	* src/types/: pa_vhashfile.C, pa_vhashfile.h: add: hashfile old
	  serialize version and exipire now removes entries

	* operators.ru.txt, operators.txt: ^hashfile.delete[] removes files
	  altogether [and dir, if could]

	* src/: classes/hashfile.C, include/pa_common.h, main/pa_common.C,
	  types/pa_vhashfile.C, types/pa_vhashfile.h: ^hashfile.delete[]
	  removes files altogether [and dir, if could]

	* src/lib/sdbm/sdbm.c: bugfix: sdbm: .h said it's OK to remove
	  nonexistent pair. .c coded that that was error. fixed

	* src/types/pa_vhashfile.C: sdbm: exception type change to
	  file.access [regretfull can't split it to different exceptions
	  without modifying sdbm source wich would prefer not to]

2003-11-07  paf

	* src/: classes/date.C, classes/file.C, classes/hash.C,
	  classes/hashfile.C, classes/image.C, classes/table.C,
	  classes/xdoc.C, include/Makefile.am, include/pa_array.h,
	  include/pa_pool.h, include/pa_request.h, main/Makefile.am,
	  main/execute.C, main/main.vcproj, main/pa_pool.C,
	  main/pa_request.C, targets/cgi/parser3.C, types/pa_vclass.C,
	  types/pa_vclass.h, types/pa_vhashfile.h, types/pa_vobject.h,
	  types/pa_vstateless_class.h: resurrected: pool idea. now only for
	  destructing objects at request processing end

2003-11-06  paf

	* src/: classes/Makefile.am, types/Makefile.am: .am sdbm INCLUDES
	  updates

	* parser3.sln, src/targets/cgi/Makefile.am: .vcproj & .am updated
	  to include sdbm

	* src/include/: pa_config_includes.h, pa_version.h: our
	  replacements of max& co only for cpp

	* src/lib/sdbm/: Makefile.am, apr_file_io.C, apr_strings.C: move to
	  upper dir, .am updated

	* tests/todo.txt: hashfile: done

	* operators.ru.txt, operators.txt, src/types/pa_vhashfile.C:
	  hashfile: clear & expiration [time in value. todo: move time to
	  key]

	* src/types/pa_vhashfile.C: hashfile: foreach body can bodify $self

	* src/types/pa_vhashfile.C: hashfile: clear now works [were trying
	  to do that in foreach, no errors, but surely wrong]

	* operators.ru.txt, operators.txt, src/types/pa_vhashfile.C,
	  src/types/pa_vhashfile.h: hashfile: clear and proper locking

	* operators.ru.txt, operators.txt, src/classes/hash.C,
	  src/classes/hashfile.C, src/types/pa_vhashfile.C,
	  src/types/pa_vhashfile.h: hashfile: foreach

	* src/classes/hashfile.C, src/types/pa_vhashfile.C,
	  src/types/pa_vhashfile.h, operators.ru.txt, operators.txt:
	  hashfile: hash

	* operators.ru.txt, operators.txt, src/classes/hashfile.C,
	  src/types/pa_vhashfile.C, src/types/pa_vhashfile.h,
	  tests/todo.txt: hashfile: delete

	* src/: include/pa_memory.h, targets/cgi/parser3.C,
	  types/pa_value.C, types/pa_value.h, types/pa_vcookie.C,
	  types/pa_vhashfile.C, types/pa_vhashfile.h: hashfile implemented
	  get/put [raw]

	* src/: classes/op.C, main/pa_os.C: just linked

	* src/: classes/xdoc.C, classes/xnode.C, types/pa_vxnode.h:
	  XmlException changes

	* src/: include/pa_charset.h, include/pa_globals.h,
	  include/pa_stylesheet_connection.h, main/pa_exception.C:
	  XmlException changes

	* src/lib/sdbm/: sdbm.c, sdbm.vcproj: just compiled

	* src/: include/pa_common.h, include/pa_exception.h,
	  main/main.vcproj, main/pa_common.C, include/pa_os.h,
	  include/pa_xml_exception.h, main/pa_os.C, lib/sdbm/sdbm.vcproj,
	  main/pa_xml_exception.C: locking move to pa_os [along with
	  pa_sleep] apr-impl locking done

	* configure, configure.in, operators.ru.txt, operators.txt,
	  parser3.sln, src/classes/classes.vcproj, src/classes/hashfile.C,
	  src/classes/xdoc.C, src/include/pa_config_fixed.h,
	  src/include/pa_exception.h, src/include/pa_globals.h,
	  src/include/pa_memory.h, src/include/pa_version.h,
	  src/lib/ltdl/libltdl.vcproj, src/lib/ltdl/libltdl.vcproj.vspscc,
	  src/lib/ltdl/ltdl.vcproj, src/lib/ltdl/ltdl.vcproj.vspscc,
	  src/main/compile.tab.C, src/main/main.vcproj,
	  src/main/pa_charset.C, src/targets/cgi/parser3.vcproj,
	  src/types/Makefile.am, src/types/pa_vhash.C,
	  src/types/pa_vhashfile.C, src/types/pa_vhashfile.h,
	  src/types/pa_vxnode.h, src/types/types.vcproj: hashfile: started
	  again with sdbm from apache

2003-11-05  paf

	* src/: classes/classes.vcproj, include/pa_config_fixed.h,
	  main/main.vcproj, targets/cgi/parser3.vcproj: not has to be in
	  \parser3project dir anymore

	* src/main/pa_charset.C: bugfix: had broken binary search [copied
	  thoughtlessly from xalan]

	* src/lib/sdbm/: Makefile.am, sdbm.c, sdbm_hash.c, sdbm_lock.c,
	  sdbm_pair.c, sdbm_pair.h, sdbm_private.h, sdbm_tune.h: original
	  from httpd-2.0.43\srclib\apr-util\dbm\sdbm

	* src/main/helpers/CaseFolding.txt:
	  http://www.unicode.org/Public/UNIDATA/CaseFolding.txt

2003-11-04  paf

	* operators.ru.txt, operators.txt: comment: ^mail:send[$.options[

	* src/classes/table.C: compiled on unix

	* src/classes/Makefile.am: classes.C to rebuild last

	* src/classes/mail.C: compiled on unix

	* operators.ru.txt, operators.txt, src/classes/mail.C,
	  src/types/pa_vmail.C, src/types/pa_vmail.h:	  !^mail:send[
		  $.options[unix: string to append to sendmail command
	  line]

	* operators.ru.txt, operators.txt, src/classes/table.C,
	  src/main/pa_string.C, tests/todo.txt: ^table.save[...
	  $.separator[^#09]	     $.encloser["]  by default

	* operators.ru.txt, operators.txt, src/classes/table.C,
	  tests/todo.txt: ^table::load	       !$.separator[^#09]
	  !$.encloser["]  by default

2003-11-03  paf

	* operators.ru.txt, operators.txt, src/classes/table.C,
	  src/main/pa_common.C: ^table::load[; options:
	  !$.column-separator[^#09]	    !$.column-encloser["]

	* operators.ru.txt, operators.txt, src/include/pa_config_fixed.h,
	  src/types/pa_vrequest.C: $request:document-root

	* src/targets/cgi/parser3.C: beauty: SIGUSRX removed qs= printing
	  [already included into uri=xxx]

	* operators.ru.txt, operators.txt, src/classes/image.C,
	  tests/todo.txt: ^image.gif[filename] for $response:download

	* src/classes/date.C: minor precaution

	* operators.ru.txt, operators.txt, src/classes/date.C:
	  !^date::unix-timestamp()
	      !^date.unix-timestamp[]

2003-10-30  paf

	* operators.ru.txt, operators.txt, src/classes/date.C,
	  src/types/pa_vdate.h: merged from 3.0.8: ^date.roll[TZ;GMT]
	  $date.hour

	* src/classes/: date.C, image.C: improvement diagnostics:
	  $now[^date::create[$undefined]] now is error

	* src/main/pa_common.C: read errors would now be reported 'actually
	  read -1 bytes'

2003-10-24  paf

	* Makefile.am, src/classes/Makefile.am, src/lib/cord/Makefile.am,
	  src/lib/md5/Makefile.am, src/lib/pcre/Makefile.am,
	  src/main/Makefile.am, src/targets/cgi/Makefile.am,
	  src/targets/isapi/Makefile.am: .dsp/w -> .vcproj/sln

2003-10-22  paf

	* src/include/pa_request.h: fixed: $h[^hash::create[]] $$h[1]

2003-10-21  paf

	* operators.ru.txt, operators.txt, src/include/pa_string.h,
	  src/main/pa_string.C: fixed: string.match[g] without <'> option
	  produced columns with NULL's, which gpf'ed at table.save time

	* src/: classes/op.C, include/pa_request.h: fixed: false 'endless
	  recoursion' message with intensive throw-catches fixed: incorrect
	  name and line (one name upper then needed) in error message about
	  problems inside try block

2003-10-10  paf

	* src/: include/pa_string.h, main/compile.tab.C: CORD_chr does not
	  check offset argument for validity did that in String::Body::pos
	  myself http://i2/tasks/edit/?id=4577425257580789777

2003-10-07  paf

	* src/main/: compile.tab.C, compile.y: ^if ( better error:
	  .html(1:4): parse error, expecting `'['' or `'{'' or `'(''  now

2003-10-03  paf

	* parser3.sln, src/include/pa_dictionary.h,
	  src/main/pa_dictionary.C, src/main/pa_string.C,
	  src/targets/cgi/parser3.vcproj: dictionary optimized by
	  precalculating cstr&length

2003-10-02  paf

	* src/: classes/op.C, include/pa_request.h, include/pa_stack.h,
	  main/execute.C, main/pa_request.C, main/pa_sql_driver_manager.C,
	  main/pa_stylesheet_manager.C: bugfix: ^throw context were
	  saved/restored incompletely http://www.parser.ru/forum/?id=21484

2003-09-30  paf

	* src/main/pa_string.C: string::replace bug fix [were ignoring
	  occurrances after lang-mismatched

2003-09-29  paf

	* src/main/: utf8-to-lower.inc, utf8-to-upper.inc: generated by
	  helper

	* src/main/pa_string.C: string::serialize bug fix with
	  zero-terminator

	* src/classes/table.C: ^nameless_table.save column row now has no
	  \t at the end

	* src/: include/pa_request.h, main/execute.C, main/pa_request.C:
	  @postprocess	now takes $response:body/download

	* src/classes/form.C: better error message: MAX_POST_SIZE_NAME to
	  error message

	* src/classes/string.C: bugfix: s.right(>s.length) returned nothing

	* src/classes/table.C: bugfix: flip: must produce nameless
	  http://i2/tasks/edit/?id=4573405524674081244

	* src/: include/pa_charset.h, main/pa_charset.C, main/pa_string.C,
	  main/helpers/simple_folding.pl: utf-8 upper/lower

	* src/main/pa_common.C: bugfix: utf signature were not ignored due
	  to typo error http://i2/tasks/edit/?id=4573354650786434584

2003-09-26  paf

	* src/main/untaint.C: removed needless field

	* src/main/untaint.C: removed needless const

	* src/: include/pa_string.h, main/pa_common.C, main/pa_string.C:
	  String.for_each bug fixed [omited one-char cases]

	* src/include/pa_stack.h: bugfix: before collecting garbage,
	  runtime-executor stack were cleared... BADLY

	* src/main/pa_string.C: ^stirng.replace code used old
	  param-convention on langs.append, fixed that search fo the like,
	  found none

	* src/: classes/op.C, include/pa_string.h, main/pa_string.C:
	  string::serialize/deserialize implemented Language enum assigned
	  meaningful letters [more convinient for debugging. read warning
	  before adding/changing anything]

2003-09-25  paf

	* src/: include/pa_string.h, include/pa_version.h,
	  main/pa_string.C, main/untaint.C: templates and anonymous unions
	  differences on unix

	* parser3.sln, src/classes/file.C, src/classes/image.C,
	  src/classes/mail.C, src/classes/op.C, src/classes/table.C,
	  src/classes/xdoc.C, src/classes/xnode.C,
	  src/include/pa_cache_managers.h, src/include/pa_charset.h,
	  src/include/pa_charsets.h, src/include/pa_common.h,
	  src/include/pa_request.h, src/include/pa_sql_driver_manager.h,
	  src/include/pa_string.h, src/include/pa_stylesheet_manager.h,
	  src/include/pa_table.h, src/lib/cord/cordbscs.c,
	  src/lib/cord/cordprnt.c, src/lib/cord/cordxtra.c,
	  src/lib/cord/include/cord.h, src/main/compile.tab.C,
	  src/main/compile_tools.h, src/main/pa_charset.C,
	  src/main/pa_charsets.C, src/main/pa_common.C, src/main/pa_exec.C,
	  src/main/pa_request.C, src/main/pa_sql_driver_manager.C,
	  src/main/pa_string.C, src/main/pa_stylesheet_manager.C,
	  src/main/untaint.C, src/types/pa_value.h, src/types/pa_vimage.C,
	  src/types/pa_vmail.C, src/types/pa_vmath.C,
	  src/types/pa_vstateless_class.h, src/types/pa_vstatus.C,
	  src/types/pa_vxnode.C: string_fragments_to_cord merged to HEAD

	* src/main/: compile.tab.C, pa_string.C: string: debug: .v()
	  functions aligned to that of eeparser3 look

	* src/lib/cord/cordprnt.c: removed warnings

2003-09-24  paf

	* src/: classes/file.C, classes/image.C, classes/mail.C,
	  classes/op.C, classes/xdoc.C, classes/xnode.C,
	  include/pa_cache_managers.h, include/pa_charset.h,
	  include/pa_charsets.h, include/pa_common.h, include/pa_request.h,
	  include/pa_sql_driver_manager.h, include/pa_string.h,
	  include/pa_stylesheet_manager.h, include/pa_table.h,
	  main/compile_tools.h, main/pa_charset.C, main/pa_charsets.C,
	  main/pa_common.C, main/pa_exec.C, main/pa_request.C,
	  main/pa_sql_driver_manager.C, main/pa_string.C,
	  main/pa_stylesheet_manager.C, main/untaint.C, types/pa_value.h,
	  types/pa_vimage.C, types/pa_vmail.C, types/pa_vmath.C,
	  types/pa_vstateless_class.h, types/pa_vstatus.C,
	  types/pa_vxnode.C: v() functions of String::Body,
	  String::Languages and String itself StringBody->String::Body

	* src/: include/pa_string.h, lib/cord/cordbscs.c,
	  lib/cord/include/cord.h: CORD_append_block showed no efficiency =
	  never optimized anything.  todo: somehow speed up harder cases:
	  concatenationA+concatenationB when last block of A and first of B
	  contain same letters

	* src/: include/pa_string.h, lib/cord/cordbscs.c,
	  lib/cord/include/cord.h: langs: speed up by joining adjucent
	  blocks of same char [CORD_append_block]

	* src/: include/pa_string.h, lib/cord/cordbscs.c,
	  lib/cord/include/cord.h, main/pa_string.C: aval/ works! todo:
	  save space by extending blocks when appending block with c ==
	  lastblock.c

	* src/: include/pa_string.h, main/pa_string.C: aval is not actually
	  working yet :( but more working &understood :)

	* src/: classes/table.C, include/pa_string.h,
	  lib/cord/include/cord.h, main/pa_string.C: aval/ works!

2003-09-23  paf

	* src/main/untaint.C: $a[ok!] $a works!

	* src/main/untaint.C: something even more works :)

	* src/: include/pa_string.h, main/pa_string.C, main/untaint.C:
	  something more works :)

	* src/: include/pa_string.h, lib/cord/cordbscs.c,
	  lib/cord/cordxtra.c: something already works :)

	* src/: include/pa_string.h, main/untaint.C: just compiled todo:
	  serialize&deserialize

	* src/: classes/table.C, include/pa_string.h, lib/cord/cordbscs.c,
	  lib/cord/cordxtra.c, lib/cord/include/cord.h, main/pa_string.C,
	  main/untaint.C: main idea implemented, details left

2003-09-22  paf

	* src/: classes/memory.C, include/pa_memory.h: #ifdef GC_DEBUG

	* src/classes/xnode.C: copy/paste comment bugfix

	* src/: include/pa_memory.h, main/pa_globals.C: when xml memory
	  allocator returns 0, just die.
	  http://i2/tasks/edit/?id=4570798492410259445

	* src/classes/xdoc.C: copy/paste comment bugfix

	* src/classes/: xdoc.C, xnode.C: new DOM2 methods from Alexandr
	  Egorov  (all?) xdoc: createAttributeNS createElementNS
	  xnode: getAttributeNS setAttributeNS removeAttributeNS
	  getAttributeNodeNS setAttributeNodeNS hasAttribute hasAttributeNS

	* src/lib/cord/cordxtra.c: CORD_pos bugfix [failed to find 8bit
	  chars due to bitwise operation signed-char error]

2003-09-19  paf

	* src/types/pa_wcontext.C: output message: more practical
	  suggestion

	* src/main/pa_common.C, operators.ru.txt, operators.txt: merged
	  $f[^file::load[binary;http://...]] $f.tables

2003-09-02  paf

	* src/main/pa_common.C: printf is buffered, write(1 is not. can't
	  flush stdout without referencing 'stdout' symbol. to hell with
	  non-ansi libraries without 'stdout' symbol

	* src/main/pa_common.C: got rid of 'stdout' symbol reference on
	  unix (users reported problems with some old libc)

	* src/types/pa_vdate.h: forgot initializer

2003-09-01  paf

	* src/: classes/date.C, include/pa_common.h, main/compile.tab.C,
	  main/pa_common.C, types/pa_vdate.h: $date.TZ ^date.roll[TZ;new
	  zone]

	* src/classes/image.C: memory handling bugs [unpatched 'new' calls]

2003-08-19  paf

	* src/types/: pa_value.C, pa_value.h, pa_vdate.h, pa_vrequest.C,
	  pa_vstring.h, pa_vxdoc.C, pa_vxnode.C: bark intefrace obsoleted,
	  simplified a little

	* src/types/: pa_vhash.C, pa_vhash.h: _default+foreach bug refix
	  [lost fix from 3.0.8]

	* src/types/pa_vcookie.C: in VC7 if(type var=xxx){ }else{   now
	  visible here }

	  bug fix

	* src/: include/pa_memory.h, types/pa_value.h: -= few warnings

	* src/main/compile.tab.C: initialized couple of variables about
	  which user reported runtime problems when parser were compiled
	  with VC7, warning level4.  study shows that later in bison
	  they've fixed that. would migrate to latest bison someday

	* src/types/pa_vmail.C: turned	off recoding in gmime (were still
	  recoding headers)

	* src/types/pa_vmail.C: works as before, same charset problems:
	  gmime recodes to UTF-8 only headers, not body. so not recoding
	  anything for now

	* src/types/: pa_vmail.C, pa_vmail.h: parses headers, still
	  problems with body

	* src/types/pa_vmail.C: mail_receive just compiled

2003-08-18  paf

	* src/: classes/classes.vcproj, include/pa_config_fixed.h,
	  main/main.vcproj, types/types.vcproj: win32: continued process
	  detaching from \parser3project directory

	* gnu.dsp, parser3.dsw, src/classes/classes.dsp,
	  src/lib/cord/cord.dsp, src/lib/ltdl/libltdl.dsp,
	  src/lib/md5/md5.dsp, src/lib/pcre/pcre.dsp,
	  src/lib/pcre/pcre_dftables.dsp,
	  src/lib/pcre/pcre_parser_ctype.dsp, src/main/main.dsp,
	  src/targets/cgi/parser3.dsp, src/targets/isapi/parser3isapi.dsp,
	  src/types/types.dsp: moved to MSVC 7

	* gnu.vcproj.vspscc, parser3.vssscc,
	  src/classes/classes.vcproj.vspscc,
	  src/lib/cord/cord.vcproj.vspscc,
	  src/lib/ltdl/libltdl.vcproj.vspscc,
	  src/lib/md5/md5.vcproj.vspscc,
	  src/lib/pcre/pcre_dftables.vcproj.vspscc,
	  src/lib/pcre/pcre_parser_ctype.vcproj.vspscc,
	  src/lib/pcre/pcre.vcproj.vspscc, src/main/main.vcproj.vspscc,
	  src/targets/isapi/parser3isapi.vcproj.vspscc,
	  src/types/types.vcproj.vspscc, src/targets/cgi/parser3.vcproj:
	  moved to MSVC 7

	* parser3.sln, gnu.vcproj, src/classes/classes.vcproj,
	  src/lib/cord/cord.vcproj, src/lib/ltdl/libltdl.vcproj,
	  src/lib/md5/md5.vcproj, src/lib/pcre/pcre.vcproj,
	  src/lib/pcre/pcre_dftables.vcproj,
	  src/lib/pcre/pcre_parser_ctype.vcproj, src/main/main.vcproj,
	  src/targets/cgi/parser3.vcproj,
	  src/targets/isapi/parser3isapi.vcproj, src/types/types.vcproj:
	  new VS project files

	* ~sak5c961f3101c36563.tmp: Temporary file created by Visual Studio
	  .NET to detect Jalindi Igloo capabilities.

	* ChangeLog, configure, configure.in, src/classes/Makefile.am,
	  src/classes/classes.awk, src/doc/footer.htm,
	  src/include/pa_config_fixed.h, src/include/pa_version.h,
	  src/lib/Makefile.am, src/main/compile.tab.C,
	  src/main/pa_charset.C, src/main/pa_string.C, src/main/untaint.C,
	  src/types/pa_vmail.C: merged 3.1.0 latest changes

2003-08-15  paf

	* src/main/untaint.C: email addresses in forms:   "non-ascii" 
	  non-ascii  now encoded correctly [kinda merge from 3.0.8]

	* src/main/untaint.C: email addresses in forms:   "non-ascii" 
	  non-ascii  now encoded correctly

2003-07-29  paf

	* src/classes/: Makefile.am, classes.awk: classes.awk added to make
	  dist

	* src/types/pa_vmail.C: just started --with-mail-receive

2003-07-28  paf

	* src/: classes/Makefile.am, lib/Makefile.am: removed circular
	  dependence in src/classes, src/lib/gc now in dist

	* src/main/pa_string.C: ^cache bug fix [were not working at all]

2003-07-25  paf

	* src/doc/footer.htm: year

2003-07-24  paf

	* src/: include/pa_config_fixed.h, main/pa_charset.C: bad #endif
	  fix

	* src/include/pa_version.h: release

	* src/lib/gc/include/: Makefile.am, gc.h: moved tempate_gc to HEAD

	* ChangeLog, src/classes/classes.dsp, src/main/main.dsp,
	  src/main/pa_globals.C, src/targets/cgi/parser3.dsp,
	  src/targets/isapi/parser3isapi.dsp, src/types/types.dsp: cvs:
	  getting rid of win32xml pseudo project

	* src/main/: compile.tab.C, pa_memory.C: moved tempate_gc to HEAD

	* ChangeLog, INSTALL, Makefile.am, acsite.m4, configure,
	  configure.in, operators.ru.txt, operators.txt, parser3.dsw,
	  etc/parser3.charsets/koi8-r.cfg,
	  etc/parser3.charsets/windows-1251.cfg, src/classes/Makefile.am,
	  src/classes/classes.C, src/classes/classes.awk,
	  src/classes/classes.dsp, src/classes/classes.h,
	  src/classes/date.C, src/classes/double.C, src/classes/file.C,
	  src/classes/form.C, src/classes/hash.C, src/classes/image.C,
	  src/classes/int.C, src/classes/mail.C, src/classes/math.C,
	  src/classes/memory.C, src/classes/op.C, src/classes/response.C,
	  src/classes/string.C, src/classes/table.C, src/classes/void.C,
	  src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h,
	  src/doc/exception.dox, src/doc/index.dox, src/doc/memory.dox,
	  src/doc/string.dox, src/include/Makefile.am,
	  src/include/pa_array.h, src/include/pa_cache_managers.h,
	  src/include/pa_charset.h, src/include/pa_charsets.h,
	  src/include/pa_common.h, src/include/pa_config_auto.h.in,
	  src/include/pa_config_fixed.h, src/include/pa_config_includes.h,
	  src/include/pa_dictionary.h, src/include/pa_dir.h,
	  src/include/pa_exception.h, src/include/pa_exec.h,
	  src/include/pa_globals.h, src/include/pa_hash.h,
	  src/include/pa_memory.h, src/include/pa_opcode.h,
	  src/include/pa_operation.h, src/include/pa_pool.h,
	  src/include/pa_pragma_pack_begin.h,
	  src/include/pa_pragma_pack_end.h, src/include/pa_request.h,
	  src/include/pa_request_charsets.h, src/include/pa_request_info.h,
	  src/include/pa_sapi.h, src/include/pa_socks.h,
	  src/include/pa_sql_connection.h,
	  src/include/pa_sql_driver_manager.h, src/include/pa_stack.h,
	  src/include/pa_string.h, src/include/pa_stylesheet_connection.h,
	  src/include/pa_stylesheet_manager.h, src/include/pa_table.h,
	  src/include/pa_threads.h, src/include/pa_types.h,
	  src/include/pa_uue.h, src/lib/Makefile.am,
	  src/lib/cord/Makefile.am, src/lib/cord/cord.dsp,
	  src/lib/cord/cordbscs.c, src/lib/cord/cordprnt.c,
	  src/lib/cord/cordxtra.c, src/lib/cord/source.url,
	  src/lib/cord/include/Makefile.am, src/lib/cord/include/cord.h,
	  src/lib/cord/include/ec.h,
	  src/lib/cord/include/private/Makefile.am,
	  src/lib/cord/include/private/cord_pos.h, src/lib/gc/Makefile.am,
	  src/lib/ltdl/libltdl.dsp, src/lib/md5/pa_md5.h,
	  src/lib/md5/pa_md5c.c, src/lib/pcre/pcre.h,
	  src/lib/pcre/pcre_parser_ctype.c, src/main/Makefile.am,
	  src/main/compile.C, src/main/compile.tab.C, src/main/compile.y,
	  src/main/compile_tools.C, src/main/compile_tools.h,
	  src/main/execute.C, src/main/main.dsp, src/main/pa_array.C,
	  src/main/pa_cache_managers.C, src/main/pa_charset.C,
	  src/main/pa_charsets.C, src/main/pa_common.C,
	  src/main/pa_dictionary.C, src/main/pa_dir.C,
	  src/main/pa_exception.C, src/main/pa_exec.C,
	  src/main/pa_globals.C, src/main/pa_hash.C, src/main/pa_pool.C,
	  src/main/pa_request.C, src/main/pa_socks.C,
	  src/main/pa_sql_driver_manager.C, src/main/pa_string.C,
	  src/main/pa_stylesheet_manager.C, src/main/pa_table.C,
	  src/main/pa_uue.C, src/main/untaint.C, src/sql/pa_sql_driver.h,
	  src/targets/Makefile.am, src/targets/cgi/Makefile.am,
	  src/targets/cgi/getopt.c, src/targets/cgi/getopt.h,
	  src/targets/cgi/pa_pool.C, src/targets/cgi/pa_threads.C,
	  src/targets/cgi/parser3.C, src/targets/cgi/parser3.dsp,
	  src/targets/cgi/pool_storage.h, src/targets/cgi/pp3.cmd,
	  src/targets/isapi/Makefile.am, src/targets/isapi/pa_pool.C,
	  src/targets/isapi/pa_threads.C, src/targets/isapi/parser3isapi.C,
	  src/targets/isapi/parser3isapi.dsp,
	  src/targets/isapi/pool_storage.h, src/types/Makefile.am,
	  src/types/pa_junction.h, src/types/pa_method.h,
	  src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vbool.h,
	  src/types/pa_vclass.C, src/types/pa_vclass.h,
	  src/types/pa_vcode_frame.h, src/types/pa_vcookie.C,
	  src/types/pa_vcookie.h, src/types/pa_vdate.h,
	  src/types/pa_vdouble.h, src/types/pa_venv.h,
	  src/types/pa_vfile.C, src/types/pa_vfile.h, src/types/pa_vform.C,
	  src/types/pa_vform.h, src/types/pa_vhash.C, src/types/pa_vhash.h,
	  src/types/pa_vimage.C, src/types/pa_vimage.h,
	  src/types/pa_vint.h, src/types/pa_vjunction.h,
	  src/types/pa_vmail.C, src/types/pa_vmail.h, src/types/pa_vmath.C,
	  src/types/pa_vmath.h, src/types/pa_vmemory.h,
	  src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h,
	  src/types/pa_vobject.C, src/types/pa_vobject.h,
	  src/types/pa_vrequest.C, src/types/pa_vrequest.h,
	  src/types/pa_vresponse.C, src/types/pa_vresponse.h,
	  src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h,
	  src/types/pa_vstateless_object.h, src/types/pa_vstatus.C,
	  src/types/pa_vstatus.h, src/types/pa_vstring.C,
	  src/types/pa_vstring.h, src/types/pa_vtable.C,
	  src/types/pa_vtable.h, src/types/pa_vvoid.h,
	  src/types/pa_vxdoc.C, src/types/pa_vxdoc.h,
	  src/types/pa_vxnode.C, src/types/pa_vxnode.h,
	  src/types/pa_wcontext.C, src/types/pa_wcontext.h,
	  src/types/pa_wwrapper.h, src/types/types.dsp: moved tempate_gc to
	  HEAD

	* tests/: 001.html, 002.html, 003.html, 004.html, 005.html,
	  006.html, 007.html, 008.html, 009.html, 010.html, 011.html,
	  012.html, 013.html, 014.html, 015.html, 016.html, 017.html,
	  018.html, 019.html, 019paf2001.gif, 020.html, 021.html, 022.html,
	  023.html, 024.html, 025.html, 026.html, 027.html, 028.html,
	  029.html, 030.html, 031.html, 032.html, 033.html, 034.html,
	  035.html, 036.html, 037.html, 038.html, 039.html, 040.html,
	  041.html, 042.html, 043.html, 044.html, 045.html, 046.html,
	  047.html, 048.html, 049.html, 050.html, 051.html, 051b.p, 051t.p,
	  052.html, 053.html, 054.html, 055.html, 056.html, 057.html,
	  058.html, 058_paf2000.png, 059.html, 060.html, 061.dat, 061.html,
	  062.html, 063.html, 064.html, 065.html, 066.html, 067.html,
	  068.html, 069.html, 070.html, 071.html, 072.html, 073.html,
	  074.html, 075.html, 076.html, 077.html, 078.html, 079.html,
	  080.html, 081.html, 082.html, 083.html, 084.html, 085.html,
	  086.html, 087.html, 088.html, 089.html, 090.html, 091.html,
	  092.html, 093.html, 094.html, 095.html, 096.html, 097.html,
	  098.html, 098font.gif, 099.html, 100.html, 101.html, 102.html,
	  103.html, 103mark.gif, 103paf2001.gif, 104.html, 105.html,
	  106.html, 107.html, 108.html, 108.xsl, 109.html, 110.html,
	  111.html, 112.html, 113.html, 114.html, 115.html, 116.html,
	  117.html, 118.html, 119.html, 120.html, 121.html, 122.html,
	  123.html, 124.html, 125.html, 126.html, 127.html, 128.html,
	  129.html, 130.html, 131.html, 132.html, 133.html, 134.html,
	  135.html, 136.html, 137.html, 138.html, 139.html, 140.html,
	  141.html, Makefile, descript.ion, run_parser.sh, 022_dir/a.html,
	  022_dir/b.txt, 022_dir/c.htm, 096_dir/163.jpg, 096_dir/188.jpg,
	  outputs/create-dir, results/001.processed, results/002.processed,
	  results/003.processed, results/004.processed,
	  results/005.processed, results/006.processed,
	  results/007.processed, results/008.processed,
	  results/009.processed, results/010.processed,
	  results/011.processed, results/012.processed,
	  results/013.processed, results/014.processed,
	  results/015.processed, results/016.processed,
	  results/017.processed, results/018.processed,
	  results/019.processed, results/020.processed,
	  results/021.processed, results/022.processed,
	  results/023.processed, results/024.processed,
	  results/025.processed, results/026.processed,
	  results/027.processed, results/028.processed,
	  results/029.processed, results/030.processed,
	  results/031.processed, results/032.processed,
	  results/033.processed, results/034.processed,
	  results/035.processed, results/036.processed,
	  results/037.processed, results/038.processed,
	  results/039.processed, results/040.processed,
	  results/041.processed, results/042.processed,
	  results/043.processed, results/044.processed,
	  results/045.processed, results/046.processed,
	  results/047.processed, results/048.processed,
	  results/049.processed, results/050.processed,
	  results/051.processed, results/052.processed,
	  results/053.processed, results/054.processed,
	  results/055.processed, results/056.processed,
	  results/057.processed, results/058.processed,
	  results/059.processed, results/060.processed,
	  results/061.processed, results/062.processed,
	  results/063.processed, results/064.processed,
	  results/065.processed, results/066.processed,
	  results/067.processed, results/068.processed,
	  results/069.processed, results/070.processed,
	  results/071.processed, results/072.processed,
	  results/073.processed, results/074.processed,
	  results/075.processed, results/076.processed,
	  results/077.processed, results/078.processed,
	  results/079.processed, results/080.processed,
	  results/081.processed, results/082.processed,
	  results/083.processed, results/084.processed,
	  results/085.processed, results/086.processed,
	  results/087.processed, results/088.processed,
	  results/089.processed, results/090.processed,
	  results/091.processed, results/092.processed,
	  results/093.processed, results/094.processed,
	  results/095.processed, results/096.processed,
	  results/097.processed, results/098.processed,
	  results/099.processed, results/100.processed,
	  results/101.processed, results/102.processed,
	  results/103.processed, results/104.processed,
	  results/105.processed, results/106.processed,
	  results/107.processed, results/108.processed,
	  results/109.processed, results/110.processed,
	  results/111.processed, results/112.processed,
	  results/113.processed, results/114.processed,
	  results/115.processed, results/116.processed,
	  results/117.processed, results/118.processed,
	  results/119.processed, results/120.processed,
	  results/121.processed, results/122.processed,
	  results/123.processed, results/124.processed,
	  results/125.processed, results/126.processed,
	  results/127.processed, results/128.processed,
	  results/129.processed, results/130.processed,
	  results/131.processed, results/132.processed,
	  results/133.processed, results/134.processed,
	  results/135.processed, results/136.processed,
	  results/137.processed, results/138.processed,
	  results/139.processed, results/140.processed,
	  results/141.processed: merged(copied) to HEAD from template_gc

	* src/targets/: cgi/parser3.dsp, isapi/parser3isapi.dsp: more step
	  towards \parser3project not having to be in root

	* src/: classes/math.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c: apache
	  module compiled [were minor unnecessary changes in lib/md5
	  interface]

	* src/include/pa_version.h: release

	* parser3.dsw, src/main/pa_globals.C: relative paths to xml&gc libs

	* src/classes/math.C: merged uuid bugfix

	* tests/: 141.html, results/141.processed: fixed bug with
	  too-small-a-buffer

	* src/classes/math.C: uuid bugfix

	* tests/: 141.html, Makefile, results/005.processed,
	  results/030.processed, results/075.processed,
	  results/078.processed: to reflect date format change (were -
	  become ' ')

	* src/classes/math.C: uuid bugfix

	* parser3.dsw, src/main/pa_globals.C: few paths for libxml
	  debug/release changes

	* src/lib/md5/pa_md5c.c: PA_ -> pa_

2003-07-23  paf

	* src/: classes/math.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c:
	  renamed a little [to move to comman naming conv]

	* src/targets/Makefile.am: apache13 splitted to simplify apache
	  build

	* src/: include/pa_request.h, include/pa_stack.h, main/execute.C,
	  main/pa_request.C, main/pa_sql_driver_manager.C,
	  main/pa_stylesheet_manager.C, targets/isapi/parser3isapi.dsp:
	  stack top_index() fixed

	* src/main/pa_globals.C: minor style changes

	* src/: classes/op.C, include/pa_sql_connection.h: connection
	  closing/caching fixed [connections were not closed/put to cache]

2003-07-22  paf

	* INSTALL: gc part updated stightly

	* src/targets/isapi/: parser3isapi.C, parser3isapi.dsp: updated to
	  new sapi interface

	* src/classes/file.C: comment on OS

	* src/main/pa_string.C: removed reduntant invariant check [there is
	  one deeper in cord lib]

	* src/main/pa_exec.C: on win32 bugfix in handling shbang

	* src/main/pa_memory.C: out of memory is no longer coredump

	* INSTALL: disable-threads adviced

2003-07-21  paf

	* src/classes/Makefile.am: removed circular dependency on classes.C

	* src/classes/file.C: file::exec/cgi environment variables now must
	  be UPPERCASE and A-Z 0-9 _-

	* src/classes/file.C: env passing fixed

	* src/main/pa_common.C: http:// CRLF now [merged from HEAD]

	* src/main/pa_common.C: http:// CRLF now

2003-07-02  paf

	* operators.ru.txt, operators.txt, src/types/pa_vstatus.C: renamed
	  $memory:status fields to reflect their real meaning

2003-06-27  paf

	* src/: classes/file.C, include/pa_charset.h, include/pa_exec.h,
	  include/pa_hash.h, main/pa_charset.C: merged from HEAD
	  file::exec/cgi .charset

2003-06-26  paf

	* ChangeLog, src/classes/file.C, src/classes/hash.C,
	  src/classes/image.C, src/classes/op.C, src/classes/string.C,
	  src/classes/table.C: fixed several uninitialized local
	  structures.  notably ^hash.foreach now inserts delimiters
	  properly [were inserting it before first body]

2003-06-24  paf

	* src/include/pa_hash.h: simplified HASH_ALLOCATES_COUNT

2003-06-20  paf

	* operators.ru.txt, operators.txt, src/include/pa_globals.h,
	  src/main/pa_common.C, src/main/pa_globals.C: introducing
	  $f[^file::load[binary;http://...]] $f.tables

2003-06-06  paf

	* src/types/: pa_vhash.h: $hash.field lookup first now: along with
	  table. [were method lookup: inconsistent]

2003-06-02  paf

	* src/include/pa_memory.h: empty string clone fixed to return
	  writable memory

	* src/main/pa_common.C: fix_line_breaks bug fix [terminating zero
	  were not appended] which violated string invariant

2003-05-30  paf

	* src/types/pa_value.C: date format now Sun, 06 Nov 1994 08:49:37
	  GMT  ; RFC 822, updated by RFC 1123 [as in HEAD]

	* src/main/pa_common.C: date format now Sun, 06 Nov 1994 08:49:37
	  GMT  ; RFC 822, updated by RFC 1123

	* src/: classes/file.C, classes/form.C, targets/cgi/parser3.C,
	  targets/isapi/parser3isapi.C: initialized request_info properly

	* src/classes/xnode.C: found minor bug, commended for future

2003-05-28  paf

	* src/classes/form.C: request_info.content_length can't be <0,
	  size_t for some time

2003-05-26  paf

	* src/: classes/file.C, classes/string.C, main/pa_string.C: few
	  forgotten <0 changed to !=STRING_NOT_FOUND

	* src/classes/math.C: merged ffffu from HEAD

2003-05-11  paf

	* src/main/pa_globals.C: xml memory debugging functions (ifdefed)

	* src/types/: pa_vxdoc.h, pa_vxnode.h: think that found cause of
	  premature doc free.  transformed document had xmlDoc reference
	  stored to non-gc-memory (libgdome) added holding-reference

2003-04-29  paf

	* src/main/pa_globals.C: started digging on double free.  on win32
	  found that that's perfectly normal.

2003-04-25  paf

	* src/classes/table.C: table.join bug fix  [bad limit check]

	* src/classes/math.C: merged from HEAD: simpiler hash_string

	* src/classes/math.C: snprintf(buf, 3) become (buf,2) and failed to
	  print anything.  changed to quicker and simplier code

	* src/classes/hash.C: allowed ^hash::create[^rem{xxx}]	 [were to
	  strict a check]

	* src/: classes/table.C, lib/md5/pa_md5c.c: minor compile errors

2003-04-24  paf

	* src/include/pa_table.h: too strict assert loosened

	* src/lib/: md5/pa_md5c.c, pcre/pcre.h: thanks to Ilia Soldis
	   for reporing this ansi c fiolation syntax
	  report

2003-04-21  paf

	* src/targets/cgi/Makefile.am: pp3 added to .am

	* src/main/pa_globals.C: pcre memory management changed to use GC
	  memory

	* src/main/pa_globals.C: 2.5.6 version of libxml allows to install
	  xmlMallocAtomic [author agreed to my suggestion], used that

	* src/types/pa_vmail.C: ^mail:send[$.body backward compatibility

	* src/: targets/cgi/parser3.C, types/pa_value.C, types/pa_value.h,
	  types/pa_vmail.C: attributed_meaning_to_string added
	  L_UNSPECIFIED piece which was sortof OK, but violated string
	  invariant [assertion barked on that] changed to L_PASS_APPEND,
	  made that param obligatory

	* src/main/pa_string.C: String::ArrayFragment::append_positions bug
	  fixed [assert helped]

	* src/include/pa_string.h: assert added [looking for bug]

	* src/main/pa_request.C: merged from HEAD: "x:..." and "\\..." file
	  names on Win32 considered disk-global

	* src/main/pa_request.C: "x:..." and "\\..." file names on Win32
	  considered disk-global

2003-04-18  paf

	* src/main/untaint.C: merged from HEAD: enabled '~' letter in
	  filenames

	* src/main/untaint.C: enabled '~' letter in filenames

2003-04-16  paf

	* src/classes/file.C: small bug introduced in autoptr times fixed

	* etc/parser3.charsets/: koi8-r.cfg, windows-1251.cfg: merged from
	  HEAD

	* src/classes/table.C: fix: gcc reported tiny error

2003-04-15  paf

	* operators.ru.txt, operators.txt, src/classes/math.C,
	  src/lib/md5/pa_md5.h, src/lib/md5/pa_md5c.c, tests/141.html,
	  tests/results/141.processed: merged from head ^math:uuid[]
	  ^math:uid64[] ^math:md5[string]

	  test added: 141.html

	* operators.ru.txt, operators.txt, src/classes/math.C:
	  ^math:uid64[]

	* src/classes/math.C: ^math:uuid[]

	* operators.ru.txt, operators.txt, src/classes/math.C: ^math:uuid[]

	* operators.ru.txt, operators.txt, src/classes/math.C,
	  src/lib/md5/pa_md5.h, src/lib/md5/pa_md5c.c: ^math:md5[string]
	  16-byte digest

	* operators.ru.txt, operators.txt, src/classes/file.C,
	  src/include/pa_common.h, src/include/pa_config_fixed.h,
	  src/main/pa_common.C: ^file::load[mode;name;	   $.offset
	  $.limit

2003-04-14  paf

	* src/: classes/math.C, lib/md5/pa_md5.h, lib/md5/pa_md5c.c:
	  started ^math:md5

	* src/classes/table.C, src/include/pa_array.h,
	  src/include/pa_table.h, src/main/pa_table.C, tests/140.html,
	  tests/results/140.processed: table $.reverse option works in
	  create&co table $.distinct[tables] bug fix merged

	* src/: classes/table.C, include/pa_table.h: table
	  $.distinct[tables] bug fixed

	* src/classes/table.C: more warnings

	* src/: include/pa_array.h, include/pa_table.h, main/pa_table.C:
	  removed checks in table::set_current, moved them back to
	  table::locate implemented table::create/join  $.reverse

	* src/: include/pa_table.h, main/pa_array.C, main/pa_table.C:
	  removed checks in table::set_current, moved them back to
	  table::locate

2003-04-11  paf

	* operators.ru.txt, operators.txt, src/classes/date.C,
	  src/classes/table.C, src/include/pa_array.h,
	  src/include/pa_common.h, src/include/pa_config_includes.h,
	  src/include/pa_string.h, src/include/pa_table.h,
	  src/main/pa_request.C, src/main/pa_sql_driver_manager.C,
	  src/main/pa_string.C, src/main/pa_table.C: merged from HEAD from
	  before_append_array_limit_sense_change to
	  after_append_array_limit_sense_change

	* src/classes/table.C: typo

	* operators.ru.txt, operators.txt, src/classes/date.C,
	  src/classes/table.C, src/include/pa_array.h,
	  src/include/pa_common.h, src/include/pa_config_includes.h,
	  src/include/pa_globals.h, src/include/pa_table.h,
	  src/main/pa_array.C, src/main/pa_globals.C,
	  src/main/pa_request.C, src/main/pa_sql_driver_manager.C,
	  src/main/pa_string.C, src/main/pa_table.C:
	  append_array_limit_sense_change locate accepts options same as
	  create new option: $.reverse(1)   [do not work in table::create]

	* src/: include/pa_common.h, main/pa_common.C: gcc didn't like
	  (stat xxx,

	* src/classes/: table.C: typo

	* tests/: 130.html, 131.html, 132.html, 133.html, 134.html,
	  135.html, 136.html, 137.html, 138.html, 139.html, descript.ion,
	  results/130.processed, results/131.processed,
	  results/132.processed, results/133.processed,
	  results/134.processed, results/135.processed,
	  results/136.processed, results/137.processed,
	  results/138.processed, results/139.processed: added few mustfail
	  tests 130.html mustfail: empty regexp 131.html mustfail: invalid
	  date/time 132.html mustfail: access to junction outside of
	  context 133.html mustfail: access to junction outside of context,
	  case version 134.html mustfail: hash: adding a key inside of
	  foreach 135.html mustfail: modifying system class 136.html
	  mustfail: $.name outside of $hash[here] 137.html mustfail:
	  appendChild without import 138.html mustfail: invalid encoding
	  inside of xml 139.html mustfail: bad XPath

	* operators.ru.txt, operators.txt, src/classes/table.C,
	  tests/084.html, tests/125.html, tests/126.html, tests/127.html,
	  tests/128.html, tests/129.html, tests/results/125.processed,
	  tests/results/126.processed, tests/results/127.processed,
	  tests/results/128.processed, tests/results/129.processed: merged
	  from HEAD ^table.hash[key][$.distinct[tables]]

	  maked appropriate tests [changed one old nonconforming]

	* operators.ru.txt, operators.txt, src/classes/table.C:
	  ^table.hash[key][$.distinct[tables]]

	* src/: classes/xdoc.C, classes/xnode.C, include/pa_charset.h:
	  merged fix for found very old xml (dom) bug: were passing
	  domString objects and later ERROREOUSLY freed them

	* INSTALL, src/include/pa_charset.h, src/lib/Makefile.am,
	  src/main/pa_charset.C: re-added libgdome patch. regretfully
	  libgdome bug can not be worked around

2003-04-10  paf

	* src/: classes/xdoc.C, classes/xnode.C, include/pa_charset.h:
	  found very old xml (dom) bug: were passing domString objects and
	  later ERROREOUSLY freed them

	* src/doc/string.dox, src/include/pa_memory.h,
	  src/include/pa_string.h, src/lib/cord/cordbscs.c,
	  src/main/pa_string.C, src/types/pa_vform.C, src/types/pa_vform.h,
	  tests/123.html, tests/124.html, tests/results/001.processed,
	  tests/results/002.processed, tests/results/003.processed,
	  tests/results/004.processed, tests/results/005.processed,
	  tests/results/006.processed, tests/results/008.processed,
	  tests/results/009.processed, tests/results/010.processed,
	  tests/results/011.processed, tests/results/012.processed,
	  tests/results/013.processed, tests/results/014.processed,
	  tests/results/015.processed, tests/results/016.processed,
	  tests/results/017.processed, tests/results/018.processed,
	  tests/results/020.processed, tests/results/021.processed,
	  tests/results/022.processed, tests/results/023.processed,
	  tests/results/024.processed, tests/results/025.processed,
	  tests/results/026.processed, tests/results/027.processed,
	  tests/results/028.processed, tests/results/029.processed,
	  tests/results/030.processed, tests/results/031.processed,
	  tests/results/032.processed, tests/results/033.processed,
	  tests/results/034.processed, tests/results/035.processed,
	  tests/results/036.processed, tests/results/037.processed,
	  tests/results/038.processed, tests/results/039.processed,
	  tests/results/040.processed, tests/results/041.processed,
	  tests/results/042.processed, tests/results/043.processed,
	  tests/results/044.processed, tests/results/045.processed,
	  tests/results/046.processed, tests/results/047.processed,
	  tests/results/048.processed, tests/results/049.processed,
	  tests/results/050.processed, tests/results/051.processed,
	  tests/results/052.processed, tests/results/053.processed,
	  tests/results/054.processed, tests/results/055.processed,
	  tests/results/056.processed, tests/results/057.processed,
	  tests/results/058.processed, tests/results/059.processed,
	  tests/results/060.processed, tests/results/061.processed,
	  tests/results/062.processed, tests/results/063.processed,
	  tests/results/064.processed, tests/results/065.processed,
	  tests/results/066.processed, tests/results/067.processed,
	  tests/results/068.processed, tests/results/069.processed,
	  tests/results/070.processed, tests/results/071.processed,
	  tests/results/072.processed, tests/results/073.processed,
	  tests/results/074.processed, tests/results/075.processed,
	  tests/results/076.processed, tests/results/077.processed,
	  tests/results/078.processed, tests/results/079.processed,
	  tests/results/080.processed, tests/results/081.processed,
	  tests/results/082.processed, tests/results/083.processed,
	  tests/results/084.processed, tests/results/085.processed,
	  tests/results/086.processed, tests/results/087.processed,
	  tests/results/088.processed, tests/results/089.processed,
	  tests/results/090.processed, tests/results/091.processed,
	  tests/results/092.processed, tests/results/093.processed,
	  tests/results/094.processed, tests/results/095.processed,
	  tests/results/096.processed, tests/results/097.processed,
	  tests/results/101.processed, tests/results/102.processed,
	  tests/results/104.processed, tests/results/105.processed,
	  tests/results/106.processed, tests/results/107.processed,
	  tests/results/108.processed, tests/results/109.processed,
	  tests/results/110.processed, tests/results/111.processed,
	  tests/results/112.processed, tests/results/113.processed,
	  tests/results/114.processed, tests/results/115.processed,
	  tests/results/116.processed, tests/results/117.processed,
	  tests/results/118.processed, tests/results/119.processed,
	  tests/results/120.processed, tests/results/121.processed,
	  tests/results/122.processed, tests/results/123.processed,
	  tests/results/124.processed: new convention: char* never 0.
	  assert in cord on that

	* src/main/pa_charset.C: couple more asserts

	* src/: main/pa_charset.C, include/pa_charset.h: little transcodes
	  speedup

	* src/main/pa_charset.C: couple assertions on fantastic situations
	  added [may be those is the case now?]

	* src/main/pa_charset.C: bugfix on memory buffer overrun [but
	  that's memory from gc_malloc, not from g_malloc :(, but would
	  hope]

	* src/main/pa_charset.C: bugfix on memory buffer overrun [but
	  that's memory from gc_malloc, not from g_malloc :(, but would
	  hope]

	* src/main/pa_charset.C: checked custom malloc for returning 0

2003-04-09  paf

	* src/classes/date.C: merged ^date.roll changes

	* src/classes/date.C: ^date.roll bug fix

	* src/classes/date.C: ^date.roll now throws less errors: month
	  shifts handles end of month situation by reducing day number
	  hour-hole shift reduces hour to recover

	* src/targets/cgi/pp3.cmd: custom profiling script: plist/ST <<
	  Sort by function time

	* operators.ru.txt, operators.txt, src/main/pa_charset.C,
	  src/main/pa_common.C: http://   $.charset[] param done

	* tests/: 122.html, results/122.processed: 122 date test <= and ==
	  added [after volatile fix. passes on win&intel-solaris]

2003-04-08  paf

	* src/: classes/file.C, classes/op.C, classes/table.C,
	  classes/xdoc.C, include/pa_charset.h, include/pa_charsets.h,
	  include/pa_common.h, include/pa_request_charsets.h,
	  main/pa_charset.C, main/pa_charsets.C, main/pa_common.C,
	  main/pa_exec.C, main/pa_request.C, main/untaint.C,
	  types/pa_value.h, types/pa_vmail.C, types/pa_vrequest.C,
	  types/pa_vresponse.C: started http://   $.charset[] param and
	  http response charset detection just compiled.  todo:test

	* src/main/pa_common.C: merged PA_USE_ALARM bugfix from HEAD

	* src/: classes/string.C, include/pa_string.h, main/pa_string.C,
	  main/untaint.C, targets/isapi/parser3isapi.C, types/pa_vform.C,
	  types/pa_vmail.C: changed transcode param converntion  along with
	  string creating convention -- all strings are zero-terminated,
	  this allowed to fix one remaining String("123", 2) case

	* src/: classes/date.C, classes/file.C, classes/hash.C,
	  classes/op.C, classes/string.C, classes/table.C,
	  include/pa_charset.h, include/pa_memory.h, include/pa_string.h,
	  main/compile.tab.C, main/pa_charset.C, main/pa_exec.C,
	  main/pa_request.C, main/pa_string.C, main/pa_uue.C,
	  main/untaint.C, types/pa_vfile.C, types/pa_vfile.h,
	  types/pa_vform.C, types/pa_vform.h, types/pa_vmail.C: pa_vform
	  violated String::invariant. started fixing [not compiled now]

	* src/: classes/string.C, include/pa_string.h, lib/cord/cordbscs.c,
	  main/compile.tab.C, main/compile.y, main/pa_string.C,
	  main/untaint.C, targets/cgi/parser3.C: number of string style
	  improvements & optimizations

	* src/classes/xnode.C: =0 bug fix [left from autoptr default ctor
	  :(]

	* src/main/untaint.C: removed redundant & in CORD_pos param passing
	  [for it's a pointer really]

	* src/main/untaint.C: CORD_pos_advance turned out to have limit on
	  'n' param. worked that around

	* src/lib/cord/: Makefile.am, cordbscs.c, source.url: From: "Boehm,
	  Hans"  To: "'Alexandr Petrosian (PAF)'"
	  ; "Boehm, Hans"  Sent: Tuesday,
	  April 08, 2003 2:16 AM Subject: RE: libgc 6.2.alpha4
	  cord/cordbscs.c/CORD_cat bug [were: CORD__extend_path bug?

	  Thanks for the bug report and patch.

	  I hadn't looked at this code in a while.  Reading it now, it
	  seems to me that the tests should also be ">= MAX_DEPTH" to
	  comply with the invariant, though that may not matter a lot.	I
	  changed that, too.

	  Hans

2003-04-07  paf

	* src/: include/pa_common.h, main/pa_common.C, main/pa_exec.C:
	  merged from head:safe mode error message now includes numbers

	* src/main/execute.C: n-th attempt to make a=a work with double.
	  problem: as_double returns it's result in fp-register compiler
	  optimizes access to that register after b->as_double, and just
	  compares ALREADY_STORED_VALUE with prev-calculated a->as_double
	  from memory.	_SAME_ double values do not match here.  when
	  forced to REload fp-register, values do match.

	  tried to make them volatile.

	* src/main/execute.C: n-th attempt to make a=a work with double.
	  problem: as_double returns it's result in fp-register compiler
	  optimizes access to that register after b->as_double, and just
	  compares ALREADY_STORED_VALUE with prev-calculated a->as_double
	  from memory.	_SAME_ double values do not match here.  when
	  forced to REload fp-register, values do match.

	  tried to make them volatile.

	* src/types/pa_vobject.h: small style change

	* src/: lib/cord/cordbscs.c, include/pa_string.h: CORD_cat bugfix

	* src/: include/pa_common.h, main/pa_common.C, main/pa_exec.C: safe
	  mode error message now includes numbers

	* src/: main/untaint.C, targets/cgi/parser3.C: unknown untaint lang
	  now causes death

2003-04-04  paf

	* src/: classes/file.C, include/pa_exec.h, main/pa_exec.C:
	  incorportated pa_exec patch by From: "Victor Fedoseev"
	   To: "Alexandr Petrosian (PAF)" 
	  Sent: Thursday, January 23, 2003 9:14 AM

	  huge speedup on ^file::cgi with big result

	* src/classes/table.C: sort table with 0 rows bug fixed

	* src/types/pa_vhash.h: $hash._default showed in foreach & co bug
	  fix http://i2/tasks/edit/?id=4493701604654042676

	  @main[] $with_default[  $.a[1]  $._default[default from
	  with_default] ] ^show[$with_default]

	  $to_add_to[	  $.b[2] ] ^to_add_to.add[$with_default]
	  =$to_add_to.xxx=
^show[$to_add_to] $cloned[^hash::create[$with_default]] =$cloned.xxx=
^show[$cloned] @show[hash] ^hash.foreach[k;v]{ $k = $v
}
* src/classes/hash.C: $hash._default showed in foreach & co bug fix http://i2/tasks/edit/?id=4493701604654042676 @main[] $with_default[ $.a[1] $._default[default from with_default] ] ^show[$with_default] $to_add_to[ $.b[2] ] ^to_add_to.add[$with_default] =$to_add_to.xxx=
^show[$to_add_to] $cloned[^hash::create[$with_default]] =$cloned.xxx=
^show[$cloned] @show[hash] ^hash.foreach[k;v]{ $k = $v
}
* src/types/pa_vmail.C: mail receive: .txt attachemnts bug fix http://i2/tasks/edit/?id=4507350336410850921 * src/classes/xdoc.C: memory allocation func bugfix http://i2/tasks/edit/?id=4499303470368629745 * src/classes/math.C: allowed random 1... * src/classes/math.C: allowed random 0.. * src/main/pa_globals.C: exif mem leak http://i2/tasks/edit/?id=4480590323629807263 * src/: classes/classes.dsp, main/main.dsp, targets/cgi/parser3.dsp, types/pa_vmail.C, types/types.dsp: buf fix http://i2/tasks/edit/?id=4493946731322521294 $.to[billgates@microsoft.com BCc: send-spam-to@someemails.ru ] * src/: classes/classes.dsp, lib/ltdl/libltdl.dsp, lib/md5/md5.dsp, lib/pcre/pcre.dsp, main/compile.tab.C, main/main.dsp, main/pa_globals.C, targets/cgi/parser3.dsp, types/types.dsp: links to xml libs made relative, no need to unpack parser3project to /parser3project. * src/main/: compile.tab.C, compile.y, compile_tools.h: error column more precise - tab handling bug fixed * src/main/: compile.tab.C, compile.y: more understandable error message in case @CLASS with more then one line inside * src/targets/cgi/parser3.C: more understandable error message in case of errors in @unhandled_exception 2003-04-03 paf * INSTALL, src/include/pa_operation.h, src/include/pa_request.h, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.C, src/main/compile_tools.h, src/main/execute.C, src/main/pa_request.C: debug info format simplified, now it's: OP_VALUE Operation::Origin << here value* higher limits: file number (max: 255) line number (max: 64535) column number (max: 255) * src/classes/math.C: top limit * src/main/: compile.C, compile.tab.C, compile.y, compile_tools.h: precise parse error position in case of ^bug ] * src/classes/op.C, src/main/pa_request.C, tests/042.html: test 042 changed to realities, and passed [bug fixed] * src/: classes/op.C, include/pa_request.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/pa_request.C: introducing ^process...[main-method-alias] * src/: classes/date.C, classes/image.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, types/pa_vmethod_frame.h: MethodParams& now [methods without params receive zero reference, but they are expected not to look there] * operators.ru.txt, operators.txt, src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/hash.C, src/classes/image.C, src/classes/int.C, src/classes/mail.C, src/classes/math.C, src/classes/memory.C, src/classes/op.C, src/classes/response.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h, src/main/execute.C, src/types/pa_method.h: MethodParams& now [methods without params receive zero reference, but they are expected not to look there] * operators.ru.txt, operators.txt, src/classes/op.C, src/include/pa_request.h, src/main/pa_request.C, src/types/pa_vmethod_frame.h: ^process...[filename] useful for better error reporting [file/line/col] * src/: main/execute.C, types/pa_value.C, types/pa_value.h, types/pa_vstring.h: slightly improved error messages text: 1. is '%s', it 2. method undefined in case of ^void[] * src/: classes/op.C, include/pa_request.h, include/pa_stack.h, include/pa_types.h, main/execute.C, main/pa_request.C: exception handling done. now we have error columns todo: test it * src/: classes/op.C, include/pa_request.h: removed from trace 'a' exception when ^try{ ^throw[a;1] }{ ^throw[b;2] } this makes life easier: were: bad stack order -- were in exception catch unwind order, which didn't match execution order @main[] ^try{ ^first[] }{ ^throw[c;3] } @first[] ^throw[a;1] showed throw a first throw b try which is no good * src/: classes/op.C, include/pa_request.h, include/pa_stack.h, main/compile.tab.C, main/execute.C, main/pa_request.C: strack trace reset after handled exception [old bug fixed] * src/main/: compile.tab.C, compile.y: parse position old bug fixed. position reporting made precise [both, in parse erros and runtime errors] 2003-04-02 paf * src/: include/pa_operation.h, include/pa_request.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_exception.C, main/pa_request.C: debug info: started using. todo:complete * src/: classes/op.C, include/pa_operation.h, include/pa_request.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_request.C: prepared debug info todo:use it * src/include/pa_operation.h: strange mistake fixed: forgot to return Operation class->union after switching from autoptrs. * tests/: Makefile, results/108.processed, results/117.processed: meta considered OK [it's up to coder now to remove it not needed] * src/main/pa_dictionary.C, tests/Makefile: replace bug fix [broke Dictionary constructor when moved to gc] * src/main/pa_common.C: uncommented http:// file loading * src/include/pa_array.h, src/main/execute.C, src/targets/cgi/parser3.C, tests/run_parser.sh: gif encoder bug fix [gdGrowingBuf] * configure.in, src/lib/Makefile.am: removed patches * configure, src/include/pa_config_auto.h.in, src/main/pa_charset.C: --enable-assertions autoconf-ed * src/main/pa_common.C: uncommented http:// file loading * src/: classes/xdoc.C, types/pa_vxdoc.h: removed ref leak in xdoc::create/load * src/: classes/form.C, classes/hash.C, classes/image.C, classes/string.C, classes/table.C, classes/void.C, include/pa_common.h, main/pa_common.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_string.C: all calls to String::String(str,helper_length) are checked. found/fixed one place: $request:body now zero-terminated, * src/: classes/op.C, classes/table.C, include/pa_request.h, main/compile_tools.C, main/execute.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.h, types/pa_vxnode.h: more locally scoped vars in execute (more easily optimizable) * src/: classes/table.C, include/pa_table.h, main/pa_table.C: few for(size_t i=0...) -> for(Array_iterator... i(..); i.has_next() * src/: include/pa_array.h, include/pa_stack.h, include/pa_string.h, main/compile_tools.C, main/main.dsp, main/pa_table.C, types/pa_vmethod_frame.C: array get/put check become assertion iterator in methodframe filler * src/: include/pa_array.h, include/pa_stack.h, main/main.dsp, targets/cgi/parser3.C: array::get/put inlined * src/: lib/cord/cordbscs.c, main/pa_globals.C: globals.c: gc_substitute_memory_management_functions +installed CORD_oom function * configure.in, src/classes/xnode.C, src/include/pa_config_fixed.h, src/include/pa_config_includes.h, src/include/pa_string.h, src/lib/cord/cordbscs.c, src/main/pa_memory.C, src/targets/cgi/parser3.C: converted debug hacks to ANSI assertions started configure.in --enable-assertions 2003-04-01 paf * src/: classes/xdoc.C, classes/xnode.h, include/pa_memory.h, main/pa_memory.C, targets/cgi/parser3.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: memory bug debugged down: gdome uses glib memory, and stores last pointer to xmlDoc there, gc misses that and collects valid memory fixed by remembering xmlDoc from dom object in xdoc. todo: do something with premature free of xdoc with xnodes/node values referring into it * src/classes/: mail.C: typo fix * src/main/pa_memory.C: bug() to set bpt in (memory.c) some .am changes * src/: include/pa_memory.h, main/pa_common.C, main/pa_globals.C, main/pa_memory.C: moved memory debugging to global level: to pa_gc_malloc * src/: main/pa_globals.C, targets/cgi/parser3.C: xml memory debugging showed no errors. todo: debug parser memory * src/targets/cgi/: parser3.C, parser3.dsp: more build configurations * src/: classes/classes.dsp, include/pa_config_fixed.h, main/compile.tab.C, main/main.dsp, main/pa_globals.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: prepared xml-static configuration 2003-03-31 paf * INSTALL, src/classes/xdoc.C, src/main/pa_globals.C, src/targets/cgi/parser3.C, src/targets/cgi/parser3.dsp: started xml lib memory debugging, simple checks failed: it seems that library does realloc(bad ptr), and recording those ptrs in heap [for debugging] was bad: heap situation changes = everything works fine * src/: main/pa_charset.C, include/pa_charset.h: worked around xmlRegisterCharEncodingHandler limitation [currently imposed limit of 10 user-defined charsets] 2003-03-28 paf * src/main/execute.C: execution stack copied to local register variable, removed lots [~2e7) of memory accesses 2003-03-27 paf * src/: classes/xdoc.C, main/pa_globals.C: XML memory funcs to GC works in debug, but fails in release todo: fix that * src/: classes/xdoc.C, main/compile.tab.C, main/pa_globals.C, targets/cgi/parser3.C: forgot to merge XML memory funcs replacement from gc branch * src/main/pa_exec.C: introducing append_help_length [radical improvement here] * src/targets/cgi/parser3.C: GC_java_finalization turned off [was 'not recommened' in gc.h, on win32 noticed no difference] * src/include/pa_array.h: returned checked array get [were disabled for debugging] result:not slower [don't understand that, it were INLINED] todo: find out a way of inlining it! * src/: include/pa_string.h, lib/gc/include/gc.h, lib/gc/include/gc_fake.h, main/compile.tab.C, targets/cgi/parser3.C, main/pa_memory.C, targets/cgi/parser3.dsp: convention changed: all resulting strings are zero-terminated * src/: classes/date.C, classes/file.C, classes/hash.C, classes/string.C, classes/table.C, classes/void.C, include/pa_string.h, lib/cord/cord.dsp, lib/cord/cordbscs.c, lib/cord/include/cord.h, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/pa_common.C, main/pa_exec.C, main/pa_request.C, main/pa_string.C, main/pa_uue.C, sql/pa_sql_driver.h, types/pa_value.C, types/pa_venv.h, types/pa_vfile.C, types/pa_vmail.C: introducing append_help_length [radical improvement here] * src/: classes/memory.C, include/pa_array.h, include/pa_hash.h, include/pa_memory.h, lib/cord/cord.dsp, lib/cord/cordxtra.c, lib/gc/include/gc.h, main/pa_memory.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vstatus.C: disabled gc, become even slower * src/: classes/string.C, classes/table.C, include/pa_array.h, include/pa_stack.h, include/pa_string.h, main/compile_tools.C, main/pa_string.C, main/untaint.C, types/pa_vmethod_frame.C: fixed clients of &get(): most to use non-ref version, some[in tight places] to get_unchecked_ref * src/doc/memory.dox: forgot to add * src/: classes/classes.dsp, classes/memory.C, classes/xdoc.C, include/pa_array.h, include/pa_request.h, include/pa_stack.h, include/pa_string.h, lib/cord/cord.dsp, lib/ltdl/libltdl.dsp, lib/md5/md5.dsp, lib/pcre/pcre.dsp, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/main.dsp, main/pa_string.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vmail.C, types/pa_vmethod_frame.C, types/types.dsp: Array::put(index, T>>&<< removed after Stack::pop wiping removed [moved to separate func] other Array & removed 2003-03-26 paf * src/: classes/classes.dsp, classes/file.C, classes/op.C, classes/table.C, include/pa_array.h, include/pa_charset.h, include/pa_stack.h, include/pa_string.h, include/pa_table.h, lib/cord/cord.dsp, lib/ltdl/libltdl.dsp, lib/md5/md5.dsp, lib/pcre/pcre.dsp, main/compile.tab.C, main/compile.y, main/main.dsp, main/pa_charset.C, main/pa_common.C, main/pa_exec.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, main/pa_table.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/types.dsp: pre-evaluated .count() in some places * src/: classes/classes.dsp, lib/ltdl/libltdl.dsp, lib/md5/md5.dsp, lib/pcre/pcre.dsp, main/main.dsp, targets/cgi/parser3.dsp, types/types.dsp: .dsp profiling updated * src/: classes/classes.dsp, lib/cord/cord.dsp, lib/ltdl/libltdl.dsp, lib/md5/md5.dsp, main/main.dsp, targets/cgi/parser3.dsp, types/types.dsp: started profiling * src/: classes/classes.dsp, lib/cord/cord.dsp, main/compile.tab.C, main/compile_tools.h, main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: .dsp updated to use lib/gc,lib/cord * acsite.m4, src/classes/Makefile.am, src/classes/mail.C, src/classes/math.C, src/classes/op.C, src/include/pa_common.h, src/include/pa_config_auto.h.in, src/include/pa_config_fixed.h, src/include/pa_config_includes.h, src/include/pa_request.h, src/include/pa_sql_driver_manager.h, src/include/pa_string.h, src/include/pa_stylesheet_connection.h, src/include/pa_version.h, src/lib/Makefile.am, src/lib/cord/Makefile.am, src/lib/cord/include/Makefile.am, src/lib/cord/include/private/Makefile.am, src/main/Makefile.am, src/main/pa_exec.C, src/main/pa_string.C, src/main/untaint.C, src/targets/cgi/Makefile.am, src/types/Makefile.am, src/types/pa_vclass.h, src/types/pa_vcookie.h, src/types/pa_vform.h, src/types/pa_vhash.h, src/types/pa_vimage.h, src/types/pa_vint.h, src/types/pa_vmail.h, src/types/pa_vresponse.h, src/types/pa_vstateless_class.h, src/types/pa_vstatus.C, src/types/pa_vstatus.h, src/types/pa_vtable.h, src/types/pa_vxdoc.h: configured math funcs ported pa_exec * src/lib/: cord/include/gc.h, gc/include/gc.h: introducing lib/gc * src/lib/cord/include/: cord.h, ec.h, gc.h, private/cord_pos.h: bundled gc includes * src/: classes/op.C, include/pa_array.h, include/pa_sql_connection.h, include/pa_string.h, include/pa_version.h, main/compile.tab.C, main/compile.y, main/execute.C, main/pa_common.C, main/pa_exception.C, main/pa_request.C, main/pa_string.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp: a number of bugfixes [while testing first real site (aval)] 2003-03-25 paf * operators.ru.txt, operators.txt, src/main/pa_sql_driver_manager.C, src/types/pa_vstatus.C: $status.memory used free since_compact process * src/: include/pa_sql_connection.h, main/pa_globals.C, main/untaint.C, sql/pa_sql_driver.h: untaint.C L_SQL * src/main/: pa_charset.C, untaint.C: untaint.C L_MAIL_HEADER * src/main/pa_request.C, src/main/untaint.C, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vfile.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vstring.C, src/types/pa_vstring.h, tests/121.html, tests/results/121.processed: untaint.C L_URI * operators.ru.txt, operators.txt, src/classes/Makefile.am, src/classes/classes.dsp, src/classes/op.C, src/main/pa_request.C, src/types/Makefile.am, src/types/pa_venv.h, src/types/types.dsp, src/classes/memory.C, src/types/pa_vmemory.h: ^memory:compact[] * tests/results/109.processed: it was a bug in parser. updated 109 test result * src/classes/xdoc.C, tests/Makefile: fixed transform params2 * src/main/pa_charset.C, src/targets/cgi/parser3.C, tests/Makefile, tests/results/107.processed: fixed dom language [values are now considered tainted. it was a bug in parser. updated 107 test result * src/classes/xdoc.C: fixed transform params * src/: include/pa_stylesheet_manager.h, main/pa_stylesheet_manager.C: fixed stylesheet caching * src/: include/pa_memory.h, main/pa_charset.C: memory: new 'new' overloads for structure handling * src/: classes/image.C, classes/xdoc.C, classes/xnode.C, include/pa_string.h, main/pa_string.C, types/pa_vxnode.C: removed StringBody(0) ambiguilty, introducting static StringBody::Format(int) * src/: main/pa_request.C, types/pa_vxnode.C: vxnode compiled xml linked * src/types/pa_vxdoc.C: vxdoc compiled * src/: classes/xnode.C, classes/xnode.h, include/pa_memory.h, types/pa_vxdoc.h, types/pa_vxnode.h: xnode.C compiled, doc/node finalizers isntalled * src/: classes/image.C, classes/xdoc.C, classes/xnode.h, doc/exception.dox, doc/index.dox, include/pa_charset.h, include/pa_memory.h, include/pa_request.h, include/pa_string.h, main/pa_charset.C, main/pa_memory.C, main/pa_string.C: xdoc.C compiled todo: xnode.C / finalizers * src/doc/string.dox: updated: new string internals 2003-03-24 paf * src/: classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_charset.h, include/pa_config_fixed.h, include/pa_request.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, main/pa_charset.C, main/pa_exception.C, main/pa_globals.C, main/pa_request.C, main/pa_stylesheet_manager.C, types/pa_vxdoc.h, types/pa_vxnode.h: started XML * src/main/: pa_common.C, pa_sql_driver_manager.C: http:// * src/: classes/file.C, classes/image.C, classes/mail.C, include/pa_string.h, main/pa_common.C, main/pa_sql_driver_manager.C: introducing string[body]::pos(char) * src/: classes/file.C, classes/image.C, classes/mail.C, include/pa_memory.h, include/pa_string.h, main/pa_common.C, main/pa_request.C, main/pa_sql_driver_manager.C, types/pa_vimage.h: size_t pos everywhere checks changed to check for eq STRING_NOT_FOUND * src/main/pa_string.C, src/main/untaint.C, tests/Makefile: string optimize bit implemented * src/: include/pa_string.h, main/pa_string.C, main/untaint.C: String::ArrayFragment::append_positions fixed * src/: classes/table.C, include/pa_string.h, main/pa_string.C: String::this_starts fixed * src/main/pa_string.C, tests/Makefile: string::pos fixed * src/: include/pa_hash.h, main/execute.C, main/pa_string.C: hashcode implemented fully, including per-char callback [it can be - substr CORD node] * src/: include/pa_array.h, main/compile.tab.C: gif encoding rewritten to rewalloc with 100byte buf ahead * src/classes/image.C, src/classes/op.C, src/classes/table.C, src/include/pa_string.h, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C, src/main/pa_common.C, src/main/untaint.C, tests/Makefile: attempt to do gif encoding to CORD_ec [bad] would rewrite as realloc now * src/: classes/date.C, classes/file.C, classes/form.C, classes/image.C, classes/math.C, classes/op.C, classes/table.C, include/pa_cache_managers.h, include/pa_charsets.h, include/pa_common.h, include/pa_request.h, include/pa_sql_driver_manager.h, include/pa_table.h, main/pa_charset.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_request.C, main/pa_uue.C, targets/isapi/parser3isapi.C, types/pa_value.C, types/pa_value.h, types/pa_vmail.C, types/pa_vmethod_frame.C, types/pa_vstateless_class.h: 2*2 worked :) * parser3.dsw, src/classes/date.C, src/classes/file.C, src/include/pa_exec.h, src/include/pa_string.h, src/main/pa_exec.C, src/main/pa_sql_driver_manager.C: empty run passed OK * src/: classes/hash.C, classes/string.C, classes/table.C, types/pa_value.C: all linked todo: debug * src/: classes/mail.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vstateless_class.C: all compiled. todo:link * src/types/pa_wcontext.C: pa_wcontext.C compiled * src/types/pa_vtable.C: pa_vtable.C compiled * src/types/pa_vstring.C: pa_vstring.C compiled * src/types/pa_vstatus.C: pa_vstatus.C compiled * src/types/: pa_vmath.C, pa_vmethod_frame.C, pa_vmethod_frame.h, pa_vobject.C, pa_vrequest.C, pa_vresponse.C, pa_vstateless_class.C, pa_vstateless_class.h: pa_vstateless_class.C compiled * src/: classes/xdoc.C, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C: pa_vmail.C compiled * src/types/: pa_vhash.C, pa_vimage.C: pa_vimage.C compiled * src/types/pa_vform.C: pa_vform.C compiled * src/types/pa_vfile.C: pa_vfile.C compiled * src/types/: pa_value.h, pa_vclass.C, pa_vcookie.C, pa_vstateless_class.C: pa_vcookie.C compiled * src/: classes/string.C, types/pa_value.C, types/pa_value.h, types/pa_vhash.h: pa_value.C compiled * src/: main/execute.C, main/pa_string.C, types/pa_wcontext.h: classes.lib main.lib compiled * src/classes/void.C: void.C compiled * src/: classes/string.C, classes/table.C, include/pa_string.h, main/pa_string.C, types/pa_vtable.C, types/pa_vtable.h: table.C compiled * src/: classes/string.C, include/pa_request.h, include/pa_string.h, main/pa_string.C: string.C compiled * src/: classes/op.C, classes/string.C, classes/table.C, classes/void.C, include/pa_sql_connection.h, include/pa_string.h, main/pa_request.C, main/pa_string.C: op.C compiled * src/classes/: math.C, op.C: math.C compiled * src/: classes/mail.C, classes/string.C, classes/table.C, types/pa_vmail.h: mail.C compiled * src/classes/: int.C, table.C: int.C compiled * src/: classes/hash.C, classes/image.C, classes/string.C, classes/table.C, include/pa_memory.h, include/pa_string.h, main/pa_memory.C, types/pa_vimage.h, types/pa_vmail.C: image.C compiled * src/: classes/hash.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, include/pa_request.h, include/pa_sql_connection.h: hash.C compiled * src/: classes/classes.C, classes/classes.awk, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, include/pa_memory.h, include/pa_request.h, include/pa_sapi.h, include/pa_string.h, main/pa_string.C, types/pa_vdate.h, types/pa_vmethod_frame.h: file.C table.C compiled * src/: include/pa_string.h, main/pa_string.C, main/pa_uue.C, main/untaint.C: main.lib compiled 2003-03-21 paf * src/: classes/op.C, include/pa_cache_managers.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, main/pa_exception.C, main/pa_globals.C, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h, types/pa_vimage.C: pa_sql_driver_manager.C compiled * src/: classes/hash.C, classes/image.C, classes/op.C, classes/xdoc.C, classes/xnode.C, include/pa_common.h, include/pa_hash.h, include/pa_request.h, include/pa_string.h, main/compile.C, main/pa_common.C, main/pa_request.C, types/pa_vmail.C, types/pa_vresponse.C, types/pa_vxnode.C: pa_request.C compiled * src/: classes/hash.C, classes/mail.C, classes/op.C, include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_value.C, types/pa_value.h, types/pa_vcookie.C, types/pa_vhash.h, types/pa_vimage.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vresponse.h, types/pa_vtable.C: pa_request.C 50% compiled * src/: include/pa_exec.h, include/pa_string.h, main/pa_exec.C, main/pa_string.C: pa_exec.C compiled [win32 only for now] todo: on unix * src/: include/pa_charset.h, include/pa_charsets.h, include/pa_exec.h, main/compile.tab.C, main/pa_charset.C, main/pa_charsets.C, main/pa_dictionary.C, main/pa_exec.C: pa_charsets.C compiled * src/: classes/image.C, classes/mail.C, classes/op.C, include/pa_request.h, include/pa_string.h, main/compile.tab.C, main/compile.y, main/execute.C, main/pa_common.C, main/pa_request.C, types/pa_junction.h, types/pa_method.h, types/pa_vcode_frame.h, types/pa_vimage.h, types/pa_vmethod_frame.h: execute.C compiled * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_cache_managers.h, include/pa_charsets.h, include/pa_common.h, include/pa_exec.h, include/pa_memory.h, include/pa_operation.h, include/pa_request.h, include/pa_sapi.h, include/pa_sql_driver_manager.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_exec.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_junction.h, types/pa_method.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: introducing StringBody [C++ CORD wrapper] * src/: lib/cord/cordbscs.c, main/pa_string.C: test14 [bug fixed] * src/: classes/file.C, include/pa_charset.h, main/pa_charset.C: $file::exec/cgi[script; $.charset[this is script's charset] command line, env values, input got transcoded before call stdout, stderr got transcoded after call * src/classes/file.C: ^file::exec/cgi now does not pass post data by default. use: ^file::exec[...;$.stdin[$request.body] * src/main/pa_common.C: } typo bug fix * src/main/pa_common.C: } typo bug fix 2003-03-20 paf * src/: include/pa_string.h, lib/cord/cordbscs.c, main/pa_string.C, main/untaint.C: cord bug fix, but still errors todo: clear out * src/include/pa_string.h: more tests * src/main/pa_string.C: string.pos fixed * src/lib/: ltdl/config_fixed.h, ltdl/configure, ltdl/configure.in, ltdl/libltdl.dsp, ltdl/ltdl.c, ltdl/ltdl.h, pcre/dftables.c, pcre/get.c, pcre/internal.h, pcre/maketables.c, pcre/pcre.c, pcre/pcre.h, pcre/pcre_parser_ctype.c, pcre/study.c: undone bad replaces * src/: classes/image.C, include/pa_dictionary.h, include/pa_string.h, lib/ltdl/ltdl.c, lib/ltdl/ltdl.h, lib/pcre/internal.h, lib/pcre/pcre.c, lib/pcre/study.c, main/compile.tab.C, main/pa_dictionary.C, main/pa_string.C, main/untaint.C, types/pa_vmail.C: more tests [bugs fixed] * src/include/pa_string.h: warning * src/include/pa_string.h: this_starts fixed * src/: include/pa_string.h, main/pa_string.C: added: assertion on new String ctor & append params convention * src/: classes/file.C, classes/hash.C, classes/image.C, classes/mail.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, include/pa_common.h, include/pa_memory.h, include/pa_string.h, main/compile.tab.C, main/pa_common.C, main/pa_exception.C, main/pa_exec.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/untaint.C, targets/isapi/parser3isapi.C, types/pa_vimage.C, types/pa_vmail.C: more tests OK * src/: include/pa_array.h, include/pa_hash.h, include/pa_memory.h, include/pa_string.h, main/pa_memory.C, main/pa_string.C: test: gc/exit runned OK * src/types/pa_vmail.C: another naming problem: should not name vars like that: unpredictable close caused problems with later sending mail: Mar 20 06:39:53 pt-6 sendmail[19044]: File descriptors missing on startup: stdin; Bad file number todo: find out why so many filters(stream) here. probably wrong? * src/: include/pa_dictionary.h, include/pa_string.h, main/pa_common.C, main/pa_dictionary.C, main/pa_string.C, main/untaint.C: test compiled * src/: classes/image.C, classes/mail.C, classes/math.C, classes/string.C, include/pa_dictionary.h, include/pa_hash.h, include/pa_memory.h, include/pa_string.h, lib/cord/cordbscs.c, lib/cord/cordxtra.c, lib/pcre/dftables.c, lib/pcre/get.c, lib/pcre/maketables.c, lib/pcre/pcre.c, lib/pcre/pcre.h, lib/pcre/pcre_parser_ctype.c, lib/pcre/study.c, main/compile.tab.C, main/pa_common.C, main/pa_dictionary.C, main/pa_exec.C, main/pa_memory.C, main/pa_request.C, main/pa_string.C, main/untaint.C, types/pa_vfile.h, types/pa_vmail.C: untaint.C 99% [except mail&sql&optimize] * parser3.dsw, src/classes/file.C, src/classes/image.C, src/classes/op.C, src/classes/string.C, src/classes/table.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_common.h, src/include/pa_memory.h, src/include/pa_request.h, src/include/pa_request_charsets.h, src/include/pa_sql_connection.h, src/include/pa_string.h, src/main/compile.tab.C, src/main/execute.C, src/main/pa_charset.C, src/main/pa_common.C, src/main/pa_exception.C, src/main/pa_exec.C, src/main/pa_request.C, src/main/pa_sql_driver_manager.C, src/main/pa_stylesheet_manager.C, src/main/untaint.C, src/sql/pa_sql_driver.h, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, src/types/pa_value.C, src/types/pa_vcode_frame.h, src/types/pa_vcookie.C, src/types/pa_venv.h, src/types/pa_vform.C, src/types/pa_vmail.C, src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vresponse.C, src/types/pa_vstatus.C, src/types/pa_vstring.C, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_wcontext.h: untaint.C 30%, pa_common.C [done, without http for now] 2003-03-19 paf * src/: classes/date.C, classes/form.C, classes/hash.C, classes/image.C, classes/mail.C, classes/op.C, classes/xdoc.C, classes/xnode.C, include/pa_array.h, include/pa_config_fixed.h, include/pa_exception.h, include/pa_memory.h, include/pa_sapi.h, include/pa_string.h, include/pa_table.h, main/compile.C, main/compile_tools.C, main/execute.C, main/pa_charset.C, main/pa_common.C, main/pa_exception.C, main/pa_request.C, main/pa_socks.C, main/pa_string.C, main/pa_table.C, main/untaint.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_value.C, types/pa_vcookie.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vmail.C, types/pa_vmethod_frame.h, types/pa_vstateless_class.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: started test * src/lib/pcre/: dftables.c, get.c, maketables.c, pcre.c, pcre.dsp, pcre.h, pcre_parser_ctype.c, study.c: restored bad replaces * src/: classes/op.C, include/pa_array.h, include/pa_memory.h, include/pa_string.h, main/pa_string.C: string compiled todo: test it * src/: classes/classes.dsp, classes/string.C, classes/table.C, include/pa_array.h, include/pa_common.h, include/pa_dictionary.h, include/pa_exception.h, include/pa_string.h, include/pa_table.h, lib/cord/cord.dsp, main/compile.tab.C, main/main.dsp, main/pa_common.C, main/pa_string.C, targets/cgi/parser3.dsp, types/pa_method.h, types/pa_value.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/types.dsp: string reimplementation with cord+array: 70% 2003-03-18 paf * src/: classes/date.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, classes/xnode.C, include/pa_hash.h, include/pa_string.h, main/pa_string.C, types/pa_vmail.C: lots of replacements, todo:we can ignore lang in cmp and pos really, but would split properly! * src/lib/cord/: cord.dsp, cordbscs.c, cordprnt.c, cordxtra.c: gc: cord part made parser/src/lib: it's not compiled into libgc by default * parser3.dsw, src/classes/classes.dsp, src/classes/classes.h, src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/form.C, src/classes/hash.C, src/classes/image.C, src/classes/int.C, src/classes/mail.C, src/classes/math.C, src/classes/op.C, src/classes/response.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xdoc.C, src/classes/xnode.C, src/classes/xnode.h, src/include/Makefile.am, src/include/pa_cache_managers.h, src/include/pa_charset.h, src/include/pa_charsets.h, src/include/pa_common.h, src/include/pa_dictionary.h, src/include/pa_exception.h, src/include/pa_exec.h, src/include/pa_globals.h, src/include/pa_hash.h, src/include/pa_memory.h, src/include/pa_pool.h, src/include/pa_request.h, src/include/pa_request_charsets.h, src/include/pa_sapi.h, src/include/pa_sql_connection.h, src/include/pa_sql_driver_manager.h, src/include/pa_string.h, src/include/pa_stylesheet_connection.h, src/include/pa_stylesheet_manager.h, src/include/pa_table.h, src/include/pa_uue.h, src/lib/pcre/get.c, src/main/Makefile.am, src/main/compile.C, src/main/compile.tab.C, src/main/compile_tools.C, src/main/compile_tools.h, src/main/execute.C, src/main/main.dsp, src/main/pa_charset.C, src/main/pa_charsets.C, src/main/pa_common.C, src/main/pa_dictionary.C, src/main/pa_exception.C, src/main/pa_exec.C, src/main/pa_globals.C, src/main/pa_memory.C, src/main/pa_pool.C, src/main/pa_request.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_stylesheet_manager.C, src/main/pa_table.C, src/main/pa_uue.C, src/main/untaint.C, src/targets/cgi/parser3.C, src/targets/cgi/parser3.dsp, src/targets/isapi/parser3isapi.C, src/types/pa_junction.h, src/types/pa_method.h, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vclass.C, src/types/pa_vclass.h, src/types/pa_vcode_frame.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vdate.h, src/types/pa_vdouble.h, src/types/pa_venv.h, src/types/pa_vfile.C, src/types/pa_vfile.h, src/types/pa_vform.C, src/types/pa_vform.h, src/types/pa_vhash.C, src/types/pa_vhash.h, src/types/pa_vimage.C, src/types/pa_vimage.h, src/types/pa_vint.h, src/types/pa_vmail.C, src/types/pa_vmail.h, src/types/pa_vmath.C, src/types/pa_vmath.h, src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vstatus.C, src/types/pa_vstatus.h, src/types/pa_vstring.C, src/types/pa_vstring.h, src/types/pa_vtable.C, src/types/pa_vtable.h, src/types/pa_vvoid.h, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, src/types/pa_vxnode.h, src/types/pa_wcontext.C, src/types/pa_wcontext.h, src/types/pa_wwrapper.h, src/types/types.dsp: started porting to gc: PA_Object done lots of replacements also * src/: include/pa_pool.h, main/execute.C, targets/cgi/pa_pool.C: gc logging 2003-03-17 paf * src/: classes/date.C, classes/file.C, classes/form.C, classes/image.C, classes/mail.C, classes/op.C, classes/table.C, classes/xdoc.C, classes/xnode.C, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_string.h, include/pa_types.h, main/compile.C, main/compile.tab.C, main/execute.C, main/pa_charset.C, main/pa_common.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_pool.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_uue.C, main/untaint.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/cgi/pool_storage.h, types/pa_vcookie.C, types/pa_vdouble.h, types/pa_vfile.C, types/pa_vform.C, types/pa_vint.h, types/pa_vmail.C, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: libgc attempt 2003-03-13 paf * src/: include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C, targets/cgi/parser3.C: lt_dlexit called * src/: include/pa_request.h, lib/ltdl/libltdl.dsp, lib/md5/md5.dsp, main/compile.tab.C, main/execute.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_value.C, types/pa_value.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_vstatus.C, types/types.dsp: set_base, set_derived simplified [counter leaks fixed] * ChangeLog, src/include/pa_config_fixed.h, src/types/pa_vstatus.C, src/types/types.dsp: incorporated status class patch From: "Victor Fedoseev" Sent: Thursday, January 23, 2003 8:14 AM now we have $status.rusage.maxrss,tv_sec,tv_usec un WIN32 [plus Win32 specific: QuotaPeakNonPagedPoolUsage QuotaPeakPagedPoolUsage PeakPagefileUsage] 2003-03-12 paf * configure, configure.in, src/lib/ltdl/configure, src/lib/ltdl/configure.in, src/targets/cgi/Makefile.am: lib/ltdl/Makefile now created by /configure.in only [were by lib/ltdl/configure.in OVERWRITE] * configure, configure.in, src/targets/cgi/Makefile.am: libstdc++ linkage fixed for g++ 3.2.2 * src/include/pa_stylesheet_manager.h: gcc 3.2 rightliy complained on using privately declared class [fixed] * src/: include/pa_sql_driver_manager.h, main/compile.tab.C: gcc 3.2 rightliy complained on using privately declared class [fixed] * src/targets/cgi/parser3.C: 1. more detailed log on signals. 2. sigpipe before request constructor now causes death * src/: include/pa_request.h, main/compile.tab.C, main/execute.C, targets/cgi/parser3.C: SIGPIPE now can be intercepted and does not cause exception in exception handler * configure, configure.in, src/targets/cgi/Makefile.am: configure now default links libstdc++ statically. that can be overriden by --with-dynamic-stdcpp 2003-03-11 paf * src/: main/compile.tab.C, main/compile.y, sql/pa_sql_driver.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: removed necessity of libstdc++ * src/include/pa_request.h: ANTI_ENDLESS_EXECUTE_RECOURSION doubled * src/include/pa_request.h: ANTI_ENDLESS_EXECUTE_RECOURSION doubled 2003-03-08 paf * tests/Makefile: make install & co * src/: include/pa_request.h, classes/op.C: removing vclass,object.h -> pa_request.h dependency * src/: classes/mail.C, classes/response.C, include/pa_request.h, main/pa_request.C: removing vform,response,cookie.h -> pa_request.h dependency * src/include/pa_request.h: removing vmail.h -> pa_request.h dependency [testing...] * src/: include/pa_config_fixed.h, types/pa_vxdoc.C: yet another return 0; fixed * src/: include/pa_config_fixed.h, types/pa_vmail.C, types/pa_vmail.h: vmail.C received just compiled [not tested] * src/classes/xdoc.C: forgotten: global xdoc when ndef XML * src/main/pa_request.C: forgotten: ifdef XML * src/main/pa_request.C: forgotten: ifdef XML * src/targets/cgi/parser3.C: todo: move to latest xml version on win32 and run memleak tests again * src/targets/cgi/parser3.C: charsets: see some strange things with old xml lib-- it's internal memory handling has faults * src/: include/pa_types.h, main/pa_charset.C: charsets: fixed problems when transcode from charset A to A. * src/: main/untaint.C, types/pa_vmail.C: mail: transcode fixed. todo: still problems when transcode from charset A to A. * src/: classes/hash.C, classes/mail.C, classes/string.C, classes/table.C, include/pa_array.h, main/pa_sql_driver_manager.C, types/pa_vmail.C, types/pa_vmail.h: started full-scale-site-test [~ http://parser.ru sources] some fixes * tests/: 021.html, 031.html, 033.html, 109.html, 110.html, 111.html, 112.html, 113.html, 114.html, 115.html, 116.html, 117.html, 118.html, 119.html, 120.html, results/109.processed, results/110.processed, results/111.processed, results/112.processed, results/113.processed, results/114.processed, results/115.processed, results/116.processed, results/117.processed, results/118.processed, results/119.processed, results/120.processed: xml: tests 109 dom create/show 110 xpath selectSingle 111 xdoc.create from tainted & 112 xdoc.create/output with russian attr value 113 xpath selectString/Number 114 dom attributes.count 115 xpath selectBool 116 output media-type change 117 transform by dom stylesheet 118 empty transform result 119 dom setAttribute 120 nbsp letter output =END OF PREPARED XML TESTS= 2003-03-07 paf * src/classes/xdoc.C, src/include/pa_charset.h, src/include/pa_stylesheet_connection.h, tests/108.html, tests/108.xsl, tests/results/108.processed: xml: test 108 transform with params [bugs fixed] * src/: main/pa_charset.C, targets/cgi/parser3.C: fixed: mem leak from copy/paste bug * src/classes/xdoc.C, src/include/pa_charset.h, src/include/pa_request.h, src/main/execute.C, src/main/pa_charset.C, src/main/pa_exception.C, src/main/pa_globals.C, src/main/pa_request.C, src/types/pa_vxdoc.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.C, tests/107.html, tests/results/107.processed: xml: test: 107 bug fixes * src/: classes/xdoc.C, classes/xnode.C, classes/xnode.h, types/pa_value.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: test: 107 bug fixes * tests/: 106.html, results/106.processed: test: 106 xdoc create, string * src/: include/pa_charset.h, main/pa_charset.C: xml: charset two mem alloc functions used for different cases [libxml, libxsl] * src/classes/classes.C: fixed: prevent system classes from modification to lock ALL the classes, not only directly used * src/: classes/xdoc.C, types/pa_vxdoc.h, types/pa_vxnode.h: xml: linked * src/: classes/xdoc.C, types/pa_vxdoc.h: xdoc.C compiled 2003-03-06 paf * src/classes/xdoc.C: xdoc.C 50% * src/: classes/xnode.C, classes/xnode.h, include/pa_charset.h, include/pa_memory.h, include/pa_request.h, include/pa_string.h, main/pa_globals.C, main/pa_request.C, main/pa_stylesheet_manager.C: xnode.C compiled * src/: include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C: xml: stylesheet&manager done * src/: include/pa_memory.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, main/pa_stylesheet_manager.C: xml: stylesheet&manager STARTED * src/: include/pa_globals.h, main/pa_charset.C, main/pa_exception.C, main/pa_globals.C: xml: exceptions * src/: include/pa_charset.h, include/pa_config_fixed.h, include/pa_memory.h, include/pa_pool.h, main/pa_charset.C, main/pa_memory.C, main/pa_pool.C, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: xml: charsets * tests/023.html: in some cases it rounded up badly. postponing solution of that problem, making more simple test * tests/: 058_paf2000.png, results/058.processed: .png added with -kb now * src/: include/pa_charset.h, include/pa_charsets.h, main/pa_charset.C, main/pa_charsets.C: charset_utf8 declaration moved to charsets.C 2003-03-05 paf * src/classes/string.C, src/include/pa_string.h, src/main/pa_string.C, tests/105.html, tests/results/105.processed: String::match bug fixed * src/classes/op.C, src/main/main.dsp, tests/104.html, tests/results/104.processed: ^bpt operator added [does int3 in debug build on win32] * tests/: 057.html, results/057.processed: test bug fixed * src/targets/cgi/Makefile.am: linker needed more tricks to link OK * src/classes/math.C: can be: crypt in -lcrypt OK, but crypt.h be missing * src/: include/Makefile.am, main/Makefile.am, types/Makefile.am: forgotten files added to Makes * ltmain.sh: ltmain.sh added * src/types/: pa_vhash.C, pa_vhash.h: hash_default_element_name change undone ;( * src/types/: pa_vhash.C, pa_vhash.h: hash_default_element_name made static * src/: classes/math.C, classes/op.C, classes/string.C, main/pa_exec.C, targets/cgi/Makefile.am: gcc more happy. todo:make linker happy * src/: classes/file.C, include/pa_exec.h, main/pa_exec.C: pa_exec env param made optional 2003-03-04 paf * src/: classes/image.C, include/pa_request.h, include/pa_stack.h, types/pa_vimage.h: number of gcc compiler bugs fixed * tests/: 103.html, 103mark.gif, 103paf2001.gif, results/103.processed: tests: 103 image.copy transparence test * src/main/execute.C, tests/101.html, tests/102.html, tests/results/101.processed, tests/results/102.processed: tests: 101 method/variable name conflict test 102 form fields change should not not change anything [bug fix] * tests/: 057.html, 099.html, 100.html, results/057.processed, results/099.processed, results/100.processed: tests: 57 date create 2002: added 99,100 response:body/download * src/classes/image.C, tests/098.html, tests/098font.gif, tests/results/098.processed: test: 98 image font text [bug fixed] * src/main/pa_common.C, src/targets/cgi/parser3.C, tests/097.html, tests/results/097.processed: test: 97 file::load http:// [bugs fixed] * src/classes/hash.C, src/classes/image.C, src/classes/table.C, src/include/pa_memory.h, tests/096.html, tests/096_dir/163.jpg, tests/096_dir/188.jpg, tests/results/096.processed: tests: 96 image EXIF [bug fixed] * src/classes/table.C, src/main/execute.C, tests/061.dat, tests/061.html, tests/062.html, tests/063.html, tests/064.html, tests/065.html, tests/066.html, tests/067.html, tests/068.html, tests/069.html, tests/070.html, tests/071.html, tests/072.html, tests/073.html, tests/074.html, tests/075.html, tests/076.html, tests/077.html, tests/078.html, tests/080.html, tests/081.html, tests/082.html, tests/083.html, tests/084.html, tests/085.html, tests/086.html, tests/087.html, tests/088.html, tests/089.html, tests/090.html, tests/091.html, tests/092.html, tests/093.html, tests/094.html, tests/095.html, tests/results/061.processed, tests/results/062.processed, tests/results/063.processed, tests/results/064.processed, tests/results/065.processed, tests/results/066.processed, tests/results/067.processed, tests/results/068.processed, tests/results/069.processed, tests/results/070.processed, tests/results/071.processed, tests/results/072.processed, tests/results/073.processed, tests/results/074.processed, tests/results/075.processed, tests/results/076.processed, tests/results/077.processed, tests/results/078.processed, tests/results/080.processed, tests/results/081.processed, tests/results/082.processed, tests/results/083.processed, tests/results/084.processed, tests/results/085.processed, tests/results/086.processed, tests/results/087.processed, tests/results/088.processed, tests/results/089.processed, tests/results/090.processed, tests/results/091.processed, tests/results/092.processed, tests/results/093.processed, tests/results/094.processed, tests/results/095.processed, tests/079.html, tests/results/079.processed: tests: 61 file::stat size 62 string->int autoconvert 63 double .int,dec,div,mul 64 date compare 65 file: basename,justname,justext 66 math:crypt 67 string.match simple on long 68 string.match normalized simple on long 69 string.int 70 file::stat content-type 71 table.join 72 hash parameter conditional pass 73 date daylightsaving,yearday 74 date arithmetics 75 response date values/attributes 76 string.pos of void, void.pos 77 syntax parsing 78 cookie tainting 79 switch with local 80 scientific numeric literal in string autoconvert 81 xor: logical and numerical 82 for delims 83 menu delims 84 table.hash distinct 85 long string replace 86 throw+catch current language preserve 87 bit shifts 88 junction tests + $caller test 89 hash.foreach selfmodification 90 int/void to int 91 $caller test 92 junction is + def junction tests 93 $caller test 94 syntax test 95 table.hash(keygenerator) [bug fixed] * src/main/: execute.C, pa_table.C: test: 59 table.locate [bug fixed] 60 string eq string [bug fixed] * tests/: 053.html, 054.html, 055.html, 056.html, 057.html, 058.html, 058_paf2000.png, 059.html, 060.html, results/053.processed, results/054.processed, results/055.processed, results/056.processed, results/057.processed, results/058.processed, results/059.processed, results/060.processed: test: 53 string.replace 54 junctions 55 table.hash 56 call indirect 57 date.create[string] 58 image.measure[png] * tests/: 052.html, outputs/049.processed, outputs/050.processed, outputs/051.processed, results/052.processed: test: 52 pre/match/post test: passed AS-IT-WERE, but wrong :) separate task: fix that 2003-03-03 paf * tests/: 043.html, 044.html, 045.html, 046.html, 047.html, 048.html, 049.html, 050.html, 051.html, 051b.p, 051t.p, Makefile, parser-cygwin.sh, parser-unix.sh, run_parser.sh, outputs/049.processed, outputs/050.processed, outputs/051.processed, results/001.processed, results/002.processed, results/003.processed, results/005.processed, results/006.processed, results/008.processed, results/009.processed, results/011.processed, results/012.processed, results/013.processed, results/014.processed, results/015.processed, results/016.processed, results/017.processed, results/020.processed, results/021.processed, results/022.processed, results/024.processed, results/025.processed, results/026.processed, results/027.processed, results/028.processed, results/029.processed, results/030.processed, results/031.processed, results/049.processed, results/050.processed, results/051.processed, results/043.processed, results/044.processed, results/045.processed, results/046.processed, results/047.processed, results/048.processed: tests: 43,44,45 date rolls 46 autoevaluating junction 47 table.select 48 name with subvar 49 hash-creating switch 50 process 51 started parent/child, works as it were but it were NOT GOOD, created separate task to fix that * tests/: 042.html, results/042.processed: test: 42 exception.handled * tests/: 041.html, results/041.processed: test: 41 table.locate by expression * tests/: 040.html, results/040.processed: test: 39 method result of type table 40 method param junction auto evaluate * tests/: 039.html, results/039.processed: test: 37 method result of type table * src/main/pa_request.C, src/types/pa_vmath.C, tests/033.html, tests/034.html, tests/035.html, tests/036.html, tests/037.html, tests/038.html, tests/results/033.processed, tests/results/034.processed, tests/results/035.processed, tests/results/036.processed, tests/results/037.processed, tests/results/038.processed: tests: 33 string.replace 34 string.upper 35 table created 36 local/global vars with juntions 37 table clone 38 math PI & number formatting math class registring typo fixed * src/classes/op.C, src/include/pa_request.h, src/include/pa_string.h, src/main/execute.C, src/main/pa_request.C, src/main/pa_string.C, src/main/untaint.C, src/types/pa_vcode_frame.h, src/types/pa_wcontext.h, tests/032.html, tests/results/032.processed: uchar changed to String_UL in all places [was not everywhere] untaint test: 032 * src/targets/cgi/parser3.C, tests/004.html, tests/Makefile, tests/results/004.processed, tests/parser-cygwin.sh, tests/parser-unix.sh: removed -H command line key, now testing using .sh file with SERVER_SOFTWARE=xxx 2003-02-26 paf * src/main/execute.C, src/types/pa_vstateless_class.h, tests/024.html, tests/025.html, tests/026.html, tests/027.html, tests/028.html, tests/029.html, tests/030.html, tests/031.html, tests/results/024.processed, tests/results/025.processed, tests/results/026.processed, tests/results/027.processed, tests/results/028.processed, tests/results/029.processed, tests/results/030.processed, tests/results/031.processed: fixed bug with name_cstr mutable CharPtr more tests * src/: include/pa_sapi.h, main/pa_globals.C, main/pa_memory.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: SAPI::abort << abort. die now just exits * src/classes/classes.awk, src/classes/classes.h, src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/form.C, src/classes/hash.C, src/classes/image.C, src/classes/int.C, src/classes/mail.C, src/classes/math.C, src/classes/op.C, src/classes/response.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_memory.h, src/include/pa_sapi.h, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, src/types/pa_venv.h, src/types/pa_vform.C, tests/015.html, tests/016.html, tests/017.html, tests/018.html, tests/019.html, tests/019paf2001.gif, tests/020.html, tests/021.html, tests/022.html, tests/023.html, tests/022_dir/a.html, tests/022_dir/b.txt, tests/022_dir/c.htm, tests/results/015.processed, tests/results/016.processed, tests/results/017.processed, tests/results/018.processed, tests/results/019.processed, tests/results/020.processed, tests/results/021.processed, tests/results/022.processed, tests/results/023.processed: methoded_array now contains all Mxxx classes SAPI::get_env now returns info on pool more tests * src/include/pa_array.h, src/include/pa_hash.h, src/include/pa_memory.h, src/main/pa_charset.C, tests/001.html, tests/002.html, tests/003.html, tests/004.html, tests/005.html, tests/006.html, tests/007.html, tests/008.html, tests/009.html, tests/010.html, tests/011.html, tests/012.html, tests/013.html, tests/014.html, tests/Makefile, tests/outputs/create-dir, tests/results/001.processed, tests/results/002.processed, tests/results/003.processed, tests/results/004.processed, tests/results/005.processed, tests/results/006.processed, tests/results/007.processed, tests/results/008.processed, tests/results/009.processed, tests/results/010.processed, tests/results/011.processed, tests/results/012.processed, tests/results/013.processed, tests/results/014.processed: hash cloning fixed 2003-02-25 paf * src/main/pa_common.C: typo fixed 2003-02-24 paf * src/types/pa_vcookie.C: fixed all places with bad get_string(0) [one remained] * src/: include/pa_request.h, main/execute.C: few bad get_string(0) [should have been get_string(&pool)] todo: check other such calls * src/: main/compile.tab.C, main/execute.C, types/pa_vfile.h: test10, bad lookups xxx* xxx=smartptr.get(); << is bad style, after ";" original object got destructed, and xxx points to sky * ChangeLog, src/classes/string.C: match bug fixed * src/types/pa_vmail.C: body [text/html] transcoded to $.charset[specified] now * src/main/pa_common.C: stupid gcc [2.95.4] generated bad code which failed to handle sigsetjmp+throw: crashed inside of pre-throw code. rewritten simplier [though duplicating closesocket code] * src/main/pa_common.C: stupid gcc [2.95.4] generated bad code which failed to handle sigsetjmp+throw: crashed inside of pre-throw code. rewritten simplier [though duplicating closesocket code] 2003-02-21 paf * operators.ru.txt, operators.txt, src/targets/cgi/parser3.C, src/types/pa_vcookie.C: $cookie:name[$.expires[date << can be now]] written makefile with regression tests [raw] * src/targets/cgi/parser3.C: MAKE_TEST must be used inside of 'make tests' only [it's not forcing CGI mode now] now use -H to output CGI header when parser used in command line [useful for tests also] * src/targets/cgi/parser3.C: MAKE_TEST environment variable switches on CGI mode, and is used in regression tests * src/: include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C, types/pa_vcookie.h, types/pa_venv.h: env fixed * src/: include/pa_memory.h, main/pa_memory.C: inlined memory handling pa_* * src/: include/pa_memory.h, main/pa_memory.C, include/pa_array.h, include/pa_exception.h, include/pa_pool.h, main/Makefile.am, main/main.dsp, main/pa_array.C, main/pa_pool.C: reorganized memory handling files * src/main/pa_array.C: pool::format_integer terminator fixed * src/: main/execute.C, targets/cgi/parser3.C: release mode now compiles OK test to show benefits of free * src/: classes/file.C, classes/image.C, classes/mail.C, classes/op.C, classes/xdoc.C, main/pa_charset.C, main/pa_exec.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, types/pa_vimage.C, types/pa_vxdoc.h: fixed all cstr's that must use pool [as the one in ^process] * src/classes/op.C: fixed process. sould now check for all cstr's -- some must use pool [as the one in ^process] 2003-02-20 paf * src/: classes/date.C, classes/double.C, classes/file.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, main/pa_string.C, types/pa_method.h, types/pa_value.C, types/pa_vmethod_frame.h: string cmp fixed * src/: include/pa_config_fixed.h, targets/cgi/parser3.C: form values passed OK now 2003-02-19 paf * src/: classes/form.C, include/pa_charset.h, include/pa_pool.h, main/pa_charset.C, main/pa_exception.C, main/pa_request.C, main/pa_stylesheet_manager.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.dsp, types/pa_vcookie.C, types/pa_vform.C, types/pa_vmail.C, types/pa_vxnode.C: found&kill all remaning leaks resulted from pooled::malloc calls [excluding in gd -- planning complete rewrite extremely ugly code] * src/targets/isapi/: pa_pool.C, pool_storage.h: removed unneeded files 2003-02-17 paf * src/: classes/date.C, classes/double.C, classes/file.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/response.C, classes/string.C, classes/table.C, classes/xdoc.C, classes/xnode.h, include/pa_stack.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, sql/pa_sql_driver.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vimage.h, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.h, types/pa_vxnode.h, types/pa_wcontext.h, types/pa_wwrapper.h: fixed all remained bugs of unitialized simple-typed field * src/: classes/classes.C, classes/classes.h, main/execute.C, main/pa_charset.C, main/pa_request.C: another bug of unitialized simple-typed field fixed. todo: find&kill all like that one * src/: main/execute.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h: few bugs in debug output fixed * src/: include/pa_stack.h, main/compile.C, main/execute.C, main/pa_request.C: stack-stored items need extra .ref to prevent object_ptr from delete[them] * src/: classes/date.C, classes/op.C, classes/table.C, classes/xdoc.C, classes/xnode.C, include/pa_array.h, include/pa_charset.h, main/Makefile.am, main/main.dsp, main/pa_charset.C, main/pa_common.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vmail.C: fixed more leaks resulted from pooled::malloc calls * src/: main/pa_request.C, targets/cgi/parser3.C, types/pa_vfile.C: couple mem leaks rusulted from old pooled::malloc usage. todo:find more like those * src/main/: compile.C, compile_tools.C: 2*2! * src/: include/pa_array.h, include/pa_request.h, main/execute.C: stackItem fixed [there were no string on stack before] * src/: main/execute.C, main/pa_request.C, types/pa_vmethod_frame.C: first letters out OK * src/: classes/classes.C, include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, main/pa_request.C, main/pa_string.C, main/untaint.C, types/pa_value.h, types/pa_vint.h, types/pa_vstateless_class.h, types/pa_vstring.h, types/pa_vvoid.h, types/pa_wcontext.h: class fields of simple type not initialized with zeros :( while class fields of class types initialized with default constructors. learn C++ * src/: classes/classes.awk, classes/double.C, classes/file.C, classes/form.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/xdoc.C, classes/xnode.C, include/pa_array.h, include/pa_string.h, main/pa_exec.C, types/pa_vmail.C: parser3.exe - 0 error(s), 0 warning(s) 2003-02-14 paf * src/: include/pa_common.h, main/pa_common.C, main/pa_request.C: 13 link errors * src/: classes/file.C, include/pa_request.h, main/pa_request.C, main/pa_sql_driver_manager.C, targets/cgi/parser3.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vimage.C, types/pa_vtable.C: all compiled, only 14 link errors :) * src/: classes/classes.C, classes/classes.awk, classes/file.C, classes/hash.C, classes/mail.C, classes/op.C, include/pa_common.h, include/pa_request.h, include/pa_sapi.h, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C: classes.lib - 0 error(s), 0 warning(s) parser.C compiled * src/: classes/classes.dsp, classes/op.C, classes/string.C, classes/table.C, include/pa_common.h, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vhash.h, types/pa_vint.h, types/types.dsp: op compiled * src/: classes/classes.dsp, classes/response.C, classes/string.C, include/pa_dictionary.h, include/pa_string.h, main/pa_string.C, main/untaint.C, types/pa_vtable.h: string, response compiled 2003-02-07 paf * src/: classes/table.C, types/pa_vtable.h: table compiled 2003-02-06 paf * src/: classes/mail.C, include/pa_request.h, main/pa_request.C: mail compiled * src/: classes/image.C, classes/string.C, classes/xdoc.C, include/pa_common.h, include/pa_hash.h, main/pa_common.C, types/pa_vfile.h, types/pa_vimage.h: image compiled * src/classes/: file.C, form.C: form compiled * src/: classes/classes.dsp, classes/file.C, include/pa_common.h, include/pa_exec.h, main/pa_common.C, main/pa_exec.C, types/pa_vfile.C, types/pa_vfile.h: file compiled * src/: classes/hash.C, classes/math.C, types/pa_vmath.C, types/pa_vmath.h: math compiled [win32] * src/: classes/hash.C, include/pa_hash.h, include/pa_table.h, types/pa_vstring.h: hash compiled 2003-02-04 paf * src/: classes/date.C, classes/hash.C, include/pa_exec.h, include/pa_hash.h, include/pa_request.h, include/pa_string.h, include/pa_table.h, main/pa_common.C, main/pa_exec.C, main/pa_string.C, types/pa_method.h, types/pa_vform.C, types/pa_vhash.h: hash 50% compiled * src/: classes/date.C, classes/file.C, classes/hash.C, classes/image.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, classes/xnode.C, include/pa_request.h, main/pa_globals.C, main/pa_string.C: date compiled * src/classes/: classes.dsp, double.C: double compiled * src/: classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, types/pa_vdouble.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vxdoc.h, types/pa_vxnode.h: int compiled * src/: classes/date.C, classes/double.C, classes/file.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, types/pa_vvoid.h: void compiled :) * src/: include/pa_globals.h, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_pool.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_uue.C, main/untaint.C, types/pa_value.C, types/pa_vcookie.C, types/pa_vfile.C, types/pa_vimage.C, types/pa_vmath.C, types/pa_vrequest.C, types/pa_vresponse.C, types/pa_vstateless_class.C, types/pa_vstatus.C, types/pa_vstring.C, types/pa_vtable.C, types/pa_wcontext.C, types/types.dsp: removed stupid value_includes.h * src/types/: pa_value.C, pa_value_includes.h, pa_vrequest.C: trying to remove stupid value_includes.h * src/main/pa_exec.C: pa_exec compiled on win32 * src/main/pa_exec.C: libmain.a compiled on six [unix] * src/: include/pa_globals.h, include/pa_request.h, types/pa_value.C, types/pa_value.h, types/pa_vclass.C, types/pa_vcookie.C, types/pa_vdate.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vmail.C, types/pa_vobject.C, types/pa_vrequest.C, types/pa_vstateless_class.C, types/pa_vstatus.C, types/pa_vtable.C: libtypes.a compiled gcc * src/: include/pa_config_includes.h, include/pa_dictionary.h, main/pa_common.C, main/pa_dictionary.C, main/pa_exec.C, main/pa_socks.C: libmain.a gcc and mail.lib msvc++ compiled * src/: include/pa_array.h, include/pa_config_includes.h, include/pa_dictionary.h, main/pa_dictionary.C, main/pa_exec.C, main/pa_socks.C, main/pa_sql_driver_manager.C: gcc libmain.a compiled * src/main/pa_globals.C: merged changes from 1.149-1.150 (stupid name conflicts) * src/: main/compile_tools.h, main/execute.C, main/pa_table.C, types/pa_vmethod_frame.h, types/pa_vvoid.h: yuk: gcc on cygwin yelds "virtual memory exhausted" while trying to compile execute.C [eating up to 127MB] 2003-02-03 paf * src/: include/pa_config_includes.h, include/pa_hash.h, include/pa_operation.h, include/pa_pool.h, include/pa_string.h, main/pa_common.C, types/pa_value.C, types/pa_value.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vstateless_class.h, types/pa_vstring.h, types/types.dsp: started gcc compiling pa_common compiled * src/: include/pa_exception.h, include/pa_pool.h, main/pa_exception.C: exception gcc change #1 * src/include/: Makefile.am, pa_hash.h, pa_pool.h: gcc refused to compile _P identifier. it replaced it to some strange 0x0000040 * src/types/: pa_vmath.C, pa_vmethod_frame.C: vmath compiled * src/types/pa_vtable.C: vtable compiled * src/types/: pa_vstring.C, pa_vstring.h: vstring compiled * src/: include/pa_cache_managers.h, main/pa_request.C, types/pa_vstatus.C, types/pa_vstatus.h: vstatus compiled * src/types/pa_vstateless_class.C: vstateless_class compiled * src/types/: pa_vresponse.C, pa_vresponse.h: vresponse compiled * src/types/pa_vrequest.C: vrequest compiled * src/types/: pa_value.C, pa_value.h, pa_vclass.C, pa_vclass.h, pa_vobject.C, pa_vobject.h: vobject compiled * src/: classes/form.C, classes/mail.C, include/pa_request.h, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vform.C, types/pa_vmail.C, types/pa_vmail.h: vmail compiled * src/types/: pa_vimage.C, pa_vimage.h: vimage compiled * src/: include/pa_pool.h, main/pa_request.C, types/pa_value.C, types/pa_vclass.C, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vform.C, types/pa_vform.h, types/pa_vobject.h: vform compiled * src/: include/pa_request.h, main/execute.C, main/pa_request.C: main.lib - 0 error(s), 0 warning(s) * src/: include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vmethod_frame.h: execute compiled 2003-01-31 paf * src/: include/pa_array.h, include/pa_operation.h, include/pa_request.h, main/execute.C, main/main.dsp, types/pa_vjunction.h: started last file from main library: execute * src/: include/pa_request.h, include/pa_sapi.h, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vhash.h: pa_request compiled * src/: classes/op.C, classes/string.C, include/pa_common.h, include/pa_globals.h, include/pa_request.h, include/pa_sql_connection.h, main/compile.tab.C, main/compile.y, main/execute.C, main/main.dsp, main/pa_common.C, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vcode_frame.h, types/pa_vcookie.h, types/pa_vform.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vresponse.h, types/pa_vtable.h, types/pa_wcontext.C, types/pa_wcontext.h, types/types.dsp: most pa_request compiled * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_operation.h, include/pa_pool.h, include/pa_request.h, include/pa_request_charsets.h, include/pa_request_info.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, lib/ltdl/config_fixed.h, lib/ltdl/ltdl.c, lib/ltdl/ltdl.h, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/pcre/dftables.c, lib/pcre/get.c, lib/pcre/maketables.c, lib/pcre/pcre.c, lib/pcre/pcre.h, lib/pcre/pcre_parser_ctype.c, lib/pcre/study.c, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/main.dsp, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/getopt.c, targets/cgi/getopt.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_value.C, types/pa_value.h, types/pa_value_includes.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vmethod_frame.C, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: grammar compiled * ChangeLog, src/classes/classes.h, src/classes/op.C, src/include/pa_cache_managers.h, src/include/pa_charset.h, src/include/pa_charsets.h, src/include/pa_common.h, src/include/pa_dictionary.h, src/include/pa_exception.h, src/include/pa_exec.h, src/include/pa_pool.h, src/include/pa_request.h, src/include/pa_sapi.h, src/include/pa_sql_connection.h, src/include/pa_sql_driver_manager.h, src/include/pa_string.h, src/include/pa_table.h, src/include/pa_uue.h, src/main/compile.C, src/main/compile.tab.C, src/main/compile_tools.C, src/main/compile_tools.h, src/main/main.dsp, src/main/pa_charset.C, src/main/pa_charsets.C, src/main/pa_common.C, src/main/pa_dictionary.C, src/main/pa_exception.C, src/main/pa_exec.C, src/main/pa_request.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_table.C, src/main/pa_uue.C, src/main/untaint.C, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vclass.h, src/types/pa_vcookie.C, src/types/pa_vcookie.h, src/types/pa_vdate.h, src/types/pa_vdouble.h, src/types/pa_venv.h, src/types/pa_vfile.C, src/types/pa_vfile.h, src/types/pa_vform.h, src/types/pa_vhash.h, src/types/pa_vimage.C, src/types/pa_vimage.h, src/types/pa_vint.h, src/types/pa_vmail.C, src/types/pa_vmail.h, src/types/pa_vmath.C, src/types/pa_vmath.h, src/types/pa_vmethod_frame.C, src/types/pa_vmethod_frame.h, src/types/pa_vobject.C, src/types/pa_vobject.h, src/types/pa_vrequest.C, src/types/pa_vrequest.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h, src/types/pa_vstateless_class.C, src/types/pa_vstateless_class.h, src/types/pa_vstateless_object.h, src/types/pa_vstatus.h, src/types/pa_vstring.h, src/types/pa_vtable.h, src/types/pa_vvoid.h, src/types/pa_wcontext.C, src/types/pa_wcontext.h, src/types/pa_wwrapper.h: ConstStringPtr died, long live StringPtr 2003-01-30 paf * src/: include/pa_charset.h, include/pa_request.h, include/pa_sql_driver_manager.h, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/pa_request.C, types/pa_vobject.h, types/pa_vstatus.h: grammar compiled * src/: classes/classes.h, include/pa_pool.h, main/compile.C, main/compile.tab.C, types/pa_value.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/types.dsp: vstateless_class compiled * src/main/compile.C: compile compiled * src/: include/pa_array.h, include/pa_operation.h, include/pa_table.h, main/compile_tools.C, main/compile_tools.h, main/pa_table.C: compile_tools compiled * src/: include/pa_operation.h, main/compile.y, main/compile_tools.C, main/compile_tools.h: started compile_tools. vagues ideas of how to free compiled code * src/: include/pa_opcode.h, main/compile_tools.h, main/execute.C, main/main.dsp, types/pa_value.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.h: value compiled 2003-01-29 paf * src/: include/pa_globals.h, include/pa_request.h, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.h, types/pa_wcontext.h, types/types.dsp: vmethodframe, pa_request.h compiled * src/lib/ltdl/config_fixed.h: libltdl compiled without warnings now * src/: include/pa_array.h, include/pa_exception.h, include/pa_pool.h, main/pa_exception.C: gd compiled * src/types/: pa_vfile.C, pa_vfile.h, pa_vimage.C, pa_vimage.h: gd compiled * src/: classes/file.C, include/pa_globals.h, main/pa_globals.C, types/pa_value.C, types/pa_value.h, types/pa_vfile.C, types/pa_vfile.h: vfile compiled * src/: include/pa_common.h, include/pa_globals.h, include/pa_string.h, main/pa_globals.C, types/pa_value.C, types/pa_value.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vform.C, types/pa_vform.h: vcookie compiled * src/: include/pa_exception.h, main/pa_cache_managers.C, main/pa_charsets.C, main/pa_common.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_pool.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_uue.C: #include "pa_value_includes.h" everywhere in main * src/: include/pa_request_charsets.h, include/pa_request_info.h, main/main.dsp, main/untaint.C: more compiled * src/: include/pa_charsets.h, include/pa_request.h, include/pa_request_info.h, include/pa_string.h, main/pa_charsets.C, types/pa_vrequest.C, types/pa_vresponse.C, types/pa_vresponse.h: vrequest compiled * src/types/: pa_value.h, pa_vdate.h, pa_vform.h, pa_vhash.h, pa_vobject.C, pa_vobject.h, pa_vrequest.C, pa_vresponse.C, pa_vresponse.h, pa_wcontext.h: vrequest compiled * src/: classes/classes.h, include/pa_charset.h, include/pa_charsets.h, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, include/pa_string.h, main/main.dsp, main/pa_charset.C, main/pa_charsets.C, main/pa_globals.C, main/untaint.C, types/pa_value.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vmath.C, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vstateless_class.h, types/pa_vstring.h, types/pa_vvoid.h: vrequest,vdouble,vint compiled * src/: classes/classes.h, classes/math.C, include/pa_pool.h, include/pa_request.h, include/pa_sapi.h, include/pa_string.h, main/main.dsp, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vjunction.h, types/pa_vmath.C, types/pa_vmath.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.h, types/pa_vstring.h, types/types.dsp: vmath compiled 2003-01-28 paf * src/: classes/classes.h, classes/date.C, classes/file.C, classes/hash.C, classes/image.C, classes/table.C, classes/xdoc.C, classes/xnode.h, main/execute.C, main/main.dsp, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vstateless_class.h: started main: compile_tools * src/: include/pa_charset.h, include/pa_exception.h, include/pa_request.h, include/pa_string.h, main/untaint.C: untaint compiled * ChangeLog, src/include/pa_array.h, src/include/pa_string.h, src/main/execute.C, src/main/untaint.C, src/types/pa_vmail.C: more compiled. struck with string::store_to needing to know source/client charsets * src/: include/pa_exception.h, include/pa_uue.h, main/pa_uue.C, types/pa_vfile.h: uue compiled * src/: include/pa_table.h, main/pa_string.C, main/pa_table.C: table compiled * src/: include/pa_cache_managers.h, main/pa_cache_managers.C, main/pa_globals.C, main/pa_sql_driver_manager.C: globals compiled * src/: include/pa_charset.h, main/pa_charset.C, main/pa_charsets.C: charset/s simplified [charset::pool_for_load introduced] * src/: classes/date.C, include/pa_charset.h, include/pa_charsets.h, include/pa_globals.h, main/pa_charset.C, main/pa_charsets.C, main/pa_globals.C, main/pa_request.C: pa_charsets compiled * src/: include/pa_array.h, include/pa_exec.h, include/pa_hash.h, include/pa_pool.h, main/pa_exec.C: pa_exec win32 compiled * src/: include/pa_pool.h, main/pa_common.C, types/pa_vdouble.h: common compiled * src/: include/pa_charsets.h, main/pa_charsets.C, main/pa_sql_driver_manager.C: pa_charsets compiled * src/: include/pa_array.h, include/pa_charset.h, include/pa_charsets.h, include/pa_pool.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, main/pa_sql_driver_manager.C, types/pa_vhash.h, types/pa_vint.h: sql_driver_manager compiled * etc/parser3.charsets/: koi8-r.cfg, windows-1251.cfg: ukranian letter i with two dots added to koi, all ukranian letters added to win1251. typographic simbol 0xb9 deleted from win1251 [strange one & were abscent from koi] 2003-01-27 paf * src/: include/pa_exception.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_string.h, main/pa_common.C, main/pa_exec.C, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: paused on sql_manager * src/: include/pa_cache_managers.h, include/pa_pool.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, main/pa_sql_driver_manager.C, types/pa_vtable.h, types/pa_vvoid.h: vtable compiled * src/: classes/op.C, include/pa_globals.h, include/pa_hash.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_table.h, main/pa_sql_driver_manager.C, main/pa_table.C: table compiled * src/: include/pa_cache_managers.h, main/pa_cache_managers.C: cache_managers compiled * src/: include/pa_array.h, include/pa_charset.h, include/pa_pool.h, main/pa_charset.C: charset compiled * src/: include/pa_pool.h, main/pa_common.C: common compiled * src/: include/pa_array.h, include/pa_common.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/pa_common.C, main/pa_string.C, types/pa_value.C, types/pa_value.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vstateless_class.h, types/pa_wcontext.C, types/pa_wcontext.h: wcontext compiled 2003-01-24 paf * src/: classes/classes.C, classes/classes.h, include/pa_array.h, include/pa_common.h, include/pa_globals.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/pa_common.C, main/pa_globals.C, main/pa_string.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.h, types/pa_vstring.h: more patched * src/: classes/op.C, include/pa_array.h, include/pa_exception.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, main/pa_dictionary.C, main/pa_exception.C, main/pa_string.C, main/pa_table.C: string compiled * src/: include/pa_array.h, include/pa_common.h, include/pa_dictionary.h, include/pa_exception.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, main/pa_common.C, main/pa_dictionary.C, main/pa_exception.C, main/pa_string.C: dictionary compiled 2003-01-23 paf * src/: include/pa_array.h, include/pa_common.h, include/pa_exception.h, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, include/pa_string.h, main/pa_common.C, main/pa_exception.C, main/pa_globals.C, types/pa_value.C, types/pa_value.h: resurrected pool in new sense: now it's factory, producing&accounting memory chunks for read[autofree] buffers * src/: include/pa_array.h, include/pa_exception.h, include/pa_hash.h, include/pa_pool.h, include/pa_table.h, main/pa_exception.C, main/pa_table.C: table compiled * src/: classes/image.C, classes/op.C, include/pa_array.h, include/pa_exception.h, include/pa_globals.h, include/pa_hash.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_sapi.h, include/pa_string.h, include/pa_table.h, include/pa_types.h, main/pa_exception.C, main/pa_globals.C, main/pa_string.C, main/pa_table.C: aint that easy * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, main/main.dsp: continued with Hash * src/main/pa_common.C: connect_string allocated on heap[wes on stack] now. and exception can be reported OK now [can be reported outside of pro c with that stack] 2003-01-22 paf * src/: include/pa_array.h, include/pa_charset.h, include/pa_dictionary.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/pa_array.C, main/pa_hash.C, main/pa_pool.C, main/pa_string.C: started auto_ptr. PA_Object is base: contains references_count. auto_ptr template calls add_ref/release 2003-01-21 paf * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/pcre/pcre_parser_ctype.c, main/compile.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h, main/compile.tab.C, main/compile.y: 2002->2003 2003-01-16 paf * operators.ru.txt, operators.txt, src/include/pa_globals.h, src/main/pa_common.C, src/main/pa_globals.C: http:// introducing $.any-status(1) * operators.ru.txt, operators.txt, src/include/pa_config_fixed.h, src/main/pa_common.C: http request now return status. and not fail on status!=200 2003-01-15 paf * src/main/pa_globals.C: localized pa_xmlFileRead/Close 2003-01-14 paf * src/lib/ltdl/: config.guess, config.sub, install-sh, missing, mkinstalldirs: removed some ancient files [they in / really] * src/lib/ltdl/: config_fixed.h, libltdl.dsp, ltdl.c: ltdl.c regretfully needed patch in two places. in config_fixed.h made stubs for lib to compile in MSVC 2003-01-13 paf * config.guess, config.sub, ltmain.sh: removed last piece of configure.in(libtool) hacks * src/lib/ltdl/: COPYING.LIB, acinclude.m4, config.h, config_auto.h.in, configure, configure.in, libltdl.dsp, ltdl.c, ltdl.h: moved to latest libtool (1.4.3) 2003-01-10 paf * src/lib/ltdl/: configure, configure.in: PROG_NM * src/main/pa_globals.C: moved to latest xml lib versions, changed patches. libxml2 >= 2.5.1 [ftp://xmlsoft.org/libxml2-2.5.1.tar.gz] libxslt >= 1.0.23 [ftp://xmlsoft.org/libxslt-1.0.23.tar.gz] gdome2 >= 0.7.2 [http://gdome2.cs.unibo.it/tarball/gdome2-0.7.2.tar.gz] * INSTALL: moved to latest versions of xml libs libxml2 >= 2.5.1 [ftp://xmlsoft.org/libxml2-2.5.1.tar.gz] libxslt >= 1.0.23 [ftp://xmlsoft.org/libxslt-1.0.23.tar.gz] gdome2 >= 0.7.2 [http://gdome2.cs.unibo.it/tarball/gdome2-0.7.2.tar.gz] 2003-01-09 paf * INSTALL: xml,xslt,gdome lib urls updated * config.guess, config.sub, missing, mkinstalldirs, src/include/pa_config_auto.h.in, src/lib/ltdl/config_auto.h.in, src/lib/ltdl/configure, src/lib/ltdl/configure.in, src/targets/cgi/Makefile.am: moved to autoconf 2.57 & automake 1.7.2 * depcomp: moving to automake 1.7.2 2002-12-27 paf * src/include/pa_version.h: 0007 * src/doc/: aliased.dox, index.dox, module.dox, pooled.dox: removed outdated parts, made links to language docs * src/include/pa_config_auto.h.in: comment 2002-12-26 paf * src/classes/file.C: ^file:fullpath[a.gif] when document root did not contain trailing / fixed. * INSTALL: changing SAFE_MODE politics * src/include/pa_config_auto.h.in: changing SAFE_MODE politics * src/main/: pa_common.C, pa_exec.C: changing SAFE_MODE politics 2002-12-25 paf * src/main/pa_globals.C: optimized-xml * src/main/pa_globals.C: optimized-as-is 2002-12-24 paf * src/main/: pa_common.C, pa_pool.C: pool::copy on zero size|ptr fixed [were really called with zero size when .html?a=&b=] * src/classes/mail.C: $MAIL in @conf now invalid when configured with --with-sendmail * src/main/pa_exec.C: fork/pipe error now [old always-pipe-error fixed] 2002-12-23 paf * src/types/pa_vcookie.C: $cookie:field[put value] fixed [were ignoring parameters & were storing only string with default expires * src/main/pa_charset.C: From: "Victor Fedoseev" To: "Alexandr Petrosian (PAF)" Sent: Monday, December 23, 2002 4:22 AM Subject: bug Charset::transcode_buf2xchar 2002-12-20 paf * src/targets/cgi/parser3.C: removed last \n appending in non-win32 non-cgi [script] runs 2002-12-19 paf * INSTALL: --without-iconv recommended [it crashes on some systems [tested on elik]] moreover, it's not needed there [parser registers charsets itself] * INSTALL: --without-iconv recommended [it crashes on some systems [tested on elik]] * operators.ru.txt, operators.txt, src/include/pa_globals.h, src/include/pa_request.h, src/main/pa_globals.C, src/main/pa_request.C: $response:download * src/classes/mail.C: 'to' check bugfix [now checked only on ms compiler [win32]]. 2002-12-18 paf * src/classes/xdoc.C: doc->URL on xdoc.load set correctly now 2002-12-17 paf * src/targets/cgi/parser3.C: merged die&iis changes * src/targets/cgi/parser3.C: 1. on win32 in die: abort() reverted to exit(1) 2. more flexible iilegal call check 2002-12-16 paf * ltmain.sh: some automakes silly insist on having this handy * src/main/untaint.C: filespec russian small 'r' changed to latin 'p' bug fix 2002-12-15 paf * src/main/untaint.C: filespec russian small 'r' changed to latin 'p' * configure.in, src/include/pa_config_auto.h.in, src/main/compile.C, src/main/pa_common.C: merged small changes from branch 6 to HEAD * src/main/compile.C: removed warning * src/main/pa_common.C: ftruncate having checked * configure.in, src/include/pa_version.h: new version 2002-12-14 paf * src/classes/table.C: removed unnecessary code * src/sql/pa_sql_driver.h: exception type fixed 2002-12-09 paf * src/types/pa_vvoid.h: $void.store[now] error * src/targets/cgi/parser3.C: ::die now tries to write core dump * src/targets/: cgi/parser3.C, isapi/parser3isapi.C: ::die now tries to write core dump * src/targets/cgi/parser3.C: ::die now tries to write core dump * src/: classes/hash.C, classes/string.C, classes/table.C, classes/void.C, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: changed exception handling mech in sql handlers #2 * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: changed exception handling mech in sql handlers * src/sql/pa_sql_driver.h: changed exception handling mech in sql handlers * src/: classes/hash.C, classes/string.C, classes/table.C, classes/void.C, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: changed exception handling mech in sql handlers * configure.in: removed configure.in:AC_LIBTOOL, it caused automake to write makefile which used libtool to install things, which is not needed 2002-12-06 paf * operators.ru.txt, operators.txt, src/main/compile.tab.C, src/types/pa_vhash.h: $hash.fields -- pseudo field to make 'hash' more like 'table' 2002-12-05 paf * src/: classes/mail.C, types/pa_vmail.C, types/pa_vmail.h: smtp cc/bcc OK now * src/main/untaint.C: mail header closed properly * src/: main/pa_common.C, main/untaint.C, types/pa_vmail.C: mail header ',' allowed. still bugs in smtp [only one receiptient works, cc, bcc ignored now, and MAILED ;)] [strncpy killed, memnchr used] * src/main/pa_table.C: table-copy now current=0 * src/main/: pa_array.C, pa_table.C: wow! found/fixed bug in lowlevel proc * src/targets/cgi/parser3.C: more checks on http://domain/parser.cgi start [maybe some getenv returns "", checked that now * src/targets/cgi/parser3.C: more checks on http://domain/parser.cgi start [maybe some getenv returns "", checked that now * src/targets/cgi/parser3.C: error logging made unbuffered [so that out-of-mem errors reached log] * src/: classes/mail.C, targets/cgi/parser3.C, types/pa_vmail.C: mail:send MIME-Version default * src/main/main.dsp: pa_version included into main.dsp 2002-12-04 paf * src/types/pa_vform.C: $form:field string value cut by premature 0 * parser3.dsw, src/main/compile.tab.C, src/main/main.dsp: lib/libltdl -> lib/ltdl Win32 changes. s * src/classes/classes.awk: more strict *.C$ * gnu.dsp: restored * configure.in, gnu.dsp, src/lib/Makefile.am, src/lib/ltdl/Makefile.am, src/lib/ltdl/README, src/lib/ltdl/acinclude.m4, src/lib/ltdl/config.guess, src/lib/ltdl/config.h, src/lib/ltdl/config.sub, src/lib/ltdl/config_auto.h.in, src/lib/ltdl/config_fixed.h, src/lib/ltdl/configure, src/lib/ltdl/configure.in, src/lib/ltdl/install-sh, src/lib/ltdl/libltdl.dsp, src/lib/ltdl/ltdl.c, src/lib/ltdl/ltdl.h: src/lib/ltdl/Makefile now created with /configure, not ltdl/configure, so it does have no problems with automake. ltdl/configure AC_OUTPUT(Makefile<>attachment<< * src/classes/image.C: ^image.font << bad font file-size now properly reported 2002-11-26 paf * src/main/pa_request.C: fixed lang in reponse header * src/main/pa_common.C: utf8 prefix ignored @read text * operators.ru.txt, operators.txt, src/main/pa_common.C: http:// response status!=200 made exception: http.status with source=bad status# 2002-11-25 paf * configure.in, src/classes/image.C, src/include/pa_config_auto.h.in, src/include/pa_config_includes.h, src/main/Makefile.am, src/main/pa_common.C, src/main/pa_globals.C: http:// and image const void related probs fixed * operators.ru.txt, operators.txt, src/main/pa_common.C: http fields now UPPERCASE $file[^file::load[http://there]] $file.SERVER * src/: classes/file.C, classes/image.C, classes/xdoc.C, include/pa_common.h, main/pa_common.C, main/pa_request.C: checked http options [invalid onces now reported] made default user-agent: paf * operators.ru.txt, operators.txt, src/classes/file.C, src/classes/table.C, src/classes/xdoc.C, src/include/pa_common.h, src/include/pa_globals.h, src/main/pa_common.C, src/main/pa_globals.C, src/main/pa_request.C, src/types/pa_vfile.C, src/types/pa_vfile.h: table/xdoc/file::load now understand http:// prefix and additional params, sample: $rates[^xdoc::load[http://www.cbr.ru/scripts/XML_daily.asp?date_req=02/03/2002; $.USER-AGENT[parser3] ]] 2002-11-22 paf * src/classes/image.C, src/include/pa_globals.h, src/main/execute.C, src/main/pa_globals.C, src/types/pa_vimage.C, src/types/pa_vimage.h, operators.ru.txt, operators.txt: $image.exif support $image.exif.DateTime & co 2002-11-21 paf * src/main/: pa_exec.C, untaint.C: cstr(UL_UNSPECIFIED) [not _PASS_APPENDED) * src/classes/image.C: jpeg size measure fixed: were badly skipping EXIF information [were big block and it's size were considered negative :(] * operators.ru.txt, operators.txt, src/classes/image.C, src/include/pa_common.h, src/main/pa_common.C, src/types/pa_vmail.C: image.measure internals rewritten. no there's reader.seek, and all's ready for EXIF extraction [now we fail to measure files with EXIF info] * src/main/pa_common.C: O_TRUNCATE killed, ftruncate used instead: O_TRUNC truncates even exclusevely write-locked file [thanks to Igor Milyakov for discovering] 2002-11-20 paf * src/targets/cgi/parser3.C: logging @signal += query_string * configure.in, src/include/pa_config_auto.h.in, src/include/pa_config_includes.h, src/targets/cgi/parser3.C: comment * src/targets/cgi/parser3.C: SIGNALS overriden @ main top * src/: include/pa_request.h, main/execute.C, main/pa_request.C, targets/cgi/parser3.C: SIGUSR1 >> writes to error_log uri of currently processed document SIGPIPE >> interrupts request processing [exception = DB rollback] * src/main/pa_exec.C: comment * src/main/pa_exec.C: pa_exec: data written only if size>0 * operators.ru.txt, operators.txt, src/classes/file.C: ^file::exec/cgi[file;$.stdin[] << disable HTTP-POST repassing * src/: include/pa_config_fixed.h, main/pa_common.C, main/pa_exec.C, targets/cgi/parser3.C: ^file:exec/cgi [pa_exec] pipe read errors now checked 2002-11-19 paf * src/targets/cgi/parser3.C: removed #ifdef WIN32 around check of CGI: Illegal call 2002-11-01 paf * src/main/execute.C: comment 2002-10-31 paf * src/main/execute.C: found out why, checked that for now. todo: find out a way for that user could do that * src/types/pa_vstateless_object.h: object put replaces static parent if any * src/types/pa_vobject.C: object put replaces static parent if any * src/: classes/form.C, classes/mail.C, classes/op.C, classes/xnode.h, main/compile.tab.C, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: static fix merged * src/: main/compile.tab.C, types/pa_vobject.C: killed $virtual_fields in dynamic, but one can reach derived static[class] variable from base * src/: classes/op.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: fixed statics, left $virtual_fields in dynamic * src/types/: pa_vobject.C, pa_vstateless_class.C: realized that one can't remember derivates in base class: there's so many of them. also there can be no virtual method calls in static classes * src/: classes/form.C, classes/mail.C, classes/op.C, classes/xnode.h, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: static call $self fixed * src/main/execute.C: comment * src/: classes/op.C, types/pa_value.h, types/pa_vobject.h: ^process[$caller.self]{...} now compiles to last derived object part of that 'self' 2002-10-29 paf * src/targets/isapi/parser3isapi.C: comment on 404 bad status re-passing [iis to blame] * src/classes/string.C: changed string.save to pass current sql connection to cstr thus one can ^connect[some server]{ $s[insert into table x (x) values (^taint[sql]{value})] ^s.save[some.sql] } and he'd get in some.sql file code with properly escaped. [tried in mssql->mysql export->import of binary data] 2002-10-25 paf * src/types/pa_vresponse.C: case insensitive response user fields get/put * src/: include/pa_hash.h, main/pa_hash.C, main/pa_request.C, types/pa_vresponse.C: saving for maybe-future 2002-10-23 paf * operators.ru.txt, operators.txt, src/classes/table.C: ^table.hash{code}... ^table.hash(expr)... * src/types/pa_vmail.C: email whitespace trimBoth-ed 2002-10-22 paf * src/types/: pa_vform.C, pa_vform.h: removed needless VForm::Append...(...Value) * src/main/execute.C: $.name outside of $name[...] checked * src/main/: compile.tab.C, compile.y: lexer changed to fix ^call[]^#HH bug [that situation yelded no EON, which whas wrong] 2002-10-21 paf * operators.ru.txt, operators.txt, src/types/pa_vform.C, src/types/pa_vform.h: $form:qtail $form:imap.x/y * operators.ru.txt, operators.txt, src/types/pa_vform.C: $form:nameless = "?value&...", "...&value&...", "...&value" * operators.ru.txt, operators.txt, src/types/pa_vform.C: $form:image-map * operators.ru.txt, operators.txt, src/classes/file.C: /some/page.html: ^file:fullpath[a.gif] => /some/a.gif 2002-10-17 paf * src/main/: compile.tab.C, compile.y: operators precedence changed a little: logical not and bitwise negation precedence made highest, << and >> bitshits precedence made equal [were << higher than >>] * src/classes/op.C: exception handling fixed [were bad with contexts] 2002-10-16 paf * src/: classes/op.C, include/pa_request.h, main/execute.C, main/pa_request.C: Request::self considered equal to VMethodFrame::self, and removed, Request::get_self() mapped to VMethodFrame.self() * src/: classes/op.C, main/pa_request.C: VMainClass now has name = $hash in open field now gives old good error meesage 2002-10-15 paf * src/types/pa_vjunction.h: ^if(def $junction){was true}{now false} use ^if($junction is junction){was and now true} * src/: classes/xdoc.C, classes/xnode.C, include/pa_charset.h, include/pa_pool.h, main/pa_charset.C, main/pa_pool.C, types/pa_vxnode.C: xml->parser strings now have origin, which points to place where value left xml library and came to parser: place of dom field extraction/call * src/: classes/op.C, include/pa_opcode.h, include/pa_request.h, main/compile.tab.C, main/compile.y, main/execute.C, types/pa_vmethod_frame.h: removed last pieces of old code allowing $junction.xxx at compile time * ChangeLog, src/classes/op.C, src/main/compile.tab.C, src/main/compile.y, src/types/pa_vmethod_frame.h: process[self] objects also considered [were only classes] * ChangeLog, src/classes/op.C, src/include/pa_request.h, src/types/pa_vmethod_frame.h: ^process[CLASS]{body} now executed with CLASS self. [ (request&method_frame).self temporarily changed ] * src/classes/: hash.C, op.C: method_frame now always changed, with no exception to native calls. for&foreach changed to use method_frame.caller for their var's name context * src/: main/execute.C, targets/cgi/parser3.C, types/pa_vstateless_class.C, types/pa_vstateless_class.h: compiling to system classes disabled * operators.ru.txt, operators.txt, src/classes/op.C: ^process[$caller.CLASS]{code-string} added * operators.ru.txt, operators.txt, src/classes/op.C, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C, src/main/pa_request.C, src/types/Makefile.am, src/types/pa_vjunction.C, src/types/pa_vjunction.h, src/types/pa_vmethod_frame.h, src/types/types.dsp: removed $junction.get $junction.set[] introducing $caller * src/types/pa_value.h: removed outdated comments. doxygen would find them lower by inheritance tree * src/types/pa_vjunction.C: ident 2002-10-14 paf * src/classes/op.C: process compiles to code's class class * src/: classes/form.C, classes/mail.C, classes/op.C, include/pa_request.h, main/compile.C, main/compile.tab.C, main/compile.y, main/execute.C, main/pa_request.C, types/pa_vstateless_class.h: operators now main-class-methods * src/: classes/op.C, include/pa_request.h: ^try{^call{}} now has better stack trace [has "call" & co there] * src/: include/pa_request.h, main/execute.C, main/pa_request.C: operators @auto now executed in MAIN context * src/main/execute.C: operator execution context now = MAIN, not closest stack frame @touchit[] $i[after] ----t.html $i[before] << local ^touchit[] $i << now 'before', were 'after' ---t.html $i[before] << notlocal [main] ^touchit[] $i << now 'after' * src/main/execute.C: comment * src/types/: pa_vclass.C, pa_vobject.h, pa_vstateless_class.C, pa_vstateless_class.h: $form:CLASS resurrected [wes killed in action] * src/types/pa_vxnode.C: misreplace fixed * configure, configure.in, src/include/pa_config_auto.h.in, src/types/pa_vstatus.C, operators.ru.txt, operators.txt: $status:rusage.tv_secs/usecs introduced 2002-10-09 paf * src/classes/: double.C, int.C, string.C: ^string.int[] now failes on empty string [or uses (default)] 2002-10-08 paf * src/main/untaint.C: mail header quoted printable changed after RFC reread * operators.ru.txt, operators.txt: plan on ^if(method * src/types/pa_vxnode.C: misreplace 2002-09-24 paf * src/targets/cgi/Makefile.am: LIBS were bad name in .am * src/types/pa_vmail.C: HAVE_TIMEZONE & co now checked and mailreceive would compile on freebsd now * src/include/pa_config_fixed.h, src/types/pa_vmail.C, acconfig.h, configure, configure.in, src/include/pa_config_auto.h.in, src/targets/cgi/Makefile.am: HAVE_TIMEZONE & co now checked and mailreceive would compile on freebsd now * src/: classes/file.C, main/untaint.C: 1. file spec language changed: now there are only few chars are untainted: * ? ' " < > | and, on unix, : \ ~ [russian letters and SPACES now enabled, one should use ^untaint[uri]{...} now] 2. $list[^file:list[dir]] now returns simply tainted names in $list.name, not tainted as filespec @russianindex[] #dir with files with russian-lang names $where[dir] $dir[^file:list[$where;\.txt^$]] ^dir.menu{ $dir.name
} 2002-09-23 paf * src/types/pa_vdouble.h: double->int round added * src/classes/date.C: date bug fix, now round(floatDays*secondsPerDay) * src/classes/date.C: date bug fix, now round(floatDays*secondsPerDay) 2002-09-20 paf * src/main/execute.C: code junction calls disabled [before: code was compiled in such a way, that there were no code-junctions in OP_CALL] this now error: @badjunctioncall[] ^badjunctioncallinside{code} @badjunctioncallinside[code] ^code[] * src/main/: compile.tab.C, compile.y: changed grammer on junction expanding to include ^junction.method * src/main/pa_common.C: -d "DIR/" now true * src/classes/xdoc.C: xdoc::create[name] now sets $request:charset as internal xdoc encoding, and after decoding attributes set by dom functions now encoded OK, not as digital entities * src/classes/xdoc.C: empty transform result, being taken as file now returns empty file, not raises stupid error about "stat-ed file" * src/types/pa_vhash.h: hash.foreach modification of existing keys allowed * src/types/types.dsp: introducing $junction.get/put(1) one can write iterators now: ^user-foreach[key;value]{$key=$value
} @user-foreach[key;value;code] ^for[i](1;10){ $code.key($i) $code.value($i*2) $code } * src/main/compile_tools.h: mistype * src/targets/cgi/Makefile.am: binaries now depend on makefiles, thus taking linking options configure changes into account [were: ignoring] * src/types/: pa_vjunction.C, Makefile.am: introducing $junction.get/put(1) one can write iterators now: ^user-foreach[key;value]{$key=$value
} @user-foreach[key;value;code] ^for[i](1;10){ $code.key($i) $code.value($i*2) $code } * src/: include/pa_opcode.h, include/pa_request.h, main/compile.tab.C, main/compile.y, main/execute.C, main/main.dsp, targets/cgi/parser3.dsp, types/pa_vjunction.h: introducing $junction.get/put(1) one can write iterators now: ^user-foreach[key;value]{$key=$value
} @user-foreach[key;value;code] ^for[i](1;10){ $code.key($i) $code.value($i*2) $code } 2002-09-19 paf * Makefile.am: new: make commit * aclocal.m4: forced to be older 2002-09-18 paf * parser3.dsw, src/include/pa_opcode.h, src/main/compile.tab.C, src/main/compile.y, src/main/execute.C: << >> int shifts * src/: include/pa_common.h, include/pa_request.h, main/pa_common.C, main/pa_request.C: auto.p exists but unreadable - now this - fatal error * src/classes/file.C: ^file::exec/cgi $.stdin[can be file now] so that one can pass binary data there * src/: classes/date.C, classes/double.C, classes/file.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, include/pa_request.h: pa_request contexts made privated, plus get_{self/method_frame} to read. Request_context_saver used in ^try to save flang too. [were not saved] * src/types/pa_vresponse.C: header value chains joined before output, this should help $.subject[$var $var] from being converted to subject: ?koi8-r?Q?...?= ?koi8-r?Q?...?= 2002-09-17 paf * src/: main/execute.C, types/pa_value.h, types/pa_vmethod_frame.h: removed changes, operators executed with calling self. lots of code with ^include code relies on defined/defining self variables $a[1] ^include[print_a.p] print_a.p: $a ^include[set_a.p] a=$a set_a.p: $a[1] * src/: classes/op.C, main/execute.C, main/pa_request.C, types/pa_value.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.h: operators now executed with MAIN self. it's for ^include sake, too strong a change * src/classes/op.C: made place for ^process to compile it's code to in case of no self * src/main/execute.C: found ancient param to Junction, removed. allowed passing self to native_code_operators [for ^process to work, she needs self] * src/: main/execute.C, types/pa_value.C, types/pa_value.h, types/pa_vstateless_class.h: found ancient param to Junction, removed. allowed passing self to native_code_operators [for ^process to work, she needs self] * src/: main/execute.C, main/pa_request.C, types/pa_value.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.h: allowed Request.self to be 0, checked that in VMethodFrame get/put and $self. * src/classes/: table.C, xdoc.C: table::sql options table::create copy options options checked, wrong option now fatal error * src/main/pa_string.C: string.replace fixed [were missing words on pieces boundaries] * configure, configure.in: .so now detected [can be .sl on hpux, .dll on cygwin, .so in other cases) * configure, configure.in: .so now detected [can be .sl on hpux, .dll on cygwin, .so in other cases) * operators.ru.txt, operators.txt, src/classes/hash.C, src/classes/table.C, src/include/pa_globals.h, src/main/pa_globals.C: table.sql hash::sql flag to allow duplicate keys [$.distinct(1/0)] first record taken [were last] * src/: classes/hash.C, classes/table.C, include/pa_sql_connection.h: table.sql hash::sql duplicate keys now errors * src/classes/hash.C: foreach delims bug fixed [were ,2,3] * src/classes/: op.C, table.C: menu/for delims bug fixed [were ,2,3] 2002-09-16 paf * src/classes/file.C: file::cgi line ends can be both unix & dos. and they can be unix [\n\n] on win when 'use CGI' used, it causes stdout to be binary. now detected closest header break. * src/: main/untaint.C, types/pa_vmail.C: mail:send closing ?= now closed right 2002-09-13 paf * operators.ru.txt, operators.txt, src/main/compile.tab.C, src/main/compile.y, src/main/compile_tools.h: (expression #comment) (multiline expression #comment line2 #comment ) (expression #comment with (brackets) comment) << OK * operators.ru.txt, operators.txt, src/main/compile.tab.C, src/main/compile.y: !| bitwise !|| numerical xor now [preparing for expression #comments] * src/main/: compile.tab.C, compile.y: @method[$name] now parse error * src/: include/pa_config_fixed.h, main/pa_socks.C: HAVE_WINSOCK_H cheched in pa_socks.C * configure, configure.in, src/include/pa_config_auto.h.in: HAVE_WINSOCK_H created in configure.in * src/: main/compile.tab.C, main/compile.y, types/pa_vresponse.C: cookie date now clean [were mistakenly tainted & that worked bad with opera -- 'happily' that worked OK with msie] 2002-09-12 paf * src/types/: pa_vclass.C, pa_vmail.C, pa_vobject.C: VObject & VClass get_element now first looks to fields, next to methods & co todo: the rest reason: more speed * src/main/untaint.C: quoted printable encoding stops before \s*<...>$ * src/main/untaint.C: quoted printable ' ' now =20 and encoding stops before <...>$ 2002-09-11 paf * src/: main/pa_charset.C, targets/cgi/parser3.dsp: while fixing ( xmlCharEncodingInput/OutputFunc callbacks returned bad value ) forgot to check users of those funcs. not all were using that return value convention * src/lib/pcre/ibm-1254.ucm, etc/parser3.charsets/windows-1254.cfg: windows-1254 added 2002-09-10 paf * src/: classes/op.C, main/execute.C, types/pa_wcontext.h: VCodeFrame parent param were specified badly * src/: main/execute.C, types/pa_value.h, types/pa_wwrapper.h: WWrapper which used in constructing objects(second param to sql method) ^...sql{}[$.default{code}] now has parent, wich helps code in hash to survivi * src/: include/pa_request.h, main/execute.C: removed redundant param to execute [stack said 'thanks'] * src/: classes/op.C, main/execute.C, types/pa_value.C, types/pa_value.h, types/pa_vcode_frame.h, types/pa_vmethod_frame.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: moved junction kill responsibility to wcontext * src/classes/file.C: decided not to log exec's with stderr, that could be warnings, and it's up to scritper to log/show them * src/: classes/double.C, main/execute.C: double:sql badly called write_assign_lang, not write_no_lang, thus doing unnecessary double/string converstion, which were loosing time&precesion * src/: main/pa_charset.C, types/pa_vmail.C: xmlCharEncodingInput/OutputFunc callbacks returned bad value in case of unfinished in buffer processing, causing accidental transcode stop [in case that source enc != utf-8 & there is incomplete utf-8 sequence at the end of 16000block iside of libxml lib] tfm readed & code updated 2002-09-04 paf * configure: makes with sjlj * INSTALL, src/include/pa_config_fixed.h, src/include/pa_sql_connection.h, src/main/pa_sql_driver_manager.C: -with-sjlj-exceptions define checked. on win32 it made default * src/include/pa_config_auto.h.in: sjlj define * configure, configure.in: introducing --with-sjlj-exceptions [hpux can not work with longjump/throw pair, and one must switch that on there. todo: detect that automatically] * src/types/pa_vxnode.C: removed too strong checks of xnode.elements. now, for instance, if element does not have any attributes, $xnode.attributes is void, not error 2002-09-02 paf * operators.ru.txt, operators.txt, src/main/execute.C, src/targets/cgi/parser3.dsp: removed double_result, didn't help * src/main/execute.C: double_result made to move that var away from hungry g++ optimizer (-O2), before: it were optimized and comparison operators worked badly * src/types/pa_vdate.h: removed debug * Makefile.am, src/types/pa_vdate.h: happy now only install-exec * src/main/execute.C: fixed numeric < & co so that thay now use c=a-b, c OPERATOR 0. this works fine on solaris/intel for still unknown reason. 2002-08-29 paf * parser3.dsw, src/classes/classes.dsp, src/classes/hash.C, src/classes/op.C, src/classes/string.C, src/include/pa_request.h, src/lib/md5/md5.dsp, src/main/execute.C, src/main/main.dsp, src/main/pa_request.C, src/targets/cgi/parser3.dsp, src/types/pa_value.C, src/types/pa_value.h, src/types/pa_vmail.C, src/types/pa_vmethod_frame.h, src/types/pa_wcontext.h, src/types/types.dsp: junction_cleaner moved to auto VMethodFrame [called less frequent, allowed to remove ugly Junction.change_context-s from many places, switch, mail:send..html{}, ..] request.root renamed to method_frame [more easyreading] ancient {...PUSH/POPs...} changed to stack vars [speed up] 2002-08-28 paf * src/types/pa_vcookie.C: $cookie:name[&] $cookie:name << now tainted * src/types/pa_vcookie.C: fixed cookie delete when $cookie:name[$.value[]] * operators.ru.txt, operators.txt, src/classes/string.C: ^string.split[delim[;options]] 2002-08-27 paf * etc/parser3.charsets/Makefile.am: merged from 3.0.0005 * operators.ru.txt, operators.txt, src/main/compile.tab.C, src/main/compile.y: # now delimiter * INSTALL: recommended latest gmime 1.0.5 2002-08-26 paf * configure, configure.in: apache13/hook added to make dist. 2002-08-23 paf * src/: include/pa_common.h, main/pa_common.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: when auto.p beside binary [cgi, isapi] not accessible [due to bad rights or whatever] it's error now 2002-08-21 paf * Makefile.am: can use: make happy equals to make update install * src/main/: compile.tab.C, compile.y, compile_tools.C, compile_tools.h: "BASE:" "BASE::" syntax allowed, means "base class". compiled as if here they named base class * src/main/pa_string.C: fixed bad language bug, [were wrong string cloning constructor] * src/: main/execute.C, types/pa_vobject.h: fixed virtual calls * src/: targets/cgi/parser3.C, types/pa_vfile.C, types/pa_vmail.C: $mail.received.file.value.content-type fixed 2002-08-20 paf * src/classes/file.C: fixed language of file:file result * operators.ru.txt, operators.txt, src/classes/void.C: ^void.pos[...] = -1 merged from 3.0.0005 * operators.ru.txt, operators.txt, src/classes/void.C: ^void.pos[...] = -1 * operators.ru.txt, operators.txt, src/classes/void.C: ^void.length[] = 0 merged from 3.0.0005 * src/classes/void.C, operators.ru.txt, operators.txt: ^void.length[] = 0 2002-08-19 paf * src/classes/xdoc.C: xdoc getElementsByTagName, ...NS overriden, work now * src/: classes/xnode.C, types/pa_vxdoc.C: xdoc.fields fixed [were error in xnode, which were not catched in xdoc] * src/: include/pa_stylesheet_connection.h, main/pa_globals.C: prepared: // validate each document after load/create (?) //xmlDoValidityCheckingDefaultValue = 1; 2002-08-15 paf * src/classes/classes.h: write to static var caused useless Exception, introduced Methoded::put_element wich consumes those * operators.ru.txt, operators.txt, src/include/pa_common.h, src/main/pa_common.C, src/types/pa_vcookie.C, src/types/pa_vdate.h, src/types/pa_vresponse.C, src/types/pa_vresponse.h: $response:field[date] $response:field[$.xxx[date]] * src/: classes/hash.C, classes/string.C, classes/table.C, classes/void.C, include/pa_sql_connection.h: fixed source of ^hash::sql{bad} * operators.ru.txt, operators.txt: $request:body unprecessed POST request body * src/types/pa_vrequest.C: $request:body unprecessed POST request * src/types/: pa_value.h, pa_vdate.h, pa_vrequest.C, pa_vxdoc.C, pa_vxnode.C: few barks: bark("%s field not found", 0, &aname) * operators.ru.txt, operators.txt, src/classes/form.C, src/include/pa_pool.h, src/include/pa_request.h, src/main/pa_pool.C, src/types/pa_vform.C, src/types/pa_vform.h: planning/preparing_to $request:body r.post_data now const * src/: classes/image.C, classes/op.C, classes/xdoc.C, classes/xnode.C, main/execute.C, types/pa_value.h, types/pa_vhash.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vtable.h: instead of type() checking everywhere used Value.as now user descendants can be used in params. VObject::as_*, is_defined now taken from bases. xtable(table) ^if($xtable) now OK * src/: main/execute.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vxdoc.C, types/pa_vxdoc.h: is->as 2002-08-14 paf * src/: classes/xnode.h, main/execute.C, targets/cgi/parser3.dsp, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: is now works with VObject & VClass * src/types/pa_vmail.C: mail: turned off utf8 to source transcoding * src/targets/cgi/: fixopt.C, fixopt.h, parser3.C, Makefile.am: removed fixopt stupidity. on stupid linux use cd /document/root ../cgi/parser3 script * src/targets/cgi/fixopt.C: fixopt now preprocesses command line params, splitting them by space, excluding argv[0], argv[argc-1] * src/targets/cgi/: Makefile.am, parser3.C, parser3.dsp, fixopt.C, fixopt.h: fixopt now preprocesses command line params, splitting them by space, excluding argv[0], argv[argc-1] * src/targets/cgi/parser3.C: -f config file * src/targets/cgi/parser3.C: fixed .log file dir 2002-08-13 paf * src/types/pa_vobject.C: allow override parent variables, useful for form descendants [in vobject too, were in vclass] * src/types/pa_vclass.C: allow override parent variables, useful for form descendants * src/types/pa_vclass.C: checked: form[vclass]fields can be overwritten in derived(table) * src/: classes/form.C, classes/mail.C, classes/op.C, classes/xnode.h, include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.C, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: introduced Value::get_element(..., bool looking_down) [needed to exclude endless recoursion] * src/types/: pa_vclass.C, pa_vobject.C: reorganized modules todo: fix bug with put endless recoursion todo: check 'as' * src/types/: Makefile.am, pa_vclass.h, pa_vobject.h, types.dsp: reorganized modules todo: fix bug with put endless recoursion todo: check 'as' * src/types/pa_vobject.h: checked: table fields can be overwritten in derived(table) * src/types/pa_vobject.h: derived classes can have fields of their own now * src/: classes/table.C, types/pa_vtable.C, types/pa_vtable.h: fixed error message on using non-created table * src/: classes/form.C, classes/hash.C, classes/mail.C, classes/op.C, classes/xnode.h, include/pa_request.h, main/compile.C, main/compile.tab.C, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wwrapper.h: VObject.get/out now looking down/up tree todo: fix error message on non-constructed parents 2002-08-12 paf * src/types/: pa_vstateless_class.h, pa_vstateless_object.h: table derived OK * src/main/execute.C: ^base:create[] dynamic call rewritten todo: thorough testing * src/: main/compile.tab.C, main/compile.y, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vclass.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_wcontext.h, types/pa_valiased.C, types/pa_valiased.h, types/Makefile.am: ^base:create[] dynamic call rewritten todo: thorough testing * src/types/: pa_value.h, pa_vclass.h, pa_vobject.h: VObject ctor now instantates base class, remembers it and saves child in parent VObject.get_class now returns last child = downward virtual calls OK * src/: main/execute.C, types/pa_value.h, types/pa_vclass.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vxdoc.h, types/pa_vxnode.h, types/pa_wcontext.h, types/types.dsp: killed VAliased [redundant], moved $CLASS to VObject only [parser class instance] * src/main/pa_request.C: $response:body[file] content-type check fixed [were bad when content-type is hash] 2002-08-09 paf * src/: main/execute.C, types/pa_value.h, types/pa_vclass.h, types/pa_vobject.h, types/pa_vxdoc.h: started as() 2002-08-08 paf * operators.ru.txt, operators.txt, src/classes/date.C, src/include/pa_globals.h, src/main/pa_globals.C: year column in month calendar [week year] * src/main/execute.C: error reporting on object writes to MAIN improved [were ruind with fixing $obj[^if(1){$obj}] ] * operators.ru.txt, operators.txt, src/types/pa_vdate.h: $date.yearday $date.daylightsaving * src/: classes/mail.C, types/pa_vmail.C: in letter texts one can use tainted data now. only she must specify the language. ^mail:send[ $.from[paf@mail.design.ru] $.to[paf@mail.design.ru] $.subject[^taint[uri][]=2] $.text[^taint[uri][]=] ] * src/: classes/file.C, classes/op.C, types/pa_vfile.C: ^process now prints more precise origin * src/include/pa_string.h: String::first_char now not fails on empty strings ^if(-f '') now ok and in 3 other places. * operators.ru.txt, operators.txt, src/include/pa_string.h, src/main/pa_string.C: String::first_char now not fails on empty strings ^if(-f '') now ok and in 3 other places. 2002-08-07 paf * src/: classes/string.C, main/pa_string.C: ^string.mid(0;bad) fixed * src/main/pa_string.C: ^string.mid(0;bad) fixed * src/: main/execute.C, types/pa_vcode_frame.h, types/pa_vmethod_frame.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: vcodeframe were mistakenly not completely transparent to object writes. $hash[^if(1){$hash}] now works * operators.ru.txt, operators.txt, src/classes/op.C: ^cache...{...^cache<client only when text/* or simple onoverridden $response:body 2002-08-01 paf * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, lib/pcre/pcre_parser_ctype.c, main/compile.C, main/compile.tab.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: Date: now * src/: classes/classes.C, classes/classes.dsp, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_uue.h, lib/md5/pa_md5.h, lib/md5/pa_md5c.c, main/compile.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/main.dsp, main/pa_array.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/pa_uue.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmail.C, types/pa_vmail.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h, types/types.dsp, Makefile.am, classes/Makefile.am, main/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: ident.C* removed * operators.ru.txt, operators.txt, src/classes/file.C, src/main/pa_request.C: file:find[/can/do/this/now.txt] * src/targets/cgi/parser3.C: usage to stdout now 2002-07-31 paf * src/types/pa_vmail.C: mail: errors-to: now default "postmaster" * src/: classes/mail.C, types/pa_vmail.C: mail: errors-to: now default "postmaster" * src/: classes/mail.C, types/pa_vmail.C: mail from/to now must be. -f postmaster now default sendmail key word "postmaster" replaced to $.from 2002-07-30 paf * configure, configure.in, src/targets/cgi/pa_config_paths.h.in, src/targets/cgi/parser3.C: removed pa_config_paths.h * src/main/pa_charset.C: comment * src/main/pa_charset.C: UTF-8 to 1byte charset convert, no char in table, &#decimal; * src/main/pa_request.C: comment * etc/parser3.charsets/windows-1251.cfg: section sign [russian paragraf] 2002-07-11 paf * src/main/pa_exec.C: build command line badly added params twice [and first time without ' ']. double wrong. fixed. * src/main/pa_exec.C: invalid .exe caused error message with params wich parser did not provide = reported badly. fixed that. * src/classes/mail.C: $MAIL[ # xxx ] now ok * operators.ru.txt, operators.txt: plan: sql detailed exception 2002-07-01 paf * src/: classes/form.C, main/pa_request.C: @conf bug fixed [MForm.configure_admin were called when request.main_class ==0 * src/classes/form.C: 10*0x400*400 bug fix [4M not 10M] * src/classes/form.C: content_length type fix 2002-06-30 paf * src/classes/mail.C: merged from 4 * src/classes/mail.C: restored $MAIL 2002-06-28 paf * configure, configure.in: removed paths.h * configure, src/include/pa_version.h, src/targets/cgi/pa_config_paths.h.in: lates changes from 4 build merged, makes updated * ChangeLog, configure, operators.ru.txt, operators.txt, src/classes/xdoc.C, src/include/pa_charset.h, src/include/pa_config_fixed.h, src/include/pa_pool.h, src/include/pa_version.h, src/main/pa_charset.C, src/main/pa_pool.C, src/targets/cgi/parser3.dsp, src/targets/isapi/parser3isapi.dsp, src/types/pa_vmail.C: merged latest updates to head 2002-06-27 paf * src/targets/: cgi/parser3.dsp, isapi/parser3isapi.dsp: post-build not error now * operators.ru.txt, operators.txt, src/classes/xdoc.C, src/include/pa_charset.h, src/include/pa_config_fixed.h, src/include/pa_pool.h, src/main/pa_charset.C, src/main/pa_pool.C: ^xdoc::create[[uri]]... base uri for document being created, imports and other relative file names would be relative to this uri default uri=path_translated * src/classes/xdoc.C: xsltParseStylesheetDoc bug workaround 2002-06-26 paf * configure, configure.in, src/include/pa_version.h: release_3_0_0004 * src/main/pa_string.C: blank string '', ' ' considered 0 now * src/targets/cgi/parser3.C: /cgi-bin/parser empty filename checked 2002-06-25 paf * src/main/pa_string.C: emtpy string, or string of whitespaces considered bad number now * operators.ru.txt, operators.txt, src/classes/xdoc.C: ^xdoc.transform[xdoc <double @ compile time were not-enough-checking... * src/main/: compile.tab.C, pa_string.C: whitespace after number in autoconvert now ignored * src/types/: pa_vform.C, pa_vform.h: $form: not determined yet check * src/classes/mail.C: mail netscape attachment name fixed. todo: $response:body content-type:name * configure, configure.in: hpux check, nsl link, no socket * operators.ru.txt, operators.txt: old merge conflict removed * configure, configure.in: pack even address access on sparc&co arch checked in configure * configure, src/include/pa_version.h: makes * configure, configure.in, src/include/pa_version.h: makes * src/main/untaint.C: (bug#2) mail subject got always prepended with charset even when all letters were 7bit one * src/main/pa_common.C: merged fixed -d (bug) * src/main/pa_common.C: fixed -d (bug) 2002-06-03 paf * ChangeLog, operators.ru.txt, operators.txt, etc/parser3.charsets/windows-1251.cfg, src/classes/classes.dsp, src/main/compile.tab.C, src/main/main.dsp, src/main/pa_globals.C, src/targets/cgi/parser3.C, src/targets/cgi/parser3.dsp, src/targets/isapi/parser3isapi.dsp, src/types/types.dsp: fixed .dsp-s along with reorganized cvs modules dirs structure * src/: classes/classes.dsp, main/compile.tab.C, main/main.dsp, main/pa_globals.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: reorganized cvs modules 2002-05-28 paf * src/targets/cgi/parser3.C: info.uri now "" 2002-05-17 paf * src/classes/: table.C: ^table.save << checked empty pre/match/post columns 2002-05-16 paf * src/classes/image.C: image::measure can png now 2002-05-15 paf * operators.ru.txt, operators.txt, src/classes/date.C: ^date::create[%H:%M[:%S]] added * etc/parser3.charsets/windows-1251.cfg: 0x forgot, fixed * operators.ru.txt, operators.txt, src/classes/date.C: ^date::create[%Y[-%m[-%d[ %H[:%M[:%S]]]]]] [-%m now 2002-05-14 paf * etc/parser3.charsets/: windows-1251.cfg: added 3 quotes 2002-05-07 paf * ChangeLog, src/classes/classes.dsp, src/classes/op.C, src/include/pa_globals.h, src/include/pa_request.h, src/include/pa_table.h, src/main/compile.tab.C, src/main/compile.y, src/main/main.dsp, src/main/pa_globals.C, src/main/pa_request.C, src/main/pa_table.C, src/targets/isapi/pa_pool.C, src/targets/isapi/parser3isapi.C, src/targets/isapi/parser3isapi.dsp, src/targets/isapi/pool_storage.h, src/types/types.dsp: Table name2number field now &. main_method_name now on Request pool rather on global_pool [Junction+VJunction created on same pool as name = were created on global pool, causing mem leaks] * src/: classes/classes.dsp, classes/op.C, include/pa_globals.h, include/pa_request.h, include/pa_table.h, main/compile.tab.C, main/compile.y, main/main.dsp, main/pa_globals.C, main/pa_request.C, main/pa_table.C, targets/isapi/pa_pool.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, targets/isapi/pool_storage.h, types/types.dsp: Table name2number field now &. main_method_name now on Request pool rather on global_pool [Junction+VJunction created on same pool as name = were created on global pool, causing mem leaks] 2002-05-06 paf * src/: main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/parser3isapi.C: removed 100*40 bytes per request memory leak [nonpool malloc in globals] * src/: main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/parser3isapi.C: removed 100*40 bytes per request memory leak [nonpool malloc in globals] 2002-04-30 paf * configure, src/include/pa_version.h: version now not b * src/targets/cgi/parser3.C: request.uri now never 0 2002-04-29 paf * configure.in: removed b * src/: classes/op.C, include/pa_exception.h, main/pa_request.C: Exception::comment/type checked in (), no there's no empty type/comment by default * ChangeLog, src/doc/ClassExample1.dox, src/doc/ClassExample3.dox, src/doc/aliased.dox, src/doc/methoded.dox, src/doc/string.dox, src/doc/value.dox, src/include/pa_exception.h, src/main/pa_request.C, src/targets/cgi/parser3.C: merged from 0001 2002-04-26 paf * src/: doc/doxygen.cfg, targets/cgi/parser3.dsp: doxygen dot image size reduced 2002-04-25 paf * src/targets/cgi/: parser3.C: setenv in .htaccess when cgi is not under that dir got REDIRECT_ prefix before HTTP_PARSER_x_CONFIG, now that took into account * operators.ru.txt, operators.txt, src/classes/date.C: ^date::create[2002-12-33 01:03:04] * ChangeLog, operators.ru.txt, operators.txt, src/classes/date.C: ^date::create[2002-12-33 01:03:04] * ChangeLog: updated changelog * src/classes/table.C: removed restriction on column count to ^table.hash to work, now must be >0 [were >1] 2002-04-24 paf * src/: classes/classes.dsp, main/compile.tab.C, main/main.dsp, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: MSVC profile targets 2002-04-23 paf * operators.ru.txt, operators.txt, src/classes/string.C: int/double/string:sql{}[$.default{code}] fixed [were barking: "junction used outside of context"] 2002-04-22 paf * types.txt, src/classes/string.C, src/include/pa_string.h, src/main/pa_string.C, src/types/pa_vstring.C, src/types/pa_vstring.h: ^string.optimize[] * src/: include/pa_globals.h, include/pa_table.h, main/pa_globals.C, main/pa_string.C, main/pa_table.C: fixed match table template * src/classes/: string.C: optimize removed from string .left/right/pos * src/main/execute.C: rolled back to before_killing_userjunction_contexts * src/main/execute.C: user junctions context killed * src/main/execute.C: junctions to local contexts got cleanized&checked later 2002-04-19 paf * src/: classes/string.C, include/pa_request.h, include/pa_string.h, main/pa_request.C, main/pa_string.C, types/pa_vstring.C, types/pa_vstring.h: string now optimized prior to .left .right .mid .pos .match when that is profitable, and always before .replace when $ORIGINS(1) optimization disabled economy from not wasting mem on lots of strings which occur by lots of String:mid calls to get parts of source string between found_occurances * src/classes/file.C: ovector now local economy: 16 bytes per ^file:list * src/: include/pa_globals.h, include/pa_table.h, main/pa_globals.C, main/pa_string.C: String::match table columns globalized, not created @ each ^match anymore economy: sizeof(Array)+space on 3+x cells=24+ bytes per ^match * src/: classes/op.C, classes/string.C, types/pa_value.h: VTable removed from each String::match replace iteration, and made stacked sizeof(VTable)=12bytes economy on each replace code * src/doc/footer.htm: 2001, * src/: classes/string.C, include/pa_string.h, main/pa_string.C: string.match[]['] option enables generation of $match.prematch .match .postmatch columns * src/main/pa_string.C: String::match options analized without cstr-ing them now * src/doc/: doxygen.cfg, footer.htm, html2chm.cmd, postbuild.txt, sources2html.cmd, view_chm.cmd, view_html.cmd, chmhelper.pl: config updated to doxygen 1.2.15, created helper which fixes minor bugs in chm project files & htm tree. changed extension to .htm 2002-04-18 paf * src/doc/doxygen.cfg: .chi generation disabled * src/: classes/classes.h, classes/xdoc.C, classes/xnode.C, classes/xnode.h, types/pa_vxdoc.C: xdoc(xnode) now fully - fields&methods * src/: classes/classes.h, classes/hash.C, types/pa_value.h, types/pa_vbool.h, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vobject.h, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.h, types/pa_vxnode.h: fclass_real lowered from VStateless_class to VObject * src/: main/pa_request.C, types/pa_valiased.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstring.h: VStateless_string_object speicalized light version of VStateless_object * src/classes/op.C: ^throw comment param made optional * src/types/: pa_valiased.C, pa_valiased.h, pa_vclass.h, pa_vobject.h, pa_wcontext.C: VAliased get/set alias now virtual and implemented down in VClass, fclass_alias removed, * src/types/pa_value.C: forced to cut that from .h because of VStateless_class usage [undefined in .h] * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_request.C, types/pa_vmethod_frame.h: OP_GET_METHOD_FRAME merged with OP_CALL, VCodeFrame move to stack [no more heap waste on each CALL] * src/: classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xnode.C, include/pa_globals.h, include/pa_request.h, main/execute.C, main/pa_globals.C, main/pa_request.C, types/Makefile.am, types/pa_value.h, types/pa_vdouble.h, types/pa_vform.C, types/pa_vhash.h, types/pa_vint.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h, types/types.dsp: removed Value::fname 2002-04-17 paf * src/: doc/ClassExample1.dox, doc/ClassExample2.dox, doc/ClassExample3.dox, doc/compiler.dox, doc/module.dox, doc/pooled.dox, doc/string.dox, doc/targets.dox, include/pa_pool.h, include/pa_types.h: dox updated to current state, PTHROW freshen to throw & co * src/types/pa_vhash.h: vstring wrong parent fixed * src/classes/op.C: taint local result var bug fixed 2002-04-16 paf * asm.txt, form.txt, lang.txt, sql.txt: removed outdated. see in Attic asm.txt as most interesting * src/: main/pa_request.C, targets/isapi/parser3isapi.C: removed check, preventing content-length: 0 from appearing * src/main/execute.C: $result in @main now taken into account as in usual functions * src/: doc/postbuild.txt, main/execute.C: $result in @postprocess & @unhandled_exception now taken into account as in usual functions * src/doc/postbuild.txt: instructions on post .html build * src/doc/: doxygen.cfg, html2chm.cmd: .chm file only now, no .chi * src/: classes/file.C, main/pa_exec.C: stderr of execs mark as tainted * src/main/pa_request.C: uri in error log * src/: classes/date.C, main/compile.tab.C, targets/cgi/parser3.C: cheched date:create(days) param for validity [later were assumed valid and crashed on invalid onces] * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/execute.C, targets/cgi/parser3.C: OP_CALL -> OP_CALL__WRITE and used that for removing VString wrapper * src/classes/op.C: exception2vhash file now tainted * src/classes/op.C: _process pseudo origin copied from local var to heap * src/classes/op.C: extra check on empty file in origin in _execute 2002-04-15 paf * src/: main/execute.C, types/pa_value.h: fixed name update * src/classes/: file.C, op.C, table.C: finished dual write_xxx_lang functions * src/: classes/file.C, classes/hash.C, classes/op.C, include/pa_request.h, main/execute.C, types/pa_wcontext.h: started dual write_xxx_lang functions, if checked & works * src/: classes/date.C, classes/file.C, classes/mail.C, classes/string.C, classes/xnode.C, include/pa_request.h, types/pa_value.h, types/pa_wcontext.h: removed absolutely unnecessary VString shells * src/main/execute.C: CodeFrame soul fixed [mistakenly killed by prev changes] * src/: classes/image.C, classes/op.C, classes/string.C, classes/table.C, include/pa_request.h, main/execute.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_wcontext.h: StringOrValue wcontext result, now ready for dual writes * src/targets/cgi/parser3.C: ctime sometimes can be just "", checked that * src/main/: compile.tab.C, compile.y, compile_tools.C, compile_tools.h, execute.C: OP_GET_ELEMENT+OP_GET_ELEMENT__WRITE changed to OP_WRITE_VALUE in var get cases * src/: classes/op.C, include/pa_globals.h, include/pa_opcode.h, include/pa_request.h, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C: switch in hash constructor fixed [were problems with using of stacked wwrapper after it's death] 2002-04-12 paf * operators.ru.txt, operators.txt, src/classes/table.C: table.select(expression) 0 2002-04-11 paf * src/: classes/string.C, include/pa_request.h, main/execute.C: Request::process_internal codeFrame & wwrapper stacked [not wasting heap anymore] 2002-04-10 paf * src/: classes/double.C, classes/file.C, classes/hash.C, classes/image.C, classes/int.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, include/pa_request.h, main/execute.C, main/pa_string.C: killed Request::process() wrapping VString(String) in case we need only String * src/: include/pa_string.h, main/pa_string.C, main/untaint.C: killed 8 bytes from String.head 2002-04-09 paf * src/: main/compile.tab.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: removed { char *a; { /*sub local*/char b[...]; a=b; situations * operators.ru.txt, operators.txt, src/classes/xdoc.C: xslt params made literal * src/classes/xdoc.C: xslt params fixed * src/: main/pa_common.C, targets/cgi/parser3.C, types/pa_vdouble.h, types/pa_vint.h: int/double get_string now not pool.malloc(MAX_NUMBER) but really neaded * operators.ru.txt, operators.txt, src/classes/double.C, src/classes/int.C: int/double.int/double(default) 2002-04-04 paf * src/: include/pa_string.h, main/pa_string.C: fixed string.replace [when reconstructing pieces were split by max_integral(piece.size), thus some strings to replace happen to be split into two = not replaced) * src/targets/cgi/: parser3.C, parser3.dsp: document root in standalone version = current dir * src/targets/cgi/parser3.C: document root in standalone version = current dir 2002-04-03 paf * configure, configure.in: more checks on nonexistent charset * INSTALL, configure, configure.in: root config configure options 2002-04-02 paf * src/main/compile.C: parser.compile [exception name more like in doc] 2002-04-01 paf * src/: classes/mail.C, include/pa_string.h, main/untaint.C, targets/isapi/parser3isapi.dsp: mail subject encoding taken from .content-type.charset, not .charset 2002-03-29 paf * etc/parser3.charsets/koi8-r.cfg: koi8-r += ukranian letters * operators.ru.txt, operators.txt, src/classes/date.C: ^date::create now may not supply day, default 1. checked 29.03 -> 29.02 roll on non 366 days' year. | 31.05->31.04 roll 2002-03-28 paf * operators.ru.txt, operators.txt, src/classes/date.C, src/classes/op.C, src/include/pa_globals.h, src/include/pa_hash.h, src/main/pa_globals.C, src/types/pa_vdate.h: ^cache[file][date]{ ^cache(seconds) ^cache[date] } * src/classes/: xdoc.C, xnode.C, xnode.h: removed redundant pool param 2002-03-27 paf * operators.ru.txt, operators.txt, src/classes/date.C, src/classes/double.C, src/classes/file.C, src/classes/form.C, src/classes/hash.C, src/classes/image.C, src/classes/int.C, src/classes/mail.C, src/classes/math.C, src/classes/op.C, src/classes/string.C, src/classes/table.C, src/classes/void.C, src/classes/xdoc.C, src/classes/xnode.C, src/include/pa_exception.h, src/include/pa_request.h, src/include/pa_stylesheet_connection.h, src/main/compile.C, src/main/compile_tools.C, src/main/execute.C, src/main/pa_array.C, src/main/pa_charset.C, src/main/pa_charsets.C, src/main/pa_common.C, src/main/pa_dictionary.C, src/main/pa_exception.C, src/main/pa_exec.C, src/main/pa_pool.C, src/main/pa_request.C, src/main/pa_socks.C, src/main/pa_sql_driver_manager.C, src/main/pa_string.C, src/main/pa_table.C, src/main/untaint.C, src/targets/cgi/parser3.C, src/targets/isapi/parser3isapi.C, src/types/pa_value.h, src/types/pa_vcookie.C, src/types/pa_vfile.h, src/types/pa_vform.C, src/types/pa_vhash.h, src/types/pa_vmethod_frame.h, src/types/pa_vstatus.C, src/types/pa_vtable.C, src/types/pa_vxdoc.h, src/types/pa_vxnode.h, src/types/pa_wcontext.C, src/types/pa_wwrapper.h: assigned exception types * operators.ru.txt, operators.txt, src/classes/op.C, src/include/pa_config_fixed.h, src/include/pa_request.h, src/main/execute.C, src/main/pa_request.C: decided agains resetting exception_trace, just changed name 2002-03-26 paf * src/: include/pa_common.h, main/pa_exec.C: windows exec chdir fixed * src/classes/op.C: forced language of $source field of exception to 'tainted', so that sql-langed-frags could be outputed outside of connect * operators.ru.txt, operators.txt: removed date.roll limit of +-1 offset * src/classes/date.C: removed date.roll limit of +-1 offset * operators.ru.txt, operators.txt, src/classes/date.C: fixed date roll on daylightsaving days mktime took into account tm_isdst flag, which remained from BEFORE roll, but should have been reset 2002-03-25 paf * operators.ru.txt, operators.txt, src/targets/cgi/parser3.C: http_site_config_filespec * src/: classes/file.C, classes/mail.C, include/pa_exec.h, main/pa_exec.C: f(!forced_allow) to allow --with-sendmail to work with any/both --disable-foreign-group-files --disable-execs * INSTALL: "--with=sendmail=COMMAND" comment * INSTALL, configure, configure.in, src/classes/mail.C, src/include/pa_config_auto.h.in, src/main/pa_exec.C, src/targets/cgi/Makefile.am: --disable-foreign-group-files now disables execs also. introducing --sendmail * operators.ru.txt, operators.txt: pgsql options comment * INSTALL: comment on --disable-link-stdcpp * INSTALL, configure, configure.in, src/targets/cgi/Makefile.am: libstdc++ link skipping configure option * src/: classes/op.C, include/pa_sql_connection.h: sql connection with error were put to cache with 'marked_to_rollback' flag, all consequent even OK requests rolled back 2002-03-22 paf * src/main/pa_exec.C: createprocess nowindow flag check on readfile false return * operators.ru.txt, operators.txt: few comments on sets 2002-03-18 paf * operators.ru.txt, operators.txt, src/classes/op.C, src/include/pa_exception.h, src/include/pa_globals.h, src/include/pa_request.h, src/include/pa_stack.h, src/main/pa_globals.C, src/main/pa_request.C: introducing ^try * src/: main/pa_charset.C, targets/isapi/pa_threads.C, types/pa_vdouble.h: removed some tested @tests 2002-03-15 paf * operators.ru.txt, operators.txt, src/classes/table.C: ^table.locate(logical expr) 2002-03-13 paf * src/main/pa_exception.C: checked not-pooled malloc 2002-03-11 paf * INSTALL, configure, configure.in, src/include/pa_config_auto.h.in: --disable-foreign-group-files * src/main/pa_common.C: --disable-foreign-group-files * INSTALL: --disable-execs * src/main/pa_exec.C: --disable-execs * configure, configure.in, src/include/pa_config_auto.h.in: --disable-execs * src/: include/pa_config_fixed.h, main/pa_exec.C: --disable-execs * src/types/pa_vfile.C: $file.text now 0A linebreaks, file::exec/cgi linebreaks "0D0A" changed to 0A onces 2002-03-05 paf * operators.ru.txt, operators.txt, src/classes/date.C: date week calendar columns named * operators.ru.txt, operators.txt, src/classes/date.C: date week calendar columns named * src/targets/isapi/: parser3isapi.C, parser3isapi.dsp: iis5 now requires headers to be terminated with \r\n manually [refuses to separate header/body itself] * src/: main/pa_globals.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: isapi site config beside .dll 2002-03-04 paf * src/: classes/op.C, types/pa_vfile.C: process body now evaluated in PASS language * src/: classes/op.C, include/pa_string.h, main/pa_string.C: string deserialize checks on broken file * src/targets/isapi/: pa_threads.C, parser3isapi.C, parser3isapi.dsp: isapi updated 2002-03-01 paf * src/main/pa_exec.C: execle -> execve, now argc OK 2002-02-28 paf * src/main/untaint.C: removed some debug comments * src/main/pa_charsets.C: when placing charset to cache using global name now [were request] * configure, configure.in: apache module updated * src/main/pa_string.C: origin by first piece preferred before last piece 2002-02-27 paf * src/main/pa_charset.C: size_t * INSTALL: shared/static-xml with-pathlink * operators.ru.txt, operators.txt: SMTP comment 2002-02-26 paf * src/main/pa_exec.C: more precise names for vars, cosmetic * src/classes/xnode.C: in some situation, xpath query returned result with type NODESET, but empty nodeset member field, checked that 2002-02-22 paf * INSTALL: without-zlib comment * etc/parser3.charsets/windows-1251.cfg: ° * configure, configure.in: glib###.a detection fixed * INSTALL: hashfile removed from INSTALL * Makefile.am: make update * src/main/pa_string.C: string iterators fixed again, so were String::join_chain * src/main/pa_string.C: string iterators fixed again, so were String::join_chain * src/: include/pa_string.h, main/pa_string.C: string iterators fixed again, so were String::join_chain * src/types/pa_vcookie.C: cookie "expires=0" = "session" * operators.ru.txt, operators.txt, src/types/pa_vcookie.C: cookie "expires=0" = "session" * configure, configure.in, src/include/pa_config_auto.h.in: --with-shared-xml --with-static-xml * src/: classes/classes.dsp, main/compile.tab.C, main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: *.dsp: removed refereces to win32db & ancient xalan&xml * acconfig.h: acconfig move in cvs[from src/libltdl to /] * operators.ru.txt, operators.txt, src/classes/classes.dsp, src/main/main.dsp, src/types/types.dsp: removed hashfile support from sources for now * configure, configure.in, src/classes/Makefile.am, src/classes/hashfile.C, src/include/Makefile.am, src/include/pa_config_auto.h.in, src/include/pa_db_connection.h, src/include/pa_db_manager.h, src/include/pa_db_table.h, src/main/Makefile.am, src/main/pa_db_connection.C, src/main/pa_db_manager.C, src/main/pa_db_table.C, src/main/pa_globals.C, src/targets/cgi/Makefile.am, src/types/Makefile.am, src/types/pa_vhashfile.C, src/types/pa_vhashfile.h: removed hashfile support for now 2002-02-21 paf * src/main/untaint.C: removed debug code, activated commented-for debug parts * Makefile.am: make cvsupdate * src/: include/pa_string.h, include/pa_types.h, main/pa_string.C, main/untaint.C: STRING_*FOREACH_ROW changed to stop at append_row, not at link zero now string to string appending works 2002-02-20 paf * src/: include/pa_string.h, main/execute.C, main/untaint.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C: //#define DEBUG_STRING_APPENDS_VS_EXPANDS * src/: include/pa_string.h, main/pa_string.C, main/untaint.C: economy: 22% * src/: include/pa_string.h, main/pa_string.C, main/untaint.C: space uptimized: string::link_row removed * src/: include/pa_string.h, include/pa_stylesheet_connection.h, main/pa_db_manager.C, main/pa_dictionary.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C, types/pa_vcookie.C, types/pa_vstring.h: speed uptimized: string::is_empty * operators.ru.txt, operators.txt, src/include/pa_common.h, src/include/pa_config_fixed.h, src/include/pa_string.h, src/include/pa_types.h, src/main/compile.tab.C, src/main/execute.C, src/main/pa_string.C, src/main/untaint.C, src/targets/cgi/pa_pool.C, src/targets/cgi/parser3.C: strign to string append optimiziation idea and estimates 2002-02-19 paf * src/classes/math.C: not used directly [but erroreously reported that 'is', thus registering twice&other probs] * src/classes/: xdoc.C, xnode.C: getElementsByTagName and *NS moved to node [element] * src/main/compile.C: without string_origins parse error file+line+col possible * src/main/: compile.C: without string_origins not worked 2002-02-18 paf * src/types/pa_vdouble.h: since we have in_expression removed that trick i've installed into double::as_string * src/main/pa_globals.C: extern "C" was removed too fast * src/: include/pa_opcode.h, include/pa_request.h, main/compile.tab.C, main/compile.y, main/execute.C, types/pa_wcontext.h: in_expression aimed to solve old problem with string/nonstring values, now in expressions double/int values are passed as-is, without stupid tostring/fromstring conversions * src/main/: main.dsp, pa_globals.C: removed unneded #ifdef __cplusplus } #endif * src/main/compile.tab.C: bison env set so one could compile without cygwin installed * src/: classes/classes.dsp, main/main.dsp, main/pa_globals.C, targets/cgi/parser3.dsp, types/types.dsp: win32xml now contains gnome xml libs parser .dsp-s changed accordingly * operators.ru.txt, operators.txt, src/targets/cgi/parser3.C: PARSER_ROOT_CONFIG * operators.ru.txt, operators.txt, src/classes/date.C: date::create [were date::set, with backward comp * src/classes/math.C: math:random range check fixed * src/main/: compile.tab.C, compile.y: integer division stops name * INSTALL: local install comment * ltconfig, ltmain.sh: removed libtool subpart files * acinclude.m4, aclocal.m4, configure, configure.in, src/include/pa_config_auto.h.in, src/include/pa_config_includes.h, src/targets/cgi/Makefile.am, src/targets/cgi/parser3.C: removed libtool usage from build mech * operators.ru.txt, operators.txt: \ comment 2002-02-13 paf * src/include/pa_config_includes.h: sys/time time both included now. vaguely remember confilicts on this on some system [not on six|ablv] so when would see them again would think up proper check * INSTALL, configure, configure.in, src/targets/cgi/Makefile.am: --with-glib-config CXXLINK=$(CC) for targets/cgi/parser3 * src/main/pa_common.C: truncation never occured when writing files on unix [since i've changed cache mech] fix * src/main/pa_common.C: strnchr: sanity check added * etc/parser3.charsets/windows-1257.cfg: id added * etc/parser3.charsets/windows-1257.cfg, src/targets/cgi/parser3.C: baltic charset file generated, in generation script ispunct check added 2002-02-08 paf * src/: include/Makefile.am, sql/Makefile.am, targets/isapi/Makefile.am: forgotten makes * src/types/: pa_vcookie.C: VCookie::fill_fields one check forgotten * src/types/pa_vcookie.C: VCookie::fill_fields one check forgotten * INSTALL, README: install&others updated * AUTHORS, COPYING, ChangeLog, INSTALL: install&others updated * Makefile.am, configure, configure.in, etc/parser3.charsets/Makefile.am, src/Makefile.am, src/classes/Makefile.am, src/main/Makefile.am, src/main/pa_status_provider.C, src/targets/Makefile.am, src/targets/cgi/Makefile.am, src/types/Makefile.am: 'make dist' works * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/compile.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_cache_managers.C, main/pa_charsets.C, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_db_table.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_status_provider.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vhash.h, types/pa_vhashfile.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.h, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h, classes/image.C, main/pa_common.C, main/pa_exec.C, main/untaint.C, targets/cgi/parser3.C, types/pa_vcookie.C, types/pa_vfile.C, types/pa_vform.C, types/pa_vhashfile.C, types/pa_vimage.C, types/pa_vrequest.C, types/pa_vresponse.C, types/pa_vstring.C, types/pa_vtable.C, types/pa_vxdoc.C, types/pa_vxnode.C, main/pa_charset.C: name spelling * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset.h, include/pa_charsets.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/compile.C, main/compile.tab.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_cache_managers.C, main/pa_charset.C, main/pa_charsets.C, main/pa_common.C, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_db_table.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_status_provider.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.C, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: 2002 2002-02-07 paf * src/main/pa_socks.C: swapped headers to avoid compiler warnings * configure, configure.in, src/include/pa_config_auto.h.in, src/main/pa_common.C, src/main/pa_socks.C: compiled under cygwin added yet another locking function: fcntl * config.sub: on cygwin configure passes it with strange i1586 const, hacked it to mean i586 * src/main/: compile.C, compile.tab.C, compile.y, compile_tools.h: disabled $if reference due to conflicts with local variables * operators.ru.txt, operators.txt, src/classes/xdoc.C, src/include/pa_config_fixed.h: xdoc::set obsolete now, now xdoc::create, with both sences * operators.ru.txt, operators.txt, src/classes/table.C, src/include/pa_array.h, src/include/pa_table.h, src/main/pa_array.C, src/main/pa_table.C: table::create now // 'set' name obsolete now table clone. * operators.ru.txt, operators.txt, src/classes/string.C, src/include/pa_config_fixed.h, src/main/compile.tab.C: ^int/double/string.format now can be called with normal [] brackets, not stupid {} as it were implemented for some strange reason. retaining backward compatibility due to some already-implemented servers * src/: include/pa_array.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h: operators now detected by check at name_without_curly_rdive_read rule whether diving code constists only of OP_VALUE+string+OP_GET_ELEMENT. and last op code substituted with OP_GET_ELEMENT_OR_OPERATOR to form OP_VALUE+string+OP_GET_ELEMENT_OR_OPERATOR. code 2002-02-06 paf * configure, configure.in: prefix expanded, grr * operators.ru.txt, operators.txt, src/classes/mail.C: mail:send config changed 2002-02-05 paf * operators.ru.txt, operators.txt: regex options commented * src/main/: pa_exec.C: argv0 now correct * src/types/pa_vstatus.C: status:rusage 3 * src/types/pa_vstatus.C: status:rusage 2 * operators.ru.txt, operators.txt: status:rusage described int operators * src/types/pa_vstatus.C: status:rusage 1 * configure.in, src/types/Makefile.am, src/types/pa_vstatus.h, src/types/types.dsp: status:rusage * configure.in, operators.ru.txt, operators.txt, src/classes/file.C, src/classes/op.C, src/include/pa_common.h, src/include/pa_config_includes.h, src/main/compile.tab.C, src/main/pa_common.C: rewritten ^cache to use non-blocking-exclusive-caches * src/main/pa_common.C: text file read mode on win32 adjusted [speed impact. was off for debugging purpose, but forgotten afterwards] 2002-02-01 paf * src/classes/op.C: file_write does EX lock after create, while file_read does SH after open, so there's a moment after create but before EX lock when read can sneak into, and read just-created-for-writing-and-not-yet-locked file, added a check for that in ^cache...read 2002-01-31 paf * src/main/: compile.y, compile.tab.C: disabled operator call after ^xxx: * src/main/: compile.tab.C, execute.C: made operators lookup first in ^xxx situation. so that one could not do $if[1] ^if[xxx] * src/: include/pa_opcode.h, include/pa_request.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, types/pa_wcontext.h: operators check 6.1 rewritten. now check is done at compile time * src/main/execute.C: operators check 5 floated up old error of staying in 'entered class/object' state after $a($a..) it prevented operators from being called thereafter * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/execute.C: operators check 4 floated up old error of staying in 'entered object' state after ^a.a(a) it prevented operators from being called thereafter * src/main/execute.C: operators check 3 floated up old error of staying in 'entered class' state after $a:a(a) it prevented operators from being called thereafter * src/: main/execute.C, types/pa_wcontext.h: operators check 2 floated up old error of staying in 'entered class' state after $a:a[a] it prevented operators from being called thereafter * src/main/execute.C: operators check, thay mistakenly seen in $class:operator $object.operators contexts * src/: classes/xdoc.C, targets/cgi/parser3.dsp: now compiles under win32 * INSTALL, configure, configure.in, ident.awk, etc/Makefile.am, src/classes/Makefile.am, src/main/Makefile.am, src/targets/cgi/Makefile.am, src/targets/cgi/pa_config_paths.h.in, src/targets/cgi/parser3.C, src/types/Makefile.am: lowered indent.awk back to src/ * AUTHORS, COPYING, ChangeLog, INSTALL, Makefile.am, NEWS, README, acinclude.m4, aclocal.m4, asm.txt, config.guess, config.sub, configure, configure.in, form.txt, ident.awk, install-sh, lang.txt, ltconfig, ltmain.sh, missing, mkinstalldirs, operators.ru.txt, operators.txt, parser3.dsw, sql.txt, types.txt, etc/Makefile.am, etc/parser3.charsets/Makefile.am, etc/parser3.charsets/koi8-r.cfg, etc/parser3.charsets/windows-1250.cfg, etc/parser3.charsets/windows-1251.cfg, src/Makefile.am, src/classes/Makefile.am, src/include/pa_config_auto.h.in, src/main/Makefile.am, src/targets/cgi/Makefile.am, src/targets/cgi/parser3.C, src/types/Makefile.am: moved etc&www out of src, moved configure&co out of src added windows-1250.cfg straightened installation scripts procedure made targets/cgi/parser3.C be dependant on ./configure --sysconfdir change 2002-01-30 paf * src/classes/xdoc.C: acconfig.h changed [comments before #undefs removed] those comments were a mistake, and prevented libltdl from function properly 2002-01-29 paf * src/: Makefile.am, classes/Makefile.am: removed libltdl/libtool creation [modified acinclude.m4 which were creating int into just assignment LIBTOOL=../libtool] added default system config&charsetts prepared 'make install', now it installs targets/cgi/parser3 into bin directory etc/parser3.conf & etc/parser3.charsets/* into $sysconfdir and $sysconfdir/parser3.charsets respectively * src/: classes/xdoc.C, include/pa_charset.h, include/pa_globals.h, main/pa_globals.C: few forgotten ifdef XML added 2002-01-28 paf * src/: classes/Makefile.am, targets/cgi/Makefile.am: xalan-patch removed * src/main/pa_exception.C: dom|generic error output fix * src/classes/xnode.C: xdoc.importNode 3 [check err] * src/classes/xnode.C: xdoc.importNode 2 [mistype err] * src/: classes/xnode.C, types/pa_vxdoc.h: xdoc.importNode 1 [fixed as_node helper func to accept docs] * src/: classes/xdoc.C, classes/xnode.h, main/pa_exception.C: xdoc.importNode 0 * src/classes/xdoc.C: xdoc::set now untaints OK 2002-01-25 paf * src/main/: compile.tab.C, compile.y: #comment before @ after @SPECIAL now works OK * src/main/: pa_exec.C: unix: exec now does chdir to script dir * src/main/pa_exec.C: max arg count now 10, and proper message on violation that added * src/classes/hash.C: unified hash::sql, now ^hash::sql{query}[[$.limit(2) $.offset(4)]] * src/: classes/file.C, include/pa_common.h, main/pa_common.C: ^file:lock[filename]{code} * src/: classes/file.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, include/pa_common.h, main/pa_common.C, types/pa_vfile.h: removed redundant pool param to some pa_common funcs * src/: include/pa_charset.h, main/pa_globals.C: http://localhost/abc -> $ENV{DOCUMENT_ROOT}/abc | ./abc * src/: include/pa_charset.h, main/pa_charset.C, include/pa_config_fixed.h, main/compile.tab.C: typedef XMLCh... not stupid illegal define 2002-01-24 paf * src/include/pa_version.h: changed version number * src/: classes/hashfile.C, include/pa_db_table.h, include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_db_connection.C, main/pa_db_table.C, types/pa_vhashfile.C, types/pa_vhashfile.h: merged from r17 - hashfile without logfiles * src/: classes/hashfile.C, include/pa_db_table.h, main/compile.tab.C, main/pa_db_connection.C, main/pa_db_table.C, types/pa_vhashfile.C, types/pa_vhashfile.h: hashfile: removed use of transactions [libdb removed DB_INIT_LOCK, DB_INIT_LOG, DB_INIT_TXN init bits, thus got rid of huge log files, which cluttered disk without huge need] * src/classes/: xdoc.C, xnode.C, xnode.h: gdome_xml_doc_get_xmlDoc handy macro, which is strangly abscent in dome lib * src/classes/xdoc.C: xsltSaveResultTo checked <0 response * src/classes/xdoc.C: checked empty response * src/classes/xnode.C: xdoc.select fixed context node [were always /, not self node] * src/classes/xnode.C: xnode.select returns array always now, in case 'nothing found' returns empty array * src/classes/xnode.C: xpath nodes select bug [0] instead of [i], be more tender with ctrl/c/v 2002-01-23 paf * src/: classes/xdoc.C, main/pa_globals.C: xdoc::load/set entities substituted. // 2. when dom tree with entites goes under transform text nodes // got [erroreosly] cut on first entity occurance * src/types/pa_vdouble.h: double prec. todo: get rid of twice-converting * src/types/pa_vdouble.h: %.20E now float format when %g produced 'e' in output this is for regretful twice-converting here: $a(double value) when they write double falue they convert it to string first, thus %g were losing precesion. todo: think up some way to remove double->string string->double twice-converting * src/: classes/xdoc.C, main/pa_globals.C, types/pa_vdouble.h: %.20E now default float format this is for regretful twice-converting here: $a(double value) when they write double falue they convert it to string first, thus %g were losing precesion. todo: think up some way to remove double->string string->double twice-converting * src/: classes/xdoc.C, include/pa_stylesheet_connection.h, main/pa_globals.C: xmlSubstituteEntitiesDefault(1) now global, reasons in comment inside * src/main/pa_globals.C: xslt linked dynamically. [mistekenly were statically linked] * src/: include/pa_exception.h, main/compile.tab.C, main/pa_exception.C: removed exception va_list constructor. 1. not needed anymore 2. there were a conflict[causing errors] between ctor(, va_list) ctor(, ...) compiler[both msvc and gcc] never detected an ambiguilty here, compiling ctor(, "hello") into ctor(, va_list) which, of course, caused gpf * src/main/pa_globals.C: removed debug xslt messages 2002-01-22 paf * src/: classes/xdoc.C, include/pa_stylesheet_connection.h, main/pa_globals.C: xsl stylesheet load: parsed entities, this helps compiling stylesheet properly. example: this refused to work, «» stranly worked only this way: «» docs says "set it to 1", never going into details, so I decided to try NOT to do that * src/classes/table.C: join behaived badly in case named tables structure mismatched: 0 strings sneaked into dest failing afterwards. replaced them with empty strings 2002-01-21 paf * src/main/pa_charset.C: checked empty transcoders in transcode_cstr|buf * src/classes/xdoc.C: xdoc::load error source = filespec * src/classes/xdoc.C: transform error source now stylesheet_filespec * src/: classes/xdoc.C, classes/xnode.C, include/pa_stylesheet_connection.h, main/pa_charset.C, main/pa_globals.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, targets/cgi/Makefile.am: autoconf gnome * src/: classes/xdoc.C, classes/xnode.C, include/pa_exception.h, include/pa_globals.h, include/pa_stylesheet_connection.h, main/pa_exception.C, main/pa_globals.C, targets/cgi/pa_threads.C: xslt generic error 1 * src/: include/pa_stylesheet_connection.h, main/pa_exception.C: xml generic message 1 * src/classes/table.C: ^table::load empty lines or #comments before headline * src/: include/pa_array.h, include/pa_globals.h, include/pa_request.h, include/pa_threads.h, main/pa_array.C, main/pa_exception.C, main/pa_globals.C, main/pa_request.C, targets/cgi/pa_threads.C, targets/isapi/pa_threads.C: xml generic errors 0 2002-01-16 paf * src/: classes/hash.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, include/pa_db_connection.h, include/pa_request.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, targets/cgi/pool_storage.h: auto closers to sql_connection, stylesheet_connection auto destroyers to remaining gnome objects * src/classes/xdoc.C: few comments 2002-01-15 paf * src/classes/xdoc.C: xdoc file save string ready. todo: error handling * src/classes/xdoc.C: xdoc save rewritten using xmlAllocOutputBuffer less mallocs, more reallocs. less fragmented result * src/: classes/xdoc.C, include/pa_charset.h, main/pa_charset.C: started output options parsing 2002-01-14 paf * src/classes/xdoc.C: method * src/: classes/xdoc.C, classes/xnode.C, include/pa_charset.h, include/pa_pool.h, include/pa_stylesheet_connection.h, main/main.dsp, main/pa_charset.C, main/pa_globals.C, main/pa_pool.C, main/pa_stylesheet_manager.C, types/pa_vxdoc.h: xslt transform0. TODO: use output options handle errors * src/classes/: xdoc.C, xnode.C: ^xdoc.file 2002-01-11 paf * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: partial logical && || evaluation * src/classes/xnode.C: xpath selectNodes * src/: classes/xnode.C, include/pa_charset.h: xpath selectNode 3: string/number/bool * src/classes/xnode.C: xpath selectNode 2 * src/: classes/xnode.C, include/pa_charset.h, main/pa_charset.C: xpath selectNode 1 2002-01-10 paf * src/classes/xnode.C: xpath selectNode -100 [just written] * src/: classes/xdoc.C, classes/xnode.C, include/pa_charset.h, include/pa_exception.h, include/pa_pool.h, main/pa_charset.C, main/pa_pool.C: GdomeDOMString_auto_ptr c++ wrapper [calls refcounter] 2001-12-29 paf * src/: classes/xdoc.C, include/pa_exception.h, main/pa_charset.C, main/pa_exception.C, main/pa_globals.C: xdoc ^set ^string with glib works 0 2001-12-28 paf * src/: classes/xdoc.C, include/pa_charset.h, main/pa_charset.C, main/pa_exception.C: started glib transcoders * src/main/pa_globals.C: renamed gdome to libgdome.dll * src/: classes/classes.dsp, classes/mail.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_exception.h, include/pa_globals.h, main/compile.tab.C, main/main.dsp, main/pa_charset.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_socks.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: gnome libs just compiled in. no refcounting no xpath no xslt yet 2001-12-27 paf * src/: include/pa_charset.h, include/pa_common.h, include/pa_exception.h, include/pa_globals.h, include/pa_pool.h, main/main.dsp, main/pa_charset.C, main/pa_charsets.C, main/pa_globals.C, main/pa_pool.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/types.dsp: going away from xalan&xerces, started the process. globals [initialization pool [charset update charset [transcodings vxnode vxdoc [DOM calls * src/classes/Makefile.am: going away from xalan&xerces, not needed anymore 2001-12-26 paf * src/: include/pa_charset.h, include/pa_charsets.h, main/pa_charset.C, main/pa_charsets.C, main/pa_request.C: charset key globalized [bug] 2001-12-25 paf * src/: classes/mail.C, classes/table.C, include/pa_string.h, main/pa_string.C: table set & append changed splitting languages, separators now can be clean AND as-is same to mail command line $MAIN:MAIL.progX arguments 2001-12-24 paf * src/classes/mail.C: one parted text messages - no multipart mime-type anymore. for convinient if $.attach-ments * src/: classes/hashfile.C, classes/op.C, main/pa_db_table.C, main/pa_string.C: read from cache size check updated * src/main/: pa_string.C: String::join_chain another ugly bug :( 2001-12-21 paf * src/classes/date.C: date:sql-string now returns localtime * src/main/pa_request.C: $result in @main actually not working, to hell with it for now * src/: include/pa_request.h, main/execute.C, main/pa_request.C, types/pa_vmethod_frame.h, types/pa_wcontext.h: $result in @main @postprocess @exception * src/main/execute.C: junction evaluation canceled - endless recursion detected 2001-12-19 paf * src/main/pa_charset.C: charset->charset transcoding via unicode intermediate * src/main/pa_request.C: CLASS_PATH now / = DOCUMENT_ROOT * src/classes/hashfile.C: ^hashfile.open DB_HOME now relative * src/classes/op.C: ^cache keypath now relative * src/classes/mail.C: changed weighting prior to sort * src/: classes/mail.C, include/pa_config_fixed.h: to/from 0 check were missing 2001-12-17 paf * src/main/pa_charset.C: ifndef XML were bad type * src/: include/pa_db_table.h, main/pa_db_table.C: db_table used outdated unset services_pool * src/: classes/mail.C, include/pa_charsets.h, include/pa_string.h, main/pa_charsets.C, main/untaint.C, types/pa_vrequest.C, types/pa_vresponse.C: ^mail:send[ $.charset[zzz] addded * src/main/untaint.C: allowed space in filespec * src/main/pa_charset.C: empty bufs transcode [forgot check :(] * src/classes/image.C: no govno * src/classes/image.C: govno 2001-12-16 paf * src/include/: pa_charset.h, pa_charsets.h: forgot to add * src/: main/Makefile.am, main/pa_charset.C, types/Makefile.am: charset_connection&manager replaced by charset&charsets * src/main/pa_charset.C: name_cstr 0 * src/main/untaint.C: uri lang now knows about client/source charsets * src/: classes/file.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/xdoc.C, include/pa_array.h, include/pa_cache_managers.h, include/pa_charset_connection.h, include/pa_charset_manager.h, include/pa_common.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_dictionary.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_transcoder.h, main/compile_tools.h, main/main.dsp, main/pa_charset.C, main/pa_charset_connection.C, main/pa_charset_manager.C, main/pa_charsets.C, main/pa_globals.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/pa_transcoder.C, main/untaint.C, types/pa_vfile.C, types/pa_vform.C, types/pa_vform.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.C, types/pa_vresponse.h, types/types.dsp: introducing Charset 2001-12-14 paf * src/: include/pa_request.h, include/pa_transcoder.h, main/pa_request.C, main/pa_transcoder.C, types/pa_vform.C, types/pa_vform.h: transcodeToUTF8[were FromUTF8] for forms todo: uri lang * src/main/pa_transcoder.C: transcodeToUTF8, now form&uri lang * src/targets/cgi/Makefile.am: -I../../pcre to .am * src/: include/pa_globals.h, main/pa_globals.C: removed unused defalts_name global * src/: include/pa_charset_connection.h, include/pa_pool.h, include/pa_request.h, main/main.dsp, main/pa_charset_connection.C, main/pa_charset_manager.C, main/pa_request.C, types/Makefile.am, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.h, types/types.dsp, include/pa_transcoder.h, main/pa_transcoder.C, main/Makefile.am: changed charset model. now important: $request:charset $response:charset while $response:content-type.charset become unimportant [informational] 2001-12-13 paf * src/targets/: cgi/pa_pool.C, isapi/pa_pool.C: EOL@EOF * src/classes/xdoc.C: rewritten auto_ptr part other way2, because of stupid gcc 2.96 /usr/include/g++-3/memory:40: candidates are: auto_ptr<_Tp> &auto_ptr<_Tp>::operator= (auto_ptr<_Tp> &) [with _Tp = FormatterListener] /usr/include/g++-3/memory:48: auto_ptr<_Tp> &auto_ptr<_Tp>::operator= (auto_ptr<_Tp1> &) [with _Tp1 = FormatterListener, _Tp = FormatterListener] * src/: classes/xdoc.C, main/pa_sql_driver_manager.C: rewritten auto_ptr part other way, because of stupid gcc 2.96 /usr/include/g++-3/memory:40: candidates are: auto_ptr<_Tp> &auto_ptr<_Tp>::operator= (auto_ptr<_Tp> &) [with _Tp = FormatterListener] /usr/include/g++-3/memory:48: auto_ptr<_Tp> &auto_ptr<_Tp>::operator= (auto_ptr<_Tp1> &) [with _Tp1 = FormatterListener, _Tp = FormatterListener] * src/classes/xdoc.C: removed extra inc * src/targets/cgi/: pa_pool.C, parser3.C: msvc heap debugging flag * src/include/pa_types.h: msvc head debugging flag * src/classes/xdoc.C: freed up listener * src/classes/string.C: change msg '... code is not code' * src/: main/pa_db_connection.C, main/pa_db_manager.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, targets/cgi/pool_storage.h: couple cache expiratiors were wrong [past/future prob] * src/: include/pa_cache_managers.h, include/pa_charset_manager.h, include/pa_config_fixed.h, include/pa_db_manager.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, main/pa_cache_managers.C, main/pa_globals.C: ~Cache_managers * src/: include/pa_config_fixed.h, main/pa_common.C, main/pa_string.C: removed signed mismatch warnings * src/targets/: cgi/parser3.C, isapi/parser3isapi.C: removed 'expires' from header outputs * src/main/pa_string.C: string::recustruct erroreusly used outdated row ptr * src/classes/file.C: file::cgi bug, request_method were passed to SERVER_PROTOCOL but SERVER_PROTOCOL were forgotten * src/classes/xdoc.C: lang list updated 2001-12-10 paf * src/classes/math.C: ^math:random(n) now yields[0;n) not [0;n] * src/main/untaint.C: FILE_SPEC untainting changed so that one can erase files like that, knowing their full name introducing // theoretical problem with, for instance, "_2B" and "." fragments, // they would yield the same // because need_file_encode('_')=false // but we need to delete such files somehow, getting names from ^index * src/main/pa_string.C: ^string.replace bug fixed [bad string::join_chank break] 2001-12-07 paf * src/: classes/hashfile.C, classes/op.C, classes/table.C, include/pa_common.h, include/pa_config_auto.h.in, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_db_table.h, include/pa_request.h, main/pa_common.C, main/pa_db_table.C, main/pa_request.C, main/pa_string.C, types/pa_vhashfile.C: merged from r14_simple_cache * src/main/pa_string.C: stupid sparc architecture failed to access short at odd address 0x311f0 : lduh [ %i2 + 1 ], %l0 bus error, fixed that * src/main/pa_string.C: strange string deserialize bug on client[pmts], a bit shortened, * src/include/pa_config_auto.h.in: makes * src/: include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, main/pa_common.C: exclusive lock file write shared lock file read * src/: classes/op.C, include/pa_common.h, include/pa_config_fixed.h, main/pa_common.C: ^cache operator 2001-12-06 paf * src/: classes/op.C, classes/table.C, include/pa_request.h, main/pa_request.C: #ifdef RESOURCES_DEBUG * src/: main/compile.tab.C, targets/cgi/parser3.C: removed debug info * src/classes/hashfile.C: removed transaction from ^cache 2001-12-05 paf * src/targets/cgi/: parser3.C: fatal error reporting fixed. in IIS5 there were a prob with illegal call check 2001-12-04 paf * src/: classes/op.C, classes/table.C, include/pa_request.h, main/pa_request.C: measures to log 2001-11-23 paf * src/: classes/hashfile.C, classes/table.C, include/pa_db_table.h, main/pa_common.C, main/pa_db_table.C, main/pa_string.C, types/pa_vhashfile.C: merged from _0014, 1 * src/: classes/hashfile.C, classes/table.C, include/pa_db_table.h, main/pa_common.C, main/pa_db_table.C, types/pa_vhashfile.C: hashfile bugfix2 more wrong sizes. ^cache behaviour changed: if ^cache(33) would change 0660 bits in file_write & hashfile create * src/main/: pa_db_table.C, pa_string.C: cache bugfix [wrong types after pa_string optimization] 2001-11-22 paf * src/: classes/table.C, include/pa_table.h, main/pa_table.C: table.offset[whence] * src/classes/op.C: process cstr(,connection) * src/classes/op.C: process now gets its body on current language, not as-is * src/main/untaint.C: ORIGINS mode removed UHTML * src/main/untaint.C: ORIGINS mode was bad - forgot about optimize bit * src/classes/xdoc.C: cached xslt [removed nocache forcing] 2001-11-21 paf * src/: classes/xdoc.C, types/pa_vxdoc.C, types/pa_vxdoc.h: buffer_size checked all that * src/classes/op.C: ^untaint{body} as-is default now * src/: main/execute.C, types/pa_vclass.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h: merged with no_bad_constructors_try * src/: main/execute.C, types/pa_vclass.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h: fixed this: $bred[^string::length[]] $bred[^response::clear[]] $bred[^int::int[]] now VObject creation moved into overriden VClass::create_new_value, thus 0 from create_new_value means that class has no ctors 2001-11-13 paf * src/classes/classes.C: returned accedently removed if in foreach callbacks [when hash no-0-restructure] 2001-11-12 paf * src/main/pa_pool.C: changed xdoc createXXX politics, now string passed as-is to method, xalan makes & into & itself * src/classes/date.C: date.roll parser2 alg used * src/: classes/classes.C, classes/hash.C, classes/xdoc.C, include/pa_hash.h, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_dictionary.C, main/pa_hash.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C: hash now does not containt 0 values. put 0 actullay removes. no check on 0 value in foreach now required 2001-11-11 paf * src/sql/pa_sql_driver.h: removed extra constructor, doc * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: CRLF * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: sql driver initialize not const 2001-11-10 paf * src/main/pa_exec.C: doc 2001-11-09 paf * src/classes/: string.C, xdoc.C: xdoc::set{code} now untaints param properly * src/classes/string.C: string.save now does untainting before saving * src/main/pa_common.C: line endings fixing fixed last piece[was still cstr oriented] * src/: include/pa_common.h, main/pa_common.C, types/pa_vform.C: line endings fixing got rid of cstr, now must work ok with post multipart * src/types/pa_vform.C: line endings fixed at post / multipart / not file also now 2001-11-08 paf * src/: include/pa_cache_managers.h, include/pa_charset_manager.h, include/pa_db_manager.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, main/pa_charset_manager.C, main/pa_db_manager.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C: restructured Cache manager to be simple parent, not second parent [gcc 2.96 strangly refused to call virtual from second parent] * src/: include/pa_common.h, main/Makefile.am, targets/cgi/pa_pool.C: makes * src/: include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: apache 'status' class enabler ParserStatusAllowed * src/: include/pa_cache_managers.h, include/pa_charset_manager.h, include/pa_db_manager.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, main/main.dsp, main/pa_cache_managers.C, main/pa_charset_manager.C, main/pa_db_manager.C, main/pa_globals.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, types/pa_vstatus.h: cache_managers, maybe-expiring every request todo: apache 'status' class enabler 2001-11-05 paf * src/main/: pa_db_connection.C, pa_db_manager.C: expiration from debug to normal * src/main/: pa_db_connection.C, pa_db_manager.C, pa_request.C: hence i removed skipping 0 values in hash::for_each-es we need to check cleaned cache items manually. few more checks. expiring to 0 time was wrong, changed to 'now' time * src/targets/cgi/parser3.C: read can return 0, that means sort of sig_pipe on freebsd [moko's experiments]. checked that in cgi, on apache already done :) * src/main/: pa_db_connection.C, pa_db_manager.C: hence i removed skipping 0 values in hash::for_each-es we need to check cleaned cache items manually * src/main/: pa_db_connection.C, pa_db_table.C: parser_multithreaded check was wrong * src/: classes/classes.C, classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_array.h, include/pa_charset_connection.h, include/pa_charset_manager.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_hash.h, include/pa_opcode.h, include/pa_pool.h, include/pa_pragma_pack_begin.h, include/pa_pragma_pack_end.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/compile.C, main/compile.tab.C, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_charset_connection.C, main/pa_charset_manager.C, main/pa_common.C, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_db_table.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_status_provider.C, main/pa_string.C, main/pa_stylesheet_manager.C, main/pa_table.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/pool_storage.h, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstatus.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: $status:db fixed used not initialized in db_connection & db_table * src/: include/pa_charset_connection.h, main/pa_charset_manager.C: $status:charset * src/: classes/xdoc.C, include/pa_db_connection.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, main/pa_stylesheet_manager.C, types/pa_vstatus.h: $status:stylesheet * src/: include/pa_charset_manager.h, include/pa_db_manager.h, include/pa_request.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, main/main.dsp, main/pa_charset_manager.C, main/pa_common.C, main/pa_db_manager.C, main/pa_globals.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_status_provider.C, main/pa_stylesheet_manager.C, types/pa_vstatus.h, types/pa_vxnode.C, types/types.dsp: started status parser class 2001-11-01 paf * src/include/pa_config_auto.h.in: makes * src/main/pa_hash.C: removed old extra include * src/: classes/math.C, include/pa_common.h: HAVE_TRUNC HAVE_ROUND checks [for hp, there are such in math.h] * src/classes/op.C: ^for endless loop check strightened * src/: classes/hash.C, classes/op.C, main/execute.C: changed root behavior in native calls. it left unchanged, so ^for ^foreach & co can use r.root to write their i & key,value there * src/classes/op.C: detected for var storage bug, fixed. todo:foreach * src/: classes/hash.C, classes/xdoc.C, classes/xnode.C, include/pa_hash.h, main/pa_hash.C, main/pa_request.C, types/pa_vhash.h, types/pa_vxnode.C: hash locking disabled changing of hash inside of foreach * src/: classes/hash.C, classes/hashfile.C, types/pa_vhashfile.C: ^hashfile.foreach[key|value]{body}[[separator]|{separator}] prev were hash.foreach * src/: classes/hash.C, classes/op.C, types/pa_vmethod_frame.h, types/pa_vstring.C, types/pa_vstring.h: ^foreach[key|value]{body}[[separator]|{separator}] * src/: classes/hash.C, include/pa_hash.h, main/pa_hash.C, types/pa_vcookie.C: ^hash.delete[key] 2001-10-31 paf * src/main/: compile.C, pa_common.C: completely empty file now considered "read", not ignored [not perfect trick used] * src/main/pa_common.C: simplier common ifdefs * src/main/pa_common.C: typing bug in common - bad ifdeff * src/main/pa_db_connection.C: z * src/main/: pa_db_connection.C, pa_sql_driver_manager.C: // lockdetector flags dbenv.lk_detect=DB_LOCK_RANDOM; * src/main/pa_sql_driver_manager.C: hiding passwords and addresses from accidental show [imagine user forgot @exception] * src/classes/table.C: ^table.save[[nameless|+append;]path] * src/: classes/file.C, classes/image.C, classes/mail.C, classes/string.C, classes/xnode.C, include/pa_common.h, main/pa_common.C: ^string.save[[append;]path] * src/: include/pa_opcode.h, main/compile.tab.C, main/compile.y, main/execute.C: \ in expression: int divide 10/3=3 * src/types/pa_vhashfile.h: hashfile ^delete to do something only inside of ^cache * src/: include/pa_threads.h, main/pa_db_connection.C, main/pa_db_table.C, targets/cgi/pa_threads.C, targets/isapi/pa_threads.C: libdb DB_THREAD flag only when really needed 2001-10-30 paf * src/: classes/classes.dsp, main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: enabled debug incremental compile * src/: include/pa_common.h, main/pa_common.C, types/pa_vform.C: form post data line endings not reformatted now. * src/types/: pa_vform.C, pa_vform.h: AppendFormEntry length param now required [had bug when file= has no value] * src/main/: pa_db_connection.C, pa_db_manager.C, pa_db_table.C, pa_exec.C, pa_request.C, pa_sql_driver_manager.C, pa_string.C: cstr(asis) default param removed * src/classes/xdoc.C: rolled back {} in xdoc.createTextNode for now * src/classes/xdoc.C: rolled back {} in xdoc.createElement for now * src/include/pa_dir.h: LOAD_DIR fixed * src/types/pa_vform.C: VForm::AppendFormEntry {length convention was broken} fix_line_breaks * src/include/: pa_config_fixed.h, pa_pragma_pack_begin.h, pa_pragma_pack_end.h, pa_string.h, pa_types.h: String & Origin packed with #pragma pack * src/include/pa_config_auto.h.in: pragma detection 2001-10-29 paf * src/types/pa_wcontext.h: bitfield syntax stricter * src/: classes/file.C, types/pa_vimage.C: image&file couple stack string hash.puts * src/include/pa_sql_connection.h: SQL_CONNECTION_FUNC_GUARDED name * src/include/pa_sql_connection.h: there were one wrong SQL_CONNECTION_FUNC_GUARDED [failed] * src/targets/isapi/pa_pool.C: added isapi&apache real_malloc debug param.someday either ifdef or remove it * src/targets/cgi/: pa_pool.C, parser3.C: removed debug defines * src/main/untaint.C: optimizing returned after debugging * src/: include/pa_string.h, include/pa_types.h, main/pa_string.C, main/untaint.C: memory hunging #pragma pack(1) 16 419 844 13 169 394 * src/: include/pa_string.h, main/pa_string.C, main/untaint.C, targets/cgi/pa_pool.C: String size_t replace to uint in proper places [todo:Array] * src/: main/execute.C, targets/cgi/pa_pool.C, targets/cgi/parser3.dsp, types/pa_wcontext.h, types/pa_wwrapper.h: debugging memory WContext flags to bits total 5 652 652/158731 total 5 469 332/158731 * src/: include/pa_array.h, main/pa_array.C: debugging memory Array:: without cache in get/put now [Mon Oct 29 18:23:02 2001] total 5 796 092/158731 [Mon Oct 29 18:25:27 2001] total 5 652 652/158731 * src/: include/pa_string.h, main/pa_string.C, targets/cgi/pa_pool.C: debugging memory String::fused_rows func now [Mon Oct 29 17:55:45 2001] total 5917436/158731 [Mon Oct 29 18:11:53 2001] total 5796092/158731 * src/: classes/file.C, include/pa_hash.h, include/pa_string.h, main/pa_globals.C, targets/cgi/pa_pool.C: debugging memory hash key ref now [Mon Oct 29 16:01:17 2001] total 17050496/202647 [Mon Oct 29 17:11:17 2001] total 16867948/202658 * src/: classes/file.C, classes/image.C, classes/string.C, classes/xdoc.C, include/pa_pool.h, include/pa_string.h, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_hash.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/untaint.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C, types/pa_vcookie.C, types/pa_vstring.h: debuggging memory. string::as_int/double now usually uses stack, not heap [200K out of 17M :)] VString(String&) not copies reference [29M -> 17M] * src/main/pa_sql_driver_manager.C: ping to have services [old hiding bug] * src/Makefile.am: .am order * src/: include/pa_array.h, include/pa_charset_manager.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_hash.h, include/pa_request.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_manager.h, include/pa_threads.h, types/pa_valiased.h, types/pa_vhashfile.h, types/pa_vstateless_class.h, types/pa_wcontext.h: gcc 3.0.1 required "friend class" ../include/pa_request.h:51: friend declaration requires class-key, i.e. `friend class Temp_lang' * src/: include/pa_exception.h, include/pa_sql_connection.h, main/pa_exception.C, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: sql driver impl changed in _throw part. the idea is to #1 jump to C++ some function to main body, where every function stack frame has exception unwind information and from there... #2 propagate_exception() 2001-10-28 paf * src/main/pa_db_connection.C: removed old consts * src/main/pa_db_connection.C: expire table [was accidently pasted with wrong type/cast] * src/main/: pa_db_connection.C, pa_db_table.C: exception translation * src/: classes/Makefile.am, targets/cgi/Makefile.am: db makes. remember to build DB2 with -fexceptions!!! * src/main/pa_db_table.C: DB_RMW defed * src/: include/pa_config_auto.h.in, include/pa_config_fixed.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, main/pa_db_connection.C, main/pa_db_table.C: db2 on linux with DB 2.4.14: (6/2/98) 2001-10-27 paf * src/: classes/hashfile.C, include/pa_db_connection.h, include/pa_db_table.h, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_db_table.C, main/pa_globals.C, types/pa_vhashfile.C: DB2 ifdefs * src/: classes/Makefile.am, include/pa_config_fixed.h, main/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: makes with DB2 * src/: include/pa_config_auto.h.in, main/Makefile.am, types/Makefile.am: makes db * src/: main/pa_globals.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp: vc projects libdb ifdefed into globals.C * src/: classes/hashfile.C, include/pa_db_connection.h, include/pa_db_table.h, main/pa_db_connection.C, main/pa_db_table.C: ^hashfile.clear[] * src/classes/classes.awk: no $ in var names * src/main/: pa_db_connection.C, pa_db_manager.C: db expiration connection&table [forgotten calls] 2001-10-26 paf * src/main/pa_db_connection.C: db checkpoints * src/: include/pa_db_connection.h, main/pa_db_connection.C: db checkpoints * src/classes/xdoc.C: xdoc createTextNode createElement UL_XML default. but entities still reparsed. todo: tothink * src/main/pa_db_connection.C: db recover mech 2 * src/: classes/hashfile.C, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_db_table.h, include/pa_hash.h, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_db_table.C, main/pa_hash.C, types/pa_vhashfile.C, types/pa_vhashfile.h: db connections & tables now cached at create time & multithreaded * src/: classes/xdoc.C, types/pa_vxdoc.h: transform2 for parsed_source * src/main/pa_db_connection.C: about to remove connection from vhashfile * src/: main/pa_db_table.C, classes/hashfile.C: db: child transaction commit/rollback responsibility left to parent [as it sould - else there were a bug with double free] * src/include/pa_db_table.h: db: child transaction commit/rollback responsibility left to parent [as it sould - else there were a bug with double free] 2001-10-25 paf * src/: classes/hashfile.C, include/pa_common.h, include/pa_db_connection.h, include/pa_db_manager.h, main/main.dsp, main/pa_db_connection.C, main/pa_db_manager.C, types/pa_vhashfile.C, types/pa_vhashfile.h, include/pa_db_table.h, main/pa_db_table.C: started db_home [multiple, cached] todo: autorecover [tried, but not succeded, yet] * src/include/pa_dir.h: ancient gpf on dir not found fixed * src/: include/pa_db_connection.h, main/pa_db_manager.C: transaction parent passed 2001-10-24 parser * src/classes/Makefile.am: makes * src/targets/: cgi/pool_storage.h, isapi/parser3isapi.C, isapi/pool_storage.h: pool_storage fixed * src/: include/pa_common.h, main/pa_common.C, types/pa_vform.C, types/pa_vform.h: form fix_line_breaks * src/targets/cgi/pool_storage.h: makes * src/: classes/Makefile.am, targets/cgi/Makefile.am, targets/cgi/pool_storage.h: makes * src/sql/pa_sql_driver.h: version * src/: include/pa_common.h, main/Makefile.am, main/pa_common.C, types/pa_vform.C, types/pa_vform.h: .am * src/main/: pa_db_connection.C, pa_db_manager.C: hashfile setted this: DB_RMW Acquire write locks instead of read locks when doing the retrieval. Setting this flag may decrease the likelihood of deadlock during a read-modify-write cycle by immediately acquiring the write lock during the read part of the cycle so that another thread of control acquiring a read lock for the same item, in its own read-modify-write cycle, will not result in deadlock * src/targets/isapi/parser3isapi.dsp: doc * src/: classes/hashfile.C, types/pa_vhashfile.h: hashfile 1 * src/: classes/hashfile.C, include/pa_request.h: hashfile.cache 0 * src/: classes/hashfile.C, include/pa_db_connection.h, main/pa_db_connection.C: hashfile expired deleted from db when get & iterate * src/: main/pa_db_connection.C, types/pa_vhashfile.C: hashfile expiring 1 * src/types/: pa_vhashfile.C, pa_vhashfile.h: hashfile expiring 0 * src/: main/pa_db_connection.C, types/pa_vhashfile.C: db_connection not bothers with key when not returning expired data * src/: include/pa_db_connection.h, main/pa_db_connection.C, types/pa_vhashfile.C: db_cursor constructor public now * src/: include/pa_db_connection.h, main/pa_db_connection.C, types/pa_vhashfile.C, types/pa_vhashfile.h: hashfile data stamped, todo: put_element analize * src/: include/pa_db_connection.h, include/pa_string.h, main/pa_db_connection.C, main/pa_string.C: hashfile pieced serialize. todo stamp 2001-10-23 parser * src/: classes/file.C, classes/hash.C, classes/hashfile.C, classes/image.C, classes/mail.C, classes/response.C, classes/string.C, classes/table.C, classes/xdoc.C, include/pa_config_fixed.h, include/pa_db_connection.h, main/pa_common.C, main/pa_db_connection.C, main/pa_request.C, types/pa_value.h, types/pa_vcookie.C, types/pa_vhash.h, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vresponse.h, types/pa_vtable.C: ^hashfile.hash[] * src/: classes/hashfile.C, classes/xdoc.C, include/pa_config_fixed.h, main/pa_db_manager.C, main/pa_globals.C: ifdefs so it compiled without db * src/: classes/hashfile.C, include/pa_db_connection.h, include/pa_db_manager.h, main/pa_db_connection.C, main/pa_db_manager.C, types/pa_vhashfile.h: ^hashfile.transaction{code} ^hashfile:clear[filename] ^hashfile.delete[key] 2001-10-22 parser * src/targets/: cgi/pa_pool.C, cgi/parser3.C, cgi/parser3.dsp, cgi/pool_storage.h, isapi/pool_storage.h: cgi += pool cleanups * src/: classes/classes.dsp, classes/hashfile.C, classes/xdoc.C, classes/xnode.C, include/pa_charset_connection.h, include/pa_db_connection.h, include/pa_db_manager.h, include/pa_exception.h, include/pa_sapi.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stylesheet_connection.h, include/pa_stylesheet_manager.h, include/pa_xslt_stylesheet_manager.h, main/main.dsp, main/pa_db_connection.C, main/pa_db_manager.C, main/pa_exception.C, main/pa_globals.C, main/pa_pool.C, main/pa_sql_driver_manager.C, main/pa_stylesheet_manager.C, main/pa_xslt_stylesheet_manager.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vhashfile.C, types/pa_vhashfile.h, types/pa_vxdoc.C, types/pa_vxnode.C, types/types.dsp: hashfile 0 * src/types/pa_vhashfile.C: z * src/: classes/classes.dsp, classes/hashfile.C, include/pa_config_fixed.h, main/execute.C, targets/cgi/parser3.dsp, types/pa_vhashfile.C, types/pa_vhashfile.h, types/types.dsp: hashfile -100 * src/targets/isapi/parser3isapi.C: SEH minor ifdef changes * src/: include/pa_exception.h, include/pa_request.h, main/execute.C, main/pa_exception.C, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vclass.h, types/pa_vobject.h: stack backtrace 2001-10-19 parser * src/include/pa_pool.h: header * src/main/pa_pool.C: auto compiled on gcc * src/classes/image.C: comment * src/: include/pa_pool.h, main/pa_common.C: makes * src/: classes/xdoc.C, classes/xnode.C, classes/xnode.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: xnode clone got freed * src/: classes/xdoc.C, classes/xnode.C, include/pa_pool.h, include/pa_types.h, main/pa_pool.C: first c++ exceptions result: can free up xalandomstring resulting from pool::transcode * src/: classes/Makefile.am, classes/xdoc.C, classes/xnode.C, include/pa_config_fixed.h, include/pa_exception.h, include/pa_stylesheet_connection.h, main/pa_charset_connection.C, main/pa_exception.C, main/pa_pool.C, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: switched to c++ exceptions 1xml configure fixed to exclude xalan-patch from non-xml compile * src/main/pa_request.C: pool:: context - get_context * src/: classes/classes.h, classes/date.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, include/pa_config_fixed.h, include/pa_exception.h, include/pa_pool.h, include/pa_request.h, include/pa_types.h, main/compile.C, main/compile_tools.C, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_dictionary.C, main/pa_exception.C, main/pa_exec.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_table.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vhash.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmethod_frame.h, types/pa_vstateless_class.h, types/pa_vtable.C, types/pa_wcontext.C, types/pa_wwrapper.h: switched to c++ exceptions 0 * src/classes/classes.awk: $ removed 2001-10-18 parser * src/types/pa_vcookie.C: cookie:CLASS * src/main/main.dsp: project * src/: classes/xdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C: vxdoc set_document & ctor question "who owns document" solved * src/: classes/xdoc.C, main/pa_pool.C: extra free removed * src/: classes/xdoc.C, classes/xnode.C, include/pa_pool.h, main/pa_pool.C: encoding in dom creating funcs * src/: classes/xdoc.C, types/pa_vxdoc.h: dom created by create can be transformed now * src/classes/xdoc.C: dom created by create can be transformed now * src/classes/xdoc.C: z * src/classes/xdoc.C: comment * src/: classes/xdoc.C, classes/xnode.C, main/compile.tab.C: xdoc create now uses XercesDocumentBridge, appendChild&co now works * src/include/pa_stylesheet_connection.h: prev stylesheet destroyed @ recompile * src/main/: compile.tab.C, compile.y, pa_request.C: ^: no colon in $origin @exception[ * src/classes/: xdoc.C, xnode.C: xdoc::create[] now. and all dom tag names forced to XML lang * src/: classes/classes.dsp, classes/xdoc.C, types/types.dsp: fiew leechy-found bugs in code&doc fixed 2001-10-17 parser * src/: classes/classes.dsp, classes/string.C, main/pa_string.C, types/pa_vxnode.h, types/types.dsp: string::mid fixed, string.mid n functionality preserved * src/types/pa_vimage.h: removed unused vimage::save 2001-10-16 parser * src/: classes/string.C, main/pa_string.C: $string.mid(p[;n]) * src/classes/: xnode.C: removed few dom returns & changed op.txt * src/types/: pa_vhash.h, pa_vtable.h: hash can be used as boolean * src/classes/image.C: image.copy tolerance * src/classes/image.C: ::CopyResampled made gd2beta+my hands, very ineffective, but works for small paleted image * src/types/pa_vimage.C: comment * src/classes/image.C: gd size/resize bugfix * src/: classes/classes.dsp, main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: ident >nul 2>&1 * src/main/pa_common.C: \r\n -> \n DOS \r -> \n Macintosh on all systems * src/: classes/image.C, types/pa_vimage.h: ^image.copy[source](src x;src y;src w;src h;dst x;dst y[;dest w[;dest h]]) 2001-10-15 parser * src/main/execute.C: z * src/classes/: xdoc.C: !::create{qualifiedName} * src/types/pa_vxnode.C: document_type_node. !readonly attribute DOMString name !notation_node. !readonly attribute DOMString publicId !readonly attribute DOMString systemId * src/types/: pa_vcode_frame.h, pa_wcontext.C: code_frame fixed - ::write badly passed string too transparently [failed to intercept it] * src/: classes/xdoc.C, classes/xnode.C, include/pa_config_fixed.h, include/pa_request.h, main/pa_sql_driver_manager.C, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h: DOM1 major addtion, only few attributes/methods left 2001-10-13 parser * src/: main/pa_sql_driver_manager.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: isapi&cgi couple non-pooled mallocs in main handler * src/targets/isapi/pool_storage.h: isapi pool storage reverse cleanups & frees order * src/types/pa_vcode_frame.h: couple comments * src/: main/execute.C, types/pa_vcode_frame.h: vcodeframe made transparent enough to handle hash if creation&passing * src/: include/pa_config_fixed.h, main/execute.C, main/pa_exception.C: noticed that vcodeframe not transparent enough, would change now 2001-10-12 parser * src/targets/isapi/parser3isapi.C: xalan&xerces multithread bug fixed. initialization&free on each thread! * src/classes/: double.C, int.C, string.C: sql{}[$.default[({})]] handling changed: now type of default param analized always, not only at problem time, thus helping early problem spotting * src/: classes/classes.dsp, classes/xdoc.C, main/compile.tab.C, main/main.dsp, main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, types/types.dsp: xalan&xerces multithread bug fixed. initialization&free on each thread! 2001-10-11 parser * src/classes/xnode.C: xnode.selectSingle now * src/: classes/xdoc.C, classes/xnode.C, include/pa_exception.h, include/pa_pool.h, include/pa_stylesheet_connection.h, main/pa_exception.C, main/pa_pool.C: moved xslt exceptions convertors out of Pool into Exception * src/main/pa_string.C: const * src/: include/pa_string.h, main/pa_string.C: restructured string: linked pieces of same language together prior to String::replace * src/classes/hash.C: !^hash.add[addme] !^hash.sub[subme] !^a.union[b] = new !^a.intersection[b] = new !^a.intersects[b] = bool * src/classes/hash.C: !^hash::append[append_from] * src/: classes/hash.C, types/pa_vhash.h: !^hash::create[[copy_from]] * src/: classes/string.C, classes/table.C, include/pa_globals.h, include/pa_string.h, main/pa_globals.C, main/pa_string.C, main/untaint.C, types/pa_vvoid.h: untaint lang origins table fixed. got rid of empty_string, which caused errors - it hasnt exception but somebody[value.bark] tried to throw it on it's pool * src/include/pa_config_auto.h.in: makes 2001-10-10 parser * src/: classes/op.C, main/compile.tab.C: ^error[msg] * src/main/: compile.tab.C, compile.y: ^a[ @next_method << now unclosed ] would be reported here * src/main/: compile.tab.C, compile.y: ^a[^b] more informative compile error 2001-10-09 parser * src/: classes/Makefile.am, main/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: makes * src/classes/Makefile.am: makes * src/targets/: cgi/parser3.C, isapi/parser3isapi.C: xml transform win32 errors intercepted [xalan transformer patched and incorporated] * src/: classes/classes.dsp, classes/xdoc.C, include/pa_stylesheet_connection.h, main/main.dsp, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vxdoc.h, types/pa_vxnode.h, types/types.dsp: xalan patches starting * src/classes/: string.C, table.C: ^string.save[file] * src/classes/: date.C, table.C: calendar moved to date * src/classes/: op.C, table.C: table.hash[key field;value field(s) string/table] now * src/classes/: op.C, table.C: z * src/: classes/op.C, classes/table.C, types/pa_vfile.h, types/pa_vimage.h, types/pa_vjunction.h, types/pa_vxdoc.h, types/pa_vxnode.h: table:menu & op for delims made allowed not to be code [be string..] * src/classes/: double.C, file.C, image.C, int.C, op.C, string.C, table.C: lots of params->as_int/double/as_string/as_junction/as_no_junction messages added 2001-10-08 parser * src/: classes/date.C, classes/image.C, classes/string.C, classes/table.C, classes/void.C, include/pa_request.h: params->as_int/double message added * src/classes/image.C: image:circle [and round arc] uses Bresenham * src/: classes/image.C, types/pa_vcookie.C, types/pa_vimage.C: image:sector removed image:html internal "line-*" attribs * src/: classes/image.C, include/pa_common.h, main/pa_common.C, types/pa_vcookie.C: cookie urlencoded [netscape doc reread] * src/types/pa_vcookie.C: removing cookie made more netscape-like way * src/: classes/file.C, classes/form.C, main/pa_common.C, main/untaint.C: header untainting to UL_HTTP_HEADER, UL_MAIL_HEADER made nonforced [only tainted pieces] * src/: include/pa_common.h, main/pa_common.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: remove_crlf @ SAPI::log * src/main/untaint.C: \r to ' ' in origins mode * src/classes/xdoc.C: xdoc:load exceptions intercepted [like in set] * src/: classes/xdoc.C, include/pa_config_fixed.h, main/compile.tab.C, types/pa_vxdoc.h: parsedSource produced by nonstandard liaison freed up 2001-10-07 parser * src/: include/pa_config_fixed.h, main/compile.tab.C: restored project 2001-10-05 parser * src/: classes/xdoc.C, include/pa_pool.h, main/main.dsp, main/pa_pool.C: changed xdoc:set to prevent SAXParseException from outputing to cerr. lots of "todos" * src/main/untaint.C: http_header tainting more gentle with enquoting now * src/: classes/xdoc.C, include/pa_dictionary.h, main/main.dsp, main/pa_dictionary.C, main/pa_string.C, types/pa_vxdoc.h: started xml errorhandler. fixed string.replace a little, read @test * src/main/pa_string.C: found replace bug - first_that_starts(char *) does not have limit, and looks further eos, fixing.... * src/doc/: doxygen.cfg, html2chm.cmd, sources2html.cmd: paths * src/: classes/xdoc.C, main/compile.tab.C: xdoc.transform now * src/main/: pa_charset_connection.C: ctype another mem clear bugfix * src/main/: compile.tab.C, compile.y: disabled ^literals in names $result[^[$p^]z] now works fine * src/: include/pa_hash.h, main/pa_hash.C: Hash::size() calculated wrong. fixed it * src/main/pa_charset_connection.C: unicode zero pair at the beging of totable appered to be vital 2001-10-04 parser * src/classes/image.C: ^image.length[text] 2001-10-03 parser * src/main/pa_request.C: DEFAULT...charset was ignored when !XML * src/main/pa_request.C: restored pcre defaulting in request [mindlessly "optimized" yesterday] comment left 2001-10-02 parser * src/: main/pa_charset_manager.C, include/pa_stylesheet_connection.h: forgot non-xml pool.*charset needed * src/: include/pa_pool.h, main/pa_pool.C, types/pa_vresponse.h: forgot non-xml pool.*charset needed * src/classes/table.C: # config comments fixed * src/: classes/table.C, main/pa_charset_connection.C: table:load & charset_connection #comment now * src/: classes/classes.dsp, types/types.dsp: release projects options fixed to use release msvcrt lib * src/main/pa_charset_connection.C: pcre tables now const inside removed default - pcre handles that internally fixed bug on not-cleaning tables [previously was calloced, now member] * src/: include/pa_request.h, main/pa_charset_connection.C, main/pa_request.C, types/pa_vstring.h: pcre tables now const inside removed default - pcre handles that internally fixed bug on not-cleaning tables [previously was calloced, now member] * src/: include/pa_config_fixed.h, main/pa_charset_connection.C: tested charset reload on file change @ apache version = OK tested freeing up prev encoding on adding new = OK 2001-10-01 parser * src/main/pa_charset_connection.C: removed entitify external hack [internal installed] * src/main/Makefile.am: makes+removed dtd * src/: include/pa_charset_connection.h, include/pa_charset_manager.h, include/pa_xslt_stylesheet_manager.h, main/main.dsp, main/pa_charset_connection.C, main/pa_charset_manager.C, main/pa_request.C: charset loading & caching mech 0 * src/: include/pa_stylesheet_connection.h, include/pa_xslt_stylesheet_manager.h, main/main.dsp, main/pa_globals.C, main/pa_request.C: would make charset loading & caching mech now 2001-09-30 parser * src/main/pa_request.C: forgot to fill toTable * src/: include/pa_config_fixed.h, main/pa_request.C: started hack_s_maximumCharacterValues to XALAN_HACK_DIGITAL_ENTITIES but failed on win32 for now.. * src/: include/pa_globals.h, main/pa_globals.C, main/pa_request.C: now charsets table configuration variable is: CHARSETS * src/: classes/xdoc.C, include/pa_request.h, main/pa_request.C: ctype with unicode 1. todo: no П entities on output somehow * src/: classes/file.C, classes/op.C, classes/string.C, include/pa_request.h, main/pa_request.C: started ctype with unicode values 2001-09-28 parser * src/: main/pa_request.C, classes/mail.C, classes/op.C, classes/xdoc.C, include/pa_stylesheet_connection.h: letter body string passed AS-IS now * src/classes/: xdoc.C, xnode.C: xdoc addencoding works! invented a way of user-configuring... todo: implement 2001-09-27 parser * src/classes/table.C: table.sort changed to sort table itself * src/: classes/xdoc.C, targets/isapi/parser3isapi.dsp: X^.getElementsByTagName[tagname] = array of xnode X^.getElementsByTagNameNS[namespaceURI;localName] = array of nodes removed - regretfully not supported @ xalan. maybe someday would reimplement, if needed. win32build system: solved long waiting anti-non-started-apache problem * src/: classes/classes.dsp, classes/xdoc.C, main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp, types/types.dsp: win32 ident make system so not to rebuild library [ident.C.new] 2001-09-26 parser * src/: classes/classes.dsp, classes/xdoc.C, classes/xnode.C, classes/xnode.h, include/pa_config_fixed.h, main/main.dsp, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vxnode.C, types/types.dsp: z * src/classes/classes.C: forgot one non-xml check * src/: Makefile.am, classes/Makefile.am, main/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: makes with clases.awk * src/targets/cgi/parser3.C: z * src/: include/pa_config_fixed.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: #ifdef SMTP * src/: classes/classes.dsp, classes/dnode.C, classes/dnode.h, classes/dom.C, classes/xdoc.C, classes/xnode.C, classes/xnode.h, main/compile.tab.C, types/pa_vdnode.C, types/pa_vdnode.h, types/pa_vdom.C, types/pa_vdom.h, types/pa_vxdoc.C, types/pa_vxdoc.h, types/pa_vxnode.C, types/pa_vxnode.h, types/types.dsp: xdoc&xnode now * src/: classes/classes.C, classes/classes.awk, classes/classes.dsp, classes/classes.h, classes/date.C, classes/dnode.C, classes/dnode.h, classes/dom.C, classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/math.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, include/pa_array.h, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_dictionary.h, include/pa_dir.h, include/pa_exception.h, include/pa_exec.h, include/pa_globals.h, include/pa_request.h, include/pa_sapi.h, include/pa_socks.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, include/pa_stack.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_xslt_stylesheet_manager.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/main.dsp, main/pa_array.C, main/pa_common.C, main/pa_dictionary.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_table.C, main/pa_xslt_stylesheet_manager.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, targets/isapi/pool_storage.h, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vdnode.C, types/pa_vdnode.h, types/pa_vdom.C, types/pa_vdom.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmath.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.C, types/pa_vtable.h, types/pa_vvoid.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h, types/types.dsp: added ident.awk and main.dsp splitted to main+classes+types along to .am * src/classes/Makefile.am: removed useless var * src/: classes/classes.cmd, main/main.dsp, targets/cgi/parser3.dsp: moved classes.inc generation on win32 to main.dsp 2001-09-25 parser * src/include/pa_config_auto.h.in: xml on linux[elik] works! no 1251 though, todo ICU * src/: Makefile.am, classes/Makefile.am, classes/dom.C, include/pa_stylesheet_connection.h, main/Makefile.am, main/pa_pool.C, targets/cgi/Makefile.am, types/Makefile.am, types/pa_vdom.h: xml configure makes 2001-09-24 parser * src/: classes/Makefile.am, include/pa_config_auto.h.in, types/Makefile.am: makes * src/targets/cgi/Makefile.am: makefiles * src/: Makefile.am, targets/Makefile.am, targets/cgi/pa_pool.C: started unix makes update * src/: Makefile.am, main/Makefile.am, targets/cgi/Makefile.am: started unix makes update * src/types/: pa_vdnode.C, pa_vvoid.h, pa_vtable.C: z * src/types/pa_value.h: z * src/types/: pa_vhash.h, pa_vtable.h, pa_vclass.h: fixed small bugs with usinge hash/table in expressions * src/types/: pa_vfile.h, pa_vimage.h, pa_vstring.h: fiew wrong resolved conflicts fixed [const] * src/: classes/classes.cmd, classes/image.C, classes/op.C, classes/table.C, include/pa_request.h, include/pa_sapi.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/main.dsp, main/pa_common.C, main/pa_sql_driver_manager.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_value.h, types/pa_vbool.h, types/pa_vdate.h, types/pa_vdouble.h, types/pa_vform.C, types/pa_vhash.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vvoid.h: merged3 with before_xml [merge2 actually didn't happen - i've created tags on wrong branch. so this merge is in fact re-merge] 2001-09-21 parser * src/: main/main.dsp, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp: updated project files [/ sadly produced "" in make file and sadly wrong interpreted on load] * src/: classes/classes.h, classes/hash.C, classes/op.C, classes/table.C, doc/doxygen.cfg, include/pa_common.h, include/pa_globals.h, include/pa_request.h, include/pa_sapi.h, include/pa_sql_driver_manager.h, include/pa_string.h, main/compile.tab.C, main/main.dsp, main/pa_common.C, main/pa_exec.C, main/pa_globals.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.dsp: merged with before_xml * src/: classes/classes.C, classes/date.C, classes/dnode.C, classes/dom.C, classes/file.C, classes/form.C, classes/int.C, classes/mail.C, doc/doxygen.cfg, include/pa_config_fixed.h, include/pa_pool.h, main/main.dsp, main/pa_globals.C, main/pa_pool.C, main/pa_request.C, main/pa_xslt_stylesheet_manager.C, targets/cgi/pa_pool.C, targets/cgi/pa_threads.C, targets/cgi/parser3.dsp, targets/isapi/pa_pool.C, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.dsp, types/pa_valiased.C, types/pa_vcookie.C, types/pa_vdnode.C, types/pa_vdom.C, types/pa_vfile.C, types/pa_vform.C, types/pa_vimage.C, types/pa_vrequest.C, types/pa_vresponse.h, types/pa_vstateless_class.C, types/pa_vstring.C, types/pa_vtable.C, types/pa_wcontext.C: zillions of #ifdef XML created new projects for sql drivers [planning to remove sql drivers from main cvs project] first, will join latest changes * src/classes/: dom.C: defaulted dom writing methods encoding to pool.get_charset * src/classes/dom.C: defaulted dom writing methods encoding to pool.get_charset * src/include/pa_pool.h: defaulted dom writing methods encoding to pool.get_charset * src/: classes/dom.C, include/pa_pool.h, main/pa_pool.C, types/pa_vdnode.C, types/pa_vresponse.h: defaulted dom writing methods encoding to pool.get_charset * src/: include/pa_pool.h, main/pa_pool.C: checked whether transcoder were created right "unsupported encoding" message. not @ set time, but @ use time, so until xml output functions .string, .file, .save used - no encoding name check occur reduced transcode buffer size to 60 fixed pool cleanup - no registration needed, pools are officially destructured 2001-09-20 parser * src/classes/image.C: 20K preload on jpg measure [image::measure] * src/main/: pa_pool.C, pa_request.C: Pool::transcode defaults from $MAIN:DEFAULTS.content-type[$.charset[here]] * src/: classes/dnode.C, classes/dom.C, include/pa_config_includes.h, include/pa_globals.h, include/pa_pool.h, main/main.dsp, main/pa_globals.C, main/pa_pool.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, types/pa_vdnode.C, types/pa_vdnode.h, types/pa_vresponse.h: Pool::transcode 0 * src/classes/dom.C: dom. string save file moved output xml options to last param and made it optional * src/types/pa_vdnode.C: !$elementnode.attributes = hash of dnodes !$attributenode.specified = boolean true if the attribute received its value explicitly in the XML document, or if a value was assigned programatically with the setValue function. false if the attribute value came from the default value declared in the document's DTD. !$pinode.target = target of this processing instruction XML defines this as being the first token following the markup that begins the processing instruction. XPath: !^node.select[xpath/query/expression] = hash of 0->node0 1->node1 !^node.select-single[xpath/query/expression] = first node if any * src/types/: pa_value.h, pa_vbool.h, pa_vdate.h, pa_vdouble.h, pa_vhash.h, pa_vint.h, pa_vstring.h, pa_vtable.h, pa_vvoid.h: some 'const's added * src/types/: pa_vhash.h, pa_vtable.h: table/hash can be used in expression context now, there value = size and boolean value size!=0 * src/types/: pa_vhash.h, pa_vstring.h, pa_vtable.h: table/hash can be used in expression context now, there value = size and boolean value size!=0 * src/: classes/dnode.C, classes/dom.C, targets/cgi/parser3.dsp, types/pa_vstring.h: dnode .file .string .save moved back to dom due to strange xalan bug 2001-09-18 parser * src/: classes/dnode.C, classes/dom.C, classes/hash.C, classes/image.C, classes/op.C, classes/table.C, include/pa_common.h, include/pa_globals.h, include/pa_request.h, include/pa_sql_driver_manager.h, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_common.C, main/pa_request.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_table.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vtable.h: merged latest bugfixes from before_xml branch ^if(def $hash) now true only when ^hash:_count[]!=0 moved .string .save .file from dom to dnode * src/: classes/op.C, main/execute.C: operators self changed to root ^for variable context changed to self * src/types/: pa_vdnode.C, pa_vdom.h, pa_vhash.h, pa_vtable.h: dom, dnode 1 * src/: classes/dnode.C, classes/dnode.h, main/main.dsp, types/pa_vdnode.C, types/pa_vdnode.h: dom, dnode 0 * src/: classes/image.C, main/pa_string.C, main/pa_table.C: image: poly* fixed 2001-09-17 parser * src/: classes/dom.C, main/main.dsp, main/pa_globals.C, types/pa_vdom.h: started dnode+dom dnode DOM methods: $node.name $node.value ...others... ^node.xpath[/rates/USD] = hash $hash[ $.0[node0] $.1[node1] ] * src/: classes/image.C, types/pa_vimage.C: $image.line-style now applies to all linear primitives * src/: classes/classes.h, classes/dom.C, classes/hash.C, include/pa_stylesheet_connection.h, main/main.dsp, targets/cgi/pa_pool.C, types/pa_vdom.h, types/pa_vfile.h, types/pa_vimage.h: started dnode DOM: $node.name $node.value ...others... ^node.xpath[/rates/USD] = hash dom(dnode) * src/: classes/hash.C, main/compile.C, main/compile.tab.C, main/compile.y, main/compile_tools.h, main/execute.C, targets/cgi/parser3.C: expressions unary+ ^hash.count[] bugfix: in expression compound($aa.zz.xx) names now can have minus '-' in name after '.' 2001-09-15 parser * src/: classes/image.C, types/pa_vimage.C, types/pa_vimage.h: image: $line-width ^line(...)[**** style] * src/: classes/dom.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h, types/pa_vdom.h: fixed bug in isapi pool_storage - cleanups first, allocations second. apache wisely does just like that * src/targets/isapi/: parser3isapi.C, pool_storage.h: pool_storage rewritten using template, no bugs now * src/: include/pa_pool.h, main/pa_pool.C, targets/cgi/pa_pool.C, targets/isapi/pa_pool.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, targets/isapi/pool_storage.h: poorly started isapi pool_storage, would rewrite using template now * src/: classes/dom.C, classes/image.C, include/pa_pool.h, include/pa_stylesheet_connection.h, main/main.dsp, targets/cgi/pa_pool.C, targets/isapi/pa_pool.C, targets/isapi/pool_storage.h, types/pa_vdom.C, types/pa_vdom.h: xalan objects freed up [introducing Pool::register_cleanup] * src/: doc/doxygen.cfg, include/pa_sapi.h, types/pa_vdom.h: comments 2001-09-14 parser * src/main/: pa_sql_driver_manager.C, pa_xslt_stylesheet_manager.C: z * src/: classes/dom.C, classes/file.C, classes/image.C, classes/mail.C, include/pa_common.h, include/pa_sql_driver_manager.h, include/pa_string.h, include/pa_stylesheet_connection.h, include/pa_xslt_stylesheet_manager.h, main/main.dsp, main/pa_common.C, main/pa_exec.C, main/pa_globals.C, main/pa_sql_driver_manager.C, main/pa_xslt_stylesheet_manager.C, main/untaint.C, types/pa_vfile.C: dom.xslt stylesheet compiled&cached 2001-09-13 parser * src/: classes/dom.C, classes/file.C, classes/image.C, types/pa_vfile.C, types/pa_vfile.h: ^dom.file[] charset * src/classes/dom.C: dom:file content-type(.method) * src/: include/pa_common.h, include/pa_globals.h, main/pa_common.C, main/pa_request.C: $MAIN:CLASS_PATH now can be string now more informative error messages * src/: include/pa_globals.h, include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: ParserRootConfig .../parser3.conf ParserSiteConfig .../parser3.conf cgi&isapi looks for {configure|c:\windows}/parser3.conf 2001-09-12 parser * src/: classes/op.C, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C: ^connect[] ^connect[aaa] more precise error reporting: "connection string must start with protocol://" now * src/main/compile.tab.C: fixed - subname code parts actually [] braced * src/main/: compile.y, compile_tools.h: name.[part].xxx syntax lexer on LS_USER level did [] matching without setting nestage, introduced special LS_NAME_SQUARE_PART state 2001-09-11 parser * src/: classes/dom.C, include/pa_string.h, main/pa_globals.C, main/untaint.C: ^dom:set{xml} default language XML languages+=xml * src/: classes/dom.C, types/pa_vdom.h: ^dom:set[xml] * src/classes/dom.C: ^dom:save/string/file[output options] output options: $.method[xml|html|text] detection fixed * src/types/pa_vdom.h: messages * src/classes/dom.C: ^dom:save/string/file[output options] output options: $.method[xml|html|text] detection fixed 2001-09-10 parser * src/classes/dom.C: ^dom:save/string/file[output options] output options: $.method[xml|html|text] $.encoding[windows-1251|...] * src/classes/dom.C: ^dom.xslt[stylesheet filename][params hash added] * src/: classes/dom.C, main/main.dsp, types/pa_vdom.h: ^dom.xslt[stylesheet filename] 0 * src/: classes/dom.C, main/main.dsp, types/pa_vdom.h: ^dom.xslt[stylesheet filename] -1 doc is lying * src/classes/dom.C: ^dom.file[encoding] = file * src/classes/: dom.C: ^dom.string[encoding] 1 ^dom.save[encoding;filename] * src/classes/dom.C: ^dom.string[] 0 * src/classes/dom.C: ^dom.save[b.xml] 1:error handling * src/: classes/dom.C, main/main.dsp, types/pa_vform.C, types/pa_vform.h: ^dom.save[b.xml] 0 2001-09-08 parser * src/types/pa_vform.C: $form:tables.name.field 2001-09-07 parser * src/classes/table.C: table:empty removed, superceded by ^if(def $table)... * src/targets/cgi/parser3.C: z * src/main/pa_string.C: $a[] ^if($a){y;n} is 'n' now [conversion from '' to int/double is 0] * src/: classes/dom.C, types/pa_value.h, types/pa_vtable.h: (def $table) is false when table is empty * src/: main/pa_request.C, types/pa_vform.C, types/pa_vform.h: !$form:tables $atable[$form:tables.a] ^atable.menu{a=$atable.element}[,] * src/: targets/cgi/parser3.dsp, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h: !$form:fields * src/: classes/dom.C, classes/table.C, main/main.dsp, types/pa_vdom.h, types/pa_vform.C: merged with successful start of dom * src/: include/pa_hash.h, main/pa_hash.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h: z * src/: main/pa_exception.C, types/pa_vform.C: getting FIRST form element [not last] * src/: classes/dom.C, classes/table.C, main/main.dsp, types/pa_vdom.h: introducing dom. dom:load[a.xml] 2001-09-06 parser * src/types/pa_vform.C: ?a=1&a=2 would result in $form:a being a table with one column 'element' and two rows: 1 and 2 * src/types/pa_vform.C: ?a=1&a=2 would result in $form:a being a table with one column 'element' and two rows: 1 and 2 * src/: classes/void.C, main/pa_string.C, main/pa_table.C: fixed up bad int/double conversions, and now $form:nonexistent.int(88) would return 88 * src/: classes/hash.C, include/pa_globals.h, main/pa_globals.C, types/pa_vhash.h: now there's special hash key '_default' [instead of ^_default method] $hash[ $.a[1] $.b[2] $._default[xx] ] $hash.c * src/main/: compile.tab.C, compile.y: ^if(0){}{ ^if(1){}^; } bug fixed [thanks, fif], ^; were treated there non-literally * src/doc/doxygen.cfg: merged new default options from 1.2.10 doxygen * src/: classes/image.C, classes/op.C, classes/string.C, classes/table.C, doc/doxygen.cfg, targets/isapi/parser3isapi.C, types/pa_vtable.C: few #ifndef DOXYGEN 2001-09-05 parser * src/classes/: string.C, table.C: sql options can be void [same as image:html the other day] * src/targets/cgi/Makefile.am: .am undo * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h, targets/cgi/parser3.C: #define STRINGIZE(name) #name does not macro expantion on param, simply qoutes whatever passed, undone * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h, targets/cgi/Makefile.am, targets/cgi/parser3.C: #define STRINGIZE(name) #name invented * src/: classes/op.C, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C: #define MAIN_SQL_NAME "SQL" #define MAIN_SQL_DRIVERS_NAME "drivers" moved to be availible to all users * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: SQL_DRIVER_CREATE_FUNC_NAME * src/classes/mail.C: MAIN:MAIL check fixed 2001-09-04 parser * src/classes/image.C: image.html now can accept void params * src/targets/isapi/parser3isapi.C: z * src/targets/cgi/parser3.C: full_file_spec bug * src/targets/cgi/parser3.C: getenvcheck * src/targets/cgi/parser3.C: zz * src/targets/cgi/parser3.C: zzz * src/classes/date.C: date * src/classes/date.C: date:sql-string is now without '' * src/: include/pa_config_auto.h.in, targets/cgi/Makefile.am, targets/cgi/parser3.C: configure --sysconfdir=sysadmin-controlled auto.p location for targets/cgi/parser3, default[/usr/local/etc] * src/include/pa_config_auto.h.in: makes 2001-09-03 parser * src/targets/cgi/parser3.C: /configure cgi SYSCONFDIR 2001-09-01 parser * src/classes/image.C: letter_spacing * src/classes/image.C: image: font params changed * src/classes/image.C: image: as_int as_string used * src/types/pa_vmethod_frame.h: $result[] now gets properly analized 2001-08-31 parser * src/targets/cgi/parser3.C: z * src/: include/pa_dir.h, targets/cgi/parser3.C: compiled under cygwin * src/classes/void.C: void:int/double += (default) * src/classes/image.C: image:font added space param image:font changed charwidth alg, added kerning const[for now] * src/classes/: string.C, table.C: string:int/double (defaults) 2001-08-29 parser * src/main/pa_exception.C: exception redundant debug info 2001-08-28 parser * src/classes/image.C: image error msgs * src/classes/image.C: image: gifsize little endian * src/doc/doxygen.cfg: doxygen conf removed some garbage from under doxygeneration * src/: classes/Makefile.am, main/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: .am-s * src/: include/pa_dictionary.h, main/pa_dictionary.C, main/pa_sql_driver_manager.C: NO_STRING_ORIGIN check3 * src/main/compile.C: NO_STRING_ORIGIN check2 * src/classes/table.C: NO_STRING_ORIGIN check * src/include/pa_dictionary.h: gcc: ../include/pa_dictionary.h:19: storage class specifiers invalid in friend function declarations * src/: classes/op.C, main/compile.tab.C, main/pa_dir.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: strncpy forced with zero ending in case of limit * src/: classes/file.C, main/pa_common.C: file:move autocreate/remove dest/src dir * src/: classes/string.C, include/pa_dictionary.h, include/pa_string.h, main/pa_dictionary.C, main/pa_string.C, main/untaint.C: pa_directory speeded up. moved zero 'from' check to directory constructor. string:replace 2001-08-27 parser * src/classes/image.C: fixed jpgsize alg * src/classes/image.C: fixed jpgsize alg * src/main/pa_exception.C: z * src/main/pa_common.C: removed debug info from pa_common * src/: main/pa_request.C, targets/cgi/parser3.C: parser3 test.html [auto.p from current dir loading] * src/: main/pa_common.C, main/pa_exception.C, main/pa_sql_driver_manager.C, targets/cgi/Makefile.am: configure for solaris -lsocket 2001-08-24 parser * src/targets/cgi/parser3.C: not cgi extra \n 3 * src/targets/cgi/parser3.C: not cgi extra \n 2 * src/targets/cgi/parser3.C: not cgi extra \n * src/main/pa_sql_driver_manager.C: z * src/: include/pa_sql_connection.h, main/pa_sql_driver_manager.C: sql* removed services from disconnect - cross-request ideological probs. * src/sql/pa_sql_driver.h: sql* removed services from disconnect - cross-request ideological probs. oracle - fixed bug: cs allocated on request.pool and got freed before disconnect * src/classes/: file.C, form.C, mail.C, table.C: fiew non-pool mallocs fixed 2001-08-23 parser * src/classes/file.C: minor bug in file:save fixed * src/main/pa_sql_driver_manager.C: oracle: dlink 2001-08-22 parser * src/: classes/file.C, main/compile.tab.C, types/pa_vfile.C, types/pa_vfile.h: file:load|save[text|binary; * src/main/: compile.tab.C, compile.y: ^method[]^[^] literals [] 2001-08-21 parser * src/classes/: file.C, table.C: ^file:list 2001-08-20 parser * src/: main/compile.tab.C, main/compile.y, main/pa_sql_driver_manager.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vint.h: $var(123) ^var.inc[] recousively caused problems: inc incremeted 123 literal!! fixed 2001-08-10 parser * src/main/: compile.tab.C, compile.y: [codes] name part syntax now * src/main/: compile.tab.C, compile.y: (codes) name part syntax added * src/main/: compile.tab.C, compile.y: (codes) name part syntax added * src/classes/table.C: table:sort restored [it was bad test :(] * src/types/: pa_value.h, pa_vstring.h: string now def only when ne '' * src/main/: pa_request.C: wanted to make const int MAX_EXECUTE_SECONDS=1; but couldnt, set_callback_and_alarm appeared to be not exported :( * src/main/pa_string.C: string.match hanged on. there were a hang check but it weren't wise enough @parse[dateString][tmp] $tmp[^dateString.match[(\d\d\d\d-)?(\d\d-)?][g]] $tmp.1 $tmp.2 #end @main[] ^parse[2001-02-03] * src/classes/: table.C: table:sort now default desc * src/: classes/table.C, include/pa_table.h, main/pa_table.C: table.sort now creates new sorted table 2001-08-09 parser * src/main/pa_string.C: $a[010] now ^if($a==10){true} were octal * src/classes/hash.C: hash:_default now [was hash:default] * src/classes/op.C: case without switch check added * src/types/pa_vcookie.C: cookie name&value origins added, more precise $ORIGINS(1) * src/main/Makefile.am: .am * src/classes/void.C: void: int double copy/paste from int: bug fixed * src/classes/void.C: void: int double copy/paste from int: bug fixed 2001-08-07 parser * src/: classes/double.C, classes/int.C, classes/string.C, classes/table.C, include/pa_globals.h, main/pa_globals.C: !^int/double:sql{query}[[$.limit(2) $.offset(4) $.default(0)]] string, table * src/: classes/math.C, main/pa_request.C: math:random fixed. win32 srand made working 2001-08-06 parser * src/: classes/mail.C, classes/op.C, include/pa_array.h, include/pa_globals.h, include/pa_hash.h, include/pa_request.h, main/compile.tab.C, main/compile.y, main/pa_array.C, main/pa_dictionary.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_request.C, main/pa_string.C: class_path * src/main/pa_exec.C: exec win32 real filename * src/classes/file.C: exec stderr out * src/classes/hash.C: hash:keys renamed to hash:_keys :( 2001-08-03 parser * src/: classes/table.C, types/pa_vtable.h: vtable.locks killed 2001-08-02 parser * src/: classes/string.C, classes/table.C, include/pa_array.h, main/execute.C, main/pa_exec.C: introducing Array_iter * src/main/execute.C: detected quick_get recursion bug. changed to get@execute, but needs array iterator, separate from array to avoid it & use caching * src/main/: pa_dictionary.C, pa_globals.C: memset dictionary minor bug fixed * src/: classes/classes.h, classes/op.C, include/pa_globals.h, main/execute.C, main/pa_globals.C: found another multithread bug in op.C (last, last global var killed) :) 2001-08-01 parser * src/: include/pa_dictionary.h, include/pa_globals.h, include/pa_string.h, main/main.dsp, main/pa_dictionary.C, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/untaint.C: speeded up typo-html replacements. introducing Dictionary with first-char caching 2001-07-31 parser * src/types/Makefile.am: pa_vtable.C added to .am * src/main/compile.tab.C: added, so that could be compiled even on non-bison-enabled platforms 2001-07-28 parser * src/classes/table.C: table:hash always produces hash, when can't - empty * src/main/: compile.y, untaint.C: bug fix @ untaint when \r skipped \n 2001-07-27 parser * src/classes/: double.C, int.C, string.C: provided meaningful msg on int/double/string :sql without result and default 2001-07-26 parser * src/classes/op.C: fixed bad multithread bug with strangly global OP * src/main/compile.y: $man[$.age[zzz]] 0 * src/: include/pa_opcode.h, main/compile.y, main/execute.C: hash creation syntax problem persists. restored $: for a while. thinking of $man[$.age[zzz]] syntax now * src/: classes/double.C, classes/int.C, classes/string.C, include/pa_opcode.h, main/compile.C, main/compile.y, main/compile_tools.h, main/execute.C, types/pa_vcode_frame.h, types/pa_vmethod_frame.h, types/pa_wcontext.h, types/pa_wwrapper.h: fixing :: realization #1 * src/: include/pa_opcode.h, main/compile.C, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_request.C, types/pa_vmethod_frame.h: introducing :: this is constructor call prefix. ordinary : remains for static accesses 2001-07-25 parser * src/types/pa_vtable.C: table: get_element order changeed. now: 1. fields 2. methods 3. columns * src/types/: pa_vdouble.h, pa_vint.h: odbc: no result queries; quote. optimized double&int tostring-s * src/main/: compile.C, compile.y, compile_tools.h: allowed whitespace before first method decl * src/classes/table.C: allowed nontable result in table:sql, results in empty table * src/main/: compile.C, compile.y, compile_tools.h: allowed empty lines before first method decl * src/: classes/table.C, main/main.dsp, types/pa_vtable.C, types/pa_vtable.h: ^table.record[] now $table.fields * src/main/compile.y: $var[] is now empty string, not void * src/main/: compile.y, execute.C: $var[] is now empty string, not void * src/: classes/string.C, include/pa_globals.h, main/execute.C, main/pa_globals.C: match replace code context moved to implicit $match context * src/: include/pa_opcode.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: with killed, code storage introduced with former 'with' syntax 2001-07-24 parser * src/: main/compile.C, main/execute.C, main/pa_string.C, types/pa_value.h: first get_element, next get operator * src/main/compile.y: removed @end handling * src/main/: compile.C, compile.y: @end handling method2 * src/: classes/file.C, include/pa_common.h, main/pa_common.C: file:move * src/main/pa_common.C: file_read close @ eof when imgsize bug fixed 2001-07-23 parser * src/: main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: sql odbc driver * src/classes/hash.C: changed sql driver query interface * src/: classes/hash.C, classes/string.C, classes/table.C, classes/void.C, include/pa_sql_connection.h, sql/pa_sql_driver.h: changed sql driver query interface 2001-07-20 parser * src/types/pa_vrequest.C: X!$browser:type * src/: classes/file.C, classes/string.C, include/pa_string.h, main/execute.C, main/pa_string.C, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vclass.h, types/pa_vcookie.h, types/pa_vdate.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vhash.h, types/pa_vmath.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h: only ^class:method dynamic calls allowed. ^BASE.method call disabled. BASE element globally removed 2001-07-18 parser * src/classes/file.C: file:exec/cgi msg * src/classes/file.C: $file:exit-code renamed to 'status' * src/: classes/file.C, main/pa_exec.C: file:exec * src/: Makefile.am, classes/Makefile.am, main/Makefile.am, targets/Makefile.am, targets/cgi/Makefile.am, types/Makefile.am: removed $id from *.in *.am * src/main/: pa_request.C, untaint.C: ORIGINS langs name abbrevations * src/: classes/date.C, classes/mail.C, classes/math.C, classes/string.C, classes/table.C, include/pa_globals.h, include/pa_string.h, main/execute.C, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/untaint.C, types/pa_value.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vstring.C, types/pa_vstring.h: $ORIGINS(1) output tracing mode 2001-07-13 parser * src/: classes/double.C, classes/int.C, classes/string.C, include/pa_request.h, main/execute.C, main/pa_request.C: auto.p[@auto], /news/auto.p[no @auto], so that initializing second would not call first @auto * src/main/: execute.C, pa_request.C: order of MAIN parents was wrong, fixed 2001-07-12 parser * src/types/pa_value.h: pa_value.putelement modification of system classes prevented 2001-07-11 parser * src/: classes/string.C, doc/sources2html.cmd: lr split now yelds table $piece * src/: classes/file.C, include/pa_common.h, main/pa_common.C, types/pa_vstateless_class.h: $file created by file:state += .atime .mtime .ctime +found&fixed bug with exceptions on get_junction-created objects [they were on wrong pool] 2001-07-09 parser * src/main/untaint.C: qp wrong name * src/: classes/date.C, classes/string.C, classes/table.C, main/compile.y: date format 0 2001-07-07 parser * src/: classes/date.C, classes/table.C, include/pa_common.h, include/pa_string.h, main/pa_common.C, types/pa_vdate.h: date roll table calendar * src/: classes/Makefile.am, classes/date.C, classes/file.C, classes/hash.C, classes/image.C, classes/mail.C, classes/math.C, classes/op.C, classes/string.C, classes/table.C, classes/void.C, include/pa_request.h, main/main.dsp, types/pa_value.h, types/pa_vdate.h, types/pa_wcontext.C: date now set $fields roll string. todo: sql, calendar 2001-07-06 parser * src/: classes/math.C, include/pa_request.h, main/execute.C, main/main.dsp, main/pa_request.C, types/pa_vmath.h: math 0 2001-07-03 parser * src/: classes/Makefile.am, classes/math.C, classes/op.C, classes/random.C, main/main.dsp: class random renamed to math, operators became methods * src/classes/op.C: pow sqrt * src/: classes/op.C, main/execute.C: sin asin cos acos tan atan 2001-07-02 parser * src/classes/table.C: ^table.columns column renamed from 'name' to 'column' * src/classes/hash.C: ^hash.keys[] * src/: classes/table.C, main/pa_table.C: ^table:columns[] * src/main/: compile.y, compile_tools.h: in expressions now allowed 'strings' 2001-06-29 parser * src/main/: execute.C: /0 %0 checkes ver 2 * src/main/execute.C: /0 %0 checke * src/classes/Makefile.am: nothing - void * src/classes/table.C: empty strings @ sql 2001-06-28 parser * src/: classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, main/compile.C, main/compile_tools.C, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_table.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, main/compile.y: */ static const char *RCSId="$Id: double.C,v 1.31 2001/06/28 07:41:59 parser Exp $"; * src/: classes/double.C, classes/file.C, classes/form.C, classes/hash.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/void.C, main/compile.C, main/compile.y, main/compile_tools.C, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_dir.C, main/pa_exception.C, main/pa_exec.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_socks.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/pa_table.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: static char *RCSId="Id"; * src/main/: compile.y, compile_tools.h: $:name: == ${name}: $class:name: == ${class:name}: * src/classes/string.C: exactly one 2001-06-27 parser * src/: classes/nothing.C, classes/void.C, types/pa_vnothing.h, types/pa_vvoid.h: nothing renamed to void * src/classes/op.C: ^switch ^case * src/main/compile.y: nothing renamed to void * src/: classes/hash.C, classes/table.C, main/compile.y, main/execute.C, main/main.dsp, main/pa_request.C, targets/cgi/pa_pool.C, types/pa_value.h, types/pa_vcode_frame.h, types/pa_vmethod_frame.h, types/pa_vtable.h: nothing renamed to void * src/main/compile.y: lexer: $zzzz^zzzz were name part 2001-05-28 parser * src/doc/html2chm.cmd: removed >a * src/: main/main.dsp, targets/isapi/parser3isapi.dsp: release project options [some bugs] * src/doc/sources2html.cmd: z * src/: classes/classes.C, main/compile.C, main/compile.y, main/execute.C: operators are not in root class again 2001-05-24 parser * src/targets/cgi/parser3.dsp: project file * src/: classes/op.C, main/pa_request.C, targets/cgi/parser3.C: ^log ^exp * src/: main/pa_request.C, targets/cgi/parser3.C: // no _ conversions in @exception[params] * src/main/pa_request.C: // no _ conversions in @exception[params] 2001-05-23 parser * src/main/pa_string.C: string cmp bug * src/classes/: mail.C, op.C: rem max 1000 * src/: classes/op.C, main/compile.y: allow one empty line before LS_DEF_NAME 2001-05-22 parser * src/classes/op.C: if params code-required 2001-05-21 parser * src/types/pa_vstring.C: eoleof * src/classes/Makefile.am: .AM * src/classes/nothing.C: resultless ^sql moved to nothing: * src/classes/: nothing.C, op.C: 'unknown' renamed to 'nothing' * src/: classes/double.C, classes/nothing.C, classes/string.C, classes/unknown.C, main/main.dsp, types/pa_vnothing.h, types/pa_vunknown.h, classes/hash.C, main/compile.y, main/execute.C, targets/cgi/pa_pool.C, types/pa_vcode_frame.h, types/pa_vmethod_frame.h, types/pa_vtable.h, classes/table.C, main/pa_request.C, types/pa_value.h: 'unknown' renamed to 'nothing' * src/types/: pa_vstring.C, pa_vstring.h: removed unnecessary vstring::set_string * src/classes/: double.C, int.C, string.C: int,double;sql * src/: classes/hash.C, classes/int.C, classes/string.C, classes/table.C, include/pa_string.h, main/pa_string.C, types/pa_vstring.C, types/pa_vstring.h: started int:sql * src/: classes/classes.C, classes/hash.C, classes/op.C, classes/table.C, main/compile.C, main/compile.y, main/execute.C: hash:sql moved to main trunc. operators.txt updated * src/classes/: hash.C, op.C, table.C: hash:sql * src/classes/op.C: z * src/: main/compile.C, classes/classes.C: 1 * src/: classes/classes.C, main/compile.C, main/compile.y, main/execute.C: 0 * src/main/execute.C: z * src/targets/cgi/parser3.C: z * src/targets/cgi/parser3.C: argv can be just "parser3". made site_auto_path "." in that case * src/targets/cgi/: parser3.C: z * src/main/pa_request.C: .am * src/: main/pa_request.C, targets/cgi/parser3.C: pcre_tables=pcre_default_tables; 2001-05-19 parser * src/main/pa_string.C: z * src/: include/pa_string.h, main/untaint.C, targets/cgi/pa_pool.C: introducing String::cstr_bufsize, returns just size+1 for as_is target. * src/: main/untaint.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C: fixed bug in pre html untaint, wrong size used, 4* mem wasted * src/classes/string.C: root context in match replace body now unchanged * src/types/pa_value.h: parameter # 1 based * src/main/pa_common.C: common: actual filename '%s' * src/classes/string.C: z * src/classes/Makefile.am: classes/.am * src/classes/: Makefile.am: classes/.am * src/: classes/Makefile.am, main/pa_sql_driver_manager.C, targets/cgi/pa_pool.C: classes/.am 2001-05-18 parser * src/: include/pa_config_auto.h.in, targets/cgi/pa_pool.C: .am pa_threads.C ins * src/targets/cgi/Makefile.am: .am pa_threads.C added 2001-05-17 parser * src/: classes/string.C, include/pa_config_fixed.h, include/pa_config_includes.h, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_dir.C, main/pa_hash.C, main/pa_pool.C, main/untaint.C, types/pa_vcookie.C, types/pa_vfile.C, types/pa_vform.C: #include "pa_config_includes.h" removed from most .C * src/doc/html2chm.cmd: z * src/doc/: chm.cmd, doxygen.cmd, html2chm.cmd, sources2html.cmd, view.cmd, view_chm.cmd, view_html.cmd: doc cmds * src/main/pa_sql_driver_manager.C: moved expiration to get_connection_from_cache * src/main/pa_sql_driver_manager.C: cache expiration bf * src/: classes/classes.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C: cache expiration[use SQL_Driver::disconnect] * src/main/pa_table.C: table.locate current restored on "not found" * src/: main/execute.C, types/pa_vmethod_frame.h: endless recursion line no * src/: include/pa_request.h, main/execute.C, main/pa_request.C: ANTI_ENDLESS_EXECUTE_RECOURSION * src/: classes/op.C, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: fixed problem at last: 2connections own 1driver and set_services fight for driver::fservices. before fix * src/: classes/op.C, include/pa_config_fixed.h, include/pa_sql_connection.h, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C: found problem at last: 2connections own 1driver and set_services fight for driver::fservices. before fix * src/: include/pa_config_fixed.h, include/pa_threads.h, targets/cgi/pa_threads.C, targets/cgi/parser3.dsp, targets/isapi/pa_threads.C, targets/isapi/parser3isapi.dsp: added pa_threads.C * src/include/pa_threads.h: removed targets/parser * src/include/: pa_array.h, pa_common.h, pa_config_fixed.h, pa_config_includes.h, pa_exception.h, pa_exec.h, pa_globals.h, pa_hash.h, pa_opcode.h, pa_pool.h, pa_request.h, pa_sapi.h, pa_socks.h, pa_sql_connection.h, pa_stack.h, pa_string.h, pa_table.h, pa_threads.h: #include "pa_config_includes.h" in all headers * src/: classes/image.C, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C, main/pa_string.C: wrong includes order prevented sqlmanager to see MULTYTHREAD define * src/: include/pa_config_fixed.h, include/pa_threads.h, main/pa_sql_driver_manager.C: SYNCHRONIZED moved closer to caches put/gets * src/: include/pa_hash.h, main/execute.C: removed /*SYNCHRONIZED*/ from hash.h * src/: classes/op.C, include/pa_sql_connection.h, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: connection from cache ->set_services(&services); 2001-05-16 parser * src/targets/cgi/parser3.C: z * src/: include/pa_pool.h, targets/cgi/pa_pool.C: removed pool debug, #ifdefed some. would debug later, on more precise sample than stupid: @main[] $name[$z[]] ^for[i](0;10000-2){ $tail[9994] $name.$tail[$tail!] $name.$tail } ok3 * src/: include/pa_array.h, main/pa_array.C, targets/cgi/parser3.C: removed array debug. before vstring rebasing * src/: include/pa_array.h, include/pa_string.h, main/execute.C, main/pa_array.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C: array debugged; adjusted * src/main/: pa_sql_driver_manager.C, pa_string.C: SQL_Driver_manager line no for connect/charset errors 2001-05-15 parser * src/: include/pa_array.h, include/pa_string.h, main/pa_array.C, main/pa_string.C: string+array made linear grows * src/: include/pa_string.h, main/pa_string.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C: think that all must grow lineary, not exponentialy * src/: include/pa_pool.h, include/pa_string.h, main/pa_string.C, targets/cgi/pa_pool.C, targets/cgi/parser3.C: string fixed bug with fullchunk cmps * src/targets/cgi/: pa_pool.C, parser3.C: main loss here: 5673321/ 70041= 81 * src/: include/pa_string.h, targets/cgi/pa_pool.C, targets/cgi/parser3.C: detected huge mem allocation: size/times malloc 27809390/368771, calloc 3232/83. would test now * src/: classes/random.C, main/compile.y, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vmethod_frame.h: numbered params had wrong name - for instance: bad error message in ^for[] bad body type. fixed 2001-05-14 parser * src/: classes/string.C, include/pa_string.h, main/pa_string.C, main/untaint.C: ^string.upper|lower[] 2001-05-11 parser * src/: classes/double.C, classes/image.C, classes/op.C, classes/string.C, classes/table.C, classes/unknown.C, main/execute.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vint.h, types/pa_vstring.h, types/pa_vunknown.h: op: MAX_LOOPS as_int * src/: main/main.dsp, targets/isapi/parser3isapi.dsp: fixed some .dsp for win32tools 2001-05-11 paf * src/: classes/classes.cmd, classes/gawk.exe, classes/ls.exe, main/bison.exe, targets/isapi/KILL.EXE, targets/isapi/PSTAT.EXE, targets/isapi/istart.cmd, targets/isapi/istop.cmd, targets/isapi/kill.pl: moved win32 helpers to /win32tools 2001-05-10 paf * src/include/: pa_common.h, pa_config_includes.h: inline undefed for C++, that's all * src/include/: pa_config_auto.h.in, pa_config_fixed.h, pa_config_includes.h: inline wonders * src/: classes/Makefile.am, classes/hash.C, doc/doxygen.cfg, doc/doxygen.cmd: hash.C added * src/: main/pa_request.C, types/pa_vrequest.C: op configured * src/main/compile.y: @end grammar: allowed zero strings in control menthod * src/types/: pa_value.h, pa_vclass.h, pa_vstateless_class.h, pa_vstateless_object.h: changed priority: field before method lookup in vclass & vobject * src/: doc/doxygen.cmd, main/compile.y, types/pa_vobject.h: grammar: priorities changes [lowerd && prior] vobject: now first fields, next methods 2001-05-08 paf * src/main/pa_table.C: table columnname2item on nameless ignored bark=false. fixed * src/: classes/table.C, types/pa_value.h, types/pa_vhash.h, types/pa_vmethod_frame.h: hash:default works at last! * src/: classes/mail.C, classes/table.C, doc/doxygen.cmd, main/main.dsp, types/pa_vhash.h, types/pa_vstateless_class.h: hash:default * src/classes/table.C: z * src/classes/table.C: table:hash always hash of hash now * src/classes/table.C: table:empty return bool now * src/: classes/table.C, doc/chm.cmd, include/pa_array.h, include/pa_table.h, main/pa_table.C, types/pa_value.h, types/pa_vtable.h: table:hash * src/classes/table.C: table:record have name * src/: classes/op.C, types/pa_vtable.h: allowed $table.2342734 returns vunknown * src/classes/: double.C, int.C, op.C, string.C: int,double,string:int[] double[] string:length[] results now have hames * src/: classes/op.C, classes/table.C, main/main.dsp, types/pa_vtable.h: removed table:find. table:locate and op:eval now return bool * src/: doc/chm.cmd, main/execute.C, types/pa_value.h: wrong pool in method checkparams again. fixed 2001-05-07 paf * src/doc/chm.cmd: cmd * src/: classes/image.C, classes/mail.C, classes/string.C, doc/chm.cmd, include/pa_table.h, main/pa_table.C, types/pa_value.h: method reported errors on wrong pool * src/main/execute.C: ^var[^class:var.method[]] is not constructor now * src/: doc/ClassExample2.dox, doc/aliased.dox, doc/chm.cmd, include/code.h, include/pa_opcode.h, main/compile.C, main/compile_tools.h, main/execute.C, types/pa_value.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h, types/pa_wcontext.h, types/pa_wwrapper.h: pa_code.h * src/doc/: chm.cmd, doxygen.cmd, view.cmd: dox cmd * src/: classes/string.C, classes/table.C, doc/ClassExample1.dox, doc/ClassExample2.dox, doc/ClassExample3.dox, doc/aliased.dox, doc/class.dox, doc/compiler.dox, doc/doxygen.cfg, doc/doxygen.cmd, doc/executor.dox, doc/index.dox, doc/methoded.dox, doc/module.dox, doc/object.dox, doc/pooled.dox, doc/string.dox, doc/targets.dox, doc/value.dox, include/code.h, include/pa_hash.h, include/pa_string.h, main/pa_request.C, main/pa_sql_driver_manager.C, types/pa_vjunction.h, types/pa_vtable.h: dox, split by not clean parts also * src/: include/pa_table.h, main/pa_table.C, types/pa_value.h, types/pa_vtable.h: table: fields, then methods. so to enable 'dir' fields & co. more * src/types/: pa_value.h, pa_vtable.h: table: fields, then methods. so to enable 'dir' fields & co. * src/main/compile.y: grammar: @end 2001-05-04 paf * src/: doc/ClassExample1.dox, doc/ClassExample2.dox, doc/ClassExample3.dox, main/execute.C: dox: example1 updated * src/: classes/classes.h, classes/double.C, classes/file.C, classes/form.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, doc/doxygen.cfg, doc/index.dox, main/pa_string.C: removed m- method dox 2001-05-03 paf * src/: classes/classes.h, classes/double.C, doc/aliased.dox, doc/class.dox, doc/compiler.dox, doc/doxygen.cfg, doc/doxygen.txt, doc/executor.dox, doc/index.dox, doc/methoded.dox, doc/module.dox, doc/object.dox, doc/pooled.dox, doc/string.dox, doc/targets.dox, doc/value.dox, main/pa_request.C: dox splitted .dox files and added some * src/: classes/Makefile.am, doc/doxygen.txt: classes/am 2001-05-02 paf * src/classes/: image.C, table.C: table:dir result are not tainted by file_name language now 2001-04-28 paf * src/classes/classes.inc: removed classes.inc * src/: classes/classes.inc, main/Makefile.am: removed pa_methoded from .am * src/classes/classes.awk: skipped classes in .awk * src/: classes/Makefile.am, classes/classes.C, classes/classes.h, classes/classes.inc, classes/double.C, classes/file.C, classes/form.C, classes/int.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, include/pa_methoded.h, main/main.dsp, main/pa_methoded.C, targets/cgi/parser3.C, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vimage.h, types/pa_vint.h: renamed pa_methoded back to classes/classes.h * src/: classes/Makefile.am, main/main.dsp: classes/Makefile.am * src/: classes/Makefile.am, classes/classes.awk, classes/classes.cmd, classes/classes.inc, classes/gawk.exe, classes/ls.exe, main/bison.exe: classes.inc autogenerator * src/: classes/classes.C, classes/classes.h, classes/double.C, classes/file.C, classes/form.C, classes/int.C, classes/op.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, include/pa_methoded.h, main/Makefile.am, main/main.dsp, main/pa_methoded.C, targets/cgi/parser3.C, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vimage.h, types/pa_vint.h: classes/classes renamet to include|main/pa_methoded * src/: include/pa_string.h, main/pa_globals.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: z * src/: classes/form.C, include/pa_globals.h, main/pa_globals.C: moved some configured data to request::classes_conf moved some string crations from globals to M... [works] * src/: classes/form.C, classes/mail.C, classes/op.C, include/pa_globals.h, include/pa_request.h, main/pa_globals.C, main/pa_request.C: moved some configured data to request::classes_conf moved some string crations from globals to M... * src/: classes/form.C, include/pa_request.h, main/pa_request.C: about to move configured data to special request hash * src/: classes/classes.C, classes/classes.h, classes/file.C, classes/form.C, classes/mail.C, include/pa_request.h, main/pa_request.C: configure started * src/: main/execute.C, types/pa_wcontext.h: Methoded reorganized 2. todo: methoded-configure * src/: classes/_double.h, classes/_file.h, classes/_form.h, classes/_image.h, classes/_int.h, classes/_mail.h, classes/_op.h, classes/_random.h, classes/_response.h, classes/_string.h, classes/_table.h, classes/_unknown.h, classes/classes.inc, classes/double.C, classes/exec.C, classes/file.C, classes/form.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, include/pa_globals.h, include/pa_request.h, main/compile.y, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vcookie.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vrequest.h, types/pa_vresponse.h, types/pa_vstateless_class.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h, types/pa_wcontext.h, classes/classes.C, classes/classes.h: Methoded reorganized. todo: methoded-configure * src/: classes/file.C, classes/table.C, main/compile.y, main/execute.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vtable.h, types/pa_wcontext.h: removed ^a.menu{$name} ability. now $a{^menu{$name}} or ^a.menu{$a.name} * src/: classes/_string.h, classes/classes.C, classes/classes.h, classes/double.C, classes/exec.C, classes/file.C, classes/form.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, include/pa_request.h, main/compile.y, main/execute.C, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.C, types/pa_vform.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vresponse.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h: beautifying just compiled. todo: debug, configure 2001-04-27 paf * src/: classes/file.C, classes/image.C, classes/table.C, main/execute.C, main/pa_request.C, types/pa_vstateless_class.h: beautifying -99 * src/: classes/_double.h, classes/_form.h, classes/_int.h, classes/_response.h, classes/_unknown.h, classes/classes.C, classes/classes.h, classes/double.C, classes/file.C, classes/form.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, include/pa_globals.h, main/main.dsp, main/pa_globals.C, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vform.h, types/pa_vimage.h, types/pa_vint.h, types/pa_vresponse.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h: beautifying -100 * src/main/compile.y: serge@ found @CLASS bug. fixed * src/: classes/_file.h, classes/_image.h, classes/_mail.h, classes/_op.h, classes/_random.h, classes/_table.h, classes/file.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, include/pa_globals.h, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vcookie.h, types/pa_venv.h, types/pa_vrequest.h: started beautifying 2001-04-26 paf * src/: main/pa_request.C, types/pa_vfile.h: code documentation ++ * src/: doc/doxygen.cfg, include/pa_socks.h, main/pa_socks.C: code documentation ++ * src/: classes/_exec.h, doc/doxygen.cfg, include/pa_config_fixed.h, include/pa_config_includes.h, targets/cgi/pa_pool.C: code documentation ++ * src/: classes/_image.h, classes/op.C, classes/random.C, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vcookie.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vform.C, types/pa_vform.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vrequest.C, types/pa_vrequest.h, types/pa_vstateless_class.C, types/pa_vstateless_object.h, types/pa_vstring.C, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h, types/pa_wcontext.C, types/pa_wwrapper.h: code documentation ++ * src/: classes/image.C, classes/mail.C, classes/string.C, classes/table.C, doc/doxygen.cfg, doc/doxygen.txt, include/pa_array.h, include/pa_dir.h, include/pa_string.h, main/compile_tools.h, main/pa_common.C, sql/pa_sql_driver.h, types/pa_vbool.h, types/pa_vclass.h, types/pa_vcode_frame.h, types/pa_vhash.h, types/pa_vjunction.h, types/pa_vmethod_frame.h, types/pa_vobject.h, types/pa_vstateless_class.h, types/pa_wcontext.h, types/pa_wwrapper.h: code documentation ++ * src/main/: pa_request.C, pa_string.C: z * src/: include/pa_common.h, include/pa_types.h, main/pa_sql_driver_manager.C: module [and, guess, isapi] connection caching fixed. request-pooled-url were stored into global connectioncache 2001-04-25 paf * src/: doc/doxygen.cfg, doc/doxygen.txt, targets/isapi/parser3isapi.C: started doc / [doxygen.txt] * src/: include/code.h, include/pa_common.h, main/compile.y, main/execute.C, main/pa_common.C: -d * src/: classes/file.C, main/pa_exec.C, targets/cgi/parser3.C: illegal call check a bit improved, but still under iis no mapping of dir with parser allowed! 2001-04-24 paf * src/targets/Makefile.am: apache module lib .am * src/main/pa_exec.C: windows32 buildCommand 2001-04-23 paf * src/targets/cgi/Makefile.am: win32 conditional * src/targets/cgi/Makefile.am: win32 conditional * src/targets/cgi/Makefile.am: liblink * src/: include/pa_array.h, main/pa_array.C, types/pa_vfile.h: vfile fields return type * src/types/pa_vfile.h: vfile fields return type * src/include/pa_config_auto.h.in: .h.in * src/: classes/Makefile, main/Makefile, targets/cgi/Makefile, types/Makefile: makefiles removed * src/: classes/Makefile, main/Makefile, main/pa_string.C, targets/cgi/Makefile, types/Makefile: configure.in + makefiles * src/main/pa_string.C: tested OK /// @test really @b test: s x m [tested: i & g ] * src/: classes/random.C, targets/cgi/parser3.C: redo failed /// @test noticed series in isapi, check how initialize_random_class is called! [must be called only once] * src/main/execute.C: operators first! so that ^table.menu{^rem{}} would not be 'unknown column' * src/: classes/table.C, types/pa_vform.C, types/pa_vtable.h: /// @test $a.menu{ $a[123] } and $a.menu{^table:set[]...} * src/: main/pa_request.C, targets/cgi/parser3.C: /// @test with commandline start "parser3 a.html" so that ^load[a.cfg] worked! [now doesnt] * src/targets/cgi/parser3.C: cgi cmdline ver * src/targets/cgi/parser3.C: cgi /// @test disable /cgi-bin/parser3/auto.p * src/main/untaint.C: untaint without charset * src/: include/pa_config_fixed.h, include/pa_config_includes.h, main/pa_common.C: common: file_write /// @test mkdirs file_delete rmdirs * src/main/untaint.C: mail header only once to =? * src/: classes/image.C, classes/mail.C, include/pa_globals.h, include/pa_string.h, main/pa_exec.C, main/pa_request.C, main/untaint.C: untaint - @test optimize whitespaces for all but 'html' * src/: classes/mail.C, include/pa_hash.h, include/pa_string.h, main/pa_common.C, main/pa_hash.C, main/pa_request.C, main/untaint.C: untaint - @test mail-header 2001-04-20 paf * src/: classes/string.C, classes/table.C, include/pa_globals.h, include/pa_request.h, include/pa_string.h, main/compile.y, main/pa_globals.C, main/pa_request.C, main/pa_string.C, targets/cgi/parser3.C: $MAIN:LOCALE * src/main/untaint.C: z * src/: main/untaint.C, targets/cgi/parser3.C: fixed header "a/a" 2001-04-19 paf * src/main/compile_tools.h: $a$b bugfix * src/targets/cgi/parser3.C: z * src/classes/file.C: z * src/: classes/file.C, include/pa_common.h, types/pa_vcookie.C: done: header to $fields. waits for header '\' tricks * src/: include/pa_common.h, main/pa_common.C, main/pa_request.C, main/untaint.C, targets/isapi/parser3isapi.C, types/pa_vcookie.C: changed urlencode here and in untaint.C to HTTP standard's " and \" mech * src/: main/pa_request.C, targets/isapi/parser3isapi.C: fixed http://alx/~paf/ doesnt load /auto.p 2001-04-18 paf * src/main/pa_request.C: 1 * src/: main/Makefile.am, main/main.dsp, targets/cgi/Makefile.am: linux @alx 2001-04-17 paf * src/: classes/file.C, classes/image.C, doc/doxygen.cfg, include/pa_sql_connection.h, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: SQL_Driver_services renamed. doxygen statics enabled * src/: Makefile.am, classes/Makefile.am, classes/_double.h, classes/_exec.h, classes/_file.h, classes/_form.h, classes/_image.h, classes/_int.h, classes/_mail.h, classes/_op.h, classes/_random.h, classes/_response.h, classes/_string.h, classes/_table.h, classes/_unknown.h, classes/file.C, classes/image.C, classes/mail.C, classes/op.C, classes/random.C, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_hash.h, include/pa_sql_driver_manager.h, include/pa_version.h, main/Makefile.am, main/compile.y, main/pa_common.C, main/pa_exec.C, main/pa_socks.C, main/pa_sql_driver_manager.C, sql/Makefile.am, sql/pa_sql_driver.h, targets/cgi/Makefile.am, targets/cgi/parser3.C, types/Makefile.am, types/pa_vcookie.C, types/pa_vform.C, types/pa_vimage.h: exec @jav * src/: include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h, types/pa_vimage.h: sql driver interface now has initialize(client .so) 2001-04-16 paf * src/Makefile.am: compile2 cygwin * src/: include/pa_config_includes.h, main/pa_exec.C, main/pa_socks.C, targets/cgi/Makefile.am: compile1 cygwin * src/targets/cgi/Makefile.am: compile0 jav * src/: Makefile.am, classes/Makefile.am, classes/_double.h, classes/_exec.h, classes/_file.h, classes/_form.h, classes/_image.h, classes/_int.h, classes/_mail.h, classes/_op.h, classes/_random.h, classes/_response.h, classes/_string.h, classes/_table.h, classes/_unknown.h, classes/image.C, classes/mail.C, classes/op.C, classes/random.C, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_hash.h, include/pa_version.h, main/Makefile.am, main/compile.y, main/pa_common.C, main/pa_exec.C, sql/Makefile.am, targets/cgi/Makefile.am, targets/cgi/parser3.C, types/Makefile.am, types/pa_vcookie.C, types/pa_vform.C: compile-1 2001-04-15 paf * src/classes/op.C: z * src/classes/table.C: table:empty +=process * src/types/pa_value.h: MethodParams !junction * src/: classes/_string.h, classes/double.C, classes/file.C, classes/image.C, classes/int.C, classes/mail.C, classes/op.C, classes/random.C, classes/response.C, classes/string.C, classes/table.C, classes/unknown.C, main/pa_request.C: MethodParams everywhere * src/: classes/op.C, include/pa_request.h, types/pa_value.h, types/pa_vmethod_frame.h: MethodParams in op.C 2001-04-12 paf * src/: classes/image.C, types/pa_vimage.h: image:font :text * src/: classes/_unknown.h, classes/unknown.C, include/pa_globals.h, main/main.dsp, main/pa_globals.C, types/pa_vunknown.h: ^unknown:int[]=0 double[]=0 * src/: classes/image.C, main/pa_hash.C: hash bug fixed * src/classes/image.C: image:gif now does not have params * src/classes/image.C: image:line/fill/rectangle/bar/replace/polygon/polybar * src/: classes/image.C, classes/op.C, main/execute.C, types/pa_value.h, types/pa_vmethod_frame.h, types/pa_wcontext.h: for var now written not to r.wcontext, but to r.root cleared "entered_object" state 2001-04-11 paf * src/classes/image.C: image:create image:load * src/: classes/image.C, main/main.dsp: gd with mem write + image just compiled * src/: classes/image.C, types/pa_vimage.C, types/pa_vimage.h: gd todo: gif without file * src/: classes/image.C, types/pa_vimage.C, types/pa_vimage.h: gd started porting to Pooled descendant * src/: classes/image.C, main/execute.C, main/main.dsp, main/pa_request.C, types/pa_vcframe.h, types/pa_vcode_frame.h, types/pa_vimage.C, types/pa_vimage.h, types/pa_vmethod_frame.h, types/pa_vmframe.h: libimaging dead end: pil parses header in .py * src/: classes/image.C, include/pa_globals.h, main/main.dsp, main/pa_globals.C, types/pa_vimage.C, types/pa_vimage.h: gd dead end. switching to python imaging lib * src/main/main.dsp: gd+smtp made separate libs * src/: include/pa_globals.h, include/pa_string.h, main/pa_common.C, main/pa_request.C, main/untaint.C, types/pa_vfile.C, types/pa_vstring.C: fixed vstring:as_vfile length * src/: classes/mail.C, classes/op.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vstring.C, types/pa_vstring.h: forced UL_FILE_NAME of posted file name * src/: classes/image.C, main/pa_request.C, types/pa_vform.C: fixed post [broke when moved post read to core] 2001-04-10 paf * src/classes/image.C: image:html done * src/: classes/image.C, types/pa_vimage.C: jpg measure bugs fixed * src/classes/image.C: z * src/: classes/_image.h, classes/image.C, types/pa_vimage.C: image forgotten! * src/: classes/table.C, include/pa_common.h, main/pa_common.C, main/pa_request.C, main/pa_string.C, main/untaint.C, types/pa_vimage.h: image:measure -90 * src/: classes/_double.h, classes/_file.h, classes/_form.h, classes/_int.h, classes/_mail.h, classes/_op.h, classes/_random.h, classes/_response.h, classes/_string.h, classes/_table.h, classes/file.C, classes/mail.C, include/pa_common.h, include/pa_globals.h, main/execute.C, main/main.dsp, main/pa_common.C, main/pa_globals.C, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vhash.h, types/pa_vimage.h, types/pa_vresponse.h, types/pa_vstring.h: image:measure -100 just compiled * src/classes/mail.C: minor bug with unclear from/to * src/classes/mail.C: sendmail unix skipping defaults * src/: classes/mail.C, include/pa_common.h, main/pa_common.C: sendmail unix added defaults * src/classes/mail.C: unix sendmail compiled. todo:testing * src/: classes/mail.C, main/pa_globals.C: smtp some consts 2001-04-09 paf * src/: classes/file.C, include/pa_exec.h, include/pa_sapi.h, main/main.dsp, main/pa_exec.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp: all targets exec * src/: include/pa_sapi.h, include/pa_string.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp: sapi exec dead end. badly parsed args in apache:util.script * src/include/pa_string.h: written but not tested exec with env for unix * src/: classes/file.C, main/main.dsp, main/pa_request.C, targets/cgi/parser3.C: exec win32 env * src/: classes/file.C, include/pa_hash.h, main/pa_hash.C: exec env 0 * src/: classes/exec.C, classes/file.C, include/pa_globals.h, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_request.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C, types/pa_vstring.C: exec4. todo env * src/: classes/exec.C, include/pa_common.h, main/pa_common.C, main/untaint.C: exec3. decided exec:cgi to move to file:cgi * src/: classes/_exec.h, main/execute.C, main/pa_globals.C, main/pa_request.C, types/pa_vcookie.C, types/pa_vfile.C: exec -2 * src/: classes/_exec.h, classes/exec.C, include/pa_common.h, include/pa_request.h, include/pa_sapi.h, include/pa_string.h, main/pa_common.C, main/pa_request.C, main/pa_string.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, types/pa_vform.C, types/pa_vform.h: exec class just compiled. moved post read to request core * src/: classes/_op.h, include/pa_dir.h, include/pa_globals.h, include/pa_sapi.h, main/main.dsp, main/pa_dir.C, main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp: problems with ^exec:cgi post data. they are already read by vform 2001-04-08 paf * src/: classes/file.C, classes/mail.C, classes/string.C, include/pa_request.h, include/pa_string.h, main/pa_request.C: uuencode. string<< 2001-04-07 paf * src/classes/mail.C: z * src/classes/mail.C: z * src/classes/mail.C: ^mail[$attach * src/classes/mail.C: ^attach dead end * src/: include/pa_socks.h, main/main.dsp, main/pa_socks.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C: mail:send 1 * src/: classes/mail.C, main/pa_request.C: z * src/: classes/mail.C, include/pa_globals.h, include/pa_request.h, main/main.dsp, main/pa_globals.C, main/pa_request.C: smtp just compiled * src/classes/mail.C: += * src/: classes/mail.C, include/pa_string.h: mail:send -1 text prepared * src/: classes/_mail.h, classes/mail.C, include/pa_common.h, include/pa_globals.h, include/pa_string.h, main/main.dsp, main/pa_common.C, main/pa_globals.C, main/pa_request.C, main/untaint.C, types/pa_vcookie.C: mail:send -10 just compiled 2001-04-06 paf * src/: classes/table.C, include/pa_globals.h, main/pa_globals.C, main/pa_string.C: table:dir 1 * src/: classes/table.C, include/pa_dir.h, main/execute.C, main/main.dsp, main/pa_dir.C: table:dir 0 [without regexp] * src/: classes/_op.h, classes/_root.h, classes/op.C, classes/root.C, include/pa_globals.h, include/pa_request.h, main/compile.C, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_request.C: renamed 'root' to 'op' * src/classes/: _op.h, op.C: renamed from 'root' * src/types/pa_valiased.C: another root inherititance skipped * src/main/: compile.C, compile.y, execute.C: operators are now not root methods of parent class. just 'ROOT' class * src/: classes/random.C, classes/table.C, main/pa_globals.C: @office * src/: main/pa_request.C, sql/pa_sql_driver.h: mysql limit 2001-04-05 paf * src/: main/execute.C, main/pa_request.C, main/pa_string.C, types/pa_value.h, types/pa_vmframe.h, types/pa_wcontext.h: constructor flag dropped at get_method_frame and remembered into method_frame * src/: classes/file.C, classes/root.C, classes/string.C, classes/table.C, main/pa_request.C: junction to code&expression in errors * src/: include/pa_globals.h, main/pa_globals.C, main/pa_request.C, main/pa_string.C, targets/isapi/parser3isapi.dsp: $LOCALE:ctype[Russian_Russia.1251] * src/: include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_hash.h, include/pa_string.h, main/pa_hash.C, main/pa_table.C: hash now not thread-safe. * src/: classes/table.C, include/pa_string.h, main/pa_string.C, main/untaint.C: z * src/: classes/random.C, classes/root.C, classes/table.C, include/pa_sql_connection.h, include/pa_string.h, main/execute.C, main/pa_sql_driver_manager.C, main/pa_string.C, main/untaint.C, sql/pa_sql_driver.h, types/pa_vmframe.h, types/pa_wcontext.C, types/pa_wcontext.h: sql quote. string untaint UL_SQL * src/: classes/table.C, include/pa_sql_connection.h, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: sql ping * src/classes/table.C: select * from hren error contains statement * src/: classes/table.C, include/pa_sql_connection.h, include/pa_types.h, main/pa_sql_driver_manager.C, main/untaint.C, sql/pa_sql_driver.h, targets/cgi/parser3.dsp: mysql 0 * src/: classes/root.C, include/pa_sql_connection.h, include/pa_sql_driver.h, main/main.dsp, main/pa_sql_driver_manager.C, sql/pa_sql_driver.h: sql driver services for conv memory & error reporting 2001-04-04 paf * src/doc/doxygen.cfg: z * src/include/pa_sql_driver.h: mysql connect * src/include/pa_sql_driver.h: mysql info * src/: classes/root.C, include/pa_sql_driver.h, include/pa_sql_driver_manager.h, main/main.dsp, main/pa_sql_driver_manager.C: more manager&connection&driver * src/sql/Makefile.am: forgot to add mysql client * src/: include/pa_sql_driver.h, include/pa_sql_driver_manager.h, main/pa_sql_driver_manager.C: connect&sql -1000 just compiled [forgot to add libltdl, added] * src/: Makefile.am, classes/root.C, classes/string.C, classes/table.C, include/pa_globals.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_sapi.h, include/pa_string.h, include/pa_table.h, main/main.dsp, main/pa_globals.C, main/pa_hash.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/untaint.C: connect&sql -1000 just compiled * src/: classes/random.C, classes/root.C, classes/table.C, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, main/pa_request.C, types/pa_vclass.h: sql frame -10 2001-04-03 paf * src/types/pa_vform.C: z * src/: classes/string.C, types/pa_vform.C: string:match replace assigned lang * src/: classes/string.C, main/compile.y: grammar: fixed to allow {}[]< empty [] * src/: classes/file.C, classes/string.C, classes/table.C, include/pa_string.h, main/pa_common.C, main/pa_string.C, main/untaint.C: string:match replace 2. string.cstr(forced lang) * src/: classes/string.C, include/pa_string.h, main/pa_string.C: string:match replace strange matches * src/classes/string.C: string:match replace 0 * src/: classes/string.C, main/pa_string.C: string:match replace prepared 2 * src/: classes/string.C, include/pa_string.h, main/pa_string.C: string:match replace prepared * src/: classes/string.C, include/pa_string.h, main/pa_string.C: string:match replace -11 * src/: classes/string.C, include/pa_globals.h, include/pa_string.h, include/pa_threads.h, main/pa_globals.C, main/pa_string.C, targets/isapi/parser3isapi.dsp: string:match 0 * src/: classes/string.C, include/pa_globals.h, include/pa_string.h, main/main.dsp, main/pa_globals.C, main/pa_string.C: string:match [search] -1 just compiled * src/types/pa_vstring.C: z * src/: classes/double.C, classes/file.C, classes/form.C, classes/int.C, classes/response.C, classes/root.C, classes/string.C, classes/table.C, include/pa_string.h, main/pa_string.C: string:match -10 [frame] * src/: classes/file.C, main/compile_tools.C, main/pa_common.C, main/pa_request.C: z * src/: main/pa_common.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/pool_storage.h: todo/tests * src/include/pa_common.h: z * src/: include/pa_globals.h, include/pa_hash.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vfile.C: content-disposition * src/: include/pa_common.h, include/pa_globals.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_value.h: main:post-process * src/: include/pa_common.h, include/pa_request.h, include/pa_sapi.h, main/main.dsp, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vstring.h: vfile in response:body * src/classes/table.C: table:append now uses string::split * src/classes/table.C: z * src/: classes/file.C, classes/root.C, classes/string.C, classes/table.C, doc/doxygen.cmd, doc/doxygen.txt, doc/generate.cmd, include/pa_array.h, include/pa_request.h, include/pa_string.h, main/execute.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C, types/pa_vcookie.C: string::pos & cmp & piece bugs fixed. string::split new table:load separated from set table:set implemented with clean \n \t searches 2001-04-02 paf * src/: classes/table.C, include/pa_string.h, main/pa_string.C, types/pa_valiased.C, types/pa_valiased.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vresponse.h, types/pa_vstring.h, types/pa_vtable.h: string::pos. about to use it in table:set/load * src/: classes/table.C, include/pa_array.h, include/pa_string.h, include/pa_table.h, main/execute.C, types/pa_value.h: table:join * src/classes/random.C: random:generate 1 * src/: classes/_random.h, classes/random.C, include/pa_globals.h, main/main.dsp, main/pa_globals.C, main/pa_request.C, types/pa_value.h: random:generate 2001-03-30 paf * src/: classes/table.C, include/pa_string.h, main/pa_string.C: todo: table flip and append. string::pos * src/: classes/double.C, classes/file.C, classes/int.C, classes/response.C, classes/root.C, classes/string.C, classes/table.C, main/compile.y, main/execute.C, types/pa_value.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: static|dynamic|any method registration * src/: classes/file.C, classes/table.C, include/pa_table.h, main/pa_table.C, types/pa_vstring.h, types/pa_wwrapper.h: table:flip 2001-03-29 paf * src/classes/string.C: string:xsplit forgot that they must result in 1 row N column [not vice versa] * src/classes/string.C: z * src/classes/string.C: string: rsplit * src/: classes/string.C, include/pa_string.h, main/pa_string.C: string: lsplit * src/: classes/string.C, include/pa_string.h, main/execute.C, main/pa_array.C, main/pa_string.C, types/pa_vtable.h: string: lsplit -1 * src/: include/pa_string.h, main/pa_string.C, main/untaint.C: string: pos * src/: classes/string.C, include/pa_string.h, main/pa_string.C: string: pos -1 * src/: classes/string.C, classes/table.C, include/pa_string.h, main/compile.y, main/pa_request.C, main/pa_string.C, main/untaint.C: string: left right mid * src/: classes/string.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/main.dsp, types/pa_value.h, types/pa_vstring.h, types/pa_vunknown.h: empty params allowed. [] and [;] are different now. * src/: include/pa_pool.h, include/pa_request.h, main/pa_request.C, main/untaint.C: pool.request undone * src/: include/pa_pool.h, include/pa_request.h, main/pa_request.C, main/untaint.C: pool.request 2001-03-28 paf * src/: classes/file.C, include/pa_globals.h, include/pa_request.h, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vrequest.C, types/pa_vunknown.h: $request:browser [.type .version]; unknown.get_double now = 0. * src/: classes/file.C, include/pa_globals.h, include/pa_request.h, include/pa_table.h, main/pa_globals.C, main/pa_request.C, main/pa_table.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C: file:load autodetection of mime-type by user-file-name * src/: classes/file.C, main/execute.C, main/pa_common.C, main/untaint.C, targets/cgi/parser3.C, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C: file:load 1. tainted * src/: classes/file.C, include/pa_common.h, main/pa_common.C, types/pa_vfile.C, types/pa_vfile.h: started file:load. wrong write. must be self.set * src/: classes/file.C, classes/root.C, classes/table.C, include/pa_table.h, main/pa_table.C: table:locate1, file:test * src/: classes/table.C, include/pa_array.h, include/pa_hash.h, include/pa_table.h, main/pa_array.C, main/pa_table.C, types/pa_vtable.h: table:locate just compiled 2001-03-27 paf * src/main/: execute.C, pa_common.C: fixed r/w context of code-params2, fixed ntfs hardlink slow dir update * src/: main/execute.C, types/pa_value.h, types/pa_vmframe.h, types/pa_wcontext.h: fixed r/w context of code-params * src/: classes/table.C, main/execute.C: about to change junction rcontext!! * src/: classes/double.C, classes/int.C, classes/root.C, classes/string.C, classes/table.C, main/compile_tools.C, main/execute.C, main/pa_request.C, main/untaint.C, types/pa_value.h, types/pa_vbool.h, types/pa_vcookie.C, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vmframe.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_vunknown.h: sort 0 * src/types/: pa_valiased.C, pa_valiased.h, pa_vdouble.h, pa_vfile.h, pa_vint.h, pa_vresponse.h, pa_vstring.h, pa_vtable.h: renamed to are_static_calls_disabled * src/: classes/table.C, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vbool.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vstring.h, types/pa_vunknown.h: continue on sort * src/main/compile.y: fixed minor bug in @mn[][] ...^{ * src/: classes/table.C, include/pa_common.h, main/compile.y: started table:sort fixed minor bug in #...^{ * src/: classes/table.C, include/pa_common.h, main/compile.y, main/execute.C, main/pa_common.C, main/pa_table.C: table:save decided to have as it were. stepped back. grammar: added 'in' 'is' 'lt'&co follow-space check 2001-03-26 paf * src/: classes/file.C, classes/root.C, classes/table.C, include/pa_common.h, include/pa_globals.h, include/pa_table.h, main/pa_common.C, main/pa_globals.C, main/pa_request.C, main/pa_table.C: moved ::save to pa_table. disabled @auto invocation in ^process * src/main/compile.y: grammar: [] 0params [;] 2 params (was 0) * src/: classes/table.C, include/pa_array.h, include/pa_table.h, main/pa_array.C: table:record * src/: main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, targets/isapi/pool_storage.h, types/pa_valiased.h, types/pa_vcookie.C, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vresponse.h, types/pa_vstring.h, types/pa_vtable.h: z * src/: include/pa_pool.h, main/execute.C, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vdouble.h, types/pa_vfile.h, types/pa_vint.h, types/pa_vresponse.h, types/pa_vstring.h, types/pa_vtable.h: disabled $a(123) $b[$a.CLASS] ^b.inc[123] shit. allowed no checks in native method realisations on 'self' validity - they now can simply assume that 'self' is V{Proper} . 2001-03-25 paf * src/main/untaint.C: z * src/main/: pa_request.C, untaint.C: moved default typo-table to lowlevel - it initialization could be skipped if failed in @auto. so that exception report would use some table * src/main/pa_request.C: table empty lines ignored. system-default content type assigned in output:result [can fail in main:auto and skipped normal defaults extraction] * src/: include/pa_string.h, main/compile.y: #comment fixed minor bug * src/main/: pa_globals.C, untaint.C: html-typo - moved all processing to table [except preliminary \r\n \r \n replacements to "\n"] * src/: classes/table.C, main/untaint.C: html-typo - decided to move all the processing to table * src/: classes/table.C, include/pa_table.h, main/pa_globals.C, main/pa_table.C, main/untaint.C: returned table originating. useful for reporting typo table problems origin. think would be useful somewhere else * src/main/untaint.C: typo \r \r\n \n properly handled * src/: classes/table.C, include/pa_globals.h, include/pa_string.h, include/pa_table.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/untaint.C, types/pa_vcookie.h: typo & typo-default 2001-03-24 paf * src/main/pa_common.C: z * src/: include/pa_string.h, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C: html-typo 2 * src/: doc/doxygen.cfg, doc/doxygen.txt, doc/generate.cmd, doc/view.cmd, include/pa_array.h, include/pa_globals.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, main/execute.C, main/pa_array.C, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_value.h, types/pa_vtable.h: html-typo 0 html-typo 1. noticed double default content-type prob. run cgi.cmd tomorrow first html-typo sample. detected << problem: they become ltlt too fast * src/main/compile.y: z * src/main/: compile.y, compile_tools.h: #comment * src/: classes/file.C, classes/root.C, classes/table.C, include/pa_common.h, include/pa_request.h, main/compile.y, main/pa_common.C, main/pa_request.C, main/pa_string.C, targets/isapi/parser3isapi.C, types/pa_vfile.h: file_read stringified * src/types/pa_valiased.C: decided to String-ify file_read * src/targets/: cgi/parser3.C, isapi/nt_log_events.mc, isapi/parser3isapi.dsp: cgi: sapi::log * src/: include/pa_sapi.h, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/nt_log_events.mc, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp: nt error log experiments failed - cgi under iis got no access to log. registereventsource simply failed with 5(illegal call) code, while worked OK as standalone executable. isapi: used HSE_APPEND_LOG_PARAMETER feature * src/: include/pa_common.h, include/pa_globals.h, main/pa_common.C, main/pa_globals.C, main/pa_request.C, targets/isapi/parser3isapi.C: fixed default content-type allocation storage * src/: include/pa_globals.h, include/pa_request.h, main/pa_globals.C, main/pa_request.C: z * src/: include/pa_array.h, include/pa_hash.h, include/pa_request.h, main/compile.y, main/pa_array.C, main/pa_common.C, main/pa_hash.C, main/pa_request.C, types/pa_vcookie.C: cyclic uses ignored. defaulted default content-type * src/main/: compile.y, execute.C, main.dsp: @CLASS equals @BASE. sanity * src/: main/pa_globals.C, types/pa_vclass.C, types/pa_vclass.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: thrown away freeze mech. no danger now for you can't do ^request:process[@new-method[] body] trick anymore. still remains $some_instance.process[@new-method[] possibility] but would leave it as a feature. see index for sample * src/: include/pa_common.h, main/pa_common.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: auto.p monkey every target * src/: include/pa_common.h, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/pool_storage.h, types/pa_vform.C, types/pa_vform.h: auto.p monkey 2001-03-23 paf * src/: include/pa_pool.h, main/pa_request.C, targets/cgi/pa_pool.C, targets/isapi/pa_pool.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, targets/isapi/pool_storage.h: isapi: dumb pool storage * src/targets/isapi/pa_pool.C: decided to continue with extension * src/targets/: cgi/parser3.C, isapi/parser3isapi.C: isapi: think it would be better to rewrite as filter then to deal with pool * src/: main/main.dsp, targets/isapi/parser3isapi.C: isapi: docroot now like in cgi, not from APPL_PHYSICAL_PATH * src/: classes/root.C, classes/table.C, include/pa_common.h, include/pa_config_fixed.h, include/pa_config_includes.h, include/pa_string.h, include/pa_threads.h, include/pa_types.h, include/pa_version.h, main/compile.y, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vfile.C, types/pa_vform.C: cgi: reinvent document_root and request_uri under iis. autoconf updated. introducing ap_config_includes * src/targets/cgi/parser3.C: cgi: reinvent document_root under iis * src/targets/cgi/parser3.C: cgi: only one pool now * src/: include/pa_globals.h, include/pa_sapi.h, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, types/pa_vcookie.C, types/pa_venv.h, types/pa_vform.C: sapi made object * src/: include/pa_globals.h, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/parser3isapi.C, types/pa_vcookie.C, types/pa_venv.h, types/pa_vform.C: all: sapi beauty * src/: main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp: isapi minor env beauty * src/: main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp: isapi document_root 0 2001-03-22 paf * src/targets/isapi/parser3isapi.C: isapi keep-alive * src/targets/: cgi/vform_fields_fill.C, cgi/vform_fields_fill.h, isapi/parser3isapi.C: z * src/: include/pa_pool.h, main/pa_request.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C: isapi 1 * src/targets/isapi/: KILL.EXE, PSTAT.EXE, istart.cmd, istop.cmd, kill.pl: isapi added utils * src/: include/pa_pool.h, main/pa_pool.C, targets/cgi/parser3.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.dsp, types/pa_vform.C: isapi 0 * src/: include/pa_pool.h, targets/cgi/pa_pool.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/isapi/pa_pool.C, targets/isapi/parser3isapi.C, targets/isapi/parser3isapi.def, targets/isapi/parser3isapi.dsp: started isapi * src/: include/pa_globals.h, main/pa_common.C, main/pa_request.C: some comments * src/: include/pa_globals.h, include/pa_request.h, include/pa_types.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vcookie.C: config of auto.p path: parser_root_auto_path parser_site_auto_path * src/types/pa_vcookie.C: cookie attr decoded 2001-03-21 paf * src/targets/cgi/parser3.C: z * src/include/pa_globals.h: post. todo: config of auto.p path * src/: include/pa_globals.h, targets/cgi/parser3.C, types/pa_venv.h: in cookie & env. todo:post * src/: Makefile.am, classes/Makefile.am, classes/file.C, classes/root.C, classes/table.C, include/pa_array.h, include/pa_common.h, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, include/pa_string.h, main/Makefile.am, main/compile.y, main/execute.C, main/main.dsp, main/pa_common.C, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/untaint.C, targets/Makefile.am, targets/cgi/Makefile.am, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/Makefile.am, types/pa_vcookie.C, types/pa_vform.C, types/pa_vstring.h, types/pa_wwrapper.h: shifted apache branch on main trunc * src/: include/pa_common.h, include/pa_globals.h, include/pa_pool.h, include/pa_request.h, main/main.dsp, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.dsp, types/pa_vcookie.C, types/pa_vform.C, types/pa_vstring.h: starting mod_parser3 * src/targets/cgi/parser3.C: starting mod_parser3 2001-03-20 paf * src/: main/pa_common.C, targets/cgi/Makefile.am, targets/cgi/parser3.C: automake compiled and works. todo:make win32 ifdefs work and add ifdef unistd * src/: classes/table.C, include/pa_common.h, include/pa_request.h, main/Makefile.am, main/pa_common.C, main/pa_request.C, main/pa_table.C, targets/cgi/Makefile.am, targets/cgi/parser3.C: z * src/: include/pa_request.h, main/Makefile.am, main/compile.y, main/execute.C, main/pa_common.C, types/Makefile.am: removing locking * src/: classes/Makefile.am, types/Makefile.am: z * src/: Makefile.am, classes/file.C, classes/root.C, classes/table.C, include/pa_array.h, include/pa_request.h, include/pa_string.h, main/Makefile.am, main/execute.C, main/pa_common.C, main/pa_globals.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/Makefile.am, targets/cgi/Makefile.am, targets/cgi/parser3.C, types/pa_vcookie.C, types/pa_wwrapper.h: String::UL_ * src/: classes/table.C, include/pa_common.h, main/pa_common.C, main/pa_request.C, types/pa_vfile.h: ^table:save * src/: classes/file.C, classes/table.C, include/pa_array.h, include/pa_common.h, include/pa_request.h, include/pa_string.h, include/pa_table.h, include/pa_threads.h, main/pa_globals.C, main/untaint.C, types/pa_valiased.h, types/pa_value.h, types/pa_vform.h: z * src/include/pa_string.h: z * src/: classes/_request.h, classes/request.C, main/main.dsp, main/pa_globals.C, types/pa_value.h, types/pa_vform.h, types/pa_vrequest.C, types/pa_vrequest.h: VRequest moved to :Value * src/: classes/_request.h, classes/request.C, main/pa_globals.C, types/pa_vrequest.C, types/pa_vrequest.h: VRequest moved to :VStateless_object * src/: classes/_response.h, classes/response.C, main/pa_globals.C, types/pa_vform.h, types/pa_vresponse.h: VResponse moved to :VStateless_object * src/: main/main.dsp, targets/cgi/parser3.dsp, types/pa_valiased.C, types/pa_vform.h: commented VForm * src/: targets/cgi/pa_vform.C, types/pa_valiased.C, types/pa_valiased.h, types/pa_value.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h: moved common get_element part from stateless object&class into VAliased * src/: classes/_env.h, classes/_table.h, classes/env.C, classes/table.C, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_request.C, types/pa_value.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_venv.h: VEnv is now :Value * src/: classes/_cookie.h, classes/_table.h, classes/cookie.C, main/execute.C, main/main.dsp, main/pa_globals.C, types/pa_vcookie.C, types/pa_vcookie.h: VCookie is now :Value * src/types/: pa_vfile.C, pa_vfile.h, pa_vstateless_object.h: vfile doxx * src/: classes/_file.h, classes/file.C, include/pa_types.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_valiased.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vstateless_class.h, types/pa_vstateless_object.h: \ to / and ^file:save 2001-03-19 paf * src/types/pa_vfile.C: z * src/: classes/file.C, classes/request.C, classes/table.C, include/pa_string.h, main/main.dsp, main/pa_pool.C, main/pa_request.C, main/untaint.C, types/pa_value.h, types/pa_vfile.C, types/pa_vfile.h, types/pa_vform.C: file 1 * src/: classes/table.C, include/pa_common.h, include/pa_globals.h, include/pa_string.h, include/pa_table.h, main/main.dsp, main/pa_common.C, main/pa_globals.C, types/pa_value.h, types/pa_vcookie.h, types/pa_venv.h, types/pa_vform.C, types/pa_vform.h, types/pa_vrequest.h, types/pa_vtable.h, classes/_file.h, classes/file.C, types/pa_vfile.C, types/pa_vfile.h: file class just compiled * src/: classes/table.C, include/pa_pool.h, include/pa_request.h, include/pa_table.h, include/pa_types.h, main/execute.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vclass.h, types/pa_vform.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h: ^table:set{default level: TABLE} * src/include/pa_pool.h: z * src/: include/pa_hash.h, include/pa_types.h, main/pa_common.C, main/pa_hash.C, main/pa_request.C, types/pa_vcookie.C: renamed Hash::Value to Val so to doxygen would finlly stop confusing those Value-s * src/: include/code.h, include/pa_array.h, include/pa_common.h, include/pa_exception.h, include/pa_globals.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_stack.h, include/pa_string.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_exception.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/untaint.C, types/pa_valiased.h, types/pa_value.h: z * src/types/: pa_valiased.h, pa_vbool.h: doc: Value and it's derivates somehow unlinked. don't know why yet * src/: include/code.h, include/pa_array.h, include/pa_pool.h, include/pa_string.h, include/pa_threads.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_exception.C, main/pa_globals.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/untaint.C, types/pa_value.h: auto @brief * src/: classes/root.C, classes/table.C, main/pa_exception.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vbool.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vdouble.h, types/pa_venv.h, types/pa_vform.h, types/pa_vint.h, types/pa_vrequest.h: doc: detected Value derivates prob * src/include/pa_globals.h: z * src/: classes/_request.h, classes/request.C, include/code.h, include/pa_array.h, include/pa_common.h, include/pa_exception.h, include/pa_globals.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_stack.h, include/pa_string.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/execute.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vform.C: doxygen include/, Value 2001-03-18 paf * src/: classes/cookie.C, types/pa_vcookie.C, types/pa_vcookie.h: cookie: allowed access to hash-assigned * src/targets/cgi/parser3.C: z * src/: classes/_cookie.h, classes/cookie.C, include/pa_common.h, include/pa_globals.h, include/pa_request.h, include/pa_string.h, include/pa_types.h, main/main.dsp, main/pa_common.C, main/pa_globals.C, main/pa_hash.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C, types/pa_value.h, types/pa_vcookie.C, types/pa_vcookie.h, types/pa_vform.C, types/pa_vform.h, types/pa_vhash.h, types/pa_vunknown.h: cookie class * src/main/pa_request.C: zero length output allowed * src/: classes/response.C, main/pa_request.C, types/pa_value.h, types/pa_vhash.h, types/pa_vresponse.h: ^response:clear[] * src/: classes/root.C, main/pa_request.C: taint forgotten forced lang switch * src/: classes/root.C, include/pa_globals.h, include/pa_string.h, main/pa_globals.C, main/pa_request.C, main/pa_string.C, types/pa_value.h, types/pa_vhash.h: $defautl[$content-type[$value[text/html] $charset[windows-1251]] * src/main/execute.C: z * src/: classes/root.C, main/pa_request.C, main/untaint.C, targets/cgi/parser3.C: taint[uri * src/: classes/request.C, classes/response.C, classes/root.C, include/pa_common.h, include/pa_globals.h, include/pa_request.h, include/pa_string.h, main/pa_common.C, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C: ^taint 0 * src/: classes/root.C, classes/string.C, include/pa_string.h, main/pa_globals.C, main/pa_request.C, main/pa_string.C, types/pa_vdouble.h, types/pa_vform.C, types/pa_vint.h, types/pa_vstateless_class.C: convinient string(pool, char *src, bool tainted) ctor * src/: include/pa_hash.h, include/pa_request.h, include/pa_string.h, main/pa_globals.C, main/pa_hash.C, main/pa_request.C, main/pa_string.C, main/untaint.C, targets/cgi/parser3.C: proper @exceptions params tainting * src/: include/pa_hash.h, main/pa_hash.C, targets/cgi/parser3.C: response fields to header * src/: include/pa_globals.h, main/pa_globals.C, main/pa_request.C: z * src/: classes/_response.h, classes/response.C, include/pa_globals.h, include/pa_hash.h, include/pa_request.h, main/compile.C, main/compile.y, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_hash.C, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_value.h, types/pa_vhash.h, types/pa_vrequest.h, types/pa_vresponse.h: $response: 0 request::core exception rethrow 2001-03-16 paf * src/: main/execute.C, main/main.dsp, types/pa_value.h, types/pa_vrequest.h: native method' class call with less params then needed error reporting * src/: classes/_request.h, classes/request.C, include/pa_globals.h, include/pa_request.h, main/execute.C, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vform.C, types/pa_vrequest.C, types/pa_vrequest.h: $request : query :uri * src/: include/pa_globals.h, main/execute.C, main/pa_globals.C, types/pa_value.h, types/pa_vcframe.h, types/pa_vmframe.h, types/pa_wcontext.h: $result * src/: main/execute.C, types/pa_vmframe.h: if(in "/news/") * src/: classes/double.C, include/code.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: () and {} param wcontext conflict fixed by OP_EXPR_CODE__STORE_PARAM * src/: include/code.h, include/pa_hash.h, include/pa_request.h, main/compile.y, main/execute.C, types/pa_value.h, types/pa_vhash.h, types/pa_vstring.h, types/pa_vtable.h, types/pa_wcontext.C, types/pa_wcontext.h: see () and {} param wcontext conflict * src/: main/execute.C, types/pa_value.h, types/pa_vstateless_object.h, types/pa_vstring.h: disabled $string.field 2001-03-15 paf * src/main/pa_request.C: news sample * src/: main/compile.y, main/execute.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vstring.h: @exception * src/main/: compile.y, execute.C: z * src/: main/compile.y, main/pa_request.C, targets/cgi/parser3.C, types/pa_vstring.h: pre-pre-pre-beta cgi under win32 apache pre pre pre works * src/: include/pa_globals.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, types/pa_vform.C, types/pa_vform.h: vform fillfields just compiled 2001-03-14 paf * src/: include/pa_request.h, main/pa_request.C, targets/cgi/parser3.C: z * src/: include/pa_globals.h, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.dsp, types/pa_vform.C, types/pa_vform.h, types/pa_vstring.h: limits -1 * src/: include/pa_globals.h, include/pa_request.h, include/pa_types.h, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vform.C, types/pa_vform.h: request_info -1 * src/: include/pa_globals.h, main/pa_globals.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, targets/cgi/vform_fields_fill.C, targets/cgi/vform_fields_fill.h: vform_fields_fill * src/targets/cgi/parser3.C: # if MSVC * src/: include/pa_common.h, include/pa_types.h, main/pa_request.C, targets/cgi/parser3.C: PATH_DELIMITER_CHAR * src/targets/cgi/parser3.C: z * src/: include/core.h, include/pa_globals.h, include/pa_pool.h, include/pa_string.h, include/pa_types.h, main/compile.y, main/core.C, main/main.dsp, main/pa_globals.C, main/pa_request.C, targets/cgi/pa_vform.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_value.h, types/pa_vform.h, types/pa_vunknown.h: global handler, exceptions in parser3 2001-03-13 paf * src/: classes/form.C, main/compile.y, main/core.C, types/pa_value.h, types/pa_vclass.h, types/pa_venv.h, types/pa_vform.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h: form:fields removed. use $form.CLASS instead * src/: include/core.h, include/pa_common.h, include/pa_request.h, main/core.C, main/execute.C, main/main.dsp, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp, types/pa_vform.h: started cgi target * src/: include/core.h, include/pa_common.h, include/pa_request.h, main/pa_common.C, main/pa_request.C, targets/cgi/parser3.C: before error show with parser * src/: classes/_form.h, classes/form.C, include/core.h, include/pa_request.h, main/core.C, main/pa_request.C, targets/cgi/parser3.C, targets/cgi/parser3.dsp: z * src/targets/cgi/: parser.dsp, parser3.dsp: z * src/targets/cgi/: Makefile.am, pa_pool.C, pa_vform.C, parser.dsp, parser3.C: renamed targets/ parser to cgi * src/: classes/double.C, classes/env.C, classes/int.C, classes/root.C, classes/string.C, classes/table.C, include/pa_request.h, types/pa_vhash.h: z * src/: classes/_env.h, classes/env.C, classes/root.C, include/core.h, include/pa_pool.h, include/pa_request.h, main/compile.C, main/compile.y, main/core.C, main/main.dsp, main/pa_common.C, main/pa_request.C, types/pa_value.h, types/pa_venv.h, types/pa_vstateless_class.h: started $form: [historical moment :)] * src/: include/code.h, include/pa_string.h, main/compile.y, main/execute.C, main/pa_string.C: 'value is type' expr operator * src/types/pa_venv.h: $ENV 1 * src/main/execute.C: z * src/: main/execute.C, types/pa_value.h, types/pa_venv.h: for future methods of ENV constructor if * src/: include/pa_request.h, types/pa_venv.h: $ENV 0.1 stateless class * src/: classes/_double.h, classes/_env.h, classes/_int.h, classes/_root.h, classes/_string.h, classes/_table.h, classes/double.C, classes/env.C, classes/int.C, classes/root.C, classes/string.C, classes/table.C, include/pa_request.h, main/compile.C, main/compile_tools.h, main/core.C, main/execute.C, main/main.dsp, main/pa_request.C, types/pa_valiased.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_venv.h, types/pa_vmframe.h, types/pa_vobject.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_wcontext.h: $ENV: re 0, stateless classes * src/: classes/_double.h, classes/_env.h, classes/_int.h, classes/_root.h, classes/_string.h, classes/_table.h, classes/double.C, classes/env.C, classes/int.C, classes/root.C, classes/string.C, classes/table.C, include/pa_request.h, main/compile.C, main/compile_tools.h, main/core.C, main/execute.C, main/main.dsp, main/pa_request.C, types/pa_valiased.h, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_venv.h, types/pa_vmframe.h, types/pa_vobject.h, types/pa_vstateless_class.C, types/pa_vstateless_class.h, types/pa_vstateless_object.h, types/pa_wcontext.h: $ENV: re 0, stateless classes * src/: include/pa_request.h, main/compile.C, main/execute.C, main/pa_request.C, types/pa_value.h, types/pa_vmframe.h: fixed yesterdays bad decision on execute_static_method * src/: classes/table.C, include/pa_types.h, main/pa_request.C: z * src/: classes/double.C, classes/int.C, classes/root.C, types/pa_vdouble.h, types/pa_vint.h: Int,Double dec mul div mod * src/main/pa_request.C: z * src/: classes/root.C, classes/table.C, include/pa_exception.h, include/pa_pool.h: skipped_restructure_exceptions_dead_end * src/: classes/root.C, classes/table.C, include/pa_exception.h, include/pa_pool.h, main/pa_request.C: restructure_exceptions_dead_end * src/: classes/root.C, main/compile.y: ^if required junctions. allowed ; inside {} to break params * src/classes/root.C: ^eval * src/: classes/_string.h, classes/double.C, classes/int.C, classes/string.C, main/execute.C, types/pa_wcontext.h: int doube string ^format * src/: main/execute.C, types/pa_wcontext.h: constructing flag not 'bad' but not 'enough' * src/: classes/double.C, classes/root.C, classes/table.C, include/pa_common.h, include/pa_types.h, main/compile.y, main/pa_common.C, main/pa_request.C, main/untaint.C, types/pa_vdouble.h, types/pa_vint.h, types/pa_vtable.h, types/pa_wwrapper.h: think constructing flag as is is bad * src/: classes/double.C, classes/int.C, classes/root.C, classes/string.C, classes/table.C, main/core.C, main/execute.C, types/pa_vint.h: ^for 2001-03-12 paf * src/classes/table.C: table ^empty * src/: classes/table.C, include/pa_table.h: table ^menu * src/: classes/root.C, classes/table.C, types/pa_vtable.h: table ^offset ^line ^count * src/classes/root.C: ^round() ^floor() ^ceiling() ^abs() ^sign() * src/classes/: root.C, table.C: ^use * src/: classes/root.C, classes/table.C, include/pa_request.h, main/compile.y, main/core.C, main/execute.C, types/pa_vclass.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: ^while. switched off wcontext.constructing after write(value) or auto-vhash-constructing * src/: classes/root.C, classes/table.C, include/pa_request.h, main/pa_request.C: fail_if_junction_ helper func * src/: classes/root.C, classes/table.C, include/pa_common.h, include/pa_request.h, main/execute.C, main/main.dsp, main/pa_common.C, main/pa_request.C: ^process error point by actual method_name, not source. ^load * src/types/pa_vtable.h: table: no, better with string in cells... * src/: include/pa_array.h, include/pa_table.h, main/pa_table.C, classes/_table.h, classes/table.C, main/untaint.C: z * src/: classes/root.C, include/pa_common.h, include/pa_string.h, include/pa_table.h, main/core.C, main/execute.C, main/pa_common.C, main/pa_request.C, main/pa_table.C, types/pa_value.h: table:set 0 * src/: classes/root.C, include/core.h, include/pa_array.h, include/pa_request.h, include/pa_table.h, main/core.C, main/main.dsp, main/pa_request.C, main/pa_table.C, types/pa_value.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vdouble.h, types/pa_vint.h, types/pa_vmframe.h, types/pa_vstring.h: freeze, ^table:create[] -1 * src/: classes/root.C, types/pa_value.h: z * src/: classes/root.C, main/execute.C, types/pa_vclass.h: used get_method in couple places optimizing them * src/classes/root.C: z * src/: classes/root.C, types/pa_vclass.h: process temp main zeroing * src/: classes/double.C, classes/int.C, classes/root.C, classes/string.C, include/pa_common.h, include/pa_request.h, include/pa_string.h, include/pa_types.h, main/compile.C, main/compile.y, main/compile_tools.h, main/execute.C, main/pa_common.C, main/pa_request.C, types/pa_value.h, types/pa_vmframe.h: ^process. actual names to store param and check_actual_numbered_params for better place diagnostics * src/: classes/root.C, main/execute.C, main/main.dsp: setname for method-junctions bug fixed * src/types/: pa_vdouble.h, pa_vint.h, pa_vobject.h, pa_vstateless_object.h, pa_vstring.h: stateless_object 2001-03-11 paf * src/: main/main.dsp, types/pa_value.h, types/pa_vdouble.h, types/pa_vint.h, types/pa_vobject.h, types/pa_vstring.h: VString VDouble VInt base now VObject_base - without fields * src/: classes/root.C, include/core.h, main/core.C: z * src/: classes/double.C, classes/int.C, classes/root.C, classes/string.C, include/core.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_string.h, main/compile.C, main/core.C, main/pa_request.C: ^untaint 0 * src/: classes/double.C, classes/int.C, classes/root.C, include/pa_request.h, main/execute.C: intercept_string * src/: classes/double.C, classes/int.C, classes/root.C, types/pa_vclass.C, types/pa_vclass.h: add_native_method helper * src/: classes/double.C, classes/int.C, include/pa_request.h: ^inc-s(expr) * src/: classes/_double.h, classes/_env.h, classes/_int.h, classes/_root.h, classes/_string.h, classes/double.C, classes/env.C, classes/int.C, classes/root.C, classes/string.C, include/code.h, include/core.h, include/pa_array.h, include/pa_common.h, include/pa_exception.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_stack.h, include/pa_string.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/core.C, main/execute.C, main/pa_array.C, main/pa_common.C, main/pa_exception.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vcframe.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vdouble.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmframe.h, types/pa_vobject.h, types/pa_vstring.h, types/pa_vunknown.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: headers updated * src/: main/pa_request.C, types/pa_vhash.h: z * src/: include/core.h, include/pa_request.h, main/core.C, main/main.dsp, main/pa_request.C: renamed AUTO: to MAIN: * src/: include/pa_valiased.h, include/pa_value.h, include/pa_vbool.h, include/pa_vcframe.h, include/pa_vclass.h, include/pa_vdouble.h, include/pa_vhash.h, include/pa_vint.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_vunknown.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/compile.y, main/core.C, main/main.dsp, main/pa_cframe.C, main/pa_request.C, main/pa_value.C, main/pa_vclass.C, main/pa_wcontext.C, types/pa_valiased.h, types/pa_value.h, types/pa_vbool.h, types/pa_vcframe.h, types/pa_vclass.C, types/pa_vclass.h, types/pa_vdouble.h, types/pa_vhash.h, types/pa_vint.h, types/pa_vjunction.h, types/pa_vmframe.h, types/pa_vobject.h, types/pa_vstring.h, types/pa_vunknown.h, types/pa_wcontext.C, types/pa_wcontext.h, types/pa_wwrapper.h: splitted types from include/ 2001-03-10 paf * src/: include/core.h, include/pa_request.h, main/core.C, main/pa_request.C: run+auto=run * src/: classes/root.C, include/pa_request.h: minor if junction bug * src/: classes/_double.h, classes/_env.h, classes/_int.h, classes/_root.h, classes/_string.h, classes/double.C, classes/env.C, classes/int.C, classes/root.C, classes/string.C, include/code.h, include/core.h, include/pa_array.h, include/pa_common.h, include/pa_exception.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_stack.h, include/pa_string.h, include/pa_table.h, include/pa_threads.h, include/pa_types.h, include/pa_valiased.h, include/pa_value.h, include/pa_vbool.h, include/pa_vcframe.h, include/pa_vclass.h, include/pa_vdouble.h, include/pa_vhash.h, include/pa_vint.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_vunknown.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/core.C, main/execute.C, main/pa_array.C, main/pa_cframe.C, main/pa_common.C, main/pa_exception.C, main/pa_hash.C, main/pa_pool.C, main/pa_request.C, main/pa_string.C, main/pa_table.C, main/pa_value.C, main/pa_vclass.C, main/pa_wcontext.C: sources header * src/main/pa_request.C: auto.. * src/: include/pa_request.h, main/compile.C, main/compile.y, main/pa_request.C: auto tree0 * src/: include/core.h, include/pa_request.h, main/compile.y, main/core.C, main/pa_request.C: names to core.C * src/: include/core.h, include/pa_common.h, include/pa_pool.h, include/pa_request.h, main/core.C, main/execute.C, main/pa_common.C, main/pa_request.C: root auto.p loaded * src/: include/code.h, include/pa_request.h, include/pa_vint.h, include/pa_vjunction.h, include/pa_vstring.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: optimized from OP_STRING+OP_WRITE to OP_STRING__WRITE * src/: include/pa_request.h, main/execute.C, main/pa_request.C: @auto[] realised. auto.p scan togo * src/: include/pa_request.h, main/execute.C: autocalc code-junctions result now have names * src/: classes/double.C, classes/int.C, classes/root.C, classes/string.C, include/pa_request.h, include/pa_string.h, include/pa_wcontext.h, main/compile.y, main/execute.C, main/pa_string.C, main/pa_wcontext.C: tainting 0 * src/classes/env.C: env:file/line * src/: include/core.h, include/pa_array.h, include/pa_hash.h, include/pa_request.h, include/pa_value.h, include/pa_vcframe.h, include/pa_vdouble.h, include/pa_vint.h, include/pa_vstring.h, include/pa_vunknown.h, include/pa_wcontext.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/core.C, main/execute.C, main/main.dsp, main/pa_cframe.C, main/pa_request.C, main/pa_wcontext.C: const fight finished * src/include/pa_vclass.h: const fight to go * src/: classes/_env.h, classes/env.C, classes/root.C, include/pa_request.h, include/pa_vclass.h, main/core.C, main/main.dsp: env0 * src/: classes/_double.h, classes/_int.h, classes/_root.h, classes/_string.h, classes/double.C, classes/int.C, classes/root.C, classes/string.C, include/pa_request.h, include/pa_string.h, include/pa_types.h, include/pa_vcframe.h, include/pa_wcontext.h, main/core.C, main/main.dsp, main/pa_cframe.C, main/pa_string.C, main/pa_vclass.C, main/pa_wcontext.C: ^lang prepare0 2001-03-09 paf * src/: include/pa_vmframe.h, main/compile.C, main/execute.C: expr construct proper naming * src/: classes/_double.h, classes/_int.h, classes/_string.h, classes/double.C, classes/int.C, classes/root.C, classes/string.C, include/code.h, include/pa_value.h, include/pa_vbool.h, include/pa_vdouble.h, include/pa_vint.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, main/compile.y, main/compile_tools.C, main/core.C, main/execute.C, main/main.dsp: Int and Double classes with ^int[] and ^double[]. fixed expr type * src/: classes/root.C, include/pa_request.h, main/execute.C: ^string.length[] 2001-03-08 paf * src/include/pa_vmframe.h: fixed forgotten method_frame my check * src/: include/pa_vclass.h, include/pa_vstring.h, include/pa_wcontext.h, main/compile.y, main/core.C, main/execute.C, main/main.dsp: dead end: vstring can't be derivated from vobject * src/: include/pa_vclass.h, include/pa_vhash.h, include/pa_vobject.h, include/pa_vstring.h, main/main.dsp: z * src/include/: pa_vclass.h, pa_vhash.h, pa_vobject.h: removes some remained clone conseqs * src/main/pa_vclass.C: that were ok... [vclass were out of vcs] * src/main/pa_vclass.C: wow! vclass were out of vcs * src/: include/pa_bool.h, include/pa_double.h, include/pa_value.h, include/pa_vbool.h, include/pa_vclass.h, include/pa_vdouble.h, include/pa_vhash.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_vunknown.h, main/compile.y, main/compile_tools.C, main/execute.C: withoud cloning. didn't need it actually, params got passed from out unnamed ewpool * src/: include/pa_vdouble.h, include/pa_vhash.h, include/pa_vjunction.h, include/pa_vobject.h, include/pa_vunknown.h, main/compile.y: cloning dead end * src/: include/pa_bool.h, include/pa_double.h, include/pa_valiased.h, include/pa_value.h, include/pa_vbool.h, include/pa_vclass.h, include/pa_vdouble.h, include/pa_vhash.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_vunknown.h, main/compile.y, main/compile_tools.C, main/execute.C, main/main.dsp, main/pa_value.C: value.cloning so to give params proper names * src/main/pa_wcontext.C: z * src/: include/pa_vmframe.h, main/execute.C: added names to unknown values in get_element and unfilled params. removed wrong name change in get_element * src/main/execute.C: z * src/main/execute.C: fixed problems calling operators in constructors * src/: classes/root.C, include/pa_stack.h, main/execute.C: detected problems calling operators in constructors * src/: classes/root.C, include/pa_request.h, main/execute.C: autocalc def to string * src/: classes/root.C, include/pa_request.h, include/pa_value.h, include/pa_vbool.h, include/pa_wwrapper.h, main/execute.C: ^if 0 * src/classes/root.C: added root.c * src/: include/pa_request.h, include/pa_value.h, include/pa_vcframe.h, include/pa_vmframe.h, include/pa_wcontext.h, main/compile.C, main/compile.y, main/core.C, main/execute.C, main/pa_cframe.C, main/pa_wcontext.C: 'if' just compiled * src/: include/pa_vbool.h, include/pa_vdouble.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vstring.h, include/pa_wcontext.h, main/execute.C, main/pa_wcontext.C: z * src/: include/pa_value.h, include/pa_vmframe.h, main/compile.y, main/core.C, main/execute.C, main/main.dsp: z. detected probs with parameter names in operator methods * src/main/compile.y: minor renamings in .y * src/: include/pa_request.h, main/compile.C, main/compile.y, main/core.C, main/main.dsp: introducing ROOT_CLASS. it's default @BASE. changed 'RUN' assignment mech * src/main/execute.C: z * src/: include/code.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: made class: dynamic, not static. so to enable runtime ^use * src/main/compile.y: minor grammar bug with OP_CODE__STORE_PARAM * src/: include/code.h, main/compile.y, main/compile_tools.C, main/execute.C: joined 2 into one OP_CODE__STORE_PARAM * src/main/execute.C: root root in code-junction 2001-03-07 paf * src/include/: pa_value.h, pa_vclass.h, pa_vhash.h, pa_vmframe.h, pa_vobject.h, pa_wwrapper.h: const in Value.get_element * src/: include/pa_stack.h, include/pa_value.h, include/pa_vclass.h, include/pa_vhash.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_wwrapper.h, main/execute.C: fixed rwcontext of {} params up * src/main/: compile.y, compile_tools.h: ^func(params) * src/main/compile.y: .y priorities syntax shaped up a bit * src/: include/pa_hash.h, include/pa_value.h, include/pa_vhash.h, include/pa_vunknown.h, main/compile.y, main/execute.C, main/pa_hash.C: expr def in -f * src/main/: compile.y, execute.C: expr calls * src/main/: compile.y, execute.C, pa_string.C: bug in string.cmp fixed * src/main/compile.y: expr quoted code * src/main/: compile.y, execute.C: expr whitespace solved. added "" support0 * src/main/compile.y: expr string comparisons 0 * src/: include/pa_string.h, main/compile.y, main/execute.C, main/pa_string.C: just compiled lt&co * src/main/execute.C: ^var.menu{$field} problem detected. that $field not a $var.field 2001-03-06 paf * src/main/compile.y: .y expr visible-shorter * src/: include/code.h, main/compile.y, main/execute.C: 1 problems with skipping whitespace in yylex fixed 2 xors: # bitwise ## logical * src/: include/pa_vstring.h, main/compile.y: problems with skipping whitespace in yylex * src/include/pa_vbool.h: forgot this * src/: include/code.h, main/compile.y, main/execute.C: without string ops in expressions 0 * src/: include/pa_value.h, include/pa_vdouble.h, include/pa_vstring.h, include/pa_vunknown.h, main/compile.y, main/execute.C, main/main.dsp: !~ * src/: include/pa_vcframe.h, include/pa_vclass.h, include/pa_vdouble.h, include/pa_vhash.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_vunknown.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: +-*/ * src/: include/pa_vdouble.h, main/compile.y, main/compile_tools.C, main/compile_tools.h: grammar-1.1 $a(z) $a=0 * src/: include/pa_value.h, include/pa_vdouble.h, main/compile.y, main/execute.C: expr grammar-1 2*2=4.000000 :) * src/main/compile.y: expr grammar-1 * src/main/compile.y: expr lexx1 * src/main/: compile.y, execute.C, main.dsp: z * src/: include/code.h, include/pa_valiased.h, include/pa_value.h, include/pa_vdouble.h, include/pa_vstring.h, main/compile.y, main/execute.C: expr lex0 exec-1 * src/: include/code.h, main/compile.y, main/compile_tools.h: g 2001-02-26 paf * src/main/compile.y: max_string in yyerror bug fix 2001-02-25 paf * src/: include/pa_value.h, include/pa_vmframe.h, include/pa_wcontext.h, main/execute.C: VAliased3 * src/include/: pa_value.h, pa_vmframe.h: VAliased2 * src/main/execute.C: VAliased1 * src/: include/pa_request.h, include/pa_value.h, include/pa_vmframe.h, include/pa_wcontext.h, main/execute.C: VAliased0 * src/: include/pa_pool.h, include/pa_request.h, include/pa_value.h, include/pa_vclass.h, include/pa_vmframe.h, include/pa_vobject.h, main/core.C, main/execute.C, main/main.dsp: VAliased just compiled * src/: include/pa_pool.h, include/pa_value.h, include/pa_vclass.h, include/pa_vobject.h, main/execute.C: alias dead end * src/: include/pa_value.h, include/pa_vclass.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/execute.C, main/main.dsp: no not get fields into interm VFielded class. fields & staticfields 1 * src/: include/pa_vcframe.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/core.C, main/execute.C, main/main.dsp: would now get fields into interm VFielded class * src/: include/pa_hash.h, include/pa_value.h, include/pa_vclass.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_vstring.h, include/pa_wcontext.h, main/compile.y, main/core.C, main/execute.C, main/main.dsp, main/pa_hash.C, main/pa_value.C, main/pa_wcontext.C: virtuals2 * src/main/compile.y: : 1 * src/main/compile.y: rethought to $class:static.field.subfield * src/: include/pa_vclass.h, main/compile.y, main/execute.C: $class:element * src/: include/pa_value.h, include/pa_vmframe.h, include/pa_wwrapper.h, main/compile.y, main/execute.C, main/pa_wcontext.C: before execute class calls rewrite * src/: include/pa_request.h, main/compile.C, main/core.C: default name RUN, also alias * src/main/compile.y: escaping bug * src/: include/pa_request.h, include/pa_value.h, include/pa_vobject.h, main/compile.y, main/compile_tools.h, main/core.C, main/execute.C, main/pa_common.C: vobject1 * src/: include/code.h, include/pa_value.h, include/pa_vclass.h, include/pa_vmframe.h, include/pa_vobject.h, include/pa_wwrapper.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: ^class:method() just compiled 2001-02-24 paf * src/main/main.dsp: no bison -d * src/main/: compile.y, compile_tools.h: use0 line no on 'undef class' err msg wrong * src/main/compile.y: z * src/main/: compile.y, core.C: yylex need some @special lines adj * src/: include/pa_request.h, include/pa_vclass.h, main/compile.C, main/compile.y, main/compile_tools.h, main/core.C: modules0 * src/: include/pa_vclass.h, main/core.C: z * src/: include/pa_value.h, include/pa_vclass.h, include/pa_vobject.h, main/main.dsp: vobject00 * src/main/pa_array.C: minor bug in expanding very small arrays. 60% from 1 were 0 * src/: include/pa_value.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/execute.C, main/pa_value.C: it works as bad as you've named it: wcontext.value() was not a perfect idea * src/main/execute.C: codeframe1 * src/: include/pa_value.h, include/pa_vcframe.h, include/pa_vclass.h, include/pa_vframe.h, include/pa_vhash.h, include/pa_vjunction.h, include/pa_vmframe.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/execute.C, main/main.dsp, main/pa_cframe.C, main/pa_wcontext.C: codeframe just compiled * src/: include/pa_vframe.h, main/compile.y: found junction ideology @: ^x{$a()) must construct current wcontext element, so smart wcontext handling needed * src/main/compile.y: fixed grammar bugs in constructor/params klinch * src/main/: compile.y, execute.C: fixed empty constructor optimized empty case. failed on calls - produced empty string param * src/main/compile.y: fixed last \n macrotemplate strip bug * src/: include/code.h, include/pa_request.h, include/pa_value.h, include/pa_vclass.h, include/pa_vframe.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/core.C, main/execute.C: code junctions0. something wrong with last \n macrotemplate strip * src/: include/pa_value.h, main/compile.C, main/core.C, main/pa_value.C: minor error reporting format beautifyings * src/: include/pa_value.h, include/pa_vclass.h, include/pa_vframe.h, main/core.C, main/execute.C, main/pa_value.C: get_method RIP. junctions everywhere. call with junctions0 2001-02-23 paf * src/include/: pa_value.h, pa_vclass.h, pa_vframe.h, pa_wwrapper.h: lara came, can't work, sorry :( * src/main/: compile.y, execute.C, main.dsp: rethought some. before junction * src/: include/pa_vframe.h, include/pa_vunknown.h, include/pa_wcontext.h, include/pa_wwrapper.h, main/core.C, main/execute.C, main/main.dsp, main/pa_value.C: call0 * src/: include/pa_hash.h, include/pa_value.h, include/pa_wcontext.h, main/core.C, main/execute.C, main/main.dsp, main/pa_hash.C: started call. store param, vframe done * src/include/pa_wcontext.h: z * src/main/: compile.y, compile_tools.C, compile_tools.h: fixed wrong grammar in complex constructor case * src/main/: compile.y, execute.C: empty constructor bug fixed * src/main/execute.C: with result rwpool * src/: include/pa_value.h, main/core.C, main/execute.C, main/main.dsp: value named * src/: include/pa_value.h, include/pa_vstring.h, main/execute.C: strign 2 value in 2 places in execute * src/: include/pa_value.h, include/pa_wcontext.h, main/compile.y, main/execute.C, main/main.dsp, main/pa_array.C: auto VHash on wcontext.put_element when wcontext fvalue==0 2001-02-22 paf * src/: include/pa_hash.h, include/pa_value.h, include/pa_vclass.h, include/pa_vhash.h, include/pa_vstring.h, include/pa_wcontext.h, main/execute.C, main/main.dsp: auto VHash in pa.th.cre.at.e * src/: include/pa_wcontext.h, main/compile.y, main/execute.C: erroreos checkout * src/: include/pa_request.h, main/compile.y: $self.put(val) * src/: include/pa_array.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/pa_array.C: $self.get * src/main/: compile.C, compile.y, compile_tools.C: z * src/main/compile.y: $: wasn't finished - $:sdf(sdf) troubled a bit. finished now. * src/main/compile.y: $: finished * src/main/: compile.C, compile.y, execute.C: started : with $a.$:f * src/: include/code.h, main/compile_tools.C, main/compile_tools.h, main/execute.C: OP_STRING better then some xxx _VALUE * src/: include/code.h, include/pa_vstring.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C: string to vstring it .y all * src/: include/pa_request.h, include/pa_stack.h, include/pa_wcontext.h, main/execute.C: z about to vstring it .y all * src/main/: compile.C, core.C, execute.C, pa_string.C: more precise parse error line:col * src/: include/pa_pool.h, include/pa_vclass.h, main/core.C, main/pa_hash.C, main/pa_pool.C: TRY... * src/: include/pa_exception.h, include/pa_pool.h, include/pa_request.h, include/pa_value.h, include/pa_wcontext.h, main/compile.C, main/compile.y, main/compile_tools.C, main/core.C, main/pa_array.C, main/pa_exception.C, main/pa_hash.C, main/pa_pool.C, main/pa_string.C, main/pa_table.C: removed exception from request * src/: include/pa_vstring.h, main/compile.C, main/core.C: added some forgotten * src/: include/code.h, include/pa_value.h, include/pa_vclass.h, include/pa_wcontext.h, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/main.dsp: iiieeyys! get/put simple vars to VClass works0 * src/: include/pa_array.h, include/pa_wcontext.h, main/pa_string.C: in process, but found that exceptions are too global * src/: include/code.h, include/pa_string.h, include/pa_value.h, include/pa_vclass.h, include/pa_wcontext.h, main/compile.y, main/execute.C, main/pa_string.C: write_value write_string 0 it seems wcontext must write strings regardles of fvalue!=0 2001-02-21 paf * src/main/execute.C: tired :) * src/main/: compile.C, compile.y, execute.C: store0 * src/: include/compile.h, include/execute.h, include/pa_array.h, include/pa_request.h, include/pa_stack.h, include/pa_vclass.h, include/pa_wcontext.h, main/compile.C, main/compile.y, main/execute.C, main/main.dsp, main/pa_array.C, main/pa_request.C: get put -1 [just compiled] * src/: include/core.h, include/pa_context.h, include/pa_request.h, include/pa_vclass.h, include/pa_wcontext.h, main/core.C, main/main.dsp, main/pa_request.C: request core methods0 * src/: include/compile.h, include/pa_array.h, main/compile.C, main/compile.y, main/execute.C: MAIN_METHOD_NAME ready to write execute * src/: include/pa_exception.h, include/pa_value.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h: .y methods and one_big_piece. now compile returns array * src/main/compile.y: more straightforward yylex[end] * src/: include/pa_string.h, include/pa_types.h, main/pa_string.C: string.operator==(char*) * src/: include/execute.h, include/pa_array.h, include/pa_value.h, main/execute.C, main/pa_array.C: after array.const get wonders * src/include/: compile.h, pa_context.h, pa_hash.h, pa_request.h, pa_string.h, pa_value.h: struck with const array.gets * src/main/: execute.C: z * src/main/: compile.y, execute.C: z * src/main/: compile.C, compile.y, compile_tools.h: error processing in eval & yyerror so it wouldn't cause memleaks. * src/main/: compile.C, compile.y: failed to add absolute precies parse error positions. leaving RIGHTMOST position as @file[line:col] * src/: include/compile.h, main/compile.C, main/compile.y, main/compile_tools.h: line numbers needed. would add them to .y now internally. externally it's not as precise as needed * src/: include/code.h, include/pa_types.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/execute.C, main/main.dsp: .y to c++ hierarchy output fix. compiler works ok 2001-02-20 paf * src/main/: compile.C, compile.y, compile_tools.C, compile_tools.h, execute.C, main.dsp: nestage probs, eof yylex not perfect * src/: include/code.h, include/compile.h, include/execute.h, include/pa_array.h, include/pa_common.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, include/pa_types.h, main/compile.C, main/compile.y, main/compile_tools.C, main/compile_tools.h, main/core.C, main/execute.C, main/main.dsp, main/pa_array.C, main/pa_common.C, main/pa_hash.C, main/pa_string.C, main/pa_table.C: bison[yacc] first time compiled. execute=dump for now * src/main/core.C: core rewrite using yacc investigations now will be compile[yacc]/execute[opcodes] 2001-02-15 paf * src/: include/pa_value.h, main/core.C: maybe a-la yacc those ifs rewrite as turing machine? for it seems it would be it's too many ifs with this syntax now 2001-02-14 paf * src/main/core.C: get_params 1 * src/main/core.C: get_params figured ^menu[UNEVALUATED unthinked :( ] * src/main/core.C: varios breaks * src/main/core.C: get names 3 * src/main/core.C: get names 2 * src/main/core.C: get names 1 * src/: include/pa_string.h, main/core.C, main/pa_string.C: get names 0 * src/: include/pa_value.h, main/core.C, main/pa_string.C: process text repassing2 operator static vars * src/: include/pa_context.h, include/pa_string.h, main/core.C, main/pa_string.C: process text repassing * src/: include/pa_context.h, include/pa_value.h, main/core.C: module:calls changes 2001-02-13 paf * src/: include/pa_context.h, include/pa_value.h, main/core.C: ^class:calls[] started * src/: include/pa_value.h, main/core.C: z * src/main/core.C: operators : and self. prefixes * src/main/core.C: z * src/: include/pa_string.h, main/pa_string.C: String_iterator tested * src/: include/pa_string.h, main/pa_string.C: String_iterator optimized * src/main/pa_string.C: String_iterator::skip_to optimized a bit. would change privates to better support optimization * src/: include/pa_string.h, main/pa_string.C: String_iterator::skip_to todo:optimize 2001-02-12 paf * src/: include/pa_string.h, main/core.C, main/pa_string.C: started String_iterator * src/: include/pa_context.h, include/pa_value.h, main/core.C: some comments * src/: include/pa_context.h, include/pa_value.h, main/core.C: get self/methodref joined 2001-02-11 paf * src/: include/pa_context.h, include/pa_value.h, main/core.C, main/main.dsp: core started. core.C, context&value .h * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/main.dsp, main/pa_array.C, main/pa_hash.C, main/pa_pool.C, main/pa_string.C: :pooled 2001-01-30 paf * src/: Makefile.am, main/Makefile.am, targets/Makefile.am: .am comments * src/: include/pa_pool.h, main/Makefile.am, main/main.dsp, main/pa_pool.C: moved pa_pool.C to be target specific * src/: include/pa_exception.h, include/pa_pool.h, include/pa_table.h, main/pa_exception.C, main/pa_table.C: minor * to & changes * src/: include/pa_exception.h, include/pa_pool.h, include/pa_request.h, include/pa_table.h, main/pa_array.C, main/pa_exception.C, main/pa_pool.C, main/pa_table.C: error re-associated. that's much better even removed 'die' necessety * src/: include/pa_error.h, include/pa_exception.h, include/pa_pool.h, include/pa_request.h, main/main.dsp, main/pa_error.C, main/pa_exception.C, main/pa_pool.C, targets/Makefile.am: lowered targets/parser into subdir, added parser_Pool(Pool) failed to add. would think.. * src/: include/pa_error.h, include/pa_hash.h, include/pa_string.h, include/pa_table.h, main/pa_error.C, main/pa_hash.C, main/pa_string.C, main/pa_table.C: Table more like C++ style hence lots of 'const' * src/: include/pa_error.h, include/pa_request.h, include/pa_string.h, include/pa_table.h, main/pa_error.C, main/pa_table.C: Error fixed 2001-01-29 paf * src/: include/pa_array.h, include/pa_common.h, include/pa_error.h, include/pa_hash.h, include/pa_pool.h, include/pa_request.h, include/pa_string.h, include/pa_table.h, main/Makefile.am, main/pa_array.C, main/pa_common.C, main/pa_error.C, main/pa_hash.C, main/pa_table.C: added forgotten * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, include/pa_types.h, main/Makefile.am, main/main.dsp, main/pa_array.C, main/pa_hash.C, main/pa_string.C, main/pa_table.C: Request Error Table * src/: include/pa_pool.h, main/pa_array.C: tested - decision "no templates" * src/: include/pa_array.h, include/pa_pool.h, main/Makefile.am, main/main.dsp, main/pa_array.C: templates failed no template specializations [VC6], no library auto instantation [VC6, GNU c++ 2.95.2-6 from latest cygwin] * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, include/pa_table.h, include/pa_types.h, main/main.dsp, main/pa_array.C, main/pa_string.C, main/pa_table.C: Table started would test template Array now * src/: include/pa_pool.h, include/pa_string.h, main/pa_string.C: String originating * src/: include/pa_hash.h, include/pa_pool.h, include/pa_threads.h, main/pa_hash.C: made local Hash-es not thread safe=quicker by SYNCHRONIZED(thread_safe) * src/include/: pa_array.h, pa_hash.h, pa_string.h: moved .h public parts to top * src/: include/pa_hash.h, include/pa_threads.h, main/pa_hash.C, main/pa_threads.C: decided on one global_mutex, like PHP as I can see: needed only in global Hash now, made Hash:: put/get SYNCHRONIZED * src/: include/pa_hash.h, include/pa_threads.h, main/main.dsp, main/pa_threads.C: added pa_threads Mutex * src/include/pa_hash.h: some comments * src/: main/pa_array.C, include/pa_array.h, include/pa_pool.h: Array& operator += (Array& src) * src/main/pa_array.C: expand not convinient, would rewrite * src/: include/pa_array.h, main/pa_array.C: Array::operator += (Array& src) rethought, would change now 2001-01-27 paf * src/: include/pa_array.h, main/pa_array.C: array [] with chunk caching * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/pa_array.C, main/pa_string.C: array cache rethought to chunk caching * src/: include/pa_array.h, include/pa_hash.h, include/pa_pool.h, include/pa_string.h, main/main.dsp, main/pa_array.C, main/pa_hash.C, main/pa_string.C: Array 0 * src/main/pa_string.C: String::operator == * src/main/pa_hash.C: String(&String) * src/main/pa_hash.C: added pa_hash.C [forgotten] * src/: include/pa_hash.h, include/pa_string.h, include/pa_types.h, main/main.dsp, main/pa_string.C: uint, and added pa_types & pa_hash[forgotten] 2001-01-26 paf * src/: include/pa_pool.h, include/pa_string.h, main/pa_string.C: removed templates [vc++ suxx] * src/: include/pa_pool.h, include/pa_string.h, main/main.dsp, main/pa_pool.C, main/pa_string.C: templates in VC++ suxx. * src/include/: pa_pool.h, pa_string.h: pa_pool split * src/main/: main.dsp, pa_string.C: Id check * src/: main/pa_pool.C, main/pa_string.C, include/pa_pool.h: Id check * src/: include/pa_pool.h, main/pa_string.C: String prealloc & dynamic row_count * src/: Makefile.am, include/pa_pool.h, main/Makefile.am, main/main.dsp, main/pa_pool.C, main/pa_string.C, targets/Makefile.am: Initial revision * src/: Makefile.am, include/pa_pool.h, main/Makefile.am, main/main.dsp, main/pa_pool.C, main/pa_string.C, targets/Makefile.am: creating parser3 module parser-3.5.1/operators.ru.txt0000644000076400007640000025723214740300505013162 00000000000000операторы ^eval(выражение)[формат] выражение, кроме обычных функций: допустимы #комментарии работают до конца строки или закрывающейся круглой скобки внутри комментария допустимы вложенные круглые скобки из неочевидных операторов: | побитный xor || логический xor ~ побитное отрицание \ целочисленное деление 10\3=3 def для проверки defined, пустая строка не defined пустая таблица не defined пустой hash не defined eq ne lt gt le ge для сравнения строк, in "/dir/" для проверки, находится ли текущий документ в каталоге ["внутри не допустимы выражения, если надо сравнить со сложным, пусть это будет переменная] is 'type' для проверки типа левого операнда, можно проверить, "не hash ли параметр метода?" -f для проверки существования файла на диске, -d для проверки существования каталога на диске, строка в кавычках или апострофах - строка, без кавычек или апострофов строка до ближайшего whitespace числовой литерал бывает 0xABC приоритеты: /* logical */ %left "!||" %left "||" %left "&&" %left '<' '>' "<=" ">=" "lt" "gt" "le" "ge" %left "==" "!=" "eq" "ne" %left "is" "def" "in" "-f" "-d" %left '!' /* bitwise */ %left '!|' %left '|' %left '&' %left '~' /* numerical */ %left '-' '+' %left '*' '/' '%' '\\' %left '~' /* negation: unary */ литералы: true false ^if(условие){когда да}{когда нет} ^if(условие1){да}[(условие2){да}[(условие2){да}[...]]]{нет} количество доп. условий не ограничено (в общем elseif это :) ^switch[значение]{^case[вариант1[;вариант2...]]{действие}^case[DEFAULT]{действие по умолчанию}} ^while(условие){тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}] ^for[i](0;4){тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}] ^try{ ... ^throw[sql.connect[;вася[;ошибся]]] // был ^error[текст] ^throw[ $.type[sql.connect] $.source[вася] $.comment[ошибся] ] ... }{ ^if($exception.type eq "sql"){ $exception.handled(1|true) ^rem{флаг, что exception обработан} .... } ^switch[$exception.type]{ ^case[sql;mail]{ $exception.handled(1) код, обрабатывающий sql ошибку $exception.type = sql.connect $exception.file $exception.lineno $exception.colno [если не запрещены при компиляции] $exception.source = вася $exception.comment = ошибся } ^case[DEFAULT]{ код, обрабатывающий другую ошибку ^throw[$exception] << re-throw // DON'T! It's default behaviour! } } } ^break[] обрывает цикл ^break(true|false) обрывает цикл, если true ^continue[] обрывает итерацию цикла ^continue(true|false) обрывает итерацию цикла, если true ^return[] обрывает выполнение метода ^return[value] присваивает $result значение value и обрывает выполнение метода ^untaint[[as-is|file-spec|uri|http-header|mail-header|sql|js|json|parser-code|regex|xml|html|optimized-[as-is|xml|html]]]{код} default as-is ^taint[[lang]][код] default "just tainted, language unknown" ^apply-taint[[lang;]текст] выполняет заданные в строке преобразования, неопределенно грязное как lang, на выходе чистая строка ^process[[$caller.CLASS|$object|$КЛАСС:CLASS]]{строка, которая будет process-ed, как код}[ $.main[во что переименовать @main] $.file[имя файла из которого, якобы, данный текст] $.lineno(номер строки в файле, откуда данный текст, можно отрицательный) ] ^process..[путь][во что переименовать @main] по умолчанию, методы компилируются в $self [в случае оператора, $self=$MAIN:CLASS] ^connect[protocol://строка соединения]]{код с ^sql[...]-ями} mysql://user:pass@{host[:port][, host[:port]]|[/unix/socket]}/database? ClientCharset=parser-charset << charset in which parser thinks client works charset=UTF-8& timeout=3& compress=0& named_pipe=1& multi_statements=1& allow execute more then one query in one parser :sql{} request config_file=.my.cnf& config_group=parser3& use group name from .my.cnf autocommit=1 autocommit если выставить в 0, будет делать commit/rollback pgsql://user:pass@{host[:port]|[local]}/database? client_encoding=win,[to-find-out] &datestyle=ISO,SQL,Postgres,European,NonEuropean=US,German,DEFAULT=ISO &ClientCharset=parser-charset << charset in which parser thinks client works odbc://DSN=dsn^;UID=user^;PWD=password^;ClientCharset=parser-charset ClientCharset << charset in which parser thinks client works sqlite://DBfile? ClientCharset=parser-charset& << charset in which parser thinks client works autocommit=1 для работы connect нужно, чтобы заранее (рекомендуется в системном конфигурационном auto.p) была определена таблица #sql drivers $SQL[ $.drivers[^table::create{protocol driver client mysql $prefix/libparser3mysql.so libmysqlclient.so pgsql $prefix/libparser3pgsql.so libpq.so sqlite $prefix/libparser3sqlite.so sqlite3.so odbc parser3odbc.dll }] ] ^rem{} комментарий, удаляется при компиляции ^syslog[ident;message[;info|warning|error|debug]] пишет message в syslog ^cache[файл](секунд){код}[{catch код}] относительное задание времени скешировать строку, которая получается при выполнении кода на 'секунд' секунд если 0 секунд, значит не кешировать, а старый такой стереть в catch коде $exception.handled[cache] ^rem{флаг, что exception обработан} ^cache[файл][expires date]{код}[{catch код}] абсолютное задание времени ^cache[файл] удалить файл [не ругает, если его нет] ^cache(секунд) ^cache[expires date] сигнализирует вышестоящему ^cache "уменьши до стольких-то 'секунд'/'expires'" в пределе: ^cache(0) отменить кеширование ^cache[] выдаёт текущую expires date у всех методов есть локальная переменная $result, если в неё что положить, то это будет результатом метода, а не его тело у всех методов есть локальная переменная $caller, в ней лежит родительский stack frame, можно записать в его локальную переменную use(^use или @USE) ищет и подключает файл: 1. если путь начинается с /, то считается, что это путь от корня веб пространства 2. относительно текущей директории 3. относительно строк из table $MAIN:CLASS_PATH, снизу вверх $MAIN:CLASS_PATH - глобальная строка или таблица с путём или путями к каталогу с классами (от корня веб пространства), задавайте её в конфигурационном auto.p глобальная табличка $CHARSETS[$.название[имя файла]] задаёт какие буквы считаются какими (whitespace, letter, etc), а также их unicode формат: tab delimited файл, с заголовком: char white-space digit hex-digit letter word lowercase unicode1 unicode2 A x x x a 0x0041 0xFF21 где char и lowercase могут быть буквами, а могут быть и 0xКОДАМИ если символ имеет единственное unicode представление, равное самому символу, можно не указывать unicode всегда есть кодировка UTF-8, она является кодировкой по-умолчанию для request и response ВНИМАНИЕ: имя кодировки case insensitive синтаксис $имя[новое значение] $имя(математическое выражение нового значения) $имя{код нового значения} $имя whitespace или ${имя}неважно - вывод значения переменой ^имя параметры - вызов $имя.CLASS - класс значения $имя.CLASS_NAME - имя класса $имя[$.key[] () {}] - конструктор переменной-хеша с элементом $имя.key ^method[$.key[] () {}] - конструктор параметра-хеша с элементом $parameter.key $CLASS.имя обращение к переменной класса имя заканчивается перед: пробел tab linefeed ; ] } ) " < > + * / % & | = ! ' , ? т.е. можно $имя,aaaa но если нужно после имени символ, скажем -, то ${имя}- в выражениях + и - являются дополнительными концами имени можно обращаться к составным объектам так: $name.subname где subname бывает: строка $переменная строка$переменная [код, вычисляющий строку] например: $хеш[$.возраст(88)] $достать[$.поле[возраст]] ^хеш.[$достать.поле].format{%05d} параметры := один или много параметров параметр := (математическое выражение) вычисляется много раз внутри вызова, | [код] вычисляется один раз перед вызовом, | {код} вычисляется 0 или много раз внутри вызова, допустимы ';' чтобы сделать много параметров в одних скобках void доступны все методы, присутствующие у объекта класса string, результат как у пустой строки ^void:sql{запрос без результата}{$.bind[см. table::sql]} int,double ^имя.int[] целочисленное значение ^имя.double[] double значение ^имя.bool[] ^name.bool(true|false) bool значение ^имя.inc(на сколько +) ^имя.dec(на сколько -) ^имя.mul(на сколько *) ^имя.div(на сколько /) ^имя.mod(на сколько %) ^имя.format[формат] ^int/double:sql{query}[[$.limit(2) $.offset(4) $.default{0} $.bind[см. table::sql]]] запрос, результат которого должен быть один столбец/одна строка string в выражении def значение равно "не пуста?" логическое/числовое значение равно попытке преобразовывания к double, пустая строка тихо преобразуется к 0 пример: ^if(def $form:name) не пуста? ^if($user.isAlive) истина? [автопреобразование к числу, не ноль?] ^string:sql{query}[[$.limit(1) $.offset(4) $.default{n/a} $.bind[см. table::sql]]] результат запроса должен быть один столбец/одна строка ^строка.int[] ^строка.int(default) целочисленное значение строки, если ломается преобразование, берётся default ^строка.double[] ^строка.double(default) double значение строки, если ломается преобразование, берётся default ^строка.bool[] ^строка.bool(default) bool значение строки, если ломается преобразование, берётся default ^строка.format[формат] %d %.2f %02d... ^строка.match[шаблон-строка|шаблон-regex][[опции поиска]] $prematch $match $postmatch $1 $2... опции поиска= i CASELESS x whitespace in regex ignored s singleline = $ считается концом всего текста m multiline = $ считается концом строки[\n], не концом всего текста g найти все вхождения, а не одно ' создавать столбцы prematch, match, postmatch n вернуть цисло с количеством найденных совпадений, а не таблицу с результатами U инвертировать смысл модификатора '?' ^строка.match[шаблон-строка|шаблон-regex][опции поиска]{замена} опции поиска+= g заменить все вхождения, а не одно ^строка.split[разделитель|regex][[lrhva]][[название столбца для вертикального разбиения]] l слева направо [default] r справа налево h nameless таблица с ключами 0, 1, 2, ... v таблица из 1 столбца 'piece' или как передадут [default] a массив ^строка.{l|r}split[разделитель] таблица из столбца $piece оставлен для совместимости ^строка.upper|lower[] ^строка.length[] ^строка.mid(P[;N]) без N - "до конца строки" ^строка.left(N), -1 выдает всю строку ^строка.right(N) ^строка.pos[подстрока] ^строка.pos[подстрока](позиция, с которой ищем) <0 = не найдено ^строка.replace[$таблица_подстановок_строка_на_строку] ^строка.replace[$что;$на-что] ^строка.save[[append;]путь] ^строка.save[путь[;$.charset[в какой кодировке сохраняем] $.append(true)]] сохраняет строку в файл ^строка.trim[start|both|end|left|right[;chars]] выкидывает chars из начала/конца/и начала и конца default 'chars' = whitespace chars ^строка.trim[chars] выкидывает chars из начала и конца ^строка.base64[ $.pad(bool) $.wrap(bool) $.url-safe(bool) ] encode ^string:base64[encoded[; $.pad(bool) $.strict(bool) $.url-safe(bool) ]] decode ^строка.idna[] IDNA кодирование, поддержка кириллических доменов ^string:idna[encoded] IDNA декодирование, поддержка кириллических доменов ^строка.js-escape[] кодирование для передачи в JS (%uXXXX) ^string:js-unescape[escaped] декодирование переданного из js ^string:unescape[js|uri;escaped; $.charset[] ] декодирование переданного из js или uri ^строка.contains[ключ] для совместимости с hash table в выражении логическое значение равно "не пуста?" числовое значение равно count[] $таблица.поле $таблица.поле[новое значение] $таблица.fields из named таблицы выдаёт текущую запись как Hash ^table::create[[nameless]]{данные}[[$.separator[^#09] $.encloser[]]] ^table::create[table][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]] клонирует таблицу reverse - в обратном порядке ^table::load[[nameless;]путь[;опции]] если не nameless, названия колонок берутся из первой строки пустые строки, и строки в первой колонке содержащие '#', игнорируются $.separator[^#09] $.encloser["] по-умолчанию, нет ^table::sql{query}[[$.limit(2) $.offset(4) $.bind[hash]]] bind привязывает переменные в запросе к их значениям пока реализован только для oracle в запросе надо написать ":имя" в параметре bind передать hash, из которого возьмётся (или куда запишется) значение ^таблица.save[[nameless|append;]путь[;опции, см. load]] сохраняет таблицу в файл ^таблица.menu{тело}[[разделитель]] выполняет код тела для каждой строки таблицы ^таблица.foreach[позиция;значение]{тело}[[разделитель]] ^таблица.line[] текущий ряд таблицы, начинается с 1 ^таблица.offset[] смещение текущего ряда таблицы от начала, начинается с 0 ^таблица.offset[[whence]](5) сдвигает whence=cur|set, без whence - это cur ^таблица.count[], ^таблица.count[rows] количество строк в таблице ^таблица.count[columns] количество столбцов таблицы ^таблица.count[cells] количество ячеек в текущей строке таблицы ^таблица.sort{{ключеделатель строка}|(ключеделатель число)}[{desc|asc}] default=asc ^таблица.append{данные} ^таблица.append[ $.имя столбца[значение столбца] ] ^таблица.insert{данные} добавить запись на текущую позицию ^таблица.insert[ $.имя столбца[значение столбца] ] ^таблица.delete[] стирает запись с текущей позиции ^таблица.join[таблица][$.limit(1) $.offset(5) $.offset[cur]] добавляет записи из таблицы, таблицы должны иметь одинаковую структуру ^таблица.flip[] выдаёт транспонированную ^таблица.locate[поле;значение][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]] передвигает текущую строку, если найдёт. выдаёт bool ^таблица.locate(логическое выражение)[[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]] передвигает текущую строку, если найдёт. выдаёт bool ^таблица.hash{[поле]|{код}|(выражение)}[[поле значений|table поля значений]{код значения}][[$.distinct(1) $.distinct[tables] $.type[hash]]] по умолчанию значением $hash.ключ будет hash в котором поля значений будут ключами поля значений могут быть не указаны, тогда ими будут все столбцы, включая ключевой если distinct содержит true, то не будет ошибки при повторяющихся ключах если distinct содержит tables, то будет создан hash из таблиц, содержащих строки с ключом $.type[string/table] поменять значение элемента на строку (указать одну колонку) или таблицу ^таблица.columns[[название столбца]] таблица из одного столбца 'column' или как передадут ^таблица.cells[], ^таблица.cells(лимит) выдает массив ячеек текущей строки ^таблица.array[] возвращает массив, элементами которого являются хеши, отображающие данные каждой строки ^таблица.array[колонка] возвращает массив значений указанной колонки ^таблица.array{код} возвращает массив результатов выполнения переданного кода для каждой строки таблицы ^таблица.rename[название столбца;новое навание столбца] ^таблица.rename[ $.название столбца[новое навание столбца] ] переименовывает столбец или столбцы $отобранное[^таблица.select(выражение)] таблица из тех столбцов и строк, у которых условие совпало $adults[^man.select($man.age>=18)] ^таблица.color[цвет1;цвет2] чередует цвет1 и цвет2 последовательно для каждого ряда hash в выражении логическое значение равно "не пуст?", хеш с _default уже не пуст числовое значение равно count[] $хеш.ключ _default - специальный ключ, если задан, то при обращении по ключу, которому нет соответствия, выдаётся _default значение $хеш.fields выдает $hash, чтобы класс hash был чуть больше похож на класс table ^hash::create[[|copy_from_hash|copy_from_hashfile]] создаёт новый hash, копию старого ^хеш.add[слагаемое] перезаписывает одноимённые ^хеш.sub[вычитаемое] ^хеш.union[b] объединение, одноимённые остаются ^хеш.intersection[b][[$.order[self|arg]]] пересечение, новый хеш, order задает порядок элементов (как в исходном хеше или хеше-параметре) ^хеш.intersects[b] = bool ^hash::sql{запрос}[[$.distinct(1) $.limit(2) $.offset(4) $.type[hash|string|table]]] получается hash(ключи=значения первая колонка ответа) of hash(ключи=названия остальных колонкок ответа) или string=значение каждого элемента - строка, при этом надо указать ровно два столбца или table=значение каждого элемента - таблица ^хеш.keys[[название колонки с ключами]] таблица из одного столбца key или как передадут ^хеш.count[] ^хеш.foreach[key;value]{тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}] ^хеш.delete[ключ] удалить ключ ^хеш.contains[ключ] существует ли в хеше ключ (bool) ^хеш.at[first|last][[key|value|hash]] ^хеш.at([-]N)[[key|value|hash]] доступ к заданным элементам упорядоченного хеша ^хеш.set[first|last;значение] ^хеш.set([-+]N)[значение] устанавливает значение заданного элемента упорядоченного хеша ^хеш.rename[старый_ключ;новый_ключ] ^хеш.rename[ $.старый_ключ[новый_ключ] ... ] переименовывает заданные ключи хеша ^хеш.sort[key;value]{{ключеделатель строка}|(ключеделатель число)}[[desc|asc]] default=asc $обратный_хеш[^хеш.reverse[]] $отобранное[^хеш.select[key;value](выражение)[ $.limit(N) $.reverse(bool) $.default(bool) ]] хеш из ключей и значений, для которых условие истинно hashfile ^hashfile::open[filename] ^хешфайл.clear[] забыть всё $хешфайл.ключ[значение] положить значение $хешфайл.ключ[$.value[значение] $.expires[ЗНАЧЕНИЕ]} положить значение до expires значение поля expires может быть date, или число дней(0дней=на вечно) $хешфайл.ключ достать ^хешфайл.delete[ключ] удалить ключ ^хешфайл.delete[] удалить файлы, содержащие данные ^хешфайл.hash[] преобразовать в обычный hash попутно стирает устаревшие пары ^хешфайл.foreach[key;value]{тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}] ^хешфайл.release[] записать данные и снять блокировки при повторном обращении к элементам откроется автоматически ^хешфайл.cleanup[] пробежаться по всем элементам и удалить устаревшие. пример: $sessions[^hashfile::open[/db/sessions]] $sid[^math:uuid[]] $sessions.$sid[$.value[$uid] $.expires(1)] $uid[$sessions.$sid] array в выражении логическое значение равно "не пуст?" числовое значение равно count[] $массив.индекс, $массив.(выражение) возврат значения по заданному индексу $массив.индекс[значение], $массив.(выражение)[значение] присваивание значения по индексу $массив[значение;значение;...] создание массива с заданными значениями ^array::create[] ^array::create[значение;значение;...] создание массива с заданными значениями или пустого массива ^array::copy[копируемый массив или хеш с цифровыми ключами] копирование массива или хеша с цифровыми ключами ^массив.add[добавляемый массив или хеш с цифровыми ключами] добавление элементов из другого массива или хеша с перезаписью значений у совпадающих индексов ^массив.join[добавляемый массив или произвольный хеш] добавление элементов другого массива или хеша в конец массива ^массив.append[значение;значение;...] добавление элементов в конец массива ^массив.insert(индекс)[значение;значение;...] вставка элементов в указанную позицию массива ^массив.left(n) возвращает новый массив из n первых элементов массива ^массив.right(n) возвращает новый массив из n последних элементов массива ^массив.mid(m;n) возвращает новый массив, содержащий n инициализированных элементов массива, начиная с позиции m ^массив.delete(index) удаление элемента массива с оставлением пустого места ^массив.remove(index) удаление элемента со сдвигом последующих элементов на его место ^массив.push[значение] добавление элемента в конец массив ^массив.pop[] возвращает последний элемент и удаляет его из массива ^массив.contains(индекс) существует ли в массиве элемент по переданому индексу (bool) ^array::sql{запрос}[[ $.sparse(false) $.distinct(false) $.limit(2) $.offset(4) $.type[hash|string|table]]] создание массива на основе выборки из базы данных $.sparse(false), по умолчанию - создать обычный массив. Значения строк выборки последовательно добавляются в массив $.sparse(true) - создать разреженный массив. Первая колонка данных должна содержать индексы, по которым будут размещены значения (аналогично ^hash::sql{}) получается array of hash (ключи=названия остальных колонкок ответа) или string = значение каждого элемента - строка, при этом надо указать ровно два столбца или table = значение каждого элемента - таблица ^массив.keys[[название колонки с ключами]] таблица из одного столбца key или переданного названия с индексами инициализированных элементов массива ^массив.count[] количество инициализированных элементов массива ^массив.count[all] общее количество элементов массива, включая неинициализированные ^массив.foreach[index;value]{тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}] перебирает все инициализированные элементы массива ^массив.for[index;value]{тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}] перебирает все элементы массива ^массив.at[first|last][[key|value|hash]] ^массив.at([-]число)[[key|value|hash]] доступ к элементу массива по порядковому номеру ^массив.set[first|last][значение] ^массив.set([-]число)[значение] установка значения элемента массива по порядковому номеру ^массив.compact[] удаление неинициализированных элементов массива ^массив.compact[undef] удаление неинициализированных и пустых элементов массива ^массив.sort[key;value]{{ключеделатель строка}|(ключеделатель число)}[[desc|asc]] default=asc сортировка массива $обратный_массив[^массив.reverse[]] возвращает новый массив из элементов исходного в обратном порядке $отобранное[^массив.select[key;value](выражение)[ $.limit(N) $.reverse(bool) ]] отбор элементов массива, для которых условие истинно date время типа date можно использовать в выражениях, подставляет количество дней с epoch [1 января 1970 (UTC)], дробное строковое значение в местном времени, численное в UTC, диапазон от 0000-00-00 00:00:00 до 9999-12-31 23:59:59 по умолчанию используется установленная средствами OS временная зона ^date::now[] ^date::now(смещение в днях) выдаёт сейчас+смещение ^date::today[] дата на 00:00:00 текущего дня ^date::today(целочисленное смещение в днях) дата на 00:00:00 текущего дня+смещение ^date::create(дней с epoch) ^date::create(year;month[;day[;hour[;minute[;second[;TZ]]]]]) ^date::create[дата в формате %Y-%m-%d %H:%M:%S] для удобного создания по значению из базы формат1: %Y[-%m[-%d[ %H[:%M[:%S]]]]] формат2: %H:%M[:%S] ^date::create[дата в формате %Y-%m-%dT%H:%M[:%S]TZ] для создания по значению в формате ISO 8601 формат TZ: Z(UTC) или +-hour[:minute] (смещение от UTC) ^date::unix-timestamp() ^дата.unix-timestamp[] $дата.year month day hour minute second weekday yearday(0...) daylightsaving TZ weekyear TZ="" << локальная зона $дата.year month day hour minute second можно задать новое значение, остальные read only ^дата.double[] ^дата.int[] количество дней с epoch [1 января 1970 (UTC)], дробное или целое ^дата.roll[year|month|day](+-смещение) сдвигает дату ^дата.roll[TZ;Новая зона] говорит, что дата в таком-то часовом поясе: влияет на .hour & Co ^date:roll[TZ;Новая зона] говорит, что по умолчанию все даты в таком-то часовом поясе ^дата.sql-string[[datetime|date|time]] datetime или без параметра - %Y-%m-%d %H:%M:%S date - %Y-%m-%d time - %H:%M:%S where published='^дата.sql-string[]' ^date:calendar[rus|eng](год;месяц) выдаёт неименованную таблицу, столбцы: 0..6, week, year ^date:calendar[rus|eng](год;месяц;день) выдаёт именнованную таблицу, столбцы: year, month, day, weekday ^date:last-day(год;месяц) вернёт последний день месяца ^дата.last-day[] вернёт последний день месяца $дата ^дата.gmt-string[] Fri, 23 Mar 2001 09:32:23 GMT ^дата.iso-string[] 2001-03-23T12:32:23+03 file $файл_из_post.name $файл_из_post.size $файлt_из_post.text ^файл.save[text|binary;имя файла[;$.charset[в какой кодировке сохраняем]]] ^file:delete[имя файла] ^file:find[имя файла][{когда не нашли}] ^file:list[путь[;шаблон-строка|шаблон-regex]] table с колонками name dir ^file:list[путь;$.filter[шаблон-строка|шаблон-regex] $.stat(true)] table с колонками name dir size [mca]date ^file::load[text|binary;big.zip[;domain_press_release_2001_03_01.zip][;опции]] ^file::create[text|binary;имя;data] ^file::create[text|binary;имя;data[;$.charset[кодировка букв в создаваемом файле] $.content-type[...]]] ^file::create[string-or-file-content[;$.name[имя] $.mode[text|binary] $.content-type[...] $.charset[...]]] $файл_который_был_loaded.size $файл_который_был_loaded_или_created.mode = text/binary ^file::stat[имя файла] $файл_который_был_stated_или_loaded.size .adate .mdate .cdate ^file::cgi[[text|binary;]имя файла[;env hash +options[;1cmd[;2line[;3ar[;4g[;5s]]]]]]] любой аргумент может быть строкой или массивом строк возвращённый заголовок рассыпается на $поля $status $stderr ^file::exec[[text|binary;]имя файла[;env hash[;1cmd[;2line[;3ar[;4g[;5s;...under unix max 50 args]]]]]]] любой аргумент может быть строкой или массивом строк options: $.stdin[текст|файл] если пусто, отключается автоматическое пересовывание данных HTTP-POST ^file:move[старое имя файла;новое имя файла] можно переименовывать и двигать каталоги[win32: но не через границу дисков] каталоги для dest создаются с правами 775 каталог старого файла стирается, если после move он остаётся пуст ^file:copy[имя файла;имя копии файла[; $.append(1) ]] можно копировать только файлы ^file:lock[имя файла]{код} файл при необходимости создаётся блокируется выполняется код разблокируется ^file:dirname[/a/some.tar.gz|file]=/a (работает аналогично комманде *nix) ^file:dirname[/a/b/|file]=/a (работает аналогично комманде *nix) ^file:basename[/a/some.tar.gz|file]=some.tar.gz (работает аналогично комманде *nix) ^file:basename[/a/b/|file]=b (работает аналогично комманде *nix) ^file:justname[/a/some.tar.gz|file]=some.tar ^file:justext[/a/some.tar.gz|file]=gz /some/page.html: ^file:fullpath[a.gif] => /some/a.gif ^файл.sql-string[] внутри ^connect даст правильно escaped строку, которую можно в запрос отдать ^file::sql{query}[[ $.name[имя_файла_для_download] $.content-type[пользовательский content-type] ]] результат запроса должен быть "одна строка". колонки: первая колонка - данные если есть вторая - это имя файла если есть третья - это content-type ^файл.base64[ $.pad(bool) $.wrap(bool) $.url-safe(bool) ] encode ^file:base64[имя файла[; $.pad(bool) $.wrap(bool) $.url-safe(bool) ]] encode ^file::base64[encoded string[; $.pad(bool) $.strict(bool) url-safe(bool) ]] decode ^file::base64[mode;имя файла;encoded string[; $.content-type[...] $.pad(bool) $.strict(bool) url-safe(bool) ]] decode ^file:crc32[имя файла] вычисляет crc32 файла с указанным именем ^файл.crc32[] вычисляет crc32 объекта ^файл.md5[], ^file:md5[имя файла] выдает digest файла, длиной 16 байт в виде строки, где байты digest выданы в hex виде, впритык, в нижнем регистре image $картинка[^image::measure[DATA[; $.exif(bool) $.xmp(bool) $.xmp-charset[] $.video(bool) ]]] смотрит на .ext case insensitive, умеет мерить gif, jpg, tiff, bmp, webp и mp4 (mov) $картинка.exif << hash после measure jpeg с exif информацией и $.exif(true) $image.exif.DateTime & co [полный список см. https://exiftool.org/TagNames/EXIF.html] числа типа int/double, даты типа dateб перечисления в виде hash с ключами 0..count-1 $картинка.src .width .height $картинка.line-width число=ширина линий $картинка.line-style строка=стиль линий '*** * '='*** * *** * *** * ' ^картинка.html[[hash]] ^image::load[фон.gif] только gif пока ^image::create(размер X;размер Y[;цвет фона default белый]]) ^картинка.line(x0;y0;x1;y1;0xffFFff) ^картинка.fill(x;y;0xffFFff) ^картинка.rectangle(x0;y0;x1;y1;0xffFFff) ^картинка.bar(x0;y0;x1;y1;0xffFFff) ^картинка.replace(hex-цвет1;hex-цвет2)[table x:y вершины_многоугольника] ^картинка.polyline(цвет)[table x:y точки] ^картинка.polygon(цвет)[table x:y вершины_многоугольника] ^картинка.polybar(цвет)[table x;y вершины_многоугольника] ^картинка.font[набор_букв;имя_файла_шрифта.gif][(ширина_пробела[;ширина_символа])] высота символа = высота картинки/количество букв в наборе если указана ширина_символа, то monospaced, если 0, то ширина_символа = ширине gif ^картинка.font[набор_букв;имя_файла_шрифта.gif; $.space(ширина_пробела) // по умолчанию = ширине gif $.width(ширина_символа) // см. выше, по умолчанию proportional $.spacing(расстояние между буквами) // по умолчанию = 1 ] ^картинка.text(x;y)[текст_надписи] AS_IS ^картинка.length[текст_надписи] AS_IS ^картинка.gif[возможно, имя файла] кодирует в FILE с content-type=image/gif имя файла будет использовано при $response:download ^картинка.arc(center x;center y;width;height;start in degrees;end in degrees;color) ^картинка.sector(center x;center y;width;height;start in degrees;end in degrees;color) ^картинка.circle(center x;center y;r;color) ^картинка.copy[source](src x;src y;src w;src h;dst x;dst y[;dest w[;dest h[;tolerance]]]) при заданных dest_w/dest_h делает изменение размера кусочка при уменьшении делает resample годится только для уменьшения простой[малоцветной] дребедени вроде графиков/pie, для thumbnais не годится при не указанном dest_h сохраняет aspect ratio tolerance - некое число[квадрат расстояния в RGB пространстве до искомого цвета], определяющее прожорливость выделялки цветов из палитры [default=150] меньше - точнее приближает цвета, но они быстро кончаются больше - неточно приближает цвет, но большей части хватит ^картинка.pixel(x;y)[(color)] узнать или задать цвет пиксела regex в выражении логическое значение всегда равно true числовое значение равно количеству байт скомпилированного шаблона ^regex::create[шаблон-строка|regex][[опции поиска]] ^шаблон.size[] количество байт скомпилированного шаблона если значение очень большое - стоит почитать документацию по pcre и, возможно, переписать шаблон ^шаблон.study_size[] размер study-структуры. если==0 - шаблон не может быть "изучен" $шаблон.pattern текст шаблона $шаблон.options строка с исходным текстом опций console $console:timeout $console:line read/write строку cookie $cookie:имя считать старое или свежезаданное $cookie:имя[значение] на 90 дней $cookie:имя[$.value[значение] $.expires[ЗНАЧЕНИЕ] $.secure(true) $.domain[имя домена] $.httponly(true)] значение поля expires может быть 'session', date, или число дней (0дней=session) если дата, она будет преобразована к формату "Sun, 25-Aug-2002 12:03:45 GMT" $cookie:fields hash со всеми cookies curl ^curl:load[[ $.url[http://URL] $.timeout(N) $.ssl_verifypeer(0) $.mode[text|binary] тип создаваемого файла ]] загружает файл с удалённого сервера, можно вызывать многократно в одной сессии, можно указать любую опцию libcurl, имена опций строчными буквами без префикса CURLOPT_ ^curl:options[[ $.library[libcurl.so.4] $.charset[UTF-8] ... ]] последующие вызовы ^curl:load наследуют заданные опции, путь к libcurl задаётся до начала использования curl ^curl:session{код} создаёт cURL-сессию, можно задать общие опции, сделать несколько загрузок ^curl:info[название], ^curl:info[] информация о последнем запросе (значение или хеш) ^curl:version[] версия используемой библиотеки cURL env $env:переменная $env:fields хеш с переменными окружения $env:PARSER_VERSION версия парсера form [берётся первый элемент из одноимённых из GET, потом первый из POST] $form:поле string/file $form:nameless поле со значением поля без имени "?value&...", "...&value&...", "...&value" $form:qtail строка со значением текста после второго "?xxxxx", если там не было ',' [imap] $form:fields hash со всеми полями формы $form:elements.поле array со всеми значениями поля - как строковыми, так и файловыми $form:tables.поле table с одним столбцом "field" со значениями "поля", для множественных значений $form:files.поле hash со значениями полей типа файл, ключи - 0, 1, ..., значение - файл $form:imap хеш с ключами 'x' и 'y' со значением ?1,2 приписки при использовании server-site image map inet ^inet:ntoa(long) ^inet:aton[IP] ^inet:name2ip[name][[ $.ipv[4|6|any] $.table(true) ]] прямое преобразование имени в IP адрес ^inet:ip2name[ip][ $.ipv[4|6|any] ]] обратное преобразование из IP адреса в имя ^inet:hostname[] имя хоста json ^json:parse[-json-строка-[; $.depth(максимальная глубина, default == 19) $.double(false) отключить встроенный парсинг чисел с плавающей точкой (по умолчанию включен) в этом случае они попадут в результирующий объект как строки $.int(false) отключить встроенный парсинг целых чисел (по умолчанию включен) в этом случае они попадут в результирующий объект как строки $.distinct[first|last|all] как будет происходить разбор дублирующихся ключей у объектов first - будет оставлен первый встретившийся элемент last - будет оставлен последний встретившийся элемент all - будут оставлены все элементы. при этом элементы, начиная со 2 получат числовые суффиксы (key_2 итд) по умолчанию дублирующиеся ключи приведут к exception $.object[method-junction] пользовательский метод[ключ;объект], которому будут передаваться все разобранные объекты и ключи объекта, метод возвращает новый объект $.array[method-junction] пользовательский метод, которому будут передаваться массивы $.taint[язык преобразования] задаёт язык преобразования для всех строк результата ]] парсит json-строку в хеш ^json:string[system or user object[; $.skip-unknown(false) отключить exception и выдавать 'null' при сериализации объектов с типами отличных от void, bool, string, int, double, date, table, hash и file $.indent(true) форматировать результирующую строку табуляциями по глубине вложенности $.date[sql-string|gmt-string|iso-string|unix-timestamp] формат вывода даты, по умолчанию -- sql-string $.table[object|array|compact] формат вывода таблицы, по умолчанию -- object object: [{"c1":"v11","c2":"v12",...},{"c1":"v21","c2":"v22",...},...] array: [["c1","c2",...] || null (for nameless),["v11","v12",...],...] compact: ["v11" || ["v11","v12",...],...] $.file[text|base64|stat] вывести тело файла в указанном виде (по умолчание тело файла не попадает в output) $.xdoc[hash] параметры преобразования xdoc в строку (как в ^xdoc.string[]) $.тип[method-junction] любой тип можно вывести с помощью пользовательского метода, который должен принимать 3 параметра: ключ, объект данного типа и опции вызова ^json:string[] $._default[метод] пользовательский метод, будет вызываться для вывода всех объектов пользовательских классов. Метод должен принимать 3 параметра: ключ, объект и опции вызова. $._default[имя метода] имя пользователького метода, при его наличии он будет вызван для сериализации $.void[null|string] неопределенное значение будет выдано в виде null (по умолчанию) или пустой строки ]] сериализует системный или пользовательский объект в json-строку mail $mail.received=MESSAGE: .from .reply-to .subject .date класса date .message-id .raw[ .СЫРОЕ_ПОЛЬЗОВАТЕЛЬСКОЕ-ПОЛЕ-ЗАГОЛОВКА ] $.{text|html|file#}[ << нумеруется как и в mail:send (text, text2, ...) (file, file2, ...) $.content-type[ $.value[{text|...|x-unknown}/{plain|html|...|x-unknown}] [$.charset[windows-1251]] << в каком пришло, сейчас уже перекодировано $.ПОЛЬЗОВАТЕЛЬСКИЙ-ПАРАМЕТР-ЗАГОЛОВКА ] $.description $.content-id $.content-md5 $.content-location .raw[ .СЫРОЕ_ПОЛЬЗОВАТЕЛЬСКОЕ-ПОЛЕ-ЗАГОЛОВКА ] $.value[строка|FILE] ] $.message#[MESSAGE] (message, message2, ...) ^mail:send[ $.options[-odd] unix: строка, которая будет добавлена к команде запуска sendmail -odd означает "быстро поставь в очередь без проверки email" win32: игнорируется $.charset[кодировка заголовка и текстовых блоков] $.any-header-field $.text[string] $.text[ $.any-header-field $.value[string] ] $.html{string} $.html[ $.any-header-field $.value{string} ] $.file#[FILE] $.file#[ $.any-header-field $value[FILE] ] ] если charset указан, письмо перекодируется в этот charset content-type.charset не влияет на перекодирование после имени части может идти # число ^mail:send[ # по-умолчанию, совпадает с source encoding. # задаёт кодировку body $.charset[windows-1251] # нет умолчания $.content-type[$.value[text/plain] $.charset[windows-1251]] $.from["вася" ] $.to["петя" ] $.subject[тема] $.body[ слова ] ] ^mail:send[$.header-field[] $.charset[кодировка письма] $.body[когда body не строка, а hash, отсылается multipart письмо]] если charset указан, письмо перекодируется в этот charset content-type.charset не влияет на перекодирование после имени части может идти целое число, части пойдут в порядке чисел. если body указан строкой, то это текст письма, никаких вложений. если body указан hash, то это части, будут собраны текстовые блоки, затем вложения это старый формат, поддерживается для обратной совместимости если имя части начинается со слова text, то это текстовый блок. если имя части начинается со слова file, то это вложение, формат задания: $file[$.format[uue|base64] $.value[DATA] $.name[user-file-name]] важно: при multipart не указывать content-type ^mail:send[ # по-умолчанию, совпадает с source encoding # задаёт кодировку body $.charset[windows-1251] # нет умолчания $.content-type[$.value[text/plain] $.charset[windows-1251]] $.from["вася" ] $.to["петя" ] $.subject[тема] $.body[ слова ] ] ^mail:send[ $.from["вася" ] $.to["петя" ] $.subject[тема] $.body[ $.text[ # задаёт кодировку body $.charset[windows-1251] # нет умолчания $.content-type[$.value[text/plain] $.charset[windows-1251]] $.body[слова] ] # для удобства можно указать только одну часть, при этом не будет multipart $.file[ $.value[^file::load[my beloved.doc]] $.name[my beloved.doc] $.format[base64] ] $.file2[ $.value[^file::load[my beloved.doc]] $.name[my beloved.doc] ] ] ] для отправки под unix используется программа с параметрами, задаваемая $MAIL.sendmail[команда] если не будет задана, проверяется, доступна ли /usr/sbin/sendmail или /usr/lib/sendmail и, если доступна, то запускается с параметром "-t". под Windows используется SMTP протокол, сервер задаётся $MAIL.SMTP[smtp.domain.ru] math $math:PI ^math:round floor ceiling ^math:trunc frac ^math:abs sign ^math:exp log log10 ^math:sin asin cos acos tan atan atan2 ^math:degrees radians ^math:pow sqrt ^math:random(ширина диапазона) ^math:convert[number|файл](base-from;base-to)[[ $.format[string|file] ]] ^math:convert[number|файл][алфавит](base-to)[[ $.format[string|file] ]] ^math:convert[number|файл](base-from)[алфавит][[ $.format[string|file] ]] преобразует строку или файл с числом из одной системы исчисления в другую система счисления может быть задана алфавитом, числом от 2 до 16 (эквивалентно алфавиту 0123456789ABCDEF), числом 256 (все ASCII символы) ^math:uuid[ $.lower(bool) $.solid(bool) ] 22C0983C-E26E-4169-BD07-77ECE9405BA5 win32: пользуется cryptapi unix: пользуется /dev/urandom, если нет, /dev/random, если нет, rand ^math:uuid7[ $.lower(bool) $.solid(bool) ] 0193CBF0-7898-7000-A391-AC513CC15658 https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7 ^math:uid64[ $.lower(bool) ] BA39BAB6340BE370 ^math:md5[string] выдает digest строки, длиной 16 байт в виде строки, где байты digest выданы в hex виде, впритык, в нижнем регистре ^math:crypt[password;salt] salt prefix $apr1$ вызывает встроенный MD5 алгоритм, если нет тела salt, оно создаётся случайным $1$ вызывает MD5 алгоритм функции OS 'crypt', если поддерживается. другие salt читайте документацию по функции OS 'crypt'. ^math:crc32[string] вычисляет crc32 строки ^math:sha1[string] ^math:digest[[md5|sha1|sha256|sha512];строка или файл][[ $.format[hex|base64|file] $.hmac[ключ строка|ключ файл] ]] объединяет в себе возможность работы с разными алгоритмами криптографического хеширования. $.hmac[ключ] для проверки целостности переданных данных memory ^memory:compact[] собрать мусор, освободив место под новые данные (предупреждение: память процесса никогда не освобождается) полезно делать перед XSL transform ^memory:auto-compact(частота сборки) задает режим автоматической сборки мусора, от 0 (выключена) до 5 (максимальная) reflection ^reflection:create[класс;конструктор[;пара[;мет[;ры]]]] вызывает указанный конструктор класса (не более 100 параметров) ^reflection:create[ $.class[name] $.constructor[name] $.arguments[ $.1[па] $.2[рам] $.3[етры] ] ] вызывает указанный конструктор класса ^reflection:classes[] хеш со всеми классами. ключ = имя класса, значение бывает methoded (класс с методами) или void ^reflection:class[объект] класс переданного объекта ^reflection:class_name[объект] имя класса переданного объекта ^reflection:base[объект] родительский класс переданного объекта ^reflection:base_name[объект] имя родительского класса переданного объекта ^reflection:class_by_name[имя класса] получение класса по имени ^reflection:class_alias[имя класса;новое имя класса] задает псевдоним для указанного класса ^reflection:def[class;имя класса] проверка класса на существование ^reflection:methods[класс] хеш со списком методов указанного класса, значения - строки 'native' или 'parser' ^reflection:method[класс или объект;имя метода] возвращает junction-method класса или объекта ^reflection:filename[объект или класс или метод] возвращает имя файла, где определен объект, класс или метод ^reflection:fields[класс или объект] хеш со списком статических полей указанного класса или динамических полей указанного объекта ^reflection:fields_reference[объект] редактируемый хеш динамических полей указанного объекта ^reflection:field[класс или объект;имя поля] возвращает значение указанного поля класса или объекта. getter-ы игнорируются. ^reflection:copy[источник;назначение] копирует поля из одного объекта или класса в другой ^reflection:uid[класс или объект] возвращает идентификатор объекта или класса ^reflection:method_info[класс;метод] хеш с параметрами указанного метода класса $.inherited[класс] имя класса, где метод был определён (возвращается только если метод был определён в предке) $.overridden[класс] имя класса, где метод был определён (возвращается только если метод был определён в предке) для native классов возвращается хеш: .min_params(минимально необходимое число параметров) .max_params(максимально возможное число параметров) .call_type[dynamic|static|any] для parser классов возвращается хеш: ключ - номер параметра (0, 1, ...), значение - имя параметра ^reflection:dynamical[[object or class, caller if absent]] возвращает true, если метод был вызван из динамического контекста при передаче параметра возвращает true, если передан динамический объект, false если класс ^reflection:delete[класс или объект;имя переменной] удаляет переменную с указанным именем в указанном классе или объекте ^reflection:is[имя элемента;имя класса][[контекст]] аналог оператора 'is', позволяющий определить, является ли элемент кодом. ^reflection:tainting[[язык|tainted|optimized];строка] строка, в которой каждому символу исходной строки соотвествует символ с кодом преобразования ^reflection:stack[ $.args(false/true) $.locals(false/true) $.limit(n) $.offset(o)] текущее состояние стека вызовов методов на парсере ^reflection:mixin[источник; $.to[получатель] $.name[имя] $.methods(true/false) $.fields(true/false) $.overwrite(false/true) ] копирует в класс методы и поля другого класса request https://site.name/a%20b/?name=some%20value $request:query name=some%20value $request:uri /a%20b/?name=value $request:path /a b/ $request:document-root каталог, относительно которого считаются пути в parser, по-умолчанию = $env:DOCUMENT_ROOT $request:argv hash с параметрами коммандной строки. ключи 0, 1, ... [0 -- имя обрабатываемого файла] $request:charset кодировка исходного документа используется при upper/lower и match[][i] ПРЕДУПРЕЖДЕНИЕ: необходимо задать $request/response:charset до использования полей класса form $request:method метод запроса (GET|POST|PUT) $request:body тело POST-запроса в виде текста $request:body-file тело POST-запроса в виде файла $request:body-charset кодировка POST-запроса $request:headers хеш с заголовками запроса (без префикса HTTP_) response $response:поле[значение] и можно считать старое - $response:поле значение может быть string а может быть hash: $value[abc] field: {abc}<<часть $attribute[zzz] field: abc; {attribute=zzz}<<часть значение поля или атрибута может быть string или date если дата, она будет преобразована к формату "Sun, 25-Aug-2002 12:03:45 GMT" $response:headers накопленные поля $response:body[DATA] замещает стандартный ответ $response:download[DATA] замещает стандартный ответ, выставляет флаг, заставляющий browser предложить download $response:status ^response:clear[] забыть все заданные response поля $response:charset кодировка клиента т.е. та, 1) из которой будут перекодированы $form:поля после забирания из browser'а 2) в которую документ будет перекодирован перед отдаванием в browser 3) в которую будет перекодирован текст языка uri не добавляет к content-type ничего, если хочется, это надо сделать вручную ПРЕДУПРЕЖДЕНИЕ: необходимо задать $request/response:charset до использования полей класса form status $status:sql cache table url time url time url time $status:stylesheet cache table file time file time file time $status:rusage hash utime user time used stime system time used maxrss max resident set size ixrss integral shared text memory size idrss integral unshared data size isrss integral unshared stack size tv_sec tv_usec $s[$status:rusage] ^s.tv_sec.format[%.0f].^s.tv_usec.format[%06.0f] $status:memory hash used includes some pages that were allocated but never written free ever_allocated_since_compact return the number of bytes allocated since the last collection ever_allocated_since_start return the total number of bytes [EVER(c)PAF] allocated in this process, never decreases $status:pid process id $status:tid thread id $status:mode режим работы, cgi|console|mail|httpd|apache|isapi $status:log-filename путь к журналу ошибок parser3.log xdoc(xnode) $xdoc.search-namespaces hash, where keys=prefixes, values=urls DOM1 attributes: readonly attribute DocumentType doctype readonly attribute Element documentElement DOM1 methods: Element createElement(in DOMString tagName) DocumentFragment createDocumentFragment() Text createTextNode(in DOMString data) Comment createComment(in DOMString data) CDATASection createCDATASection(in DOMString data) ProcessingInstruction createProcessingInstruction(in DOMString target,in DOMString data) Attr createAttribute(in DOMString name) EntityReference createEntityReference(in DOMString name) NodeList getElementsByTagName(in DOMString tagname) DOM2 some methods: ^.getElementById[elementId] = xnode The DOM implementation must have information that says which attributes are of type ID. Attributes with the name "ID" are not of type ID unless so defined. Implementations that do not know whether attributes are of type ID or not are expected to return null. кодировка строк и умолчание для $.encoding равно текущей кодировке выходной страницы, $response:charset ::sql{...} ::create[[URI]]{} старое имя 'set' ::create[[URI]][qualifiedName] URI default = disk path to requested document для каталогов конечный / обязателен ::create[file] can be usable: $f[^file::load[binary;http://;some HTTP options here...]] $x[^xdoc::create[$f]] ::load[file.xml[;опции]] .transform[rules.xsl|xdoc][[params hash]] выдаёт dom шаблон кешируется, кеш обновляется при изменении даты файла шаблона, или изменении даты файла "имя шаблона.stamp"[проверка даты stamp приоритетнее] параметры передаются как есть, не xpath выражения .string[[output options]] .save[file.xml[;output options]] с шапкой .file[[output options]] = file output options идентичны атрибутам xsl:output [исключение: игнорируется cdata-section-elements, нужно будет, сделаю] выдаёт media-type при подстановке $response:body[сюда] если на документ ссылаются так: parser://method/param/to/that/method то в качестве документа используется ^MAIN:method[/param/to/that/method] [примечание: в параметр всегда приходит лидирующая /, даже, если параметров вообще не было] xnode DOM1 attributes: $node.nodeName $node.nodeValue read write $node.nodeType = int ELEMENT_NODE = 1 ATTRIBUTE_NODE = 2 TEXT_NODE = 3 CDATA_SECTION_NODE = 4 ENTITY_REFERENCE_NODE = 5 ENTITY_NODE = 6 PROCESSING_INSTRUCTION_NODE = 7 COMMENT_NODE = 8 DOCUMENT_NODE = 9 DOCUMENT_TYPE_NODE = 10 DOCUMENT_FRAGMENT_NODE = 11 NOTATION_NODE = 12 $vasyaNode.type==$xnode:ELEMENT_NODE $node.parentNode $node.childNodes = array of nodes $node.firstChild $node.lastChild $node.previousSibling $node.nextSibling $node.ownerDocument = xdoc $node.prefix $node.namespaceURI $element_node.attributes = hash of xnodes $element_node.tagName $attribute_node.specified = boolean true if the attribute received its value explicitly in the XML document, or if a value was assigned programmatically with the setValue function. false if the attribute value came from the default value declared in the document's DTD. $attribute_node.name $attribute_node.value $text_node/cdata_node/comment_node.substringData $pi_node.target = target of this processing instruction XML defines this as the first token following the markup that begins the processing instruction. $pi_node.data = The content of this processing instruction From the first non-whitespace character after the target to the character immediately preceding the ?>. document_node. readonly attribute DocumentType doctype readonly attribute DOMImplementation implementation readonly attribute Element documentElement document_type_node. readonly attribute DOMString name readonly attribute NamedNodeMap entities readonly attribute NamedNodeMap notations notation_node. readonly attribute DOMString publicId readonly attribute DOMString systemId DOM1 node methods: Node insertBefore(in Node newChild,in Node refChild) Node replaceChild(in Node newChild,in Node oldChild) Node removeChild(in Node oldChild) Node appendChild(in Node newChild) boolean hasChildNodes() Node cloneNode(in boolean deep) DOM1 element methods: DOMString getAttribute(in DOMString name) void setAttribute(in DOMString name, in DOMString value) raises(DOMException) void removeAttribute(in DOMString name) raises(DOMException) Attr getAttributeNode(in DOMString name) Attr setAttributeNode(in Attr newAttr) raises(DOMException) Attr removeAttributeNode(in Attr oldAttr) raises(DOMException) NodeList getElementsByTagName(in DOMString name) void normalize() Introduced in DOM Level 2: Node importNode(in Node importedNode, in boolean deep) raises(DOMException) NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString localName) boolean hasAttributes() XPath: ^node.select[xpath/query/expression] = array of nodes, empty array if nothing found ^node.selectSingle[xpath/query/expression] = first node if any ^node.selectBool[xpath/query/expression] = bool if any or die ^node.selectNumber[xpath/query/expression] = double if any or die ^node.selectString[xpath/query/expression] = string if any or die DATA::=string | file | hash hash вида [ $.file[имя файла на диске] $.name[имя файла для пользователя] $.mdate[date] ] MAIN это класс, загружаемый на автомате из конфигурационного auto.p, кучи auto.p и запрашиваемого документа: конфигурационный auto.p cgi: 1. или полный путь из переменной окружения CGI_PARSER_SITE_CONFIG или рядом с бинарником parser'а isapi: windows directory apache module: 1) ParserConfig [can be in .htaccess] auto.p вниз от DOCUMENT_ROOT/ по дереву до каталога с обрабатываемым файлом включительно класс собирается из всех этих файлов, последующие становятся родителями предыдущих имя последнего загруженного MAIN, имён у предыдущих нет после загрузки MAIN класса вызывается его @main[] результат которого передаётся в его @postprocess[data] if($data is string) ... результат которого отдаётся пользователю если встречается ошибка и try не задан, её можно красиво сообщить пользователю, определив @unhandled_exception[exception;stack] $exception.type строка "тип проблемы" $exception.file $exception.lineno $exception.colno файл, строка и позиция, где случилась проблема [если не запрещены при компиляции] $exception.source строка, из-за которой случилась проблема $exception.comment комментарий english stack табличка из колонок file line name, там лежат в обратном порядке имена[name] и места вызовов[file line] операторов/методов, приведших к ошибке. при загрузке файла (file::load, table::load, xdoc::load) можно указать такое имя файла: http://domain/document[?params<> создает http.status ошибку, это можно отключить, передав $.any-status(1) $.charset[кодировка удалённых документов по-умолчанию], если сервер вернёт content-type:charset - ОНА ПЕРЕБИВАЕТ $.response-charset[кодировка удалённых документов], не перебиваеся content-type:charset $.user[пользователь] $.password[пароль] file::load в дополнительные поля записывает ПОЛЕ:значение (имена полей ответа заглавными буквами) tables << хеш их ПОЛЕ->table с единственным столбцом "value" в таких таблицах можно брать повторяющиеся заголовки. например, несколько set-cookies todo:сделать отдельный cookies системные типы ошибок: parser.compile ^test[} компиляция (непарная скобка, ...) parser.runtime ^if(0). параметры (больше/меньше, чем нужно, не тех типов, ...) number.zerodivision ^eval(1/0) ^eval(1%0) number.format ^eval(abc*5) file.lock shared/exclusive lock error file.missing ^file:delete[delme] not found file.access ^table::load[.] no rights file.read ^file::load[...] error while reading file file.seek seek failed file.execute ^file::cgi[...] incorrect cgi header/can't execute image.format ^image::measure[index.html] not gif/jpg sql.connect ^connect[mysql://baduser:pass@host/db]{} not found/timeout sql.execute ^void:sql{select bad} syntax error sql.duplicate sql.access sql.missing xml ^xdoc::create{} any error in xml/xslt libs smtp.connect not found/timeout smtp.execute communication error email.format hren tam@null.ru wrong email format (bad chars/empty) email.send $MAIL.sendmail[/shit] sendmail not executable http.host ^file::load[http://notfound/there] host not found http.connect ^file::load[http://not_accepting/there] host found, but does not accept connections http.timeout ^file::load[http://host/doc] load operation failed to complete in # seconds http.response ^file::load[http://ok/there] host found, connection accepted, bad answer http.status ^file::load[http://ok/there] host found, connection accepted, status!=200 date.range ^date::create(10000;1;1) date out of valid range если в MAIN определён $SIGPIPE(1) то в случае, если обработка была прервана пользователем, сообщение об этом будет записано в parser3.log если описание метода содержит локальную переменную result в явном виде (есть и неявная переменная) то код вывода пробельных литералов не попадает в конечный байт-код $Id: operators.ru.txt,v 1.265 2025/01/10 20:02:21 moko Exp $ parser-3.5.1/COPYING0000644000076400007640000004311007430727316011010 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. parser-3.5.1/NEWS0000644000076400007640000000006713046666024010456 00000000000000Read the Parser3 news at http://www.parser.ru/en/news/ parser-3.5.1/parser3.sln0000644000076400007640000003010113715440626012045 00000000000000Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parser3", "src\targets\cgi\parser3.vcproj", "{33B3FF55-1BB6-4F22-A448-04065AC10AFB}" ProjectSection(ProjectDependencies) = postProject {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} = {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} {09C0531B-9B8F-443A-A16B-BD9134712613} = {09C0531B-9B8F-443A-A16B-BD9134712613} {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} = {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} {5F0D9CDB-E876-11E4-A90D-001D7DE6219A} = {5F0D9CDB-E876-11E4-A90D-001D7DE6219A} {21593B27-7994-49DC-A4A7-993DD8849862} = {21593B27-7994-49DC-A4A7-993DD8849862} {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} = {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} {EB565D67-9950-4F5E-926F-63DAC8F7F314} = {EB565D67-9950-4F5E-926F-63DAC8F7F314} {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} = {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} {B95DF5BC-85D8-4B4C-AF72-113B99592D38} = {B95DF5BC-85D8-4B4C-AF72-113B99592D38} {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} = {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} = {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} = {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} {019EA036-519E-11E4-A984-001D7DE6219A} = {019EA036-519E-11E4-A984-001D7DE6219A} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ApacheModuleParser3", "src\targets\apache\ApacheModuleParser3.vcproj", "{61FD304C-2949-4400-845F-0B27CD088547}" ProjectSection(ProjectDependencies) = postProject {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} = {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} {09C0531B-9B8F-443A-A16B-BD9134712613} = {09C0531B-9B8F-443A-A16B-BD9134712613} {21593B27-7994-49DC-A4A7-993DD8849862} = {21593B27-7994-49DC-A4A7-993DD8849862} {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} = {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} {EB565D67-9950-4F5E-926F-63DAC8F7F314} = {EB565D67-9950-4F5E-926F-63DAC8F7F314} {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} = {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} {B95DF5BC-85D8-4B4C-AF72-113B99592D38} = {B95DF5BC-85D8-4B4C-AF72-113B99592D38} {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} = {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} = {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D} = {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D} {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} = {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} = {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} {5F0D9CDB-E876-11E4-A90D-001D7DE6219A} = {5F0D9CDB-E876-11E4-A90D-001D7DE6219A} {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D} = {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D} {019EA036-519E-11E4-A984-001D7DE6219A} = {019EA036-519E-11E4-A984-001D7DE6219A} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ApacheModuleParser3Core", "src\targets\apache\ApacheModuleParser3Core.vcproj", "{CB915CEB-DC1A-40F6-9CA9-3B5212C0497D}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "classes", "src\classes\classes.vcproj", "{B79D9D3D-DFD7-4D48-91AA-484378D5E76C}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cord", "src\lib\cord\cord.vcproj", "{74F38AE8-E0CF-4684-B4EA-B0555F0B30AE}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gnu", "gnu.vcproj", "{02438934-FA19-49DC-B5D1-2E9BA1CD0159}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ltdl", "src\lib\ltdl\ltdl.vcproj", "{EB565D67-9950-4F5E-926F-63DAC8F7F314}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "main", "src\main\main.vcproj", "{650C3584-6F31-4CDE-9A4E-42BAAD4EA88E}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "md5", "src\lib\md5\md5.vcproj", "{2FBFAD1C-76EE-4EA4-82B5-204B2671A05D}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "punycode", "src\lib\punycode\punycode.vcproj", "{5F0D9CDB-E876-11E4-A90D-001D7DE6219A}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parser3isapi", "src\targets\isapi\parser3isapi.vcproj", "{2E7BF3D9-C58C-4808-B786-494E7C5F9FE2}" ProjectSection(ProjectDependencies) = postProject {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} = {AE697E13-B86D-4408-B76D-EC54D2BEEFE0} {09C0531B-9B8F-443A-A16B-BD9134712613} = {09C0531B-9B8F-443A-A16B-BD9134712613} {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} = {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D} {5F0D9CDB-E876-11E4-A90D-001D7DE6219A} = {5F0D9CDB-E876-11E4-A90D-001D7DE6219A} {21593B27-7994-49DC-A4A7-993DD8849862} = {21593B27-7994-49DC-A4A7-993DD8849862} {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} = {B79D9D3D-DFD7-4D48-91AA-484378D5E76C} {EB565D67-9950-4F5E-926F-63DAC8F7F314} = {EB565D67-9950-4F5E-926F-63DAC8F7F314} {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} = {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E} {B95DF5BC-85D8-4B4C-AF72-113B99592D38} = {B95DF5BC-85D8-4B4C-AF72-113B99592D38} {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} = {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD} {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} = {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE} {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} = {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A} {019EA036-519E-11E4-A984-001D7DE6219A} = {019EA036-519E-11E4-A984-001D7DE6219A} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types", "src\types\types.vcproj", "{09C0531B-9B8F-443A-A16B-BD9134712613}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdbm", "src\lib\sdbm\sdbm.vcproj", "{AE697E13-B86D-4408-B76D-EC54D2BEEFE0}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gd", "src\lib\gd\gd.vcproj", "{B95DF5BC-85D8-4B4C-AF72-113B99592D38}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smtp", "src\lib\smtp\smtp.vcproj", "{9B5091F7-0ED5-4E5A-ABAF-430ED79D231A}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "json", "src\lib\json\json.vcproj", "{21593B27-7994-49DC-A4A7-993DD8849862}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memcached", "src\lib\memcached\memcached.vcproj", "{71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcre_internal", "src\lib\pcre\pcre_internal.vcproj", "{019EA036-519E-11E4-A984-001D7DE6219A}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {61FD304C-2949-4400-845F-0B27CD088547}.Debug.ActiveCfg = Debug|Win32 {61FD304C-2949-4400-845F-0B27CD088547}.Release.ActiveCfg = Release|Win32 {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D}.Debug.ActiveCfg = Debug|Win32 {CB915CEB-DC1A-40F6-9CA9-3B5212C0497D}.Release.ActiveCfg = Release|Win32 {B79D9D3D-DFD7-4D48-91AA-484378D5E76C}.Debug.ActiveCfg = Debug|Win32 {B79D9D3D-DFD7-4D48-91AA-484378D5E76C}.Debug.Build.0 = Debug|Win32 {B79D9D3D-DFD7-4D48-91AA-484378D5E76C}.Release.ActiveCfg = Release|Win32 {B79D9D3D-DFD7-4D48-91AA-484378D5E76C}.Release.Build.0 = Release|Win32 {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE}.Debug.ActiveCfg = Debug|Win32 {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE}.Debug.Build.0 = Debug|Win32 {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE}.Release.ActiveCfg = Release|Win32 {74F38AE8-E0CF-4684-B4EA-B0555F0B30AE}.Release.Build.0 = Release|Win32 {02438934-FA19-49DC-B5D1-2E9BA1CD0159}.Debug.ActiveCfg = Debug|Win32 {02438934-FA19-49DC-B5D1-2E9BA1CD0159}.Release.ActiveCfg = Release|Win32 {02438934-FA19-49DC-B5D1-2E9BA1CD0159}.Release.Build.0 = Release|Win32 {EB565D67-9950-4F5E-926F-63DAC8F7F314}.Debug.ActiveCfg = Debug|Win32 {EB565D67-9950-4F5E-926F-63DAC8F7F314}.Debug.Build.0 = Debug|Win32 {EB565D67-9950-4F5E-926F-63DAC8F7F314}.Release.ActiveCfg = Release|Win32 {EB565D67-9950-4F5E-926F-63DAC8F7F314}.Release.Build.0 = Release|Win32 {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E}.Debug.ActiveCfg = Debug|Win32 {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E}.Debug.Build.0 = Debug|Win32 {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E}.Release.ActiveCfg = Release|Win32 {650C3584-6F31-4CDE-9A4E-42BAAD4EA88E}.Release.Build.0 = Release|Win32 {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D}.Debug.ActiveCfg = Debug|Win32 {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D}.Debug.Build.0 = Debug|Win32 {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D}.Release.ActiveCfg = Release|Win32 {2FBFAD1C-76EE-4EA4-82B5-204B2671A05D}.Release.Build.0 = Release|Win32 {5F0D9CDB-E876-11E4-A90D-001D7DE6219A}.Debug.ActiveCfg = Debug|Win32 {5F0D9CDB-E876-11E4-A90D-001D7DE6219A}.Debug.Build.0 = Debug|Win32 {5F0D9CDB-E876-11E4-A90D-001D7DE6219A}.Release.ActiveCfg = Release|Win32 {5F0D9CDB-E876-11E4-A90D-001D7DE6219A}.Release.Build.0 = Release|Win32 {33B3FF55-1BB6-4F22-A448-04065AC10AFB}.Debug.ActiveCfg = Debug|Win32 {33B3FF55-1BB6-4F22-A448-04065AC10AFB}.Debug.Build.0 = Debug|Win32 {33B3FF55-1BB6-4F22-A448-04065AC10AFB}.Release.ActiveCfg = Release|Win32 {33B3FF55-1BB6-4F22-A448-04065AC10AFB}.Release.Build.0 = Release|Win32 {2E7BF3D9-C58C-4808-B786-494E7C5F9FE2}.Debug.ActiveCfg = Debug|Win32 {2E7BF3D9-C58C-4808-B786-494E7C5F9FE2}.Release.ActiveCfg = Release|Win32 {09C0531B-9B8F-443A-A16B-BD9134712613}.Debug.ActiveCfg = Debug|Win32 {09C0531B-9B8F-443A-A16B-BD9134712613}.Debug.Build.0 = Debug|Win32 {09C0531B-9B8F-443A-A16B-BD9134712613}.Release.ActiveCfg = Release|Win32 {09C0531B-9B8F-443A-A16B-BD9134712613}.Release.Build.0 = Release|Win32 {AE697E13-B86D-4408-B76D-EC54D2BEEFE0}.Debug.ActiveCfg = Debug|Win32 {AE697E13-B86D-4408-B76D-EC54D2BEEFE0}.Debug.Build.0 = Debug|Win32 {AE697E13-B86D-4408-B76D-EC54D2BEEFE0}.Release.ActiveCfg = Release|Win32 {AE697E13-B86D-4408-B76D-EC54D2BEEFE0}.Release.Build.0 = Release|Win32 {B95DF5BC-85D8-4B4C-AF72-113B99592D38}.Debug.ActiveCfg = Debug|Win32 {B95DF5BC-85D8-4B4C-AF72-113B99592D38}.Debug.Build.0 = Debug|Win32 {B95DF5BC-85D8-4B4C-AF72-113B99592D38}.Release.ActiveCfg = Release|Win32 {B95DF5BC-85D8-4B4C-AF72-113B99592D38}.Release.Build.0 = Release|Win32 {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A}.Debug.ActiveCfg = Debug|Win32 {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A}.Debug.Build.0 = Debug|Win32 {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A}.Release.ActiveCfg = Release|Win32 {9B5091F7-0ED5-4E5A-ABAF-430ED79D231A}.Release.Build.0 = Release|Win32 {21593B27-7994-49DC-A4A7-993DD8849862}.Debug.ActiveCfg = Debug|Win32 {21593B27-7994-49DC-A4A7-993DD8849862}.Debug.Build.0 = Debug|Win32 {21593B27-7994-49DC-A4A7-993DD8849862}.Release.ActiveCfg = Release|Win32 {21593B27-7994-49DC-A4A7-993DD8849862}.Release.Build.0 = Release|Win32 {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD}.Debug.ActiveCfg = Debug|Win32 {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD}.Debug.Build.0 = Debug|Win32 {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD}.Release.ActiveCfg = Release|Win32 {71C9E3C6-47E8-4CB2-AF6F-784A49F5ABFD}.Release.Build.0 = Release|Win32 {019EA036-519E-11E4-A984-001D7DE6219A}.Debug.ActiveCfg = Debug|Win32 {019EA036-519E-11E4-A984-001D7DE6219A}.Debug.Build.0 = Debug|Win32 {019EA036-519E-11E4-A984-001D7DE6219A}.Release.ActiveCfg = Release|Win32 {019EA036-519E-11E4-A984-001D7DE6219A}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal