parser-3.5.1/ 0000755 0000764 0000764 00000000000 14740300546 010030 5 0000000 0000000 parser-3.5.1/buildall 0000755 0000764 0000764 00000017536 14733312235 011502 0000000 0000000 #!/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/ 0000755 0000764 0000764 00000000000 14740300546 010603 5 0000000 0000000 parser-3.5.1/etc/parser3.charsets/ 0000755 0000764 0000764 00000000000 14740300546 013775 5 0000000 0000000 parser-3.5.1/etc/parser3.charsets/windows-1251.cfg 0000644 0000764 0000764 00000012010 11445753746 016465 0000000 0000000 char 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.cfg 0000644 0000764 0000764 00000011075 11445753747 016506 0000000 0000000 char 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.in 0000644 0000764 0000764 00000036267 14740273415 016004 0000000 0000000 # 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.cfg 0000644 0000764 0000764 00000012020 11446221750 015504 0000000 0000000 char 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.am 0000644 0000764 0000764 00000000277 11764601311 015754 0000000 0000000 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) parser-3.5.1/etc/parser3.charsets/windows-1254.cfg 0000644 0000764 0000764 00000010557 11445753746 016506 0000000 0000000 char 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.cfg 0000644 0000764 0000764 00000011760 11446221750 015513 0000000 0000000 char 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.cfg 0000644 0000764 0000764 00000011770 11445753747 017237 0000000 0000000 char 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.cfg 0000644 0000764 0000764 00000011275 11445753746 016500 0000000 0000000 char 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.cfg 0000644 0000764 0000764 00000012015 11534227423 015243 0000000 0000000 char 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.in 0000644 0000764 0000764 00000052501 14740273415 012577 0000000 0000000 # 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.in 0000644 0000764 0000764 00000015161 14734016311 012262 0000000 0000000 #$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.am 0000644 0000764 0000764 00000000101 13763451205 012552 0000000 0000000 SUBDIRS = parser3.charsets
confdir=@sysconfdir@
conf_DATA=auto.p
parser-3.5.1/gnu.vcproj 0000644 0000764 0000764 00000004201 10734724454 011772 0000000 0000000
parser-3.5.1/config.sub 0000644 0000764 0000764 00000106246 13111545410 011731 0000000 0000000 #! /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/ 0000755 0000764 0000764 00000000000 14740300546 010617 5 0000000 0000000 parser-3.5.1/src/include/ 0000755 0000764 0000764 00000000000 14740300546 012242 5 0000000 0000000 parser-3.5.1/src/include/pa_charset.h 0000644 0000764 0000764 00000013652 14726405317 014461 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000000706 14712042465 014142 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000002341 14712042465 014161 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000012034 14712042465 016033 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000003357 14712207735 015454 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000000633 14712042465 013615 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000005220 14712042465 013773 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000000357 14740272737 014517 0000000 0000000 /* 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.in 0000644 0000764 0000764 00000037676 14740273415 014256 0000000 0000000 # 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.h 0000644 0000764 0000764 00000003123 14712042465 014121 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000001262 14712042465 014102 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000035033 14712042465 014511 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000004570 14712042465 017433 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000002555 14712042465 015171 0000000 0000000 /** @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.am 0000644 0000764 0000764 00000001107 13562620045 014215 0000000 0000000 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
parser-3.5.1/src/include/pa_charsets.h 0000644 0000764 0000764 00000001713 14712042465 014633 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000003332 14712042465 013574 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000002464 14712042465 015701 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000001700 14712042465 013434 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000002070 14712042465 015734 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000003336 14712042465 016705 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000001562 14712042465 013745 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000003036 14712042465 013770 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000055107 14712042465 014333 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000002530 14712042465 014447 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000004226 14712042465 016665 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000017244 14732404263 014143 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000007136 14712042465 014275 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000004146 14713777072 013770 0000000 0000000 /** @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.h 0000644 0000764 0000764 00000007551 14726331736 014123 0000000 0000000 /** @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